/* ============================================================================
   AGENT 08 — LOWER HOMEPAGE SECTIONS (Gold Master §§08–13) · lower.css
   Companion to lower.html. All selectors are gm-prefixed; all tokens are
   scoped to .gm-lower so nothing leaks into sibling sections or global CSS.
   Desktop sizes are Agent 02's @1440 extrapolations (native 699px × 2.06).
   Colors sampled from the gold PNG (Agent 02 §2 + Agent 08 spot-checks).
   ========================================================================== */

.gm-lower {
  --gm-red: #E00E29;          /* CTA red — sampled everywhere in gold */
  --gm-red-hover: #B90B21;
  --gm-navy: #03264A;         /* hero-family navy (step circle 2, icons) */
  --gm-btn-navy: #002F59;     /* navy buttons — sampled mode, maint. button */
  --gm-btn-navy-hover: #002242;
  --gm-cta-navy: #002D54;     /* bottom CTA band — flat, brighter navy */
  --gm-ink: #23394F;          /* heading ink (gold core ink #243A52 family) */
  --gm-body: #55677A;         /* body / link gray-slate */
  --gm-pale: #F2F7FB;         /* maintenance band bg */
  --gm-strip: #F1F6FA;        /* copyright strip bg */
  --gm-line: #E1EAF2;         /* footer hairline dividers */
  --gm-focus: #087FCB;        /* brand Air Blue — focus outline */
  --gm-serif: "Playfair Display", Georgia, "Times New Roman", Times, serif; /* G-17: gold serif face unidentified; see BUILD-NOTES */
  --gm-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-family: var(--gm-sans);
  color: var(--gm-body);
  -webkit-font-smoothing: antialiased;
}

.gm-lower *,
.gm-lower *::before,
.gm-lower *::after { box-sizing: border-box; }

.gm-lower h2, .gm-lower h3, .gm-lower p, .gm-lower figure, .gm-lower ul, .gm-lower ol { margin: 0; }
.gm-lower ul, .gm-lower ol { padding: 0; list-style: none; }
.gm-lower img { max-width: 100%; }
.gm-lower a { -webkit-tap-highlight-color: transparent; }

.gm-lower a:focus-visible,
.gm-lower .gm-btn:focus-visible {
  outline: 3px solid var(--gm-focus);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Container: gold content column = 89.7% of page width (x 38–665 of 699) */
.gm-container { width: min(89.7%, 1290px); margin-inline: auto; }

/* ---------- Shared buttons (gold: ~52–58px tall @1440, slight rounding) --- */
.gm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  min-height: 3.25rem; padding: .8rem 1.5rem;
  border: 2px solid transparent; border-radius: .375rem;
  font-family: var(--gm-sans); font-size: 1.0625rem; font-weight: 700; line-height: 1.2;
  text-decoration: none; white-space: nowrap;
  transition: background-color .15s ease, color .15s ease;
}
.gm-btn--red { background: var(--gm-red); color: #FFF; }
.gm-btn--red:hover { background: var(--gm-red-hover); }
.gm-btn--navy { background: var(--gm-btn-navy); color: #FFF; }
.gm-btn--navy:hover { background: var(--gm-btn-navy-hover); }
.gm-btn--outline { background: transparent; border-color: #FFF; color: #FFF; }
.gm-btn--outline:hover { background: rgba(255, 255, 255, .12); }
.gm-btn__icon { width: 1.4rem; height: 1.4rem; flex: none; }
.gm-btn__arrow { width: 1.15rem; height: 1.15rem; flex: none; }

/* ==================== 08 · WHAT TO EXPECT ==================== */
.gm-wte { background: #FFF; padding: 0.9rem 0 0.8rem; }
.gm-wte__title {
  font-family: var(--gm-serif); font-weight: 700; color: var(--gm-ink);
  font-size: 2.5rem; line-height: 1.22; text-align: center;
}
.gm-lower .gm-wte__caption { text-align: center; font-size: .9375rem; margin-top: .9rem; }
.gm-wte__steps {
  display: flex; align-items: flex-start; gap: 1.1rem; margin-top: 1rem;
}
.gm-step { flex: 1 1 0; display: flex; align-items: flex-start; gap: 1.05rem; }
.gm-step__num {
  flex: none; width: 3.375rem; height: 3.375rem; border-radius: 50%;
  display: grid; place-items: center;
  color: #FFF; font-size: 1.5rem; font-weight: 800; line-height: 1;
}
.gm-step__num--red { background: var(--gm-red); }
.gm-step__num--navy { background: var(--gm-navy); }
.gm-step__icon { flex: none; width: 3rem; height: 3rem; }
.gm-step__name { font-size: 1.375rem; font-weight: 700; color: var(--gm-ink); line-height: 1.2; }
.gm-step__body { font-size: 1rem; line-height: 1.35; margin-top: .3rem; }
.gm-wte__arrow { flex: none; width: 2rem; align-self: center; }
.gm-wte__arrow svg { display: block; width: 100%; height: auto; }

/* ==================== 09 · COMFORT MAINTENANCE PLAN ==================== */
.gm-maint {
  background: var(--gm-pale);
  display: grid; grid-template-columns: 32% minmax(0, 1fr) 34%;
  align-items: stretch; min-height: 11.3rem;
}
.gm-maint__photo { position: relative; overflow: hidden; }
.gm-maint__photo img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: 32% 50%; } /* R-08: position tuned for the Pexels 6471914 band derivative (gauges stay in frame at narrow aspects) */
.gm-maint__content { align-self: center; padding: 1.05rem 1rem 1.05rem 1.6rem; }
.gm-maint__title {
  font-family: var(--gm-serif); font-weight: 700; color: var(--gm-ink);
  font-size: 2.25rem; line-height: 1.15;
}
.gm-maint__copy { font-size: 1.125rem; line-height: 1.5; margin: .4rem 0 .8rem; max-width: 34rem; }
.gm-maint__device { position: relative; overflow: hidden; }
.gm-maint__device img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: 65% 50%; }

/* ==================== 10 · SERVICE AREA ==================== */
.gm-area { position: relative; z-index: 2; background: #FFF; padding: 1rem 0 1.5rem; }
.gm-area__photo {
  position: absolute; top: 0; right: 0; z-index: 0;
  width: 38%; height: 100%; object-fit: cover; object-position: center 28%;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 42%);
          mask-image: linear-gradient(to right, transparent 0, #000 42%);
}
.gm-area__inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 29% minmax(0, 33rem); gap: 2.2rem; align-items: start;
}
.gm-area__map { position: relative; z-index: 3; }
.gm-area__map img { display: block; width: 100%; height: auto; }
.gm-area__map svg { display: block; width: 100%; height: auto; } /* R-08: inline vector map replaces the G-12 crop */
.gm-area__title {
  font-family: var(--gm-serif); font-weight: 700; color: var(--gm-ink);
  font-size: 2.0625rem; line-height: 1.14; max-width: 26rem;
}
.gm-area__copy { font-size: 1rem; line-height: 1.5; margin: .45rem 0 .8rem; max-width: 27rem; }

/* ==================== 11 · HEAR FROM LOCAL HOMEOWNERS ==================== */
.gm-reviews {
  position: relative; z-index: 1;
  /* REFINEMENT R-09 (brief §5): clean pale panel replaces the G-14 panorama
     background. Text sits on this solid backing only (MX-4). */
  background-color: #EEF7FE;
  padding: 3rem 0;
  text-align: left;
}
.gm-reviews__inner {
  display: grid; grid-template-columns: 1.02fr .98fr;
  align-items: center; gap: 3rem;
}
.gm-reviews__title {
  font-family: var(--gm-serif); font-weight: 700; color: var(--gm-ink);
  font-size: 2.125rem; line-height: 1.15;
}
.gm-reviews__copy { font-size: 1rem; line-height: 1.55; margin: .6rem 0 1.4rem; color: #41546A; max-width: 30rem; }
.gm-reviews__media {
  border-radius: .5rem; overflow: hidden;
  box-shadow: 0 10px 30px rgba(3, 38, 74, .16);
  aspect-ratio: 3 / 2;
}
.gm-reviews__media img {
  display: block; width: 100%; height: 100%; object-fit: cover;
}

/* ==================== 12 · BOTTOM CTA BAND ==================== */
.gm-ctaband { background: var(--gm-cta-navy); padding: 1.3rem 0; }
.gm-ctaband__inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.gm-ctaband__title { font-size: 2.5rem; font-weight: 800; color: #FFF; line-height: 1.12; }
.gm-ctaband__sub { font-size: .9375rem; color: #D7E5F2; margin-top: .35rem; }
.gm-ctaband__actions { display: flex; gap: 1rem; flex: none; flex-wrap: wrap; }

/* ==================== 13 · FOOTER ==================== */
.gm-footer { background: #FFF; }
.gm-footer__main {
  display: grid; gap: 1.8rem;
  grid-template-columns: 1.35fr .85fr .8fr .95fr .7fr 1.1fr;
  padding: 1.2rem 0 1.4rem;
}
.gm-footer__logo { display: inline-block; }
.gm-footer__logo img { display: block; width: 15.5rem; height: auto; }
.gm-footer__id { margin-top: .7rem; font-size: .875rem; line-height: 1.55; }
.gm-footer__col, .gm-footer__contact { border-left: 1px solid var(--gm-line); padding-left: 1.4rem; }
.gm-footer__heading { font-size: 1rem; font-weight: 700; color: var(--gm-ink); margin-bottom: .5rem; }
.gm-footer__links li { margin: .1rem 0; }
.gm-footer__links a, .gm-footer__legal a {
  color: var(--gm-body); font-size: .9375rem; text-decoration: none;
  transition: color .15s ease;
}
.gm-footer__links a:hover, .gm-footer__legal a:hover { color: var(--gm-red); text-decoration: underline; }
.gm-footer__contact address { font-style: normal; }
.gm-footer__addr { display: flex; gap: .6rem; color: var(--gm-ink); font-size: .9375rem; line-height: 1.45; }
.gm-footer__pin { flex: none; width: 1.3rem; height: 1.3rem; margin-top: .12rem; }
.gm-footer__phone {
  display: inline-flex; align-items: center; gap: .6rem; margin-top: 1rem;
  color: var(--gm-ink); font-size: 1.125rem; font-weight: 800; text-decoration: none;
}
.gm-footer__phone:hover { color: var(--gm-red); }
.gm-footer__phone-icon { width: 1.35rem; height: 1.35rem; flex: none; }
.gm-footer__social { display: flex; gap: .8rem; margin-top: 1.1rem; }
.gm-footer__social a { display: block; width: 2.3rem; height: 2.3rem; border-radius: 50%; }
.gm-footer__social svg { display: block; width: 100%; height: 100%; }
.gm-footer__bar { background: var(--gm-strip); padding: 1.7rem 0; }
.gm-footer__bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.gm-footer__copy { font-size: .9375rem; }
.gm-footer__legal { display: flex; flex-wrap: wrap; }
.gm-footer__legal li + li { border-left: 1px solid #C9D6E2; margin-left: 1rem; padding-left: 1rem; }

/* ==================== RESPONSIVE ==================== */
@media (min-width: 1024px) {
  /* Gold map-tail: the map graphic overlaps the reviews band below
     (Agent 02 §10: map bottom y≈1335 vs band bottom y≈1298 ≈ 76px @1440). */
  .gm-area__map { margin-bottom: -4.6rem; }
}

@media (max-width: 1100px) {
  .gm-footer__main { grid-template-columns: repeat(3, 1fr); }
  .gm-footer__contact { border-left: none; padding-left: 0; }
}

@media (max-width: 1023px) {
  .gm-step__num { width: 2.7rem; height: 2.7rem; font-size: 1.25rem; }
  .gm-step__icon { width: 2.4rem; height: 2.4rem; }
  .gm-step { gap: .8rem; }
  .gm-maint { grid-template-columns: 38% 1fr; }
  .gm-maint__device { grid-column: 1 / -1; height: 11rem; }
  .gm-area__inner { grid-template-columns: 34% 1fr; }
  .gm-area__photo { width: 42%; }
  .gm-ctaband__inner { flex-wrap: wrap; }
}

@media (max-width: 820px) {
  .gm-wte__steps { flex-direction: column; gap: 1.4rem; }
  .gm-wte__arrow { display: none; } /* stacked layout: order is carried by the <ol> */
  .gm-maint { grid-template-columns: 1fr; min-height: 0; }
  .gm-maint__photo { height: 13rem; order: -1; }
  .gm-maint__content { padding: 1.5rem 1.2rem 1.7rem; }
  .gm-maint__device { height: 11rem; }
  .gm-area { display: flex; flex-direction: column; padding-bottom: 0; }
  .gm-area__inner { grid-template-columns: 1fr; gap: 1.2rem; order: 1; }
  .gm-area__map { width: min(21.5rem, 100%); margin-inline: auto; justify-self: center; } /* R-08 / MX-1: centered map (justify-self needed — default stretch zeroes auto margins); MX-2 label size holds via the wider panel */
  .gm-area__photo {
    position: static; order: 2; width: 100%; height: 12rem; margin-top: 1.4rem;
    -webkit-mask-image: none; mask-image: none;
  }
  .gm-ctaband__inner { flex-direction: column; text-align: center; }
  .gm-ctaband__actions { justify-content: center; }
  .gm-footer__main { grid-template-columns: 1fr 1fr; }
  .gm-footer__brand, .gm-footer__contact { grid-column: 1 / -1; }
  .gm-footer__bar-inner { flex-direction: column; text-align: center; }
  .gm-footer__legal { justify-content: center; }
}

@media (max-width: 480px) {
  .gm-wte__title, .gm-ctaband__title { font-size: 2rem; }
  .gm-maint__title { font-size: 1.8rem; }
  .gm-area__title { font-size: 1.7rem; }
  .gm-reviews__title { font-size: 1.75rem; }
  .gm-step__icon { width: 2rem; height: 2rem; }
  .gm-ctaband__actions { flex-direction: column; align-items: stretch; width: 100%; }
  .gm-footer__main { grid-template-columns: 1fr; }
  .gm-footer__col { border-left: none; padding-left: 0; }
  .gm-footer__legal li + li { margin-left: .6rem; padding-left: .6rem; }
}

/* Reduced motion: this fragment uses no animation; neutralize transitions. */
@media (prefers-reduced-motion: reduce) {
  .gm-lower *, .gm-lower *::before, .gm-lower *::after {
    transition: none !important; animation: none !important;
  }
}

/* Gate 4 fix (U-9/U-2): section-scoped button heights matched to gold. */
.gm-maint .gm-btn { min-height: 2.6rem; padding: .55rem 1.3rem; }
.gm-reviews .gm-btn { min-height: 3.125rem; padding: .6rem 1.5rem; } /* R-09: 50px tall (MX-5: 48–52), label inherits 17px */

/* ==== Gate 4 fix round 2 (staging only) ====
/* R-2/R-4: grid children may shrink; below 1200px the maintenance CTA
   wraps instead of forcing the band's ~390px minimum content width
   (the 360/320px page overflow). */
.gm-maint > * { min-width: 0; }
@media (max-width: 1200px) {
  .gm-maint .gm-btn { white-space: normal; text-align: center; }
}
/* P1: service-area composition at >=821px. The map leaves its boxed
   grid cell: pulled to the viewport's left edge and shown at gold's
   scale (re-cropped panel = 244 native px wide = 34.9vw, all visible
   map content, rooftop sliver removed); section padding goes to zero
   so the band tracks gold's proportions. Gold's sub-y1298 'tail' zone
   contains no visible map content in the flattened master (verified:
   it is the reviews strip itself), so the map ends at the section
   boundary exactly as gold's visible content does. */
@media (min-width: 821px) {
  .gm-area { padding: 0; }
  .gm-area__map { margin: 0; align-self: start; width: 34.9vw; left: calc(-1 * (100vw - min(89.7vw, 1290px)) / 2); z-index: 0; }
  .gm-area__content { position: relative; z-index: 2; }
}
/* A-1 follow-through: in the assembled page .gm-lower and <main> now
   close before <footer>, keeping the footer a body-level contentinfo
   landmark. The footer therefore no longer inherits .gm-lower's
   tokens/resets — re-homed here with values copied verbatim (no
   visual change). */
.gm-footer {
  --gm-red: #E00E29; --gm-red-hover: #B90B21; --gm-navy: #03264A;
  --gm-btn-navy: #002F59; --gm-btn-navy-hover: #002242; --gm-cta-navy: #002D54;
  --gm-ink: #23394F; --gm-body: #55677A; --gm-pale: #F2F7FB;
  --gm-strip: #F1F6FA; --gm-line: #E1EAF2; --gm-focus: #087FCB;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--gm-body); -webkit-font-smoothing: antialiased;
}
.gm-footer *, .gm-footer *::before, .gm-footer *::after { box-sizing: border-box; }
.gm-footer h3, .gm-footer p, .gm-footer figure, .gm-footer ul { margin: 0; }
.gm-footer ul { padding: 0; list-style: none; }
.gm-footer img { max-width: 100%; }
.gm-footer a { -webkit-tap-highlight-color: transparent; }
.gm-footer a:focus-visible, .gm-footer .gm-btn:focus-visible { outline: 3px solid var(--gm-focus); outline-offset: 2px; border-radius: 2px; }
@media (prefers-reduced-motion: reduce) {
  .gm-footer *, .gm-footer *::before, .gm-footer *::after { transition: none !important; animation: none !important; }
}

/* ==== REFINEMENT R-09 — Reviews redesign responsive rules (brief §5, MX-4/5/6, TS) ====
   Desktop grid holds >=821px. Below that the section stacks: heading/copy/CTA
   first, photograph below — no overlap with the bottom CTA band at any width. */
@media (max-width: 820px) {
  .gm-reviews { padding: 2.25rem 0; }
  .gm-reviews__inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .gm-reviews__media { max-width: 560px; }
}
@media (max-width: 767px) {
  .gm-reviews__title { font-size: 1.75rem; } /* 28px — TS H2 range 26–28 at <=767 */
  .gm-reviews__copy { margin: .55rem 0 1.25rem; }
}


/* ==== REFINEMENT FIX-2 (staging only) — R-11 findings F-2 / F-6 / F-7 / F-8 ====
   Every rule below is scoped to <=767px: the desktop (>=768px) rendering of
   this file is byte-for-byte unaffected. Appended last so these declarations
   win the cascade over the earlier <=480px block at equal specificity. */
@media (max-width: 767px) {
  /* F-2 (TM-3 defect): the shared .gm-btn nowrap label made the Reviews CTA
     a 522px min-content column at 200% text scaling -> 542px page overflow
     at 390. Let this one label wrap; min-height (3.125rem, Gate 4) keeps the
     target >=44px and the label text is unchanged. */
  .gm-reviews .gm-btn { white-space: normal; text-align: center; }
  /* F-2 contributor (same defect class, masked behind the reviews maximum
     in R-11's isolation): the service-area CTA's nowrap label set its grid
     column's min-content to ~473px at 200% scaling, dragging the title,
     copy and map figure off-screen with it. Wrap permission only — at
     100% the label fits one line and the 52px box (MX-3) is unchanged. */
  .gm-area .gm-btn { white-space: normal; text-align: center; }
  /* F-2 contributors (same class, same masking): the bottom CTA band's two
     nowrap buttons are 381px of min-content at 200% scaling at every phone
     width, and WTE step 3's name is one unbreakable 256px word
     ("Comfortable" at 42px) whose min-content chain (step -> steps column)
     reached 373px at 320. Wrap permission for the band buttons; shrink
     permission + break-word for the step name. All inert at 100%: labels
     and the word fit their boxes unbroken there. */
  .gm-ctaband .gm-btn { white-space: normal; text-align: center; }
  .gm-step { min-width: 0; }
  .gm-step__text { min-width: 0; overflow-wrap: anywhere; }
  .gm-step__name { overflow-wrap: anywhere; }
  /* F-2 contributors, long-serif-word class (canvas-measured at the 200%
     sizes): a single unbreakable word wider than its column sets the
     column's min-content — "Homeowners" 344px in the reviews title (grid
     track), "Maintenance" 322px in the maintenance title, "Obligation."
     308px in the Second Look title. overflow-wrap:anywhere (NOT
     break-word, which per spec leaves min-content untouched) collapses
     the min-content and lets the word wrap under text scaling only.
     Inert at 100%: at base sizes the same words measure 172 / 161 / 154px
     and fit their columns unbroken. */
  .gm-reviews__title { overflow-wrap: anywhere; }
  .gm-maint__title { overflow-wrap: anywhere; }
  .tha-secondlook__title { overflow-wrap: anywhere; }
  /* F-8: Maintenance CTA measured 42px tall at 390 (< 44px floor). Raised
     via padding + min-height only — font size untouched. */
  .gm-maint .gm-btn { min-height: 2.75rem; padding-top: .75rem; padding-bottom: .75rem; }
  /* F-6 (TS table): section H2s in the sections no refinement lane restyled
     move into the 26–28px mobile band (measured at 390 before -> after):
       What to Expect title 32 -> 27 · Comfort Maintenance Plan 28.8 -> 27 ·
       bottom CTA band title 32 -> 27 · service-area title already 27.2 at
       <=480 but 33 at 481–767 -> held at 27.2 across <=767 (390 unchanged).
     Reviews (28) and Difference (27) already sit in band at <=767 and are
     deliberately not touched. No wording changes anywhere. */
  .gm-wte__title { font-size: 1.6875rem; }   /* 27px */
  .gm-maint__title { font-size: 1.6875rem; } /* 27px */
  .gm-ctaband__title { font-size: 1.6875rem; } /* 27px */
  .gm-area__title { font-size: 1.7rem; }     /* 27.2px — same value the <=480px rule already produced at 390 */
  /* F-6: What-to-Expect step titles 22px -> card-title band 20–21px. */
  .gm-step__name { font-size: 1.3125rem; }   /* 21px */
}

/* ==== V-02 OWNER-CORRECTED VISUAL ROUND (staging only) — WS C ====
   The service-area photo now sits in a <picture> wrapper (desktop + mobile
   crops). Desktop: the wrapper is a plain static block and the absolutely
   positioned photo behaves exactly as before. At <=820px the section is a
   flex column, so the wrapper takes the photo's old order/margin slot.
   The .gm-area__credit pill rules were removed above with the element —
   attribution lives on /photo-credits/. */
@media (max-width: 820px) {
  .gm-area__frame { order: 2; margin-top: 1.4rem; }
  .gm-area__frame .gm-area__photo { margin-top: 0; }
}
