/* ============================================================
   C&R — Brochure sub-page
   Layout grammar: Claude Design's "navy banner + lifted white deck."
   3D brochure object: kept from prior iteration — operator-approved.
   Form: format buttons (not dropdown) with reveal-on-Posted address fields.

   Builds on core.css (vars, type, buttons) + home.css (nav, footer, .field/.field--float, .btn-contact).
   ============================================================ */

/* Frontier-tier motion tokens */
:root {
  --ease-mech:     cubic-bezier(0.4, 0.0, 0.2, 1);
  --ease-mech-out: cubic-bezier(0.0, 0.0, 0.2, 1);
  --ease-mech-in:  cubic-bezier(0.4, 0.0, 1, 1);
}

/* Current-page nav state */
.nav-links a.is-current {
  color: var(--green);
  position: relative;
}
.nav-links a.is-current::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -22px;
  height: 2px;
  background: var(--green);
}


/* ============================================================
   1. NAVY BANNER — split layout, text + 3D brochure
   ============================================================ */
.br-banner {
  position: relative;
  background: #0E0930;
  color: var(--white);
  padding: clamp(56px, 7vw, 96px) 0 clamp(96px, 11vw, 160px);
  overflow: hidden;
}
.br-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 50% at 10% 0%, rgba(97, 204, 107, .10), transparent 60%),
    radial-gradient(60% 60% at 95% 100%, rgba(97, 204, 107, .06), transparent 65%);
}
.br-banner .container {
  position: relative;
}

.br-banner-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.85fr;
  gap: 64px;
  align-items: center;
}

.br-banner-text {
  max-width: 620px;
}

.br-banner-eyebrow {
  font-family: var(--font-display);
  font-weight: var(--w-semibold);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--green);
}

.br-banner-title {
  font-family: var(--font-display);
  font-weight: var(--w-semibold);
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1.04;
  letter-spacing: -.022em;
  margin: 18px 0 0;
  color: var(--white);
}
.br-banner-title .is-green { color: var(--green); }

.br-banner-sub {
  margin: 22px 0 0;
  max-width: 620px;
  font-family: var(--font-body);
  font-size: clamp(15px, 1.2vw, 17px);
  line-height: 1.6;
  color: rgba(255, 255, 255, .78);
}

/* Banner-scale brochure container — centred, no extra chrome */
.br-banner-brochure {
  display: flex;
  align-items: center;
  justify-content: center;
}


/* ============================================================
   2. LIFTED WHITE DECK — two cards overlap into the banner bottom
   ============================================================ */
.br-deck {
  background: var(--white);
  padding: 0 0 clamp(56px, 7vw, 96px);
}

/* Two-row grid so subgrid in each column lines up: row 1 = top zone
   (inside-card / form-top), row 2 = bottom zone (CTA strip / form-bottom).
   This is what aligns the button TOP exactly with the CTA strip TOP. */
.br-deck-inner {
  margin-top: clamp(-80px, -8vw, -120px);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  grid-template-rows: 1fr auto;
  gap: 24px;
  align-items: stretch;
  position: relative;
  z-index: 1;
}

/* LEFT column — inherits the 2 rows from the deck grid */
.br-deck-col-left {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: 1 / -1;
  gap: 24px;
  min-width: 0;
}


/* ----- WHAT'S INSIDE card ----- */
.br-inside {
  background: var(--white);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: clamp(24px, 3vw, 36px);
  box-shadow: 0 20px 48px -24px rgba(14, 9, 48, .18);
}

.br-inside-eyebrow {
  font-family: var(--font-display);
  font-weight: var(--w-semibold);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--green);
  margin: 0 0 10px;
}

.br-inside-h {
  font-family: var(--font-display);
  font-weight: var(--w-semibold);
  font-size: clamp(22px, 2vw, 28px);
  letter-spacing: -.01em;
  color: var(--navy);
  margin: 0 0 12px;
}
.br-inside-h .is-green { color: var(--green); }

.br-inside-sub {
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--fg-muted);
  margin: 0 0 24px;
  max-width: 480px;
}

.br-inside-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.br-tile {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  background: var(--surface-soft);
  border-radius: 10px;
  border: 1px solid transparent;
  transition:
    border-color var(--dur) var(--ease-out),
    background var(--dur) var(--ease-out),
    transform var(--dur) var(--ease-out);
}
.br-tile:hover {
  border-color: rgba(97, 204, 107, .4);
  background: var(--white);
  transform: translateY(-2px);
}

.br-tile-ico {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(97, 204, 107, .14);
  color: var(--green);
}
.br-tile-ico svg { width: 18px; height: 18px; }

.br-tile-text {
  font-family: var(--font-display);
  font-weight: var(--w-semibold);
  font-size: 14px;
  line-height: 1.35;
  letter-spacing: -.005em;
  color: var(--navy);
}
.br-tile-text span {
  color: var(--fg-muted);
  font-weight: var(--w-regular);
  display: block;
  font-size: 12.5px;
  margin-top: 4px;
  letter-spacing: 0;
  line-height: 1.5;
}


/* ----- REQUEST FORM card -----
   Subgrid container — inherits the 2 rows from .br-deck-inner so the
   form-top / form-bottom split aligns with inside-card / CTA-strip.
   Padding MATCHES .br-inside (clamp 24-36) so pills/button sit at the
   same distance from the card edge as the inside tiles do. */
.br-form-card {
  background: var(--white);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: clamp(24px, 3vw, 36px);
  box-shadow: 0 20px 48px -24px rgba(14, 9, 48, .18);
  display: grid;
  grid-template-rows: subgrid;
  grid-row: 1 / -1;
  gap: 24px;
}

.brochure-form {
  display: contents;
}

/* TOP ZONE — block layout with margin-based spacing so it produces the
   SAME rhythm as .br-inside (no flex-gap doubling): eyebrow→heading 10,
   heading→sub 12, sub→first field 24, field→field 16 (matches the inside
   card's tile grid gap of 16). */
.br-form-top {
  display: block;
  min-width: 0;
}
.br-form-top > * { margin: 0; }
.br-form-top > * + * { margin-top: 16px; }
.br-form-top > .br-form-h { margin-top: 10px; }
.br-form-top > .br-form-sub { margin-top: 12px; }
.br-form-top > .br-form-sub + * { margin-top: 24px; }

/* BOTTOM ZONE — button + status + alt-contact. Sits in the bottom subgrid
   row, same row as the CTA strip on the left. Top edge of this zone
   matches top edge of CTA strip exactly. */
.br-form-bottom {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

/* Override .btn-contact's home.css 6px top-margin — that margin was for the
   homepage contact form spacing. In the brochure form-bottom the button is
   the FIRST element of the bottom-zone subgrid row, so its top edge must
   equal the row top edge (= CTA strip top edge on the left column). */
.br-form-bottom .btn-contact {
  margin-top: 0;
}

/* Anchor alt-contact to the bottom of the bottom-zone — keeps it flush
   with the bottom of the card whatever the zone height ends up being. */
.br-form-bottom .br-form-alt {
  margin-top: auto;
}

/* Header trio spacing — eyebrow / heading / sub margins are 0 and 12 so
   that, combined with .br-form-top's flex gap (12px), the rhythm matches
   .br-inside exactly: heading→sub = 12, sub→next field = 24. */
.br-form-eyebrow {
  font-family: var(--font-display);
  font-weight: var(--w-semibold);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--green);
  margin: 0;
}

.br-form-h {
  font-family: var(--font-display);
  font-weight: var(--w-semibold);
  font-size: clamp(22px, 2vw, 28px);
  letter-spacing: -.01em;
  color: var(--navy);
  margin: 0;
}
.br-form-h .is-green { color: var(--green); }

.br-form-sub {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  color: var(--fg-muted);
  margin: 0 0 12px;     /* +12 added to the 12 flex-gap = 24 to first field */
  max-width: 460px;
}

/* Empty form-status takes no vertical space — only displays when there's
   an actual error/success message. */
.brochure-form .form-status:empty {
  display: none;
}

/* Alt-contact block — sits at the bottom of the form-bottom subgrid row
   (which is sized to match the CTA strip on the left). */
.br-form-alt {
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.br-form-alt-eyebrow {
  font-family: var(--font-display);
  font-weight: var(--w-semibold);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin: 0;
}
.br-form-alt-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-family: var(--font-display);
  font-weight: var(--w-medium);
  font-size: 14.5px;
}
.br-form-alt-row a {
  color: var(--navy);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color var(--dur) var(--ease-out);
}
.br-form-alt-row a:hover {
  color: var(--green);
}
.br-form-alt-row a svg {
  width: 14px;
  height: 14px;
  color: var(--green);
}

.brochure-form .hp {
  position: absolute !important;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}


/* ============================================================
   FORMAT TOGGLE — pill buttons (replaces dropdown)
   ============================================================ */
.format-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  border: 0;
  padding: 0;
  margin: 0 0 4px;
}

.format-option input[type="radio"] {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  margin: 0;
  pointer-events: none;
}

.format-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
  font-family: var(--font-display);
  font-weight: var(--w-medium);
  font-size: 14px;
  color: var(--navy);
  cursor: pointer;
  transition:
    border-color var(--dur) var(--ease-out),
    background var(--dur) var(--ease-out),
    color var(--dur) var(--ease-out);
}
.format-pill svg { width: 16px; height: 16px; flex-shrink: 0; }

.format-option input[type="radio"]:checked + .format-pill {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}
.format-option input[type="radio"]:focus-visible + .format-pill {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}
.format-pill:hover {
  border-color: var(--navy);
}


/* Address fields — ALWAYS reserve their natural height in the layout.
   Only opacity + visibility toggle on Posted/Digital. This is what stops
   the layout shifting when the format switches: the address-field row is
   always there in the form-top's natural height, just visually hidden or
   shown. Nothing else in the page can move because nothing else's size
   depends on the address-field state. */
.address-fields {
  opacity: 0;
  visibility: hidden;
  transition:
    opacity .3s var(--ease-mech),
    visibility 0s linear .3s;
}
.address-fields[data-shown="true"] {
  opacity: 1;
  visibility: visible;
  transition:
    opacity .3s var(--ease-mech),
    visibility 0s linear 0s;
}
@media (prefers-reduced-motion: reduce) {
  .address-fields { transition: none; }
}


/* ============================================================
   CTA STRIP — navy panel in the bottom subgrid row alongside the
   form's button-zone. Hidden on mobile where the deck stacks.
   ============================================================ */
.br-cta-strip {
  background: #0E0930;
  color: var(--white);
  border-radius: 16px;
  /* Vertical padding slimmed (was 28-40 → 18-26) per operator request. */
  padding: clamp(18px, 2.4vw, 26px) clamp(28px, 3.5vw, 44px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  position: relative;
  overflow: hidden;
}
.br-cta-strip::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 50% at 8% 0%, rgba(97, 204, 107, .10), transparent 60%),
    radial-gradient(50% 60% at 96% 100%, rgba(97, 204, 107, .06), transparent 65%);
}
.br-cta-text {
  position: relative;
  min-width: 0;
}
.br-cta-h {
  font-family: var(--font-display);
  font-weight: var(--w-semibold);
  font-size: clamp(20px, 1.9vw, 26px);
  letter-spacing: -.01em;
  line-height: 1.15;
  color: var(--white);
  margin: 0;
}
.br-cta-h .is-green { color: var(--green); }
.br-cta-sub {
  font-family: var(--font-body);
  font-size: clamp(14px, 1vw, 15px);
  line-height: 1.55;
  color: rgba(255, 255, 255, .7);
  margin: 6px 0 0;
}
.br-cta-cue {
  position: relative;
  font-family: var(--font-display);
  font-weight: var(--w-medium);
  font-size: 14px;
  letter-spacing: .01em;
  color: var(--green);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  padding: 12px 18px;
  border: 1px solid rgba(97, 204, 107, .4);
  border-radius: 999px;
  background: rgba(97, 204, 107, .08);
}
.br-cta-cue svg {
  width: 14px;
  height: 14px;
  /* Tiny rightward nudge to hint the form is "over there" */
  animation: ctaCueNudge 2.4s var(--ease-mech) infinite;
}
@keyframes ctaCueNudge {
  0%, 65%, 100% { transform: translateX(0); }
  82%           { transform: translateX(4px); }
}
@media (prefers-reduced-motion: reduce) {
  .br-cta-cue svg { animation: none; }
}


/* ============================================================
   THE 3D BROCHURE — original "clean" version (operator preference).
   Real cover image, left-facing perspective tilt, flat-shadow depth cues:
     - back-page hint that peeks bottom-right (suggests page beneath the cover)
     - spine gradient on the left edge of the cover (suggests bound side)
     - paper sheen with top-left highlight (suggests glossy cover catching light)
   NO perpendicular 3D side panels and NO curved spine facets.
   ============================================================ */
.brochure-stage {
  perspective: 1800px;
  perspective-origin: 50% 50%;
  display: flex;
  justify-content: center;
  width: 100%;
}

.brochure-3d {
  position: relative;
  transition: transform 1.2s var(--ease-mech);
  filter:
    drop-shadow(0 30px 50px rgba(0, 0, 0, .55))
    drop-shadow(0 6px 12px rgba(97, 204, 107, .08));
}

/* Landscape A4 (1.414:1), faces LEFT (rotateY negative) */
.brochure-3d--landscape {
  width: 500px;
  height: 354px;
  transform: rotateY(-16deg) rotateX(6deg);
}

.br-banner-brochure:hover .brochure-3d--landscape {
  transform: rotateY(-13deg) rotateX(5deg) translateY(-4px);
}

/* Banner-scale modifier */
.brochure-stage--banner .brochure-3d--landscape {
  width: 480px;
  height: 340px;
}

@media (prefers-reduced-motion: reduce) {
  .brochure-3d { transition: none; }
}


/* ----- Back-page hint — peeks bottom-right beneath the cover ----- */
.brochure-back {
  position: absolute;
  top: 6px;
  left: 8px;
  right: -8px;
  bottom: -6px;
  background: #E9E6DC;
  border-radius: 4px 8px 8px 4px;
  z-index: -1;
}

/* ----- Spine — left-edge gradient overlay (flat, not perpendicular) ----- */
.brochure-spine {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 8px;
  background: linear-gradient(90deg, rgba(0, 0, 0, .25) 0%, rgba(0, 0, 0, .08) 60%, transparent 100%);
  border-radius: 4px 0 0 4px;
  z-index: 2;
  pointer-events: none;
}

/* ----- Cover (front face) ----- */
.brochure-cover {
  position: absolute;
  inset: 0;
  border-radius: 4px 8px 8px 4px;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .8),
    inset 1px 0 0 rgba(27, 20, 66, .04);
  isolation: isolate;
}

.brochure-cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: contrast(1.02) saturate(1.04);
}

.brochure-cover-sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(105deg, rgba(255, 255, 255, .14) 0%, rgba(255, 255, 255, 0) 28%),
    radial-gradient(80% 60% at 20% 12%, rgba(255, 255, 255, .08) 0%, transparent 60%);
  z-index: 2;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1100px) {
  :root { --page-pad: 32px; }

  .br-banner-grid {
    gap: 48px;
    grid-template-columns: 1.1fr 0.85fr;
  }

  .brochure-stage--banner .brochure-3d--landscape {
    width: 420px;
    height: 297px;
  }

  .br-deck-inner {
    gap: 20px;
    grid-template-columns: 1fr 0.95fr;
  }
}

@media (max-width: 900px) {
  :root { --page-pad: 24px; }

  .nav-links a.is-current::after { display: none; }

  /* Banner: stack text on top, brochure below */
  .br-banner-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .br-banner-text { max-width: none; }
  .br-banner-brochure {
    order: 2;
    padding-bottom: 16px;
  }

  .brochure-stage--banner .brochure-3d--landscape {
    width: 400px;
    height: 283px;
  }

  /* Deck: stack cards vertically — reset subgrid to natural flex layout */
  .br-deck-inner {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    margin-top: -64px;
    gap: 18px;
  }
  .br-deck-col-left,
  .br-form-card {
    display: flex;
    flex-direction: column;
    grid-row: auto;
    grid-template-rows: none;
  }
  .brochure-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  /* On mobile alt-contact doesn't need to push to bottom — single column flow */
  .br-form-bottom .br-form-alt { margin-top: 0; }

  /* CTA strip is only useful as a gap-filler in the desktop two-column layout —
     on stacked mobile there's no gap, and the form sits right beneath the inside
     card, so the "complete the form →" cue would be redundant. Hide it. */
  .br-cta-strip { display: none; }

  /* On mobile the form has no left-column partner to align to, so the
     address-fields shouldn't reserve their full height when Digital is
     selected. Swap the opacity-only toggle for a display toggle so the
     form grows/shrinks based on Posted vs Digital. */
  .address-fields {
    display: none;
    /* Cancel desktop opacity transition — display toggles don't tween */
    transition: none;
  }
  .address-fields[data-shown="true"] {
    display: block;
  }

  /* Inside grid: single column on tablet */
  .br-inside-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  :root { --page-pad: 20px; }

  .br-banner {
    padding: 40px 0 96px;
  }
  .br-banner-title {
    font-size: clamp(32px, 9vw, 44px);
    letter-spacing: -.025em;
  }
  .br-banner-sub {
    font-size: 14.5px;
  }

  .brochure-stage--banner .brochure-3d--landscape {
    width: 300px;
    height: 212px;
  }

  .br-deck-inner {
    margin-top: -48px;
    gap: 14px;
  }

  .br-inside, .br-form-card {
    padding: 20px;
  }
  .br-inside-h, .br-form-h { font-size: 22px; }
  .br-inside-sub { font-size: 13.5px; margin-bottom: 18px; }
  .br-form-sub { font-size: 13.5px; }

  .br-tile {
    padding: 14px;
    gap: 12px;
  }
  .br-tile-ico { flex: 0 0 34px; width: 34px; height: 34px; }
  .br-tile-text { font-size: 13.5px; }
  .br-tile-text span { font-size: 12px; }

  .format-pill { padding: 12px 14px; font-size: 13.5px; }
}

@media (max-width: 380px) {
  .brochure-stage--banner .brochure-3d--landscape {
    width: 260px;
    height: 184px;
  }
}

/* No hover-driven movement on touch / hybrid pointers (e.g. iPad + mouse). */
@media (hover: none), (pointer: coarse) {
  .br-tile:hover { transform: none; }
}
