/* ==========================================================================
   Aquiles for Mayor — campaign site styles.
   Tokens come from ds/theme/*.css (shared 1:1 with the design export).
   This file only adds: base reset, the three DS form/action components
   rebuilt as classes, and responsive layout helpers. Decorative styling
   stays inline in the markup (all token-based, so it needs no remapping).
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--canvas); }
body { font-family: var(--font-body); color: var(--text-body); }
a { color: var(--brick); text-decoration-thickness: 2px; }
a:hover { color: var(--brick-deep); }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }

/* --- layout container ---------------------------------------------------- */
.wrap { max-width: var(--container-max); margin: 0 auto; padding: 56px 28px; }
.hero-inner {
  max-width: var(--container-max); margin: 0 auto; padding: 48px 28px;
  box-sizing: border-box; min-height: 540px;
  display: flex; flex-direction: column; justify-content: center;
}
.section-line { border-bottom: 2px solid var(--border); }

/* photo-tinted hero backgrounds */
.bg-cover { background-size: cover; }

/* --- responsive grids (intrinsically collapsing) ------------------------- */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
/* text + media split; media wraps under text on narrow screens */
.split { display: grid; gap: 44px; align-items: center; grid-template-columns: 1.1fr .9fr; }
.split.figure { grid-template-columns: 1.15fr .85fr; }
/* Custom column ratios live as classes, NOT inline: an inline grid-template-columns
   beats the @media collapse below (media queries don't add specificity), so the grid
   would never go single-column on mobile and its contents overflow the viewport. */
.split.split-plan { grid-template-columns: 300px minmax(0, 1fr); }
.split.split-hero { grid-template-columns: 1fr 340px; }
/* Press row: headline + publication left, og:image teaser right. */
.press-row { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 28px; align-items: center; }
.press-row .press-og { aspect-ratio: 1200 / 630; background: var(--canvas); border: 2px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.press-row .press-og img { width: 100%; height: 100%; object-fit: cover; display: block; }

@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split, .split.figure, .split.split-plan, .split.split-hero { grid-template-columns: 1fr; }
  .split .split-media { order: -1; max-width: 420px; }
}
@media (max-width: 720px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .press-row { grid-template-columns: 1fr; gap: 16px; }
  .press-row .press-og { order: -1; }
  .wrap { padding: 44px 20px; }
  .hero-inner { padding: 40px 20px; min-height: 460px; }
  .btn-lg { padding: 14px 24px; font-size: 16px; } /* shrink big buttons so long labels fit narrow screens */
}

/* --- Button (mirrors DS forms/Button.jsx) -------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 800; text-transform: uppercase;
  line-height: 1.15; border: 2px solid transparent; border-radius: var(--radius-md);
  cursor: pointer; text-decoration: none; text-align: center;
  /* wrap (not nowrap) + max-width so a long label shrinks to its container on
     narrow screens instead of forcing horizontal overflow. */
  white-space: normal; max-width: 100%;
  transition: transform var(--dur-fast) var(--ease-out),
              filter var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.btn:hover { filter: brightness(0.92); color: inherit; }
.btn:active { transform: translate(2px, 2px); }
.btn-sm { padding: 8px 16px; font-size: 13px; letter-spacing: .08em; }
.btn-md { padding: 12px 24px; font-size: 15px; letter-spacing: .09em; }
.btn-lg { padding: 16px 34px; font-size: 18px; letter-spacing: .10em; }
.btn-primary   { background: var(--accent); color: var(--accent-text); }
.btn-secondary { background: var(--text-strong); color: var(--bg-surface); }
.btn-outline   { background: transparent; color: var(--text-strong); border-color: var(--border-strong); }
.btn-ghost     { background: transparent; color: var(--text-strong); }
.btn-block { display: flex; width: 100%; }
.btn-sign { box-shadow: var(--sign-shadow-sm); }
.btn-sign:active { box-shadow: 1px 1px 0 var(--shade); }

/* --- Input (mirrors DS forms/Input.jsx) ---------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; font-family: var(--font-body); min-width: 0; }
.field > label {
  font-size: 12px; font-weight: 800; letter-spacing: .09em;
  text-transform: uppercase; color: var(--text-strong);
}
.field input {
  font-family: var(--font-body); font-size: 16px; font-weight: 500;
  color: var(--text-strong); background: var(--bg-surface);
  padding: 11px 14px; border: 2px solid var(--border-strong);
  border-radius: var(--radius-md); outline: none; width: 100%;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.field input:focus { border-color: var(--focus-ring); }
.field.err input { border-color: var(--brick); }
.field .err-msg { font-size: 12px; font-weight: 500; color: var(--brick); display: none; }
.field.err .err-msg { display: block; }

/* --- Checkbox (mirrors DS forms/Checkbox.jsx) ---------------------------- */
.check { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-body); cursor: pointer; }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check .box {
  position: relative; width: 22px; height: 22px; flex-shrink: 0;
  border-radius: var(--radius-sm); border: 2px solid var(--border-strong);
  background: transparent; transition: all var(--dur-fast) var(--ease-out);
}
.check .box svg { position: absolute; top: 1px; left: 1px; display: none; }
.check input:checked + .box { border-color: var(--accent); background: var(--accent); }
.check input:checked + .box svg { display: block; }
.check .lbl { font-size: 15px; font-weight: 500; color: var(--text-body); }

/* --- header nav: inline >=980px, hamburger below (pure CSS) --------------- */
.nav-inline { display: flex; gap: 4px; margin-left: auto; }
.nav-toggle { display: none; }
.nav-menu { display: none; }
.nav-menu.open { display: flex; }
@media (max-width: 979px) {
  .nav-inline, .header-cta { display: none; }
  .nav-toggle { display: flex; margin-left: auto; }
}

/* --- Endorse form legibility ---------------------------------------------
   The form renders inside the brick (red) hero, whose colorway flips text to
   cream — which made labels cream-on-cream and placeholders low-contrast.
   Reset text to a dark palette on the cream card, keep the red input fields,
   and make placeholder ("preview") text white so it reads on the red. */
.endorse-card { --text-strong: var(--ink); --text-body: #2c3b44; --text-muted: #5c6b6d; --border-strong: rgba(34,49,58,0.32); }
.endorse-card .field input { background: var(--brick); color: var(--paper); border-color: rgba(240,230,210,.55); }
.endorse-card .field input::placeholder { color: #fff; opacity: .85; }
.endorse-card .field input:focus { border-color: var(--sand); }
/* Form rows: 2-up on desktop, stacked on mobile. Columns live here (not inline)
   so the media query can collapse them — inline columns can't be overridden. */
.endorse-pickers { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); }
.endorse-submit  { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
@media (max-width: 720px) {
  .endorse-pickers, .endorse-submit { grid-template-columns: 1fr; }
}

/* Inverted action button: cream with red text at rest → red with cream text on hover. */
.btn-invert:hover { background: var(--brick); color: var(--paper); filter: none; }

/* Reading list: clip long publication headlines to a short, ellipsed line.
   Full title stays in the DOM (hover tooltip + accessibility); change 2 → 1 to
   make them a single line. */
.read-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* flip card (home symptoms) */
.flip { perspective: 1000px; }
.flip-face { display: grid; height: 100%; transform-style: preserve-3d;
  transition: transform 420ms var(--ease-out); }
.flip.flipped .flip-face { transform: rotateY(180deg); }

/* collapse animation for plank/fight bodies is handled by show/hide in JS */
.hidden { display: none !important; }
