/* Legacy ACF content sections (inc/legacy-acf.php).
   Styles the old pages' flexible-content layouts in the new design system;
   loaded only on pages the page-legacy template renders. */

.leg-section { padding-block: var(--section-pad); }
.leg-section + .leg-section { padding-top: 0; }
.leg-section.leg--tint,
.leg-section.leg--dark,
.leg-section.leg-hero { padding-top: var(--section-pad) !important; }
.leg--tint { background: var(--surface); }
.leg--dark { background: var(--brand-green-deep); color: var(--text-light); }
.leg--dark h2, .leg--dark h3 { color: #fff; }
.leg--dark a:not(.btn) { color: #fff; text-decoration: underline; }

.leg-h2 { font-size: clamp(26px, 3.4vw, 36px); margin-bottom: 18px; }
.leg-h3 { font-size: clamp(20px, 2.4vw, 24px); margin-bottom: 12px; }
/* Editors sometimes typed literal <h2>/<h3> into title fields; the helpers wrap
   those in a div.leg-h2/.leg-h3 — size the inner heading from the wrapper. */
.leg-h2 :is(h1, h2, h3, h4), .leg-h3 :is(h1, h2, h3, h4) { font-size: inherit; margin: 0; }
.leg-narrow { max-width: 860px; }
.leg-lead { max-width: 860px; margin: 0 auto 36px; text-align: center; }
.leg-lead h2, .leg-lead h3 { font-family: var(--font-display); font-size: clamp(26px, 3.4vw, 36px); }
.leg-btn-row { margin-top: 22px; display: flex; gap: 12px; flex-wrap: wrap; }

/* Old WYSIWYG bodies arrive with bare p/h/ul tags — restore rhythm. */
.leg-prose p { margin: 0 0 1em; }
.leg-prose p:last-child { margin-bottom: 0; }
.leg-prose h2, .leg-prose h3, .leg-prose h4 { margin: 1.2em 0 .5em; }
.leg-prose h2:first-child, .leg-prose h3:first-child { margin-top: 0; }
.leg-prose ul, .leg-prose ol { margin: 0 0 1em; padding-left: 22px; }
.leg-prose li { margin-bottom: .4em; }
.leg-prose img { border-radius: var(--radius); height: auto; }

/* Text beside image — the pair caps below the page frame so paragraph lines
   stay readable while grid/gallery sections use the full fluid width. */
.leg-split .container, .leg-twocol .container { max-width: min(var(--maxw), 1560px); }
.leg-split__grid { display: grid; gap: 32px; align-items: center; }
.leg-split__media img { width: 100%; height: auto; border-radius: var(--radius); box-shadow: var(--shadow-md); }
@media (min-width: 900px) {
  .leg-split__grid { grid-template-columns: 7fr 5fr; gap: 56px; }
  .leg-split--img-left .leg-split__grid { grid-template-columns: 5fr 7fr; }
  .leg-split--img-left .leg-split__text { order: 2; }
  .leg-split--img-left .leg-split__media { order: 1; }
}

/* Full-bleed image band with text on a scrim */
.leg-hero { position: relative; background-size: cover; background-position: center; color: #fff; }
.leg-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(23, 33, 22, 0.72), rgba(23, 33, 22, 0.72)); }
.leg-hero__inner { position: relative; max-width: 860px; }
.leg-hero h2, .leg-hero h3 { color: #fff; }
.leg-hero a:not(.btn) { color: #fff; text-decoration: underline; }
.leg-logo { max-width: 220px; margin-bottom: 16px; border-radius: 0; box-shadow: none; }

/* Two text columns */
.leg-twocol__grid { display: grid; gap: 32px; }
@media (min-width: 820px) { .leg-twocol__grid { grid-template-columns: 1fr 1fr; gap: 56px; } }

/* Icon / advantage cards — auto-fit so wide displays gain columns instead of
   stretching cards (2-up ~1100px, 4-up ~1900px; 3-up ~1000px, 5-up ~1700px). */
.leg-cards__grid { display: grid; gap: 20px; }
.leg-cards__grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); }
.leg-cards__grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.leg-card { background: #fff; border: 1px solid var(--hairline); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.leg--dark .leg-card { background: rgba(255, 255, 255, 0.06); border-color: var(--hairline-light); }
.leg-card__icon { width: 56px; height: 56px; object-fit: contain; margin-bottom: 14px; border-radius: 0; box-shadow: none; }

/* Image grids */
.leg-gallery__grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); }
.leg-tile { margin: 0; }
.leg-tile img { width: 100%; height: 220px; object-fit: cover; border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }
.leg-tile figcaption { font-size: 13px; color: var(--text-muted); margin-top: 6px; }
/* Supplier-logo wall ("Brands we install"): uniform white cards normalize 13
   wildly different logo shapes (wide wordmarks, square marks, boxed lockups)
   into one ordered grid — naked logos at a shared height read as scatter.
   Flex (not grid) so a partial last row centers. Cards are not links: no hover. */
.leg-gallery--logos .leg-h2 { text-align: center; margin-bottom: 10px; }
.leg-gallery--logos .leg-gallery__sub { text-align: center; color: var(--text-muted); max-width: 38em; margin: 0 auto 30px; }
.leg-gallery--logos .leg-gallery__grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.leg-tile--logo {
  flex: 1 1 200px; max-width: 250px;
  display: flex; align-items: center; justify-content: center;
  min-height: 104px; padding: 20px 24px;
  background: #fff; border: 1px solid var(--hairline); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
}
.leg-tile--logo img { width: auto; height: auto; max-width: 100%; max-height: 56px; object-fit: contain; border-radius: 0; box-shadow: none; }
@media (max-width: 640px) {
  .leg-tile--logo { flex-basis: 140px; min-height: 84px; padding: 14px 16px; }
  .leg-tile--logo img { max-height: 44px; }
}

/* Reviews proof band + quote jump band */
.leg-reviews .container, .leg-quote .container { text-align: center; max-width: 760px; }
.leg-reviews .leg-btn-row, .leg-quote .leg-btn-row { justify-content: center; }
.leg-reviews__line { font-size: 18px; margin-top: 8px; }
.leg-quote p { margin-top: 8px; }

/* ---------------------------------------------------------------------------
 * Design check 3.E (2026-07-24): restore white/sand band alternation on the
 * two legacy pages that shipped adjacent same-background bands. Every
 * .leg-section after the first carries a 32px body-white block-layout margin,
 * so a same-bg neighbour renders as a white "crack" (sand|sand) or an invisible
 * merge (white|white). These page-scoped overrides re-alternate so every flat
 * boundary is white<->sand and the white gap always lands against a white band
 * (invisible). Scoped by page-id => zero effect on the other legacy pages.
 * ------------------------------------------------------------------------- */

/* Products & Service Area (page-id-316):
   sand hero -> white intro -> SAND logos -> WHITE service split -> sand reviews. */
body.page-id-316 .leg-section.leg-gallery--logos { background: var(--surface); }
body.page-id-316 .leg-section.leg-split.leg--tint { background: #fff; }

/* Atlanta Fence Installation Warranty (page-id-319):
   sand hero -> WHITE warranty cards -> sand reviews. */
body.page-id-319 .leg-section.leg-cards.leg--tint { background: #fff; }

/* Financing (page-id-2643): the PREQUALIFY CTA was a Shortcodes-Ultimate
   [su_button]. 3.E restyled it to the .btn-cta token with a stack of
   !important overrides; site check 4.E retired the shortcode outright
   (Austin 2026-07-25) because it pulled a 108KB Fork Awesome webfont that
   NOTHING on the page painted with. The button is now a plain themed
   <a class="btn btn-cta"> in the ACF content, so all those overrides are
   gone -- this only restores the shortcode's center="yes" alignment. */
body.page-id-2643 .leg-btn-row { justify-content: center; }
