/* =====================================================================
   SNRR global stylesheet
   Design tokens + base styles derived from docs/SNRR-STYLE-GUIDE.md
   (SOT for all design decisions). Component-specific styles live in
   scoped <style> blocks inside their .astro components.
   ===================================================================== */

/* ---- Design tokens -------------------------------------------------- */
:root {
  /* Brand colours — exact values extracted from the SNRR logo */
  --snrr-blue: #0065A4;       /* Primary. Links, buttons, heading accents */
  --snrr-navy: #003A61;       /* Hero/footer backgrounds, headline text */
  --snrr-sky: #99C1DB;        /* Borders, dividers, subtle accents */
  --snrr-sky-tint: #EAF3F9;   /* Alternating section backgrounds, cards */
  --snrr-gold: #FDBB30;       /* THE primary CTA + small highlights only */
  --snrr-gold-dark: #8A5B00;  /* Darker gold accent */
  --snrr-gold-text: #3D2800;  /* Text on gold surfaces — AA contrast (8.4:1) */
  --snrr-ink: #16242F;        /* Body text */
  --snrr-gray: #5C6B77;       /* Secondary text */
  --snrr-paper: #FFFFFF;      /* Page background */

  /* Semantic states (wet-weather status) */
  --state-open: #2E7D32;
  --state-closed: #C62828;
  --state-caution: #B7791F;

  /* Typography */
  --font-sans: "Barlow", -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-base: 17px;
  --lh-base: 1.65;

  /* Spacing & layout */
  --container: 1160px;
  --container-narrow: 820px;
  --section-pad: 96px;        /* generous desktop section padding */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;

  /* Elevation */
  --shadow-sm: 0 1px 3px rgba(0, 58, 97, 0.08), 0 1px 2px rgba(0, 58, 97, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 58, 97, 0.10);
  --shadow-lg: 0 12px 32px rgba(0, 58, 97, 0.14);

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--snrr-ink);
  background: var(--snrr-paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, picture, svg, video { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }

/* ---- Typography ----------------------------------------------------- */
h1, h2, h3, h4 { line-height: 1.12; color: var(--snrr-navy); letter-spacing: -0.015em; }
h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); font-weight: 800; }
h2 { font-size: clamp(1.9rem, 3.2vw, 2.4rem); font-weight: 800; }
h3 { font-size: clamp(1.3rem, 2vw, 1.6rem); font-weight: 700; }
h4 { font-size: 1.1rem; font-weight: 700; }
p { max-width: 68ch; }

a { color: var(--snrr-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

strong { font-weight: 700; }

/* ---- Accessibility -------------------------------------------------- */
:focus-visible {
  outline: 3px solid var(--snrr-gold);
  outline-offset: 2px;
  border-radius: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--snrr-navy);
  color: #fff;
  padding: 0.75rem 1.25rem;
  z-index: 200;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

.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;
}

/* ---- Layout helpers ------------------------------------------------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 24px; }
.container-narrow { max-width: var(--container-narrow); }

.section { padding-block: var(--section-pad); }
.section--tint { background: var(--snrr-sky-tint); }
.section--navy { background: var(--snrr-navy); color: #fff; }
.section--navy h1, .section--navy h2, .section--navy h3 { color: #fff; }

@media (max-width: 720px) {
  :root { --section-pad: 60px; }
}

/* ---- Buttons -------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 1.02rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
  text-decoration: none;
  line-height: 1.2;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }

/* Primary CTA — gold. Use ONCE per view (per style guide). */
.btn--gold { background: var(--snrr-gold); color: var(--snrr-gold-text); box-shadow: var(--shadow-md); }
.btn--gold:hover { background: #ffc94f; box-shadow: var(--shadow-lg); }

.btn--blue { background: var(--snrr-blue); color: #fff; }
.btn--blue:hover { background: #0074bd; }

/* Outline secondary — for use on navy */
.btn--outline { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.6); }
.btn--outline:hover { border-color: #fff; background: rgba(255, 255, 255, 0.1); }

/* Outline on light */
.btn--ghost { background: transparent; color: var(--snrr-blue); border-color: var(--snrr-sky); }
.btn--ghost:hover { border-color: var(--snrr-blue); background: var(--snrr-sky-tint); }

/* ---- Status pill (wet weather) ------------------------------------- */
.pill {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.95rem; border-radius: var(--radius-pill);
  font-weight: 700; font-size: 0.92rem; line-height: 1;
}
.pill::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.pill--open { background: rgba(46, 125, 50, 0.14); color: var(--state-open); }
.pill--closed { background: rgba(198, 40, 40, 0.14); color: var(--state-closed); }
.pill--caution { background: rgba(183, 121, 31, 0.16); color: var(--state-caution); }

/* ---- Cards ---------------------------------------------------------- */
.card {
  background: #fff;
  border: 1px solid var(--snrr-sky);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.18s var(--ease), box-shadow 0.2s var(--ease);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

/* ---- Rendered markdown (committee pages read repo docs at build time) --- */
.doc-prose { color: var(--snrr-ink); }
.doc-prose > *:first-child { margin-top: 0; }
.doc-prose h2 { font-size: clamp(1.5rem, 2.4vw, 1.9rem); margin: 2.5rem 0 0.9rem; }
.doc-prose h3 { font-size: 1.25rem; margin: 1.9rem 0 0.6rem; }
.doc-prose p { margin-bottom: 1rem; max-width: 78ch; }
.doc-prose ul, .doc-prose ol { margin: 0 0 1.1rem 1.35rem; }
.doc-prose li { margin-bottom: 0.4rem; }
.doc-prose strong { color: var(--snrr-navy); }
.doc-prose hr { border: 0; border-top: 1px solid var(--snrr-sky); margin: 2rem 0; }
.doc-prose code {
  background: var(--snrr-sky-tint); padding: 0.12em 0.4em; border-radius: 4px;
  font-size: 0.92em; color: var(--snrr-navy);
}
.doc-prose pre {
  background: var(--snrr-navy); color: #e8f1f8; padding: 1.15rem 1.25rem;
  border-radius: var(--radius); overflow-x: auto; margin-bottom: 1.25rem;
  font-size: 0.85rem; line-height: 1.55;
}
.doc-prose pre code { background: none; color: inherit; padding: 0; }
.doc-prose table {
  width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; font-size: 0.95rem;
  display: block; overflow-x: auto;
}
.doc-prose thead { background: var(--snrr-sky-tint); }
.doc-prose th, .doc-prose td {
  border: 1px solid var(--snrr-sky); padding: 0.6rem 0.8rem; text-align: left; vertical-align: top;
}
.doc-prose th { color: var(--snrr-navy); font-weight: 700; white-space: nowrap; }

/* ---- Utilities ------------------------------------------------------ */
.eyebrow {
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700;
  font-size: 0.82rem; color: var(--snrr-blue);
}
.section--navy .eyebrow { color: var(--snrr-gold); }
.text-center { text-align: center; }
.grid { display: grid; gap: 1.5rem; }
