/* ============================================================
   24/7 Service Mate — Section Craft layer
   Advanced section dividers (inline SVG flow dividers) and
   section background treatments. Loaded after styles.css.
   ============================================================ */

/* ---------- Flow dividers ----------
   Markup (via v2_flow_divider() in inc/v2/graphics.php):
   SVG variants:
   <div class="flow-div flow-div--wave" style="--fd-from:...;--fd-to:...">
     <svg viewBox="0 0 1440 96" preserveAspectRatio="none">…</svg>
   </div>
   Mask variant ('mask' | 'pebble'): empty .flow-div--mask; fill/crest via ::before/::after.
   The div background is the OUTGOING section colour (--fd-from);
   the SVG / mask shape is filled with the INCOMING section colour (--fd-to).
*/
.flow-div {
  --fd-h: clamp(36px, 6vw, 84px);
  position: relative;
  display: block;
  width: 100%;
  line-height: 0;
  background: var(--fd-from, transparent);
  pointer-events: none;
  overflow: hidden;
}
.flow-div svg {
  display: block;
  width: 100%;
  height: var(--fd-h);
}
.flow-div--flip svg { transform: scaleX(-1); }
.flow-div--short { --fd-h: clamp(26px, 4vw, 56px); }
.flow-div--tall  { --fd-h: clamp(48px, 8vw, 116px); }
.flow-div--handshake { --fd-h: clamp(40px, 6.5vw, 88px); }

.flow-div .fd-main { fill: var(--fd-to, var(--c-bg)); }
/* Restrained tonal depth behind the main shape — avoid full-width brand colour bands. */
.flow-div .fd-acc--1 { fill: rgba(var(--c-purple-rgb), .055); }
.flow-div .fd-acc--2 { fill: rgba(var(--c-charcoal-rgb), .035); }
/* Fine purple hairline tracing the top edge of the main shape */
.flow-div .fd-line {
  fill: none;
  stroke: var(--fd-line, rgba(var(--c-purple-rgb), .30));
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Dark-context divider (into charcoal bands): soft purple glow along the wave */
.flow-div--to-dark .fd-line {
  stroke: var(--fd-line, rgba(var(--c-purple-rgb), .45));
  stroke-width: 2;
}
.flow-div--no-line .fd-line { display: none; }

/* ---------- Mask / pebble ridge divider ----------
   Rocky Edge mask-image fill with a restrained charcoal / purple edge.
   Markup (via v2_flow_divider('mask'|'pebble', …)):
   <div class="flow-div flow-div--mask" style="--fd-from:…;--fd-to:…;--fd-mask:url(…)">
   Background = outgoing section (--fd-from).
   ::before = incoming fill (--fd-to) through the pebble mask.
   ::after  = thin purple crest, same mask, offset 2px. */
.flow-div.flow-div--mask {
  --fd-h: clamp(48px, 5.5vw, 68px);
  height: var(--fd-h);
  margin-top: -1px;
  z-index: 4;
  background: var(--fd-from, transparent);
  overflow: visible;
}
.flow-div--mask.flow-div--short { --fd-h: clamp(36px, 4vw, 52px); }
.flow-div--mask::before,
.flow-div--mask::after {
  content: "";
  position: absolute;
  inset: 0;
  -webkit-mask-image: var(--fd-mask);
          mask-image: var(--fd-mask);
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
          mask-size: 100% 100%;
  -webkit-mask-position: center bottom;
          mask-position: center bottom;
}
/* Incoming section fill + subtle charcoal wash along the ridge */
.flow-div--mask::before {
  background:
    linear-gradient(180deg, rgba(var(--c-charcoal-rgb), .035), transparent 48%),
    var(--fd-to, var(--c-bg));
}
/* Restrained purple crest */
.flow-div--mask::after {
  background: var(--c-purple-600);
  opacity: 0.20;
  transform: translateY(1.5px);
  pointer-events: none;
}
.flow-div--mask.flow-div--no-line::after { display: none; }
.flow-div--mask.flow-div--flip::before {
  transform: scaleX(-1);
}
.flow-div--mask.flow-div--flip::after {
  transform: scaleX(-1) translateY(1.5px);
}

/* ---------- Section background utilities ----------
   Add `sec-bg sec-bg--<variant>` to a <section>. The pattern is painted
   on ::before so existing section ::after/gradients are untouched.
   NOTE: sections that already use ::before for chrome (e.g. .hero-dark)
   should NOT receive .sec-bg. */
.sec-bg { position: relative; }
.sec-bg > .container { position: relative; z-index: 1; }
.sec-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* Blueprint grid — fine tradesman's plan lines, faded at edges */
.sec-bg--blueprint::before {
  background-image:
    linear-gradient(rgba(var(--c-slate-rgb), .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--c-slate-rgb), .07) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 40%, #000 30%, transparent 78%);
          mask-image: radial-gradient(ellipse 90% 80% at 50% 40%, #000 30%, transparent 78%);
  opacity: .8;
}

/* Dot grid — refined, masked toward centre */
.sec-bg--dots::before {
  background-image: radial-gradient(circle, rgba(var(--c-charcoal-rgb), .06) 1px, transparent 1.5px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse 85% 75% at 50% 45%, #000 25%, transparent 75%);
          mask-image: radial-gradient(ellipse 85% 75% at 50% 45%, #000 25%, transparent 75%);
}

/* Diagonal hatch — very subtle 45° pinstripes */
.sec-bg--hatch::before {
  background-image: repeating-linear-gradient(
    45deg,
    rgba(var(--c-slate-rgb), .05) 0 1px,
    transparent 1px 14px
  );
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 18%, #000 82%, transparent 100%);
          mask-image: linear-gradient(180deg, transparent 0%, #000 18%, #000 82%, transparent 100%);
}

/* Brand mesh — restrained slate / purple corner washes */
.sec-bg--mesh::before {
  background:
    radial-gradient(ellipse 46% 40% at 88% 6%, rgba(var(--c-purple-rgb), .05), transparent 62%),
    radial-gradient(ellipse 44% 42% at 8% 94%, rgba(var(--c-charcoal-rgb), .045), transparent 60%);
}

/* Centre-top wash (for headline-led sections) */
.sec-bg--glow-top::before {
  background: radial-gradient(ellipse 62% 46% at 50% 0%, rgba(var(--c-purple-rgb), .045), transparent 68%);
}

/* ---------- Soft tinted band (neutral slate surface) ---------- */
.sec-band--soft {
  background:
    radial-gradient(ellipse 52% 44% at 92% 8%, rgba(var(--c-purple-rgb), .04), transparent 60%),
    linear-gradient(180deg, var(--c-bg-soft) 0%, var(--c-bg-alt) 100%);
}

/* ---------- Dark hero texture upgrade (subtle micro-dot grid) ---------- */
.hero-dark {
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, .045) 1px, transparent 1.5px),
    linear-gradient(160deg, var(--c-brand-charcoal) 0%, #1c1824 45%, #4a3a62 100%);
  background-size: 30px 30px, auto;
}

/* ---------- Section-craft page rhythm helpers ---------- */
/* How-it-works as a soft band needs breathing room inside the tint */
.how-works.sec-band--soft { padding: 56px 0 64px; }

/* Testimonials: pull background radials down so the flat divider fill
   meets a flat top edge (avoids a visible tint seam under the curve). */
.testimonials-v2 {
  background:
    radial-gradient(circle at 10% 18%, rgba(var(--c-green-rgb), .06), transparent 34%),
    radial-gradient(circle at 90% 100%, rgba(var(--c-purple-rgb), .05), transparent 36%),
    var(--c-bg-alt);
}

/* Divider sitting directly above the pre-footer CTA band */
/* Prefooter CTA stack sits flush — no light wavy ridge between gallery and cta-band. */
.prefooter-cta .cta-band { margin-top: 0; }

/* ---------- Location hero: suburb fact chips + ETA badge ----------
   Replaces the generic four-item trust strip on location pages with
   suburb-specific data chips, freeing hero vertical space. */
.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}
.hero-facts .fc {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .14);
  font-size: 12.5px;
  font-weight: 600;
  color: #e7e3ec;
  line-height: 1.2;
  backdrop-filter: blur(4px);
}
.hero-facts .fc .ico {
  width: 14px;
  height: 14px;
  color: var(--c-lime-400);
  flex-shrink: 0;
}
.hero-facts .fc .ico svg { display: block; width: 100%; height: 100%; }

.hero-media .hero-eta {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border-radius: 999px;
  background: rgba(18, 18, 19, .82);
  border: 1px solid rgba(var(--c-green-rgb), .45);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.hero-media .hero-eta .ico {
  width: 15px;
  height: 15px;
  color: var(--c-lime-400);
  flex-shrink: 0;
}
.hero-media .hero-eta .ico svg { display: block; width: 100%; height: 100%; }

/* ---------- Suburb snapshot card (loc-intro sidebar) ----------
   Stat-row treatment: each fact gets its own small coloured icon chip
   (category-accent-aware, via .suburb-facts--elec/--plumb/--heat) instead
   of a bare glyph, matching the .loc-signals__icon / .loc-metrics__icon
   chip language used elsewhere on L4 so the sidebar reads as one themed
   component rather than a leftover plain list. */
.suburb-facts {
  --sf-accent: var(--c-purple-600);
  --sf-accent-soft: rgba(var(--c-purple-rgb), .1);
  position: sticky;
  top: calc(var(--header-height, 92px) + 16px);
  background: #fff;
  border: 1px solid var(--c-line);
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--sh-card);
}
.suburb-facts--elec  { --sf-accent: var(--c-elec-deep, #6b7524); --sf-accent-soft: var(--c-elec-soft); }
.suburb-facts--plumb { --sf-accent: #1d4ed8; --sf-accent-soft: var(--c-plumb-soft); }
.suburb-facts--heat  { --sf-accent: #b91c1c; --sf-accent-soft: var(--c-heat-soft); }
.suburb-facts__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--c-line-soft);
}
.suburb-facts__head .pic {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--sf-accent-soft);
  color: var(--sf-accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.suburb-facts__head .pic .ico-glyph { width: 30px; height: 30px; }
.suburb-facts__head .kicker {
  display: block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--c-muted);
}
.suburb-facts__head strong {
  font-size: 18px;
  font-weight: 800;
  color: var(--c-ink);
}
.suburb-facts__list { margin: 8px 0 0; }
.suburb-facts__list .row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 14px 0;
  border-bottom: 1px solid var(--c-line-soft);
}
.suburb-facts__list .row:last-child { border-bottom: none; }
.suburb-facts__list dt {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--c-muted);
}
.suburb-facts__list dt .ico {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--sf-accent-soft);
  color: var(--sf-accent);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  padding: 6px;
  box-sizing: border-box;
}
.suburb-facts__list dt .ico svg { display: block; width: 100%; height: 100%; }
.suburb-facts__list dd {
  margin: 0 0 0 35px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--c-ink);
  line-height: 1.45;
}
.suburb-facts__cta { margin-top: 18px; }

@media (max-width: 860px) {
  .suburb-facts { position: static; }
}

/* ---------- Branded glyphs on dark emergency pages ----------
   Generated two-tone brand icons sit inside soft light chips so the deep
   green strokes stay readable on the near-black emergency background. */
.emg-alert__head .pic {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .94);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.emg-alert__head .pic .ico-glyph { width: 36px; height: 36px; }

.emg-steps .card .pic {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .35);
  margin: 14px 0 16px;
  position: relative;
}
.emg-steps .card .pic .ico-glyph { width: 38px; height: 38px; }
.emg-steps .card .pic .ico { width: 26px; height: 26px; color: var(--c-green-600); }

.emg-availability__trio .t .pic {
  background: rgba(255, 255, 255, .94);
  border: none;
}
.emg-availability__trio .t .pic .ico-glyph { width: 22px; height: 22px; }

.emg-how__icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .35);
  margin-bottom: 16px;
}
.emg-how__icon .ico-glyph { width: 42px; height: 42px; }
.emg-how__icon .ico { width: 28px; height: 28px; color: var(--c-green-600); }

.emg-trust-bar .pic {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .92);
  flex-shrink: 0;
}
.emg-trust-bar .pic .ico-glyph { width: 28px; height: 28px; }
.emg-trust-bar .ti { display: flex; align-items: center; gap: 12px; }

.emg-why-tiles__icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  border: none;
  background: rgba(255, 255, 255, .94);
}
.emg-why-tiles__icon .ico-glyph { width: 30px; height: 30px; }

.emg-about__trust .ti .pic {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .92);
  flex-shrink: 0;
}
.emg-about__trust .ti .pic .ico-glyph { width: 20px; height: 20px; }

.emg-areas__radar .pin .ico-glyph { width: 44px; height: 44px; }

/* ---------- Pricing band 1-2-3 infographic icons ---------- */
.pricing-band .step .pic {
  flex-shrink: 0;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
}
.pricing-band .step .pic .ico-glyph { width: 50px; height: 50px; }
.pricing-band .step .pic .ico { width: 30px; height: 30px; color: var(--c-green-600); }

/* ---------- How-it-works: mobile process rail (not a snap carousel) ----------
   Horizontal peek-cards looked broken (clipped card 2, no swipe cue).
   Stack full-width with a centered brand spine through the step numbers. */
@media (max-width: 640px) {
  .how-works {
    overflow-x: clip;
  }
  .how-works .steps {
    display: grid;
    grid-template-columns: 1fr;
    grid-auto-flow: row;
    grid-auto-columns: unset;
    gap: 18px;
    overflow: visible;
    scroll-snap-type: none;
    padding: 10px 0 0;
    position: relative;
  }
  .how-works .steps::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 4px;
    bottom: 4px;
    width: 2px;
    transform: translateX(-50%);
    background: linear-gradient(
      180deg,
      rgba(var(--c-purple-rgb), .45) 0%,
      rgba(var(--c-green-rgb), .55) 100%
    );
    opacity: .55;
    pointer-events: none;
    z-index: 0;
  }
  .how-works .step {
    scroll-snap-align: none;
    width: 100%;
    max-width: none;
    position: relative;
    z-index: 1;
    box-shadow: 0 10px 28px rgba(26, 28, 20, .06);
  }
  .how-works .step .num {
    box-shadow:
      0 0 0 4px var(--c-bg-soft, #eef1e0),
      0 4px 10px rgba(74, 82, 24, .28);
  }

  /* ---------- Horizontal snap-scroll (emergency / pricing only) ---------- */
  .emg-how__steps {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: min(78%, 300px);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 16px;
    gap: 16px;
    padding-bottom: 16px;
    scrollbar-width: none;
  }
  .emg-how__steps::-webkit-scrollbar { display: none; }
  .emg-how__step {
    scroll-snap-align: center;
    background: var(--emg-bg-alt, #151517);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 16px;
    padding: 20px 18px;
  }
  .emg-how__steps::before { display: none; }

  .emg-steps .grid {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: min(78%, 300px);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 16px;
    gap: 14px;
    padding-bottom: 16px;
    scrollbar-width: none;
  }
  .emg-steps .grid::-webkit-scrollbar { display: none; }
  .emg-steps .card {
    scroll-snap-align: center;
    background: var(--emg-bg-alt, #151517);
    border: 1px solid rgba(255, 255, 255, .08) !important;
    border-radius: 16px;
    padding: 20px 18px;
  }

  .pricing-band .card {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: min(80%, 320px);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 16px;
    padding: 20px 16px 18px;
    scrollbar-width: none;
  }
  .pricing-band .card::-webkit-scrollbar { display: none; }
  .pricing-band .step { scroll-snap-align: center; }
  .pricing-band .card .btn { scroll-snap-align: center; align-self: center; }

  /* Emergency 5-pillar trust bar: swipeable chips instead of a tall stack */
  .emg-trust-bar__inner {
    flex-direction: row !important;
    align-items: stretch !important;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    gap: 10px;
    padding: 0 16px 12px !important;
    scrollbar-width: none;
  }
  .emg-trust-bar__inner::-webkit-scrollbar { display: none; }
  .emg-trust-bar .ti {
    scroll-snap-align: start;
    flex: 0 0 auto;
    width: auto !important;
    min-width: 220px;
    border-bottom: none !important;
    border-right: none !important;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .08) !important;
    border-radius: 14px;
    padding: 12px 16px !important;
  }
}

/* ---------- Responsive audit fixes ---------- */
/* About hero: let CTA buttons wrap instead of widening the 1fr grid track
   (unwrappable flex row forced the whole hero text column past the viewport). */
.story-hero .cta-row { flex-wrap: wrap; }

@media (max-width: 860px) {
  /* Photo tile: min-height + aspect-ratio 16/9 resolved to a 391px width
     inside a ~345px track. Let width drive the ratio instead. */
  .svc-rows .row .visual { min-height: 0; }
  /* Dual CTA cards could not shrink below their flex min-content width.
     Wrap the trailing button to its own row and keep the number on one line. */
  .dual-cta .card { flex-wrap: wrap; }
  .dual-cta .card .meta { min-width: 0; flex: 1 1 180px; }
  .dual-cta .card .big-num { white-space: nowrap; }
}

/* ---------- Responsive guards ---------- */
@media (max-width: 640px) {
  .flow-div { --fd-h: clamp(26px, 7.5vw, 44px); }
  .flow-div.flow-div--mask { --fd-h: 40px; }
  .flow-div .fd-acc--1,
  .flow-div .fd-acc--2 { opacity: .7; }
  .sec-bg--blueprint::before { background-size: 32px 32px; }
  .how-works.sec-band--soft { padding: 44px 0 52px; }
}

/* ---------- Homepage diagonal seams (ST-style tilt, 247 limelight) ---------- */
.home-slash {
  --slash-h: clamp(36px, 5.6vw, 68px);
  --slash-to: var(--c-bg-alt, #eff1f0);
  position: relative;
  z-index: 4;
  display: block;
  width: 100%;
  height: var(--slash-h);
  margin: -1px 0;
  overflow: hidden;
  pointer-events: none;
  line-height: 0;
  background: transparent;
}
.home-slash--band { --slash-to: var(--c-bg-alt, #eff1f0); }
.home-slash--invert { --slash-to: #121213; }
.home-slash::before,
.home-slash::after {
  content: "";
  position: absolute;
  inset: 0;
}
/* Incoming section fill — the diagonal face */
.home-slash::after {
  background: var(--slash-to);
  clip-path: polygon(0 100%, 100% 22%, 100% 100%);
}
/* Limelight edge along the slant */
.home-slash::before {
  background: var(--c-brand-limelight, #c8db4f);
  clip-path: polygon(0 100%, 100% 22%, 100% 32%, 0 calc(100% - 5px));
  z-index: 1;
}
.home-slash--flip::after {
  clip-path: polygon(0 22%, 100% 100%, 0 100%);
}
.home-slash--flip::before {
  clip-path: polygon(0 22%, 100% 100%, 100% calc(100% - 5px), 0 32%);
}

.page-home-v2 .prefooter-cta { margin-top: 0; }
.page-home-v2 .cta-gallery {
  background: #121213;
  padding: 0;
}
.page-home-v2 .cta-gallery > .container {
  width: 100%;
  max-width: none;
  padding-inline: 0;
}
.page-home-v2 .cta-gallery__shell {
  border-radius: 0;
  box-shadow: none;
}
.page-home-v2 .cta-gallery__layout {
  width: min(100% - 32px, var(--container, 1120px));
  margin-inline: auto;
}

@media (max-width: 640px) {
  .home-slash { --slash-h: clamp(28px, 8vw, 44px); }
}
