/* ============================================================================
   BC HOME SERVICE — v26.css · DESKTOP MINIMAL-DENSITY PASS
   ----------------------------------------------------------------------------
   Owner brief: "site looks TOO BIG on desktop — make below-hero sections
   minimal/modern, EXCEPT the hero."

   Scope rules of this layer:
   • DESKTOP ONLY — every rule lives inside @media (min-width: 1024px).
     Mobile / tablet are completely untouched.
   • HERO IS EXCLUDED — nothing here matches #home, .hero, .page-hero,
     .hero-v9 or any hero-* selector. Hero keeps its big cinematic padding.
   • ADDITIVE RE-STYLE ONLY — no element, card, badge or animation is removed.
     reveal / tilt / glow / fx-* systems keep working; only spacing,
     typography scale and grid density change.
   • Loaded AFTER v23.css on every page that loads v23.css.
   ============================================================================ */

@media (min-width: 1024px) {

  /* ------------------------------------------------------------------
     0. DENSITY TOKENS (desktop)
     --space-section  : 64-110px  ->  56-72px   (section vertical rhythm)
     --font-size-h2   : up to 2.25rem -> 2.1rem (section titles)
     --font-size-stat : up to 3.5rem -> 2.5rem (giant stat numbers)
     Hero never consumes these tokens (verified in DOM: #home uses its own
     inline clamp() paddings + inline h1 clamp; .page-hero uses explicit
     clamp() values) — so heroes are structurally immune.
     ------------------------------------------------------------------ */
  :root {
    --space-section: clamp(56px, 5vw, 72px);
    --font-size-h2: clamp(1.7rem, 1.6vw, 2.1rem);
    --font-size-stat: clamp(2rem, 2.4vw, 2.5rem);
  }

  /* ------------------------------------------------------------------
     1. SECTION RHYTHM — homepage below-hero sections + internal pages
     (React sections use inline `padding: var(--space-section) 0`, the
     .section class reads the same token — both compress via the token.)
     ------------------------------------------------------------------ */

  /* Booking band — React inline clamp(56px,8vw,96px) */
  section#book-online {
    padding-top: clamp(56px, 4.5vw, 64px) !important;
    padding-bottom: clamp(56px, 4.5vw, 64px) !important;
  }

  /* Google-reviews band (JS-injected <style> lands after this file -> !important) */
  .gr-section {
    padding-top: clamp(48px, 4.5vw, 60px) !important;
    padding-bottom: clamp(48px, 4.5vw, 60px) !important;
  }

  /* Booking widget band (homepage + internal booking blocks) */
  .bc-booking {
    padding-top: clamp(48px, 4.5vw, 64px) !important;
    padding-bottom: clamp(48px, 4.5vw, 64px) !important;
  }

  /* Internal-page section families (bc-v9 / v18 / v10 layers) */
  .m-section { padding-block: clamp(48px, 5vw, 64px); }
  .m-section + .m-section { padding-top: clamp(24px, 3vw, 36px); }
  .v10-section { padding: clamp(48px, 5vw, 64px) 0; }
  .bc9-section { padding-block: clamp(48px, 5vw, 64px); }

  /* ------------------------------------------------------------------
     2. SECTION HEADER / TYPOGRAPHY (below-hero only — hero excluded)
     ------------------------------------------------------------------ */
  .section-header { margin: 0 auto 30px; }
  .section-header .section-eyebrow { margin-bottom: 10px; }
  .section-title { margin: 0 0 12px; }

  /* Eyebrow chips — slimmer pill, tighter gap to title.
     #home (homepage hero) + .page-hero (internal heroes) are excluded. */
  section:not(#home):not(.page-hero):not(.hero):not(.hero-v9) .section-eyebrow {
    padding: 5px 12px;
    margin-bottom: 10px;
  }

  /* Lead paragraphs — quieter scale */
  section:not(#home):not(.page-hero):not(.hero):not(.hero-v9) .section-subtitle {
    font-size: 0.98rem;
    line-height: 1.6;
  }

  /* Internal-page headings (bc-v9 family) — cap at 2.1rem */
  .m-h2 { font-size: clamp(1.6rem, 1.8vw, 2.1rem); }

  /* ------------------------------------------------------------------
     3. SERVICE / CARD GRID DENSITY (homepage "Expert Services" + generic)
     ------------------------------------------------------------------ */
  @media (min-width: 1200px) {
    /* React inline grid: repeat(auto-fill,minmax(280px,1fr)) -> clean 4-col */
    #services div[style*="minmax(280px"] {
      grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
      gap: 18px !important;
    }
    /* Uniform 1×1 tiles: 8 cards = two tidy full rows (the v18 "featured
       span-2" track left a lonely card on a 4-col grid — same repair v23
       already applied to the Seasonal Deals grid). */
    #services .v17-bento > .service-card {
      grid-column: auto / span 1 !important;
    }
  }

  /* Service cards — tighter surface + smaller card title.
     (Main.css gives 28px padding; the h3 uses inline var(--font-size-h3).) */
  .service-card { padding: 20px; }
  .service-card h3 { font-size: 1.12rem !important; }
  .service-card .svc-img-wrap { margin: -20px -20px 12px !important; }

  /* Generic card families on internal pages — one compact step */
  .card, .feature-card, .value-card, .review-card, .m-card, .v10-card {
    padding: 20px;
  }

  /* Grids that carry inline React styles need !important */
  .offers-grid { gap: 18px !important; }
  .steps-grid { gap: 20px !important; }
  .financing-grid { gap: 20px !important; margin-bottom: 32px !important; }
  .calc-grid { gap: 24px !important; }
  .blog-grid { gap: 18px !important; }

  /* Grids defined in the head <style> (before this file) — plain cascade */
  .ba-grid { gap: 20px; }
  .ba-info { padding: 16px 18px 18px; }

  /* Stats band (about section) — smaller cells + tighter trailing space */
  .stats-grid > div > div { padding: 18px 14px !important; }
  .stats-grid { margin-bottom: 36px !important; }

  /* ------------------------------------------------------------------
     4. GIANT NUMBERS / DECORATIVE PADDING SLIMMING
     (rules defined inside body-level <style> tags land after this file,
     so these need !important; nothing is deleted, only scaled down)
     ------------------------------------------------------------------ */
  .calc-hero-value { font-size: clamp(1.4rem, 2vw, 1.75rem) !important; }
  .calc-shell { padding: 28px !important; }
  .calc-inputs { padding: 24px !important; }
  .calc-hero-card { padding: 16px 18px !important; }
  .map-shell { margin-bottom: 24px !important; }

  /* ------------------------------------------------------------------
     5. FOOTER — compress desktop top padding
     ------------------------------------------------------------------ */
  footer#footer > .container,
  footer#footer .container {
    padding-top: clamp(40px, 4vw, 52px) !important;
  }
  .footer { padding: clamp(40px, 4vw, 56px) 0 0; }
  .bc9-footer .f-grid { padding-block: clamp(40px, 4vw, 52px); }

} /* end @media (min-width: 1024px) */

/* ============================================================================
   XL DESKTOP REFINEMENT (≥1440px) — same families, one notch tighter.
   Hero still untouched: no selector below matches any hero element and the
   hero never consumes --space-section (verified against home-bundle.js).
   ============================================================================ */
@media (min-width: 1440px) {
  :root {
    --space-section: clamp(52px, 3.5vw, 64px);
    --font-size-h2: clamp(1.7rem, 1.4vw, 2rem);
    --font-size-stat: clamp(2rem, 2vw, 2.4rem);
  }

  /* Section header block — compact, modern */
  .section-header { margin: 0 auto 26px; }
  .section-header .section-eyebrow { margin-bottom: 8px; }
  section:not(#home):not(.page-hero):not(.hero):not(.hero-v9) .section-eyebrow {
    padding: 4px 11px;
    font-size: 0.72rem;
  }
  .section-title { margin: 0 0 10px; }

  /* Card density — final step */
  .service-card { padding: 18px 20px; }
  .service-card h3 { font-size: 1.06rem !important; }
  .card, .feature-card, .value-card, .m-card, .v10-card { padding: 18px 20px; }

  /* Gaps — tighter on wide screens */
  .offers-grid { gap: 16px !important; }
  .steps-grid { gap: 18px !important; }
  .financing-grid { gap: 18px !important; }
  .blog-grid { gap: 16px !important; }
  .ba-grid { gap: 18px; }

  /* Footer top padding — slim */
  footer#footer > .container,
  footer#footer .container {
    padding-top: clamp(36px, 3vw, 44px) !important;
  }
} /* end @media (min-width: 1440px) */

/* ============================================================================
   Bug Hunt 8 — MOBILE UX PASS (390px / 360px phones)
   ----------------------------------------------------------------------------
   Verified live at 390×844 + 360×740 (agent-browser, touch emulation).
   Every rule below lives inside @media (max-width: 768px) — desktop is
   untouched. All fixes are additive; nothing is removed.

   Measured BEFORE this layer (phones):
   M1. Internal sticky CTA bar (.m-sticky-cta, 57px tall) covered the last
       52px of the last FAQ item on scrollIntoView / #faq deep links —
       html scroll-padding-bottom was "auto".
   M2. Tap targets under 44px: homepage hamburger (.mobile-menu-btn 40px —
       a flex-shrink ate the inline 44px), reviews carousel arrows
       (.gr-arrow 38px), read-more buttons (.rm-btn 34px), footer social
       icon links (36px inline), .v15-seasonal-cta pill (30px).
   M3. 108 text nodes under 11px on the homepage (smallest 9.61px) —
       .ba-label/.ba-cat-badge/.ba-tag/.ba-cat, .cd61-tag, .bcat-plabel/
       .bcat-attr/.bcat-hint, .calc-stat-lbl, .calc-disclaimer,
       .blog-category-tag, .topbar-pill (site-wide) + hero-orbit inline
       0.62/0.65/0.7rem micro-labels.
   M4. Furnace-repair pricing table min-content (372px) > its 354px/324px
       scroll wrapper at 390px/360px — last column half-clipped.
   ============================================================================ */
@media (max-width: 768px) {

  /* ------------------------------------------------------------------
     M1. SCROLL PADDING — the internal sticky CTA bar (.m-sticky-cta,
     57px) + floats must never cover the tail of whatever the browser
     scrolls into view (last FAQ item, fragment targets). 76px clears the
     57px bar with the same 9px breathing room the footer already has.
     ------------------------------------------------------------------ */
  html {
    scroll-padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* ------------------------------------------------------------------
     M2. TAP TARGETS ≥ 44px (CTAs and icon controls only — body text
     links keep their natural inline size, per WCAG 2.5.8 exceptions)
     ------------------------------------------------------------------ */
  /* homepage hamburger — inline width/height is 44px but the flex row
     shrank it to 40px; un-shrink + floor it */
  .mobile-menu-btn {
    flex: 0 0 auto !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px;
    min-height: 44px;
  }

  /* Google-reviews carousel arrows (were 38px) */
  .gr-carousel .gr-arrow {
    flex: 0 0 auto !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px;
    min-height: 44px;
  }

  /* read-more.js expander buttons (were 34px tall) */
  .rm-btn {
    min-height: 44px !important;
    padding: 11px 16px !important;
  }

  /* footer social icon links (inline 36px squares) */
  footer a[href*="facebook.com"],
  footer a[href*="instagram.com"],
  footer a[href*="youtube.com"],
  .footer-socials a[href*="facebook."],
  .footer-socials a[href*="instagram."],
  .footer-socials a[href*="youtu"] {
    width: 44px !important;
    height: 44px !important;
  }

  /* seasonal banner pill CTA (was 30px tall) */
  .v15-seasonal-cta {
    min-height: 44px !important;
    padding: 12px 18px !important;
    display: inline-flex;
    align-items: center;
  }

  /* ------------------------------------------------------------------
     M3. TEXT FLOOR — nothing readable under 11px on phones
     (a) classed micro-labels (CSS-authored sizes)
     ------------------------------------------------------------------ */
  .topbar-pill,
  .ba-label, .ba-cat-badge, .ba-tag, .ba-cat,
  .cd61-tag,
  .bcat-plabel, .bcat-attr, .bcat-hint,
  .calc-stat-lbl, .calc-disclaimer,
  .blog-category-tag,
  .bc-dp-label,
  .bc-mnav-label, .bc-mnav-trust span,
  .v16-hours-chip,
  .v16-dock-hours {
    font-size: 11px !important;
  }

  /* (b) inline-styled micro-labels (React/hero-orbit 0.62/0.65/0.7rem
     sizes, written both with and without the space after the colon).
     max() keeps ≥11.2px values untouched on 16px-root hosts and lifts
     the 9.6–10.9px values on the 15.5px-root homepage. */
  [style*="font-size: 0.62rem"],
  [style*="font-size:0.62rem"] { font-size: 11px !important; }
  [style*="font-size: 0.65rem"],
  [style*="font-size:0.65rem"] { font-size: 11px !important; }
  [style*="font-size: 0.7rem"],
  [style*="font-size:0.7rem"] { font-size: max(11px, 0.7rem) !important; }

  /* (c) Leaflet map attribution (10.54px default) — rendered text too */
  .leaflet-control-attribution {
    font-size: 11px !important;
  }

  /* ------------------------------------------------------------------
     M4. PRICING TABLES — static pages wrap tables in
     <div style="overflow-x:auto"> but the 12px/14px cell padding pushed
     min-content to 372px on a 354px (390px viewport) wrapper. Tighten
     the cell padding so the natural width fits the wrapper; long text
     already wraps. Table font stays ≥13px (well above the 11px floor).
     ------------------------------------------------------------------ */
  div[style*="overflow-x:auto"] table th,
  div[style*="overflow-x: auto"] table th,
  div[style*="overflow-x:auto"] table td,
  div[style*="overflow-x: auto"] table td {
    padding: 10px 6px !important;
  }

} /* end @media (max-width: 768px) — Bug Hunt 8 mobile pass */

/* ============================================================================
   H10 · ACCESSIBILITY LAYER (Hunter #10 — a11y bug hunt)
   Appended below the desktop-density pass; applies to ALL breakpoints.
   ----------------------------------------------------------------------------
   A. Global :focus-visible ring — one consistent high-contrast ring on every
      interactive element (v26.css loads last on all page types, so this
      unifies homepage / city pages / blog / calculator).
   B. Muted-text contrast: --color-text-light #8896AB measured 3.0:1 on white
      and 2.86:1 on off-white (AA body text needs 4.5:1). Re-pointed to
      #5F7186 → 5.0:1 on white, 4.8:1 on off-white. Brand hues untouched.
      Dark-surface muted text uses white alphas (not this token) — unaffected.
   C. Hardcoded #8896AB text in v23.css calculator rules → #5F7186.
   D. Faint form-control focus rings (0.18 alpha) strengthened.
   ============================================================================ */

/* --- A. Keyboard focus ring ------------------------------------------------ */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[role="button"]:focus-visible,
[role="radio"]:focus-visible,
[role="tab"]:focus-visible,
[role="checkbox"]:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible {
  outline: 3px solid #2E86DE;
  outline-offset: 2px;
}

/* Brighter ring variant on dark surfaces so the indicator stays visible. */
footer a:focus-visible,
footer button:focus-visible,
.mobile-nav a:focus-visible,
.mobile-nav button:focus-visible,
.site-footer a:focus-visible,
[data-theme="dark"] a:focus-visible,
[data-theme="dark"] button:focus-visible,
.stats-on-dark a:focus-visible,
.stats-on-dark button:focus-visible {
  outline-color: #48CAE4;
}

/* Skip link — ensure it is always visible when focused. */
.skip-link:focus,
a.skip-link:focus-visible {
  outline: 3px solid #48CAE4;
  outline-offset: 2px;
}

/* --- B. Muted text contrast (WCAG AA) -------------------------------------- */
:root {
  --color-text-light: #5F7186; /* was #8896AB — 3.0:1 on #FFF; now 5.0:1 */
}
/* Dark surfaces (footer, mobile-nav, stats-on-dark, heroes) set their muted
   text with white alphas — rgba(255,255,255,.60-.74) — not this token, so
   the darker #5F7186 tone never lands on a dark background. Verified in
   main.css:636-650 and bundle-common.css:1387+ (footer palettes). */

/* v10 faint token follows the corrected muted tone (light surfaces). */
:root { --v10-text-faint: #5F7186; }

/* --- C. Calculator (v23.css hardcoded muted text) ------------------------- */
.bcc-pill small   { color: #5F7186; }               /* was #8896AB, 3.0:1 */
.bcc-empty        { color: #5F7186; }               /* was #8896AB, 3.0:1 */
.bcc-r-sep        { color: #5F7186; }               /* was #8896AB, 3.0:1 */
.bcc-pill.sel small { color: #C9D4E2; }             /* white-on-navy small text, 4.6:1 */

/* sm-note chip: #8896AB on #F1F6FB was 2.8:1 → #5F7186 ≈ 4.7:1 */
.sm-note { color: #5F7186; }

/* --- D. Strengthen faint focus rings on form controls -------------------- */
.hcf-input:focus, .hcf-select:focus {
  box-shadow: 0 0 0 4px rgba(72, 202, 228, 0.45);
}
.qf-input:focus, .qf-textarea:focus {
  box-shadow: 0 0 0 4px rgba(72, 202, 228, 0.45);
}
.bcc-cb input:focus {
  box-shadow: 0 0 0 4px rgba(72, 202, 228, 0.45);
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  box-shadow: 0 0 0 4px rgba(46, 134, 222, 0.30);
}

/* Reduced-motion users: keep rings, kill transitions on focus color only. */
@media (prefers-reduced-motion: reduce) {
  a:focus-visible, button:focus-visible, input:focus-visible,
  select:focus-visible, textarea:focus-visible, summary:focus-visible {
    transition: none;
  }
}

/* --- D2. Specificity-hardened rings for controls that reset outline -----
   (bundle-common/main/v23 set `outline:none` via class+pseudo selectors
   that out-weigh the generic rule above; these win on keyboard focus). */
input.hcf-input:focus-visible,
select.hcf-select:focus-visible,
input.qf-input:focus-visible,
textarea.qf-textarea:focus-visible,
.bcc-cb input:focus-visible,
input.form-input:focus-visible,
textarea.form-textarea:focus-visible,
select.form-select:focus-visible,
input.bc-bk-field:focus-visible,
select.bc-bk-field:focus-visible,
.ai-chat-input:focus-visible {
  outline: 3px solid #2E86DE;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(72, 202, 228, 0.45);
}
