/* ==========================================================================
   Starr County Behavioral Health Center — site.css
   THE shared design system. Theme: "The Open Sweep."
   Shelter, not confinement. Dignity, not pity. Calm, warm, credible.
   Owned by the designer. Shared, do NOT fork. Page-scoped styles go in
   styles/pages/<page>.css.

   Contrast decisions (WCAG 2.1 AA, verified):
     - Brand coral #E8826B on white = 2.68:1  → FAILS. Coral is used ONLY for
       the star, large display accents, and decoration. NEVER body/small text,
       NEVER as button fill with white text.
     - Navy #1F3A60 + white text = 11.5:1     → primary CTA + structure.
     - Teal #2E7D8F on white = 4.73:1         → passes AA, links/secondary text.
     - Coral-deep #B54A30 on white = 5.27:1   → accessible "warm coral" for
       links, emphasis text, and the warm CTA variant.
     - Light-teal #9FC6D1 on navy = 6.26:1    → text/detail on navy surfaces.
   ========================================================================== */

/* ---- 1. Tokens ---------------------------------------------------------- */
:root {
  /* Brand (exact, from site-config.json / brand guide) */
  --navy:        #1F3A60;
  --coral:       #E8826B;   /* THE accent — the star. Large/decoration only. */
  --teal:        #2E7D8F;
  --light-teal:  #9FC6D1;

  /* Derived, accessibility-tuned interactive shades */
  --navy-deep:   #16283F;   /* darker navy for gradients / footers */
  --navy-soft:   #2B4A73;   /* hover state for navy surfaces */
  --coral-deep:  #B54A30;   /* accessible "warm coral" — text/links/warm CTA (5.27:1) */
  --coral-deeper:#9A3D26;   /* hover for warm CTA */
  --teal-deep:   #256677;   /* hover for teal */

  /* Ink & surfaces (warm, calm, never stark) */
  --ink:         #1B2A44;   /* body text — 13.5:1 on paper */
  --ink-soft:    #45536B;   /* muted/meta text — ~7:1 on paper */
  --ink-faint:   #6B7789;   /* captions, timestamps — ~4.7:1 on paper */
  --paper:       #FBF9F6;   /* page background — warm off-white */
  --sand:        #F4EEE7;   /* alt section — warm */
  --mist:        #EAF1F3;   /* alt section — cool, light-teal tinted */
  --line:        #E3DBD1;   /* hairline borders on paper */
  --line-cool:   #D5E2E6;   /* hairline borders on cool surfaces */
  --white:       #FFFFFF;

  /* Crisis palette — warm & human (health, not alarm). Distinct from header. */
  --crisis-bg:   #B54A30;   /* coral-deep: warm, high-contrast, unmistakable */
  --crisis-bg-hover: #9A3D26;
  --crisis-ink:  #FFFFFF;

  /* Focus ring — high visibility on any surface */
  --focus:       #12406b;
  --focus-ring:  0 0 0 3px var(--paper), 0 0 0 6px #4a90c2;

  /* Typography — system stack, zero render-blocking web fonts */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
               Arial, "Noto Sans", sans-serif, "Apple Color Emoji",
               "Segoe UI Emoji";
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
               "Times New Roman", serif;

  /* Modular type scale (fluid, 1.20 mobile → larger on wide) */
  --step--1: clamp(0.83rem, 0.80rem + 0.15vw, 0.90rem);
  --step-0:  clamp(1.00rem, 0.96rem + 0.20vw, 1.125rem);
  --step-1:  clamp(1.20rem, 1.12rem + 0.40vw, 1.44rem);
  --step-2:  clamp(1.44rem, 1.30rem + 0.70vw, 1.90rem);
  --step-3:  clamp(1.73rem, 1.50rem + 1.15vw, 2.55rem);
  --step-4:  clamp(2.07rem, 1.68rem + 1.95vw, 3.35rem);
  --step-5:  clamp(2.44rem, 1.85rem + 2.95vw, 4.25rem);

  /* Spacing rhythm (8px base) */
  --sp-1: 0.25rem;  --sp-2: 0.5rem;   --sp-3: 0.75rem;  --sp-4: 1rem;
  --sp-5: 1.5rem;   --sp-6: 2rem;     --sp-7: 3rem;     --sp-8: 4rem;
  --sp-9: 6rem;     --sp-10: 8rem;

  /* Radii — soft, rounded (open, humane; never sharp/institutional) */
  --r-sm: 6px; --r-md: 12px; --r-lg: 18px; --r-xl: 28px; --r-pill: 999px;

  /* Shadows — soft, low, warm-tinted (calm elevation) */
  --sh-1: 0 1px 2px rgba(27,42,68,.06), 0 2px 6px rgba(27,42,68,.05);
  --sh-2: 0 4px 12px rgba(27,42,68,.08), 0 10px 28px rgba(27,42,68,.07);
  --sh-3: 0 10px 24px rgba(27,42,68,.10), 0 24px 60px rgba(27,42,68,.10);

  /* Layout */
  --container: 72rem;   /* ~1152px */
  --container-narrow: 46rem;
  --header-h: 4.5rem;    /* mobile: framed for the smaller Starr Boundary logo */
  --crisis-h: 2.75rem;   /* default; site.js re-syncs to the crisis bar's real height */

  --ease: cubic-bezier(.22,.61,.36,1);
}

/* ---- 2. Reset & base ---------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Keep in-page anchors clear of the fixed crisis bar + header */
  scroll-padding-top: calc(var(--crisis-h) + var(--header-h) + 1rem);
}

body {
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.62;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* The crisis bar + header form a two-tier STICKY stack (both in normal flow),
     so no body padding is needed and there is no fixed/padding double-count that
     would push the header away from the crisis bar. */
  /* `clip` (not `hidden`): hidden forces the other axis to `auto`, making body a
     scroll container and BREAKING position:sticky on iOS. clip prevents horizontal
     overflow without establishing a scroll container, so the sticky nav keeps working. */
  overflow-x: clip;
}

img, svg, picture { display: block; max-width: 100%; height: auto; }
a { color: var(--teal-deep); text-underline-offset: 0.15em; }
a:hover { color: var(--coral-deeper); }
strong, b { font-weight: 700; }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  line-height: 1.12;
  color: var(--navy);
  font-weight: 600;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h1 { font-size: var(--step-5); letter-spacing: -0.02em; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); font-family: var(--font-sans); font-weight: 700; }
p { text-wrap: pretty; }

/* ---- 3. Accessibility: focus + skip link -------------------------------- */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
/* Elements that carry their own high-contrast ring */
.btn:focus-visible,
.crisis-bar__link:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.skip-link {
  position: fixed;
  left: 50%;
  top: -6rem;                 /* fully off-screen until keyboard-focused (reliable hide) */
  transform: translateX(-50%);
  z-index: 1200;
  background: var(--navy);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--r-pill);
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--sh-2);
  transition: top .2s var(--ease);
}
.skip-link:focus { top: calc(var(--crisis-h) + 0.5rem); color: #fff; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---- 4. Layout primitives ---------------------------------------------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 1.25rem; }
.container--narrow { max-width: var(--container-narrow); }
@media (min-width: 48rem) { .container { padding-inline: 2rem; } }

.section { padding-block: var(--sp-8); }
@media (min-width: 48rem) { .section { padding-block: var(--sp-9); } }
.section--tight { padding-block: var(--sp-7); }
.section--sand { background: var(--sand); }
.section--mist { background: var(--mist); }
.section--navy { background: var(--navy); color: #EAF1F3; }
.section--navy h1, .section--navy h2, .section--navy h3, .section--navy h4 { color: #fff; }
/* Scope navy-section link colors to NON-button links — buttons (.btn--onnavy,
   .btn--outline-onnavy, etc.) manage their own text color, incl. dark text on their
   light hover background. Without :not(.btn) this forced button labels white on a
   white hover fill, so the text blended into the background. */
.section--navy a:not(.btn) { color: var(--light-teal); }
.section--navy a:not(.btn):hover { color: #fff; }

.stack > * + * { margin-top: var(--sp-4); }
.stack-lg > * + * { margin-top: var(--sp-6); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-deep);
  margin-bottom: var(--sp-3);
}
.eyebrow::before {
  content: ""; width: 1.5rem; height: 2px; border-radius: 2px;
  background: var(--coral);
}
.section--navy .eyebrow { color: var(--light-teal); }

.lead { font-size: var(--step-1); color: var(--ink-soft); line-height: 1.55; max-width: 46ch; }
.section--navy .lead { color: #CFE0E6; }
.measure { max-width: 62ch; }

/* Section header block */
.section-head { max-width: 52rem; margin-bottom: var(--sp-6); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center .eyebrow { justify-content: center; }

/* ---- 5. Buttons --------------------------------------------------------- */
.btn {
  --_bg: var(--navy);
  --_fg: #fff;
  --_bg-hover: var(--navy-soft);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  font-family: var(--font-sans);
  font-size: var(--step-0);
  font-weight: 700;
  line-height: 1.1;
  padding: 0.85rem 1.5rem;
  min-height: 3rem;              /* >= 48px tap target */
  border: 2px solid transparent;
  border-radius: var(--r-pill);
  background: var(--_bg);
  color: var(--_fg);
  text-decoration: none;
  cursor: pointer;
  transition: background-color .18s var(--ease), transform .18s var(--ease),
              box-shadow .18s var(--ease), border-color .18s var(--ease);
  box-shadow: var(--sh-1);
}
.btn:hover { background: var(--_bg-hover); color: var(--_fg); transform: translateY(-1px); box-shadow: var(--sh-2); }
.btn:active { transform: translateY(0); box-shadow: var(--sh-1); }

/* Primary = navy fill / white (11.5:1). The dependable, dominant action. */
.btn--primary { --_bg: var(--navy); --_fg: #fff; --_bg-hover: var(--navy-soft); }

/* Warm = accessible coral-deep (5.27:1). Use for the single warmest CTA
   ("Show Your Support") when you want emotional warmth, not corporate navy. */
.btn--warm { --_bg: var(--coral-deep); --_fg: #fff; --_bg-hover: var(--coral-deeper); }

/* Teal = secondary emphasis (4.73:1 — white on teal is higher). */
.btn--teal { --_bg: var(--teal); --_fg: #fff; --_bg-hover: var(--teal-deep); }

/* Outline = quiet action (Give lives here — present, not loudest). */
.btn--outline {
  background: transparent; color: var(--navy);
  border-color: var(--navy); box-shadow: none;
}
.btn--outline:hover { background: var(--navy); color: #fff; border-color: var(--navy); }

/* Ghost on navy surfaces */
.btn--onnavy { background: #fff; color: var(--navy); --_bg-hover: #EAF1F3; }
.btn--onnavy:hover { color: var(--navy); }
.btn--outline-onnavy {
  background: transparent; color: #fff; border-color: rgba(255,255,255,.55); box-shadow: none;
}
.btn--outline-onnavy:hover { background: #fff; color: var(--navy); border-color: #fff; }

.btn--lg { font-size: var(--step-1); padding: 1rem 1.9rem; min-height: 3.4rem; }
.btn--sm { font-size: var(--step--1); padding: 0.55rem 1rem; min-height: 2.5rem; }
.btn--block { display: flex; width: 100%; }

.btn-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
@media (max-width: 30rem) { .btn-row .btn { flex: 1 1 100%; } }

/* Plain text link with arrow */
.link-arrow {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-weight: 700; color: var(--teal-deep); text-decoration: none;
}
.link-arrow::after { content: "\2192"; transition: transform .18s var(--ease); }
.link-arrow:hover { color: var(--coral-deeper); }
.link-arrow:hover::after { transform: translateX(3px); }

/* ---- 6. Cards ----------------------------------------------------------- */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  box-shadow: var(--sh-1);
  transition: box-shadow .2s var(--ease), transform .2s var(--ease), border-color .2s var(--ease);
}
.card--hover:hover { box-shadow: var(--sh-2); transform: translateY(-2px); border-color: var(--line-cool); }
.card__icon {
  width: 3rem; height: 3rem; border-radius: var(--r-md);
  display: grid; place-items: center; margin-bottom: var(--sp-4);
  background: var(--mist); color: var(--teal-deep);
}
.card__title { font-size: var(--step-1); margin-bottom: var(--sp-2); }
.card--accent { border-top: 4px solid var(--coral); }
.card--navy { background: var(--navy); color: #DCE7EA; border-color: transparent; }
.card--navy .card__title { color: #fff; }

.card-grid { display: grid; gap: var(--sp-5); grid-template-columns: 1fr; }
@media (min-width: 40rem) { .card-grid--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 52rem) {
  .card-grid--3 { grid-template-columns: repeat(3, 1fr); }
  .card-grid--2 { grid-template-columns: repeat(2, 1fr); }
}

/* ---- 7. Stat blocks (data-forward, honest) ------------------------------ */
.stat {
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: var(--r-md);
  padding: var(--sp-5);
}
.stat__value {
  font-family: var(--font-serif);
  font-size: var(--step-4);
  line-height: 1;
  color: var(--navy);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.stat__value--coral { color: var(--coral-deep); }
.stat__label { margin-top: var(--sp-2); font-weight: 600; color: var(--ink); }
.stat__source {
  margin-top: var(--sp-3);
  font-size: var(--step--1);
  color: var(--ink-faint);
  line-height: 1.4;
}
.stat__source a { color: var(--ink-faint); text-decoration: underline; }
/* Honest placeholder state — no invented numbers */
.stat--pending { border-left-color: var(--ink-faint); background: var(--sand); }
.stat--pending .stat__value { font-size: var(--step-2); color: var(--ink-soft); }
.badge-pending {
  display: inline-block; font-size: var(--step--1); font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--teal-deep); background: var(--mist);
  padding: 0.2rem 0.6rem; border-radius: var(--r-pill); margin-bottom: var(--sp-2);
}

/* ---- 8. Phase timeline -------------------------------------------------- */
.timeline { display: grid; gap: var(--sp-5); grid-template-columns: 1fr; counter-reset: phase; }
@media (min-width: 52rem) { .timeline { grid-template-columns: repeat(3, 1fr); gap: var(--sp-6); } }

.phase {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--sp-6) var(--sp-5) var(--sp-5);
  box-shadow: var(--sh-1);
}
.phase__num {
  position: absolute; top: calc(-1 * var(--sp-4)); left: var(--sp-5);
  width: 2.75rem; height: 2.75rem; border-radius: var(--r-pill);
  display: grid; place-items: center;
  background: var(--navy); color: #fff;
  font-family: var(--font-serif); font-weight: 600; font-size: var(--step-1);
  box-shadow: var(--sh-2);
}
.phase:first-child .phase__num { background: var(--coral-deep); }
.phase__time {
  margin-top: var(--sp-2);
  font-size: var(--step--1); font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--teal-deep);
}
.phase__title { font-size: var(--step-1); margin: var(--sp-2) 0; }
/* Connector line on wide screens */
@media (min-width: 52rem) {
  .timeline { position: relative; }
  .timeline::before {
    content: ""; position: absolute; top: 0; left: 8%; right: 8%; height: 3px;
    background: linear-gradient(90deg, var(--coral) 0%, var(--teal) 55%, var(--light-teal) 100%);
    border-radius: 3px; z-index: 0;
  }
  .phase { z-index: 1; }
}

/* ---- 9. Crisis bar (persistent, injected by site.js) -------------------- */
.crisis-bar {
  /* Sticky (not fixed): it sits at the very top of the document, so top:0 pins it
     exactly like a fixed bar, but it stays in normal flow — the sticky header
     below it lands flush directly beneath, with no gap and no padding hacks. */
  position: sticky; top: 0; left: 0; right: 0; z-index: 1100;
  background: var(--crisis-bg);
  color: var(--crisis-ink);
  min-height: var(--crisis-h);
}
.crisis-bar__inner {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem 1rem;
  flex-wrap: wrap;
  max-width: var(--container); margin-inline: auto;
  padding: 0.4rem 1rem; text-align: center;
}
.crisis-bar__msg { font-size: var(--step--1); font-weight: 600; }
.crisis-bar__dot {
  display: inline-block; width: 0.55rem; height: 0.55rem; border-radius: 50%;
  background: #fff; margin-right: 0.4rem; vertical-align: middle;
  box-shadow: 0 0 0 0 rgba(255,255,255,.7);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,255,255,.6); }
  70%  { box-shadow: 0 0 0 8px rgba(255,255,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}
.crisis-bar__link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: #fff; color: var(--crisis-bg);
  font-weight: 800; font-size: var(--step--1);
  padding: 0.35rem 0.9rem; border-radius: var(--r-pill);
  text-decoration: none; white-space: nowrap;
  transition: transform .15s var(--ease), background-color .15s var(--ease);
}
.crisis-bar__link:hover { color: var(--crisis-bg-hover); transform: translateY(-1px); background: #fff; }

/* ---- 10. Site header + nav (injected by site.js) ------------------------ */
.site-header {
  position: sticky; top: var(--crisis-h); z-index: 1000;
  background: rgba(251, 249, 246, 0.92);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex; align-items: center; gap: 1rem; flex-wrap: nowrap;
  max-width: var(--container); margin-inline: auto;
  padding: 0.6rem 1.25rem; min-height: var(--header-h);
}
@media (min-width: 48rem) { .site-header__inner { padding-inline: 2rem; } }

.brand { display: inline-flex; align-items: center; flex: 0 0 auto; text-decoration: none; }
.brand__mark { display: block; width: auto; }
/* Show the full horizontal wordmark at EVERY size — the name must be visible, not
   just the icon. On phones it's sized down so the 5:1 lockup stays legible and never
   cramps the menu button or overflows (at 320px it renders ~156px wide, leaving
   comfortable room for the hamburger). */
.brand__mark--icon { display: none; }
.brand__mark--full { display: block; height: clamp(2rem, 8vw, 2.6rem); }
/* Tablet & up: a little more room. */
@media (min-width: 48rem) {
  .brand__mark--full { height: 3.25rem; }
}

.nav { display: none; }
.nav__list { list-style: none; display: flex; align-items: center; gap: 0.15rem; padding: 0; flex-wrap: nowrap; }
.nav__link {
  display: inline-block; padding: 0.5rem 0.7rem; border-radius: var(--r-sm);
  color: var(--navy); font-weight: 600; font-size: var(--step-0);
  text-decoration: none; white-space: nowrap;
}
.nav__link:hover { color: var(--coral-deeper); background: var(--sand); }
.nav__link[aria-current="page"] { color: var(--teal-deep); }
.nav__link[aria-current="page"]::after {
  content: ""; display: block; height: 2px; border-radius: 2px;
  background: var(--coral); margin-top: 2px;
}
.nav__list { margin: 0; }
.nav__item { position: relative; }

/* Desktop nav dropdown (accessible disclosure) */
.nav__group-btn {
  /* it is a <button> but reuses .nav__link — reset UA button chrome */
  background: transparent; border: 0; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 0.3rem;
}
.nav__group-btn.is-current { color: var(--teal-deep); }
.nav__caret {
  width: 0.5rem; height: 0.5rem; border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg);
  transition: transform .18s var(--ease); opacity: .8;
}
.nav__group-btn[aria-expanded="true"] .nav__caret { transform: translateY(1px) rotate(-135deg); }
.nav__group-btn[aria-expanded="true"] { color: var(--coral-deeper); background: var(--sand); }
.nav__panel {
  position: absolute; top: calc(100% + 0.4rem); left: 0; z-index: 1001;
  min-width: 15rem; list-style: none; margin: 0; padding: 0.4rem;
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--sh-2);
}
.nav__panel[hidden] { display: none; }
.nav__panel-link {
  display: block; padding: 0.6rem 0.75rem; border-radius: var(--r-sm);
  color: var(--navy); font-weight: 600; font-size: var(--step-0);
  text-decoration: none; white-space: nowrap;
}
.nav__panel-link:hover { background: var(--sand); color: var(--coral-deeper); }
.nav__panel-link[aria-current="page"] { color: var(--teal-deep); }
/* Folded utility link (Contact) — subtle divider from the participation items */
.nav__panel-link--sep { border-top: 1px solid var(--line); margin-top: 0.3rem; padding-top: 0.7rem; }

/* On phones/tablets the top bar is deliberately just logo + menu button, so the
   enlarged logo has room and nothing crowds. The EN/ES toggle and Give button
   move into the drawer (see .mobile-nav__actions). The cluster reappears inline
   at >=64rem next to the primary nav. */
.header-actions { display: none; align-items: center; gap: 0.5rem; }

/* Language toggle */
.lang-toggle {
  display: inline-flex; align-items: center;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  overflow: hidden; background: var(--white);
}
.lang-toggle__opt {
  padding: 0.35rem 0.7rem; font-size: var(--step--1); font-weight: 700;
  color: var(--ink-soft); text-decoration: none; min-height: 2.25rem;
  display: inline-flex; align-items: center;
}
.lang-toggle__opt[aria-current="true"] { background: var(--navy); color: #fff; }
.lang-toggle__opt:not([aria-current="true"]):hover { background: var(--sand); color: var(--navy); }

/* Mobile menu toggle — icon-only (the bars glyph is self-explanatory), so the
   enlarged logo gets maximum room. The label stays for screen readers. */
.nav-toggle {
  margin-left: auto; display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--white); border: 1px solid var(--line); color: var(--navy);
  border-radius: var(--r-pill); padding: 0.5rem 0.7rem; min-height: 2.75rem;
  min-width: 2.75rem; justify-content: center;
  font-weight: 700; font-size: var(--step--1); cursor: pointer;
}
.nav-toggle__label {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.nav-toggle__bars { width: 1.1rem; height: 0.85rem; position: relative; }
.nav-toggle__bars::before, .nav-toggle__bars::after, .nav-toggle__bars span {
  content: ""; position: absolute; left: 0; right: 0; height: 2px;
  background: var(--navy); border-radius: 2px; transition: transform .2s var(--ease), opacity .2s var(--ease);
}
.nav-toggle__bars::before { top: 0; }
.nav-toggle__bars span { top: 50%; transform: translateY(-50%); }
.nav-toggle__bars::after { bottom: 0; }
[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
[aria-expanded="true"] .nav-toggle__bars span { opacity: 0; }
[aria-expanded="true"] .nav-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

/* Mobile drawer */
.mobile-nav {
  display: none;
  border-top: 1px solid var(--line);
  background: var(--paper);
}
.mobile-nav.is-open { display: block; }
.mobile-nav__list { list-style: none; padding: 0.75rem 1.25rem 1.25rem; margin: 0; }
.mobile-nav__list li + li { border-top: 1px solid var(--line); }
.mobile-nav__link {
  display: block; padding: 0.9rem 0.25rem; color: var(--navy);
  font-weight: 600; font-size: var(--step-1); text-decoration: none;
}
.mobile-nav__link[aria-current="page"] { color: var(--teal-deep); }
.mobile-nav__actions { display: flex; flex-direction: column; gap: 0.85rem; margin-top: 1rem; }
/* EN/ES toggle inside the drawer: full-width, evenly split, clearly labelled. */
.mobile-nav__lang { display: flex; flex-direction: column; gap: 0.4rem; }
.mobile-nav__langlabel {
  font-size: var(--step--1); font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--teal-deep);
}
.mobile-nav__actions .lang-toggle { align-self: stretch; }
.mobile-nav__actions .lang-toggle__opt { flex: 1 1 50%; justify-content: center; padding-block: 0.6rem; }
/* Mobile grouped sub-section (e.g. "Get Involved") */
.mobile-nav__group { padding: 0.6rem 0.25rem 0.2rem; }
.mobile-nav__grouplabel {
  margin: 0 0 0.25rem; font-size: var(--step--1); font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--teal-deep);
}
.mobile-nav__sublist { list-style: none; margin: 0; padding: 0; }
.mobile-nav__sublist li + li { border-top: 1px solid var(--line); }
.mobile-nav__link--sub { font-size: var(--step-0); padding-left: 0.75rem; }

/* Horizontal nav appears only where the tight bar is verified to fit on one
   line without crowding (>=1024px). Below that, the hamburger drawer takes over
   cleanly — so the desktop bar can never wrap to a crowded second line. */
@media (min-width: 64rem) {
  :root { --header-h: 4.25rem; }
  /* The horizontal bar must hold logo + 5 nav items + Give + EN/ES on one line in
     BOTH languages (Spanish labels are wider). So at the 1024px tier the logo is a
     restrained 3rem and the nav is tightened; the logo grows to a bold 4rem once
     there's comfortable room (>=80rem / 1280px). */
  .brand__mark--full { height: 2.6rem; }
  .site-header__inner { gap: 0.75rem; }
  /* Logo hard-left; a right-aligned cluster of nav links + Give + EN/ES toggle.
     margin-left:auto on .nav pushes the whole cluster to the right edge. */
  .nav { display: block; margin-left: auto; }
  .nav__link { padding-inline: 0.55rem; }
  .header-actions { display: flex; margin-left: 0; }
  /* Give + EN/ES must never wrap or shrink into a squeezed column. */
  .header-actions .btn, .header-actions .lang-toggle { flex: 0 0 auto; white-space: nowrap; }
  .lang-toggle__opt { white-space: nowrap; }
  .nav-toggle { display: none; }
  .mobile-nav { display: none !important; }
}
@media (min-width: 80rem) {
  :root { --header-h: 4.75rem; }          /* framed for the smaller logo */
  .brand__mark--full { height: 3.25rem; }
  .site-header__inner { gap: 1rem; }
  .nav__link { padding-inline: 0.7rem; }
}

/* ---- 11. Hero ----------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(120% 90% at 85% -10%, rgba(159,198,209,.35) 0%, rgba(159,198,209,0) 55%),
    radial-gradient(90% 70% at 0% 110%, rgba(232,130,107,.16) 0%, rgba(232,130,107,0) 55%),
    var(--paper);
}
.hero__inner { padding-block: var(--sp-8) var(--sp-8); }
@media (min-width: 52rem) { .hero__inner { padding-block: var(--sp-9); } }
.hero__eyebrow { color: var(--teal-deep); }
.hero h1 { margin-bottom: var(--sp-5); max-width: 20ch; }
.hero__sub { font-size: var(--step-1); color: var(--ink-soft); max-width: 52ch; margin-bottom: var(--sp-6); }
.hero .btn-row { margin-bottom: var(--sp-6); }

/* Hero right column: brand illustration stacked above the supporter card */
.hero__aside { display: flex; flex-direction: column; gap: var(--sp-5); }
.hero__art {
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-2);
  background: var(--paper);
  line-height: 0;                 /* kill descender gap under the inline SVG */
}
.hero__art-svg { display: block; width: 100%; height: auto; }

/* The open-sweep motif line — echoes the logo's arc */
.sweep-rule {
  height: 4px; width: 5.5rem; border: 0; border-radius: 4px;
  background: linear-gradient(90deg, var(--coral) 0%, var(--teal) 100%);
  margin: 0;
}

/* ---- 12. Supporter count block ------------------------------------------ */
.supporter-count {
  background: var(--navy);
  color: #fff;
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  box-shadow: var(--sh-2);
}
.supporter-count__num {
  font-family: var(--font-serif); font-size: var(--step-5); line-height: 1;
  color: #fff; font-weight: 600; letter-spacing: -0.02em;
}
.supporter-count__zero { font-size: var(--step-2); color: var(--light-teal); }
.supporter-count__label { color: var(--light-teal); margin-top: var(--sp-2); font-weight: 600; }
.supporter-count__breakdown {
  margin-top: var(--sp-4); padding-top: var(--sp-4);
  border-top: 1px solid rgba(159,198,209,.3);
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem;
  font-size: var(--step--1); color: #CFE0E6;
}
.supporter-count__breakdown b { color: #fff; }
.supporter-count__cta { margin-top: var(--sp-5); }

/* ---- 13. Callout / notice ---------------------------------------------- */
.notice {
  border: 1px solid var(--line-cool);
  border-left: 4px solid var(--teal);
  background: var(--mist);
  border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-5);
  color: var(--ink);
}
.notice--warm { border-left-color: var(--coral-deep); background: #FBEEE9; border-color: #F0D8CF; }
.notice__title { font-weight: 700; color: var(--navy); margin-bottom: var(--sp-1); }

/* Honest-status pill (legal, "being built", etc.) */
.status-line {
  font-size: var(--step--1); color: var(--ink-soft); line-height: 1.5;
}

/* ---- 14. Forms ---------------------------------------------------------- */
.field { display: block; margin-bottom: var(--sp-4); }
.field__label { display: block; font-weight: 700; color: var(--navy); margin-bottom: var(--sp-2); }
.field__hint { font-size: var(--step--1); color: var(--ink-soft); margin-bottom: var(--sp-2); }
.field__req { color: var(--coral-deep); }
.input, .select, .textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  padding: 0.75rem 0.9rem; min-height: 3rem;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.textarea { min-height: 7rem; resize: vertical; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-cool); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(46,125,143,.20);
}
.input[aria-invalid="true"], .textarea[aria-invalid="true"], .select[aria-invalid="true"] {
  border-color: var(--coral-deep); box-shadow: 0 0 0 3px rgba(181,74,48,.18);
}
.field__error { display: block; margin-top: var(--sp-2); color: var(--coral-deeper); font-size: var(--step--1); font-weight: 600; }
.checkbox { display: flex; gap: 0.6rem; align-items: flex-start; margin-bottom: var(--sp-3); }
.checkbox input { width: 1.25rem; height: 1.25rem; margin-top: 0.15rem; flex: 0 0 auto; accent-color: var(--teal); }
.checkbox label { font-size: var(--step-0); color: var(--ink); }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---- 15. Crisis page specifics ----------------------------------------- */
.crisis-hero {
  background: linear-gradient(180deg, var(--mist) 0%, var(--paper) 100%);
  border-bottom: 1px solid var(--line-cool);
}
.quick-exit {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--navy); color: #fff; border: 0; cursor: pointer;
  font-weight: 700; font-size: var(--step--1);
  padding: 0.6rem 1rem; border-radius: var(--r-pill); min-height: 2.75rem;
  text-decoration: none;
}
.quick-exit:hover { background: var(--navy-soft); color: #fff; }

.resource {
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 5px solid var(--teal);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  box-shadow: var(--sh-1);
}
.resource--urgent { border-left-color: var(--coral-deep); background: #FCF3EF; }
.resource__name { font-size: var(--step-1); color: var(--navy); margin-bottom: var(--sp-1); }
.resource__lines { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: var(--sp-3) 0; }
.resource__action {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-weight: 800; font-size: var(--step-1);
  color: #fff; background: var(--teal); text-decoration: none;
  padding: 0.65rem 1.15rem; border-radius: var(--r-pill); min-height: 3rem;
}
.resource__action:hover { background: var(--teal-deep); color: #fff; }
.resource--urgent .resource__action { background: var(--coral-deep); }
.resource--urgent .resource__action:hover { background: var(--coral-deeper); }
.resource__action--phone { background: var(--navy); }
.resource__action--phone:hover { background: var(--navy-soft); }
.resource__meta { margin-top: var(--sp-3); font-size: var(--step--1); color: var(--ink-faint); }
.resource__verified {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-weight: 600; color: var(--teal-deep);
}
.resource__verified::before { content: "\2713"; font-weight: 800; }
.resource-grid { display: grid; gap: var(--sp-5); grid-template-columns: 1fr; }
@media (min-width: 46rem) { .resource-grid--2 { grid-template-columns: repeat(2, 1fr); } }

/* ---- 16. Footer (injected by site.js) ----------------------------------- */
.site-footer { background: var(--navy-deep); color: #C7D4DA; padding-block: var(--sp-8) var(--sp-6); }
.site-footer a { color: var(--light-teal); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid {
  display: grid; gap: var(--sp-6); grid-template-columns: 1fr;
  padding-bottom: var(--sp-6); border-bottom: 1px solid rgba(159,198,209,.22);
}
@media (min-width: 40rem) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 64rem) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; } }
/* Stacked (icon-on-top) reversed logo — larger, transparent vector on navy. */
.footer__brand img { height: 5.5rem; width: auto; margin-bottom: var(--sp-4); }
@media (min-width: 40rem) { .footer__brand img { height: 6rem; } }
.footer__col h2 { font-size: var(--step-0); font-family: var(--font-sans); color: #fff; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: var(--sp-3); }
.footer__list { list-style: none; padding: 0; display: grid; gap: 0.5rem; }
.footer__legal { margin-top: var(--sp-5); font-size: var(--step--1); color: #9FB2BC; line-height: 1.6; }
.footer__legal .footer__crisis {
  display: inline-flex; align-items: center; gap: 0.4rem;
  color: #fff; font-weight: 700;
}
.footer__bottom {
  margin-top: var(--sp-5); display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem;
  justify-content: space-between; align-items: center;
  font-size: var(--step--1); color: #9FB2BC;
}

/* ---- 17. Utilities ------------------------------------------------------ */
.text-center { text-align: center; }
.mx-auto { margin-inline: auto; }
.mt-6 { margin-top: var(--sp-6); }
.mt-4 { margin-top: var(--sp-4); }
.hidden { display: none !important; }
.grid-2 { display: grid; gap: var(--sp-6); grid-template-columns: 1fr; }
@media (min-width: 52rem) { .grid-2 { grid-template-columns: 1fr 1fr; align-items: center; } }
.grid-2--sidebar { }
@media (min-width: 52rem) { .grid-2--sidebar { grid-template-columns: 1.5fr 1fr; align-items: start; } }

/* Draft-translation flag (per convention: mark ES copy as draft for RGV review) */
.draft-flag {
  display: inline-block; font-size: var(--step--1); font-weight: 700;
  color: var(--ink-faint); border: 1px dashed var(--line); border-radius: var(--r-sm);
  padding: 0.15rem 0.5rem;
}

/* "Why we are building this" pull-points — a tight list carrying the star motif
   (coral star glyph = decorative brand accent; the text itself stays navy for AA). */
.why-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.7rem; }
.why-points li {
  position: relative; padding-left: 1.9rem;
  font-weight: 600; color: var(--navy); line-height: 1.4;
}
.why-points li::before {
  content: "\2605"; position: absolute; left: 0; top: -0.05em;
  color: var(--coral); font-size: 1.1em;
}

/* ---- 18. Motion preferences -------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important; scroll-behavior: auto !important;
  }
  .crisis-bar__dot { animation: none; }
}

/* Print — make help numbers legible, hide chrome noise */
@media print {
  .crisis-bar, .site-header, .nav-toggle, .mobile-nav, .quick-exit { position: static; }
  body { padding-top: 0; }
  .btn { border: 1px solid var(--navy); }
}

/* ---- 19. Small-device & tablet hardening (super-friendly UX) ------------ */
/* Guarantee: zero horizontal overflow, no long-token break-outs (emails/URLs/
   phones), comfortable 44px tap targets, and gentle collapse on tablet/phone. */
html, body { max-width: 100%; overflow-x: clip; }  /* clip, not hidden — preserves position:sticky on iOS */

/* Long unbreakable strings (info@beyondbordersmhc.com, URLs, ratios) must wrap
   instead of forcing a horizontal scrollbar on ~320-360px phones. */
p, li, dd, dt, a, span, small, address, figcaption,
.stat__source, .stat__label, .card, .resource, .notice, .field, .lead, .measure {
  overflow-wrap: break-word;
  word-break: break-word;
}
/* Emails/tel links are the worst offenders — let them break anywhere if needed. */
a[href^="mailto:"], a[href^="tel:"], .break-anywhere { overflow-wrap: anywhere; }

/* Comfortable touch targets (WCAG 2.5.5 / 44px) on coarse pointers. */
@media (pointer: coarse) {
  .btn, .nav a, .mobile-nav a, .link-arrow,
  .input, .select, .textarea,
  .checkbox input, .checkbox label,
  .lang-toggle, .nav-toggle, [data-cookie-settings] {
    min-height: 44px;
  }
  .checkbox input { min-width: 44px; }
}

/* Never let a grid or media element push the page wider than the viewport. */
img, svg, video, iframe, .card, .stat, .resource, .timeline, .supporter-count,
.grid-2, .grid-2--sidebar, .card-grid, .card-grid--2, .card-grid--3 { max-width: 100%; }
.card-grid, .card-grid--2, .card-grid--3, .grid-2, .grid-2--sidebar { min-width: 0; }
.card-grid > *, .grid-2 > *, .grid-2--sidebar > * { min-width: 0; } /* fix flex/grid overflow */

/* Tighter, still-breathable gutters on the smallest phones. */
@media (max-width: 26rem) {
  .container, .container--narrow { padding-left: 1rem; padding-right: 1rem; }
  .section { padding-top: var(--sp-7); padding-bottom: var(--sp-7); }
  .btn-row .btn { flex: 1 1 100%; }         /* full-width stacked CTAs */
  .field .input, .field .select, .field .textarea { width: 100%; }
  h1 { hyphens: auto; }
}

/* Tablet portrait (≈768-1024): keep two-up grids readable, forms single-column. */
@media (min-width: 40rem) and (max-width: 64rem) {
  .card-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid, .field-row { grid-template-columns: 1fr; } /* forms never cramp on tablet */
}
