/* ==========================================================================
   Allied Insurance, commercial.html page-scoped styles (Pass 1)
   Loads AFTER styles.css. Reuses the locked design system (tokens + classes:
   .container .split .col-text .col-media .headline .beat .section-body .btn).
   Adds only three page devices:
     .page-hero   inner-page hero VARIANT (banded, not the 100vh home hero)
     .spec        one rich section per specialty line (reuses the .split device)
     .cover-list  static hairline-divided cover list (reproduces the reference
                  promise-list device, as a list of covers rather than links)
   No new tokens, no new colours; radii held to the captured scale.
   ========================================================================== */

/* ---- PAGE HERO (inner-page band; deliberately distinct from the home hero:
        ~64vh not 100vh, gold eyebrow, vertically-centred copy, jump-nav row) -- */
.page-hero {
  position: relative;
  min-height: clamp(460px, 64vh, 600px);
  display: flex;
  align-items: center;
  background: var(--brand-dark);
  overflow: hidden;
}
.page-hero-media {
  position: absolute;
  inset: 0;
  background: var(--brand-dark) url("../img/webp/commercial-hero.webp") center/cover no-repeat;
}
/* warm cinematic grade + left/bottom legibility scrim, greener than the home hero */
.page-hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(101deg, rgba(31, 33, 18, 0.94) 0%, rgba(31, 33, 18, 0.74) 44%, rgba(31, 33, 18, 0.38) 100%),
    linear-gradient(180deg, rgba(73, 111, 54, 0.12) 0%, rgba(31, 33, 18, 0.15) 40%, rgba(31, 33, 18, 0.6) 100%),
    radial-gradient(120% 130% at 90% 4%, rgba(217, 138, 43, 0.16) 0%, rgba(217, 138, 43, 0) 55%);
}
.page-hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding: 150px var(--gutter) 62px;
}
.page-hero-eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-soft);
  margin-bottom: 18px;
}
.page-hero h1 {
  font-size: clamp(38px, 5.4vw, 62px);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.02em;
  max-width: 18ch;
}
.page-hero h1 .beat { display: block; }
.page-hero h1 .beat-gold { color: var(--accent-soft); }
.page-hero h1 .beat-cream { color: var(--on-dark); }
.page-hero-sub {
  color: var(--on-dark-70);
  font-size: 18px;
  line-height: 1.6;
  max-width: 54ch;
  margin-top: 24px;
}

/* in-page jump nav (a non-hover-fade inner-page device: anchors to each line) */
.spec-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 34px;
}
.spec-jump a {
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(254, 252, 246, 0.28);
  color: var(--on-dark);
  font-size: 14px;
  font-weight: 500;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.spec-jump a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--surface);
}

/* ---- SPECIALTY LINE SECTIONS (reuse the .split device, alternating side) --- */
.spec {
  padding-block: clamp(64px, 9vw, 104px);
  scroll-margin-top: 88px; /* clear the fixed 74px nav on anchor jump */
}
.spec--surface { background: var(--surface); }
.spec--cream   { background: var(--canvas); }
.spec .split { align-items: center; }
.spec .col-text { order: 1; max-width: 46ch; }
.spec .col-media { order: 2; min-height: 460px; }
.spec .col-media img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--r-card); min-height: 460px; }
/* flipped rows: image left, text right */
.spec--flip .col-text { order: 2; }
.spec--flip .col-media { order: 1; }

.spec-eyebrow {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.spec .headline { max-width: 20ch; }
.spec .section-body p { max-width: 50ch; }
.spec .section-body .btn { margin-top: 30px; }

/* ---- COVER LIST (static hairline list; reproduces the promise-list device) -- */
.cover-list {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
}
.cover-list > li {
  display: flex;
  gap: 13px;
  padding: 13px 2px;
  border-top: 1px solid var(--line);
}
.cover-list > li:last-child { border-bottom: 1px solid var(--line); }
.cover-list > li::before {
  content: "";
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  background: no-repeat center/contain
    url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23af5f05'%20stroke-width='2.4'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M20%206%209%2017l-5-5'/%3E%3C/svg%3E");
}
.cover-list .cl-body { flex: 1; }
.cover-list .cover-label { font-size: 17px; font-weight: 500; color: var(--ink); }
.cover-list .cover-sub {
  display: block;
  margin-top: 3px;
  font-size: 15px;
  font-weight: 400;
  color: var(--ink-70);
  line-height: 1.5;
}

/* ---- RESPONSIVE ---------------------------------------------------------- */
@media (max-width: 980px) {
  .spec .split { grid-template-columns: 1fr; gap: 30px; }
  /* on mobile always read text first, then the image, regardless of flip */
  .spec .col-text { order: 1; max-width: none; }
  .spec .col-media { order: 2; min-height: 340px; }
  .spec .col-media img { min-height: 340px; }
}

@media (max-width: 560px) {
  .page-hero-inner { padding: 128px var(--gutter) 44px; }
  .page-hero-sub { font-size: 16.5px; }
  .spec-jump { gap: 8px; }
  .spec-jump a { padding: 8px 14px; font-size: 13px; }
}

/* ==========================================================================
   PASS-2 FACELIFT, commercial.html page-specific catalog components
   (loaded after styles.css; reuses the shared tokens + shared JS wiring. All
   motion honors prefers-reduced-motion and the Zim mobile budget.)
   ========================================================================== */

/* ---- Specialty overview band (holds the 113 Feature Flipper) ------------- */
.spec-overview { background: var(--canvas); padding-block: clamp(64px, 8vw, 100px); }
.spec-overview .ov-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 26px 40px; flex-wrap: wrap; margin-bottom: 34px;
}
.spec-overview .ov-head-text { max-width: 44ch; }
.spec-overview .ov-eyebrow {
  display: block; font-size: 13px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 12px;
}
.spec-overview .headline { max-width: 20ch; }
.spec-overview .ov-lead { margin-top: 14px; color: var(--ink-70); font-size: 17px; max-width: 48ch; }

/* right-side stat cluster: 016 counter + 204 lottie shield accent */
.ov-aside { display: flex; align-items: center; gap: 20px; }
.ov-aside .al-lottie { flex: none; }

/* ---- 113 Feature Flipper (horizontal click-expand accordion) ------------- */
.flipper { display: flex; gap: 12px; height: 420px; list-style: none; margin: 0; padding: 0; }
.flipper__card {
  position: relative; flex: 1 1 0%; min-width: 0;
  display: block; padding: 0; margin: 0; border: 0; text-align: left; cursor: pointer;
  border-radius: var(--r-card); overflow: hidden;
  background: var(--brand-dark); color: var(--on-dark);
  transition: flex-grow .5s cubic-bezier(.4, .01, .2, 1);
  will-change: flex-grow; outline: none;
}
.flipper__card:focus-visible { box-shadow: 0 0 0 3px var(--accent-soft); }
.flipper__card.is-active { flex-grow: 3.4; }
.flipper__img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: .34; transform: scale(1.05);
  transition: opacity .5s ease, transform .6s ease;
}
.flipper__card.is-active .flipper__img { opacity: .6; transform: scale(1); }
.flipper__card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(31, 33, 18, .22) 0%, rgba(31, 33, 18, .84) 100%);
}
.flipper__body {
  position: relative; z-index: 2; height: 100%;
  display: flex; flex-direction: column; justify-content: flex-end;
  gap: 8px; padding: 22px 20px;
}
.flipper__idx { font-size: 12.5px; font-weight: 600; letter-spacing: .12em; color: var(--accent-soft); }
.flipper__name { font-size: 16px; font-weight: 600; line-height: 1.14; transition: font-size .4s ease; }
.flipper__card.is-active .flipper__name { font-size: 23px; }
.flipper__desc {
  font-size: 15px; line-height: 1.5; color: var(--on-dark-70); max-width: 42ch;
  opacity: 0; max-height: 0; overflow: hidden; transform: translateY(6px);
  transition: opacity .4s ease .08s, transform .4s ease .08s, max-height .5s ease;
}
.flipper__card.is-active .flipper__desc { opacity: 1; max-height: 170px; transform: none; }
.flipper__link {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 4px;
  font-size: 14px; font-weight: 600; color: var(--accent-soft);
  opacity: 0; transform: translateY(6px);
  transition: opacity .4s ease .14s, transform .4s ease .14s, color .2s ease;
}
.flipper__card.is-active .flipper__link { opacity: 1; transform: none; }
.flipper__link:hover { color: #fff; }
.flipper__link svg { width: 15px; height: 15px; transition: transform .2s ease; }
.flipper__link:hover svg { transform: translateX(3px); }

/* ==========================================================================
   040 FlowStack (specialty detail accordion) + 116 Click to Mask Expand
   No-JS / reduced-motion default = all rows OPEN + images revealed; commercial.js
   adds .fs-ready to collapse to one-open. Grid-rows 0fr/1fr = smooth unknown height.
   ========================================================================== */
.fs-section { background: var(--surface); padding-block: clamp(64px, 8vw, 104px); }
.fs-head { max-width: 32ch; margin-bottom: 34px; }
.fs-head .headline { max-width: 22ch; }

.fs-stack { display: grid; gap: 12px; }
.fs-row {
  border: 1px solid var(--line); border-radius: var(--r-card);
  background: var(--surface); overflow: hidden;
  scroll-margin-top: 88px;
  transition: border-color .25s ease, box-shadow .25s ease;
}
.fs-row.is-open { border-color: var(--accent-soft); box-shadow: 0 12px 34px rgba(31, 33, 18, .08); }

.fs-toggle {
  width: 100%; display: flex; align-items: center; gap: 18px;
  padding: 22px 24px; text-align: left; cursor: pointer;
  background: transparent; border: 0; font-family: inherit; color: inherit;
}
.fs-idx { font-size: 13px; font-weight: 600; letter-spacing: .1em; color: var(--accent); flex: none; font-variant-numeric: tabular-nums; }
.fs-heading { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.fs-name { font-size: clamp(20px, 2.4vw, 26px); font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.fs-kbd { font-size: 14.5px; color: var(--ink-70); }
.fs-chevron { flex: none; color: var(--brand-green); display: inline-flex; transition: transform .35s cubic-bezier(.4, 0, .2, 1); }
.fs-chevron svg { width: 22px; height: 22px; }
.fs-row.is-open .fs-chevron { transform: rotate(180deg); }
.fs-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; border-radius: var(--r-card); }

/* panel: 0fr/1fr grid trick expands to any content height smoothly */
.fs-panel { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .5s cubic-bezier(.4, 0, .2, 1); }
.fs-stack.fs-ready .fs-row:not(.is-open) .fs-panel { grid-template-rows: 0fr; }
.fs-panel__inner {
  overflow: hidden; min-height: 0;
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(24px, 4vw, 56px);
  align-items: stretch; padding: 0 24px 28px;
}
.fs-copy { min-width: 0; align-self: center; }
.fs-title { font-size: clamp(19px, 2.1vw, 24px); font-weight: 600; line-height: 1.14; letter-spacing: -.01em; margin-bottom: 4px; }
.fs-title .beat-1 { color: var(--brand-green); }
.fs-title .beat-2 { color: var(--ink-70); font-weight: 500; }
.fs-copy .cover-list { margin-top: 22px; }
.fs-copy .btn { margin-top: 26px; }

/* 116 mask reveal: the image wipes in top-to-bottom when the row opens */
.fs-media { border-radius: var(--r-card); overflow: hidden; align-self: stretch; }
.fs-media img {
  width: 100%; height: 100%; min-height: 260px; max-height: 460px; object-fit: cover; display: block;
  clip-path: inset(0 0 0 0);
  transition: clip-path .6s cubic-bezier(.4, 0, .2, 1);
}
.fs-stack.fs-ready .fs-row:not(.is-open) .fs-media img { clip-path: inset(0 0 100% 0); }

@media (max-width: 820px) {
  .fs-panel__inner { grid-template-columns: 1fr; }
  .fs-media { order: -1; }
  .fs-media img { min-height: 180px; max-height: 240px; }
}
@media (prefers-reduced-motion: reduce) {
  .fs-panel, .fs-chevron, .fs-row, .fs-media img { transition: none !important; }
}

/* ---- Cross-cover tilt band (011 Tilt Card + 062 Border Beam + 029 grid) --- */
.xcover { background: var(--surface); padding-block: clamp(56px, 7vw, 88px); }
.xcover .promise-title { font-size: 22px; font-weight: 600; color: var(--ink); margin-bottom: 16px; }
.xcover-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.xcover .tilt-card { padding: 20px 22px; }
.xcover .tc-sub { display: block; margin-top: 6px; font-size: 14.5px; font-weight: 400; color: var(--ink-70); line-height: 1.5; }

/* ---- CTA support: replace the old branch motif with the owned swoosh ------ */
.cta-support .cta-branch path { vector-effect: non-scaling-stroke; }

/* ---- RESPONSIVE ---------------------------------------------------------- */
@media (max-width: 900px) {
  .ov-aside { width: 100%; }
}
@media (max-width: 720px) {
  /* flipper becomes a vertical click-expand accordion (still non-hover-fade) */
  .flipper { flex-direction: column; height: auto; gap: 10px; }
  .flipper__card { flex: none; min-height: 96px; transition: min-height .45s cubic-bezier(.4, .01, .2, 1); }
  .flipper__card.is-active { min-height: 272px; }
  .flipper__name { font-size: 18px; }
  .flipper__card.is-active .flipper__name { font-size: 22px; }
  .xcover-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .spec-overview .ov-head { margin-bottom: 26px; }
}

/* ---- REDUCED MOTION ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .flipper__card, .flipper__img, .flipper__desc, .flipper__name { transition: none !important; }
  /* show the active panel's copy without motion; collapsed still expands on click */
  .flipper__card.is-active .flipper__desc { transform: none; }
}
