/* ══════════════════════════════════════════════════════════════════════
   ABAVA — Design Tokens
   ══════════════════════════════════════════════════════════════════════
   One source of truth for the public site, the officials pages and the
   admin portal. Loaded before every other stylesheet.

   Why this file exists: css/style.css carried ~40 tokens and css/admin.css
   carried 9, all of them colour. The admin had no spacing scale, no radius
   scale, no elevation ramp and no type scale, so every value in it was
   chosen locally — twelve font sizes between 0.68rem and 2rem, six padding
   systems in one screen, and two shadow values for the whole product.
   A token changed in one sheet could not reach the other.

   Rules for anything added here:
   - spacing is an 8pt grid (--sp-1 and --sp-3 are the half-steps)
   - every surface picks an --elev-* step; nothing invents a shadow
   - every control is at least --control-h tall and --field-font big
   ══════════════════════════════════════════════════════════════════════ */

:root {
  /* ── Brand ──────────────────────────────────────────────────────── */
  --navy:        #0a0e1a;
  --navy-mid:    #111827;
  --navy-light:  #1c2540;
  --gold:        #f5c518;
  --gold-dim:    #c49a10;
  --gold-bright: #ffd93d;
  --gold-glow:   rgba(245,197,24,0.25);
  --white:       #f0f2f7;
  --white-dim:   #9aa3b8;
  --accent:      #e8423a;
  --green:       #22c55e;
  --red:         #ef4444;
  --blue:        #60a5fa;
  /* Softer shades, for text on a tinted panel where the solid one is too hot. */
  --red-soft:    #f87171;
  --green-soft:  #4ade80;

  /* ── Gradients ──────────────────────────────────────────────────── */
  --gradient-gold: linear-gradient(135deg, #f5c518 0%, #ffd93d 50%, #f5a623 100%);
  --gradient-hero: linear-gradient(135deg, rgba(245,197,24,0.15) 0%, rgba(245,166,35,0.05) 50%, transparent 100%);

  /* ── Typography ─────────────────────────────────────────────────── */
  --font-display: 'Inter', 'Segoe UI', sans-serif;
  --font-body:    'Inter', 'Segoe UI', sans-serif;

  /* Fluid type scale. Each step is paired with a line height so a size
     change never leaves the rhythm behind. */
  --txt-xs:   clamp(0.72rem, 0.70rem + 0.10vw, 0.78rem);
  --txt-sm:   clamp(0.82rem, 0.79rem + 0.15vw, 0.90rem);
  --txt-base: clamp(0.92rem, 0.89rem + 0.18vw, 1.00rem);
  --txt-lg:   clamp(1.05rem, 1.00rem + 0.28vw, 1.20rem);
  --txt-xl:   clamp(1.25rem, 1.15rem + 0.50vw, 1.55rem);
  --txt-2xl:  clamp(1.60rem, 1.40rem + 1.00vw, 2.20rem);
  --txt-3xl:  clamp(2.20rem, 1.80rem + 2.00vw, 3.40rem);

  --lh-tight:  1.15;
  --lh-snug:   1.35;
  --lh-normal: 1.6;

  --track-label:   0.06em;   /* uppercase labels   */
  --track-heading: -0.02em;  /* display headings   */

  /* ── Spacing — 8pt grid ─────────────────────────────────────────── */
  --sp-1:  4px;   /* half-step  */
  --sp-2:  8px;
  --sp-3:  12px;  /* half-step  */
  --sp-4:  16px;
  --sp-5:  20px;
  --sp-6:  24px;
  --sp-8:  32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;

  /* Fluid card and section padding, still landing on the grid at the ends */
  --pad-card:    clamp(16px, 2.5vw, 24px);
  --pad-card-lg: clamp(24px, 3vw, 32px);

  /* ── Radii ──────────────────────────────────────────────────────── */
  /* 4px for things smaller than a button — a flag, a score chip, a thumb.
     Forcing those up to 6px makes a 20px element look soft. */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius:    8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  /* ── Elevation ramp ─────────────────────────────────────────────────
     Four steps, each a contact shadow plus an ambient one, so a surface
     reads as lifted rather than outlined. Warm-tinted, because a pure
     black shadow on navy goes muddy.
     1 raised row · 2 card · 3 card hover / popover · 4 modal           */
  --elev-1: 0 1px 2px rgba(0,0,0,0.30), 0 2px 8px rgba(5,8,20,0.20);
  --elev-2: 0 2px 4px rgba(0,0,0,0.32), 0 8px 24px rgba(5,8,20,0.28);
  --elev-3: 0 4px 8px rgba(0,0,0,0.34), 0 16px 40px rgba(5,8,20,0.40);
  --elev-4: 0 8px 16px rgba(0,0,0,0.38), 0 32px 80px rgba(5,8,20,0.55);
  --elev-gold: 0 8px 32px rgba(245,197,24,0.20);
  /* A drawer casts sideways, which a vertical ramp cannot express. */
  --elev-drawer: -8px 0 40px rgba(0,0,0,0.5);

  /* ── Glow ───────────────────────────────────────────────────────────
     Glow is not elevation: it says "this is live / brand / focused", not
     "this is raised". Kept as its own scale so the two cannot drift into
     each other, which is how the public sheet ended up with five
     different gold glows. */
  --glow-sm:   0 0 16px rgba(245,197,24,0.08);
  --glow:      0 0 24px rgba(245,197,24,0.15);
  --glow-lg:   0 4px 20px rgba(245,197,24,0.30);
  --glow-ring: 0 0 0 3px rgba(245,197,24,0.25);

  /* ── Surfaces & borders ─────────────────────────────────────────── */
  --surface-1:         rgba(255,255,255,0.03);
  --surface-2:         rgba(255,255,255,0.06);
  --surface-3:         rgba(255,255,255,0.09);
  --border-subtle:     rgba(255,255,255,0.08);
  --border-gold:       rgba(245,197,24,0.2);
  --border:            rgba(255,255,255,0.1);
  --card-border:       1px solid rgba(255,255,255,0.08);
  --card-border-hover: 1px solid rgba(245,197,24,0.3);

  /* ── Glass ──────────────────────────────────────────────────────────
     The association's design system is glassmorphic; these are the only
     values that should produce it, so the blur radius stays consistent
     and can be dialled back in one place if it costs too much paint. */
  --glass-bg:     rgba(17, 24, 39, 0.72);
  --glass-bg-sub: rgba(28, 37, 64, 0.55);
  --glass-border: 1px solid rgba(255,255,255,0.10);
  --glass-blur:   blur(20px) saturate(140%);

  /* ── Motion ─────────────────────────────────────────────────────────
     Three durations and three curves. --ease-spring overshoots slightly,
     which is what makes a card feel picked up rather than faded in. */
  --dur-fast: 150ms;
  --dur-base: 220ms;
  --dur-slow: 320ms;
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-inout:  cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.26, 0.64, 1);
  --transition: 0.2s ease;

  /* ── Controls ───────────────────────────────────────────────────────
     --control-h is the touch minimum; --field-font is the size below
     which iOS Safari zooms the page on focus. Neither is negotiable. */
  --control-h:    44px;
  --control-h-sm: 36px;   /* fine pointers only */
  --field-font:   16px;

  /* ── Layout ─────────────────────────────────────────────────────── */
  --nav-height:    64px;
  --section-py:    clamp(60px, 8vw, 100px);
  --container-pad: clamp(16px, 4vw, 40px);
  --grid-gap:      clamp(12px, 2vw, 20px);
  --admin-rail:    240px;
}

/* A keyboard focus ring that reads on every surface in the system.
   Scoped with :where() so it carries no specificity and any component
   can still state its own. */
:where(a, button, select, input, textarea, [role="button"], [tabindex]):focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-fast: 1ms;
    --dur-base: 1ms;
    --dur-slow: 1ms;
  }
}
