/* ===========================================================================
   TradesMen Review — Homepage redesign stylesheet.
   Light-only, Apple-style blue/white. All selectors are namespaced .tmrh-*
   and scoped under body.tmrh-home so this file never affects other pages.
   =========================================================================== */
body.tmrh-home {
    --h-blue: #0b6bff;
    --h-blue-deep: #003bbf;
    --h-navy: #071d3a;
    --h-muted: #5b6f8d;
    --h-light: #7a8ba3;
    --h-border: #e3eaf5;
    --h-bg: #f7faff;
    --h-blue-soft: #eef5ff;
    --h-gold: #ffb020;
    --h-white: #ffffff;

    --h-radius-btn: 14px;
    --h-radius-input: 12px;
    --h-radius-card: 18px;
    --h-radius-cta: 16px;

    --h-shadow-card: 0 18px 45px rgba(7, 29, 58, 0.08);
    --h-shadow-float: 0 24px 60px rgba(7, 29, 58, 0.16);

    --h-font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    margin: 0;
    background: var(--h-white);
    color: var(--h-navy);
    font-family: var(--h-font);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body.tmrh-home * { box-sizing: border-box; }
body.tmrh-home img { max-width: 100%; display: block; }
body.tmrh-home a { color: var(--h-blue); text-decoration: none; }
body.tmrh-home a:hover { text-decoration: none; }

.tmrh-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

.tmrh-sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.tmrh-eyebrow {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 12px;
    font-weight: 800;
    color: var(--h-blue);
    margin: 0 0 18px;
}

.tmrh-accent { color: var(--h-blue); }

/* --- Buttons -------------------------------------------------------------- */
.tmrh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: var(--h-radius-btn);
    padding: 13px 22px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
    white-space: nowrap;
}
.tmrh-btn:active { transform: translateY(1px); }
.tmrh-btn--primary { background: var(--h-blue); color: #fff; }
.tmrh-btn--primary:hover { background: #0a5fe6; }
.tmrh-btn--bright { background: var(--h-blue); color: #fff; }
.tmrh-btn--bright:hover { background: #2a82ff; }
.tmrh-btn--white { background: #fff; color: var(--h-blue-deep); }
.tmrh-btn--white:hover { background: #f1f6ff; }
.tmrh-btn--ghost { background: var(--h-blue-soft); color: var(--h-blue); border-color: var(--h-border); }
.tmrh-btn--ghost:hover { background: #e2edff; }
.tmrh-btn--block { width: 100%; }

/* --- Header --------------------------------------------------------------- */
.tmrh-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid var(--h-border);
}
.tmrh-header__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    height: 72px;
}
.tmrh-brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    font-weight: 800;
    font-size: 19px;
    color: var(--h-navy);
    letter-spacing: -0.01em;
}
.tmrh-brand__icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--h-blue-soft);
    color: var(--h-blue);
    flex: none;
}
.tmrh-brand__icon svg { width: 20px; height: 20px; }

.tmrh-nav {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-left: auto;
    margin-right: 8px;
}
.tmrh-nav > a,
.tmrh-dropdown > summary {
    color: var(--h-navy);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
.tmrh-nav > a:hover,
.tmrh-dropdown > summary:hover { color: var(--h-blue); }

/* Native <details> dropdown — keyboard accessible, no JS (CSP blocks inline JS). */
.tmrh-dropdown { position: relative; }
.tmrh-dropdown > summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    user-select: none;
}
.tmrh-dropdown > summary::-webkit-details-marker { display: none; }
.tmrh-dropdown > summary svg { width: 14px; height: 14px; transition: transform 0.15s ease; }
.tmrh-dropdown[open] > summary svg { transform: rotate(180deg); }
.tmrh-dropdown__menu {
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    min-width: 220px;
    background: #fff;
    border: 1px solid var(--h-border);
    border-radius: 14px;
    box-shadow: var(--h-shadow-card);
    padding: 8px;
    display: grid;
    gap: 2px;
    z-index: 60;
}
.tmrh-dropdown__menu a {
    display: block;
    padding: 10px 12px;
    border-radius: 9px;
    color: var(--h-navy);
    font-size: 14px;
    font-weight: 600;
}
.tmrh-dropdown__menu a:hover { background: var(--h-blue-soft); color: var(--h-blue); }

.tmrh-header__cta { display: flex; align-items: center; gap: 12px; flex: none; }
.tmrh-header__cta .tmrh-btn { padding: 11px 20px; }

.tmrh-nav-toggle { display: none; }

/* --- Hero ----------------------------------------------------------------- */
.tmrh-hero {
    position: relative;
    background:
        radial-gradient(900px 520px at 8% 22%, rgba(11, 107, 255, 0.10), transparent 60%),
        linear-gradient(180deg, #ffffff 0%, var(--h-bg) 100%);
    overflow: hidden;
}
.tmrh-hero__inner {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
    gap: 40px;
    padding: 72px 0 96px;
}
.tmrh-hero__copy { max-width: 560px; }
.tmrh-hero__title {
    font-size: clamp(40px, 5vw, 60px);
    line-height: 1.05;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--h-navy);
    margin: 0 0 22px;
}
.tmrh-hero__lead {
    font-size: 19px;
    line-height: 1.55;
    color: var(--h-muted);
    margin: 0 0 30px;
    max-width: 480px;
}

/* Search form */
.tmrh-search { margin: 0; }
.tmrh-search__row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 12px;
    align-items: start;
}
.tmrh-field { position: relative; }
.tmrh-field__icon {
    position: absolute;
    left: 14px;
    top: 15px;
    width: 18px;
    height: 18px;
    color: var(--h-light);
    pointer-events: none;
}
.tmrh-input {
    width: 100%;
    height: 50px;
    padding: 0 14px 0 42px;
    font-family: inherit;
    font-size: 15px;
    color: var(--h-navy);
    background: #fff;
    border: 1px solid var(--h-border);
    border-radius: var(--h-radius-input);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.tmrh-input::placeholder { color: var(--h-light); }
.tmrh-input:focus {
    outline: none;
    border-color: var(--h-blue);
    box-shadow: 0 0 0 3px rgba(11, 107, 255, 0.16);
}
.tmrh-search__submit { height: 50px; padding: 0 26px; }
.tmrh-search__hint {
    margin: 9px 0 0 4px;
    font-size: 13px;
    color: var(--h-light);
}

/* Popular searches */
.tmrh-popular {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
}
.tmrh-popular__label { font-size: 14px; color: var(--h-muted); margin-right: 2px; }
.tmrh-pill {
    display: inline-flex;
    align-items: center;
    padding: 7px 15px;
    font-size: 13px;
    font-weight: 600;
    color: var(--h-blue);
    background: var(--h-blue-soft);
    border: 1px solid var(--h-border);
    border-radius: 999px;
    transition: background-color 0.15s ease;
}
.tmrh-pill:hover { background: #e2edff; }

/* Hero media + floating rating card */
.tmrh-hero__media {
    position: relative;
    align-self: stretch;
    min-height: 480px;
    border-radius: 22px 0 0 22px;
    overflow: hidden;
}
.tmrh-hero__media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.tmrh-hero__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, var(--h-bg) 0%, rgba(247, 250, 255, 0.35) 18%, transparent 45%);
    pointer-events: none;
}
.tmrh-rating-card {
    position: absolute;
    left: 26px;
    bottom: 26px;
    z-index: 2;
    width: 232px;
    background: #fff;
    border: 1px solid var(--h-border);
    border-radius: var(--h-radius-card);
    box-shadow: var(--h-shadow-float);
    padding: 18px 20px;
}
.tmrh-rating-card__label { font-size: 13px; color: var(--h-muted); }
.tmrh-rating-card__score {
    font-size: 38px;
    font-weight: 800;
    line-height: 1.05;
    color: var(--h-navy);
    margin: 2px 0 4px;
}
.tmrh-stars { display: inline-flex; gap: 2px; color: var(--h-gold); }
.tmrh-stars svg { width: 17px; height: 17px; }
.tmrh-rating-card__sub { font-size: 12px; color: var(--h-muted); margin-top: 8px; }
.tmrh-avatars { display: flex; align-items: center; margin: 12px 0 0; }
.tmrh-avatars span {
    width: 30px; height: 30px; border-radius: 50%;
    border: 2px solid #fff; margin-left: -8px;
    background-size: cover; background-position: center;
    display: grid; place-items: center;
    font-size: 11px; font-weight: 700; color: #fff;
}
.tmrh-avatars span:first-child { margin-left: 0; }
.tmrh-avatars .a1 { background: linear-gradient(135deg, #5aa0ff, #0b6bff); }
.tmrh-avatars .a2 { background: linear-gradient(135deg, #ffb020, #ff8a3d); }
.tmrh-avatars .a3 { background: linear-gradient(135deg, #34c97b, #1aa260); }
.tmrh-avatars .a4 { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.tmrh-rating-card__count { font-size: 12px; color: var(--h-muted); margin-top: 10px; font-weight: 600; }

/* On wide desktops the hero image bleeds flush to the right viewport edge
   (like the reference). Text is capped at 560px so it can never underlap it. */
@media (min-width: 1200px) {
    .tmrh-hero__inner { grid-template-columns: minmax(0, 560px) 1fr; }
    .tmrh-hero__media {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: clamp(520px, 48vw, 820px);
        min-height: 0;
        border-radius: 24px 0 0 24px;
    }
}

/* --- Stats bar ------------------------------------------------------------ */
.tmrh-stats-wrap {
    background: var(--h-bg);
    padding: 0 0 64px;
}
.tmrh-stats {
    position: relative;
    margin-top: -56px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    background: #fff;
    border: 1px solid var(--h-border);
    border-radius: var(--h-radius-card);
    box-shadow: var(--h-shadow-card);
    padding: 30px 20px;
}
.tmrh-stat {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 4px 14px;
}
.tmrh-stat + .tmrh-stat { border-left: 1px solid var(--h-border); }
.tmrh-stat__icon {
    flex: none;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--h-blue-soft);
    color: var(--h-blue);
    display: grid;
    place-items: center;
}
.tmrh-stat__icon svg { width: 26px; height: 26px; }
.tmrh-stat__n { font-size: 26px; font-weight: 800; color: var(--h-navy); line-height: 1.1; }
.tmrh-stat__t { font-size: 14px; font-weight: 700; color: var(--h-navy); margin-top: 2px; }
.tmrh-stat__s { font-size: 13px; color: var(--h-muted); }

/* --- Section shell -------------------------------------------------------- */
.tmrh-section { padding: 76px 0; }
.tmrh-section--alt { background: var(--h-white); }
.tmrh-section__head { text-align: center; max-width: 640px; margin: 0 auto 52px; }
.tmrh-section__title {
    font-size: clamp(28px, 3.4vw, 36px);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--h-navy);
    margin: 0;
}
.tmrh-center { text-align: center; }

/* --- How it works --------------------------------------------------------- */
.tmrh-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    position: relative;
}
.tmrh-step { text-align: center; padding: 0 8px; position: relative; }
.tmrh-step__icon {
    position: relative;
    width: 64px;
    height: 64px;
    margin: 0 auto 26px;
    border-radius: 50%;
    background: var(--h-blue-soft);
    color: var(--h-blue);
    display: grid;
    place-items: center;
    z-index: 2;
}
.tmrh-step__icon svg { width: 28px; height: 28px; }
.tmrh-step__num {
    position: absolute;
    left: 50%;
    bottom: -10px;
    transform: translateX(-50%);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--h-blue);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    display: grid;
    place-items: center;
    border: 3px solid #fff;
}
/* Dotted connector line between step icons (desktop only). */
.tmrh-step:not(:last-child) .tmrh-step__icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: calc(50% + 42px);
    width: calc(100% * 3 - 84px);
    width: clamp(40px, 12vw, 180px);
    border-top: 2px dashed #c5d6f2;
    z-index: -1;
}
.tmrh-step__title { font-size: 17px; font-weight: 800; color: var(--h-navy); margin: 6px 0 8px; }
.tmrh-step__text { font-size: 14px; color: var(--h-muted); line-height: 1.5; max-width: 220px; margin: 0 auto; }

/* --- Why cards ------------------------------------------------------------ */
.tmrh-why { padding-top: 8px; }
.tmrh-why__title {
    text-align: center;
    font-size: clamp(26px, 3.2vw, 32px);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--h-navy);
    margin: 0 0 40px;
}
.tmrh-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.tmrh-card {
    background: #fff;
    border: 1px solid var(--h-border);
    border-radius: var(--h-radius-card);
    box-shadow: var(--h-shadow-card);
    padding: 26px 24px;
}
.tmrh-card__icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--h-blue-soft);
    color: var(--h-blue);
    display: grid;
    place-items: center;
    margin-bottom: 18px;
}
.tmrh-card__icon svg { width: 24px; height: 24px; }
.tmrh-card__title { font-size: 17px; font-weight: 800; color: var(--h-navy); margin: 0 0 8px; }
.tmrh-card__text { font-size: 14px; color: var(--h-muted); line-height: 1.55; margin: 0; }

/* --- Blue CTA banner ------------------------------------------------------ */
.tmrh-cta-wrap { padding: 8px 0 80px; background: var(--h-white); }
.tmrh-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    flex-wrap: wrap;
    background: linear-gradient(120deg, var(--h-blue-deep) 0%, var(--h-blue) 100%);
    border-radius: var(--h-radius-cta);
    padding: 34px 40px;
    box-shadow: 0 20px 50px rgba(0, 59, 191, 0.28);
}
.tmrh-cta__left { display: flex; align-items: center; gap: 20px; min-width: 0; }
.tmrh-cta__icon {
    flex: none;
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    display: grid;
    place-items: center;
}
.tmrh-cta__icon svg { width: 26px; height: 26px; }
.tmrh-cta__title { font-size: 22px; font-weight: 800; color: #fff; margin: 0 0 6px; }
.tmrh-cta__text { font-size: 15px; color: rgba(255, 255, 255, 0.85); margin: 0; max-width: 520px; }
.tmrh-cta__actions { display: flex; gap: 12px; flex: none; }

/* --- Footer --------------------------------------------------------------- */
.tmrh-footer {
    background: #fff;
    border-top: 1px solid var(--h-border);
    padding: 56px 0 40px;
}
.tmrh-footer__grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
    gap: 32px;
}
.tmrh-footer__brand .tmrh-brand { margin-bottom: 14px; }
.tmrh-footer__brand p { font-size: 14px; color: var(--h-muted); margin: 0; max-width: 260px; }
.tmrh-footer__col h4 {
    font-size: 14px;
    font-weight: 800;
    color: var(--h-navy);
    margin: 4px 0 16px;
}
.tmrh-footer__col a {
    display: block;
    font-size: 14px;
    color: var(--h-muted);
    margin-bottom: 12px;
}
.tmrh-footer__col a:hover { color: var(--h-blue); }
.tmrh-footer__meta {
    grid-column: 1 / -1;
    margin-top: 8px;
    padding-top: 24px;
    border-top: 1px solid var(--h-border);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: var(--h-light);
}
/* The reference places the ecosystem note top-right of the footer; keep a
   simple, robust stacked layout that reads cleanly at every width. */

/* Flash messages (homepage only). */
.tmrh-flash {
    border-radius: 12px;
    padding: 13px 16px;
    margin: 16px 0;
    font-size: 14px;
    font-weight: 600;
}
.tmrh-flash--success { background: #e6f4ec; color: #0f7a45; }
.tmrh-flash--error { background: #fce6ee; color: #b3173f; }
.tmrh-flash--info { background: var(--h-blue-soft); color: var(--h-blue-deep); }

/* ===========================================================================
   Responsive
   =========================================================================== */
@media (max-width: 1024px) {
    .tmrh-hero__inner {
        grid-template-columns: 1fr;
        gap: 36px;
        padding: 48px 0 72px;
    }
    .tmrh-hero__copy { max-width: none; }
    .tmrh-hero__lead { max-width: none; }
    .tmrh-hero__media {
        min-height: 340px;
        border-radius: 22px;
        order: 2;
    }
    .tmrh-hero__media::after {
        background: linear-gradient(180deg, transparent 60%, rgba(7, 29, 58, 0.10));
    }
    .tmrh-steps { grid-template-columns: repeat(2, 1fr); gap: 36px 16px; }
    .tmrh-step:not(:last-child) .tmrh-step__icon::after { display: none; }
    .tmrh-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .tmrh-nav { display: none; }
    .tmrh-header__bar { height: 64px; }
    .tmrh-search__row { grid-template-columns: 1fr; }
    .tmrh-search__submit { width: 100%; }
    .tmrh-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px 0;
        margin-top: -40px;
    }
    .tmrh-stat { padding: 16px 14px; }
    .tmrh-stat:nth-child(2) { border-left: none; }
    .tmrh-stat:nth-child(3) { border-left: none; }
    .tmrh-stat:nth-child(n+3) { border-top: 1px solid var(--h-border); }
    .tmrh-section { padding: 56px 0; }
    .tmrh-cta { padding: 28px 24px; }
    .tmrh-cta__actions { width: 100%; }
    .tmrh-cta__actions .tmrh-btn { flex: 1; }
    .tmrh-footer__grid { grid-template-columns: 1fr 1fr; gap: 28px 24px; }
    .tmrh-footer__brand { grid-column: 1 / -1; }
    .tmrh-footer__meta { justify-content: flex-start; gap: 4px; flex-direction: column; }
}

@media (max-width: 480px) {
    .tmrh-container { padding: 0 18px; }
    .tmrh-hero__title { font-size: 34px; }
    .tmrh-stats { grid-template-columns: 1fr; }
    .tmrh-stat { border-left: none !important; border-top: 1px solid var(--h-border); }
    .tmrh-stat:first-child { border-top: none; }
    .tmrh-cards { grid-template-columns: 1fr; }
    .tmrh-rating-card { left: 16px; bottom: 16px; width: 200px; padding: 14px 16px; }
    .tmrh-footer__grid { grid-template-columns: 1fr; }
}
