/* section-rhythm.css — unified vertical section rhythm (2026-07-01)
   Goal: even, breathable, consistent spacing between every section site-wide.
   One fluid token is routed through the Webflow section-gap variables, the
   project's custom sections, and the few 0-padding sections that butted into
   their neighbors. Intentional overlaps (listing hero, stacked about-v5 group)
   are left untouched. Loaded LAST so it wins the cascade. */

:root {
  /* ~64px on phones -> ~112px on wide screens. Trims the heavy 8.75rem (140px)
     default and lifts the tight spots to the same rhythm. */
  --rt-section-space: clamp(4rem, 3.1rem + 3.6vw, 7rem);
  --rt-section-space-half: clamp(2rem, 1.55rem + 1.8vw, 3.5rem);
}

/* The Webflow section-gap tokens are redefined on `body` (and on body inside
   media queries), so they must be overridden on `body` too — an element's own
   declaration beats an inherited !important. This unifies every var-driven
   section to the single rhythm. */
body {
  --_gap-size---section-gap-v1: var(--rt-section-space) !important;
  --_gap-size---section-gap-v2: var(--rt-section-space) !important;
}

/* Sections added this session -> match the site rhythm (were 72px) */
.rt-related-guides,
.rt-listing-form-section {
  padding-top: var(--rt-section-space) !important;
  padding-bottom: var(--rt-section-space) !important;
}

/* Program-page overview sat at 0/0 and butted the dark hero above it.
   Scope with :has so ONLY program pages are affected — listing pages use the
   same class with an intentional hero overlap and must stay as-is. */
body:has(.pf-program-hero) .rt-property-overview {
  padding-top: var(--rt-section-space) !important;
  padding-bottom: var(--rt-section-space) !important;
}

/* Program hero: keep the large top pad (clears the fixed navbar) but bring the
   bottom in line with the rhythm so the hero -> next-section gap is consistent. */
.pf-program-hero-inner {
  padding-bottom: var(--rt-section-space) !important;
}

/* Home-one feature rows (rt-about-v5) rendered at 0/0 padding, so the last row's
   "See how it works" CTA butted the top color-edge of the linen band below it —
   the exact spot JB flagged. Give the rows an even internal rhythm, and the row
   that meets a colored band a full section-space so white breathing room exists
   before the color change. (Detected visually: content sat 0px from the band edge.) */
.rt-about-v5 {
  padding-top: var(--rt-section-space-half) !important;
  padding-bottom: var(--rt-section-space-half) !important;
}
/* first row in the run -> full top gap from the section above it */
.rt-about-v5:not(.rt-about-v5 + .rt-about-v5) {
  padding-top: var(--rt-section-space) !important;
}
/* last row in the run -> full bottom gap before the colored band */
.rt-about-v5:not(:has(+ .rt-about-v5)) {
  padding-bottom: var(--rt-section-space) !important;
}

/* Footer keeps its top rhythm via the unified token (padding-top already uses
   section-gap-v1); no bottom change needed. */
