/* =========================================================================
   base.css — design tokens, reset and typography
   -------------------------------------------------------------------------
   Everything visual starts here. Change a value in :root and it changes
   everywhere on the site. Nothing below :root hard-codes a colour or size.
   ========================================================================= */

:root {
  /* ---- Brand colours -------------------------------------------------- */
  --club-blue: #0b3d5c;            /* always navy: hero, on-dark buttons   */
  --color-brand: #0b3d5c;          /* headings, links, brand fills         */
  --color-brand-dark: #072a41;     /* always navy: hero gradient, hovers   */
  --color-brand-light: #e6eef4;    /* tinted backgrounds                   */
  --color-on-brand: #ffffff;       /* text on a --color-brand fill         */
  --color-stripe: #dce7ef;         /* placeholder image stripes            */
  --color-accent: #1a7a4c;         /* club green: button fills             */
  --color-accent-dark: #105828;    /* the green from the club badge        */
  --color-accent-text: #1a7a4c;    /* green text, hovers, focus rings      */
  --color-accent-light: #e3f1e8;   /* tinted backgrounds                   */
  --color-on-accent-light: #105828;/* text on --color-accent-light         */

  /* ---- Neutrals ------------------------------------------------------- */
  --color-ink: #16232e;            /* body text                            */
  --color-ink-soft: #566a7b;       /* secondary text, captions             */
  --color-surface: #ffffff;        /* page background                      */
  --color-surface-raised: #ffffff; /* cards, inputs, dropdowns              */
  --color-surface-alt: #f3f6f9;    /* alternating section background       */
  --color-border: #dde5ec;
  --color-footer: #072a41;
  --color-header-bg: rgba(255, 255, 255, 0.92);
  --color-focus-glow: rgba(11, 61, 92, 0.12);

  /* ---- Feedback ------------------------------------------------------- */
  --color-success: #17692f;
  --color-error: #b3261e;

  /* ---- Type ----------------------------------------------------------- */
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  --font-heading: var(--font-body);

  /* Fluid sizes: min on a phone, max on a desktop, smooth in between. */
  --text-xs: 0.8125rem;
  --text-sm: 0.9375rem;
  --text-base: 1.0625rem;
  --text-lg: clamp(1.125rem, 1.05rem + 0.35vw, 1.3125rem);
  --text-xl: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  --text-2xl: clamp(1.75rem, 1.45rem + 1.4vw, 2.5rem);
  --text-3xl: clamp(2.125rem, 1.6rem + 2.4vw, 3.5rem);

  --leading-tight: 1.15;
  --leading-normal: 1.6;

  /* ---- Spacing scale (multiples of 4px) -------------------------------- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;

  /* ---- Shape and depth ------------------------------------------------- */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(16, 35, 46, 0.06), 0 1px 3px rgba(16, 35, 46, 0.08);
  --shadow-md: 0 4px 12px rgba(16, 35, 46, 0.08), 0 2px 4px rgba(16, 35, 46, 0.04);
  --shadow-lg: 0 12px 32px rgba(16, 35, 46, 0.12);

  /* ---- Layout ---------------------------------------------------------- */
  --container-width: 1160px;
  --container-narrow: 720px;
  --measure: 46rem;                /* reading width: text, callouts, quotes */
  --gutter: var(--space-4);
  --header-height: 68px;

  --transition: 160ms ease;
}

@media (min-width: 640px) {
  :root {
    --gutter: var(--space-5);
  }
}

/* Dark mode: navy and white swap places. The script at the top of base.html sets
   data-theme before the page paints. Buttons keep their green, because white text
   on it passes either way. */
:root[data-theme="dark"] {
  color-scheme: dark;

  --color-brand: #ffffff;
  --color-brand-light: #164c70;
  --color-on-brand: #072a41;
  --color-stripe: #1c577d;
  --color-accent-text: #6fdca6;
  --color-accent-light: #0f4a33;
  --color-on-accent-light: #b5f0d0;

  --color-ink: #e8eff5;
  --color-ink-soft: #b7c9d6;
  --color-surface: #072a41;
  --color-surface-raised: #0b3d5c;
  --color-surface-alt: #0a3450;
  --color-border: #2f5b78;
  --color-footer: #051e2f;
  --color-header-bg: rgba(7, 42, 65, 0.92);
  --color-focus-glow: rgba(255, 255, 255, 0.18);

  --color-success: #7fe0a0;
  --color-error: #ff9d94;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35), 0 2px 4px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45);
}

/* =========================================================================
   Reset — just enough to make browsers agree with each other
   ========================================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + var(--space-4));
}

body {
  margin: 0;
  background: var(--color-surface);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
}

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

/* =========================================================================
   Typography
   ========================================================================= */

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  line-height: var(--leading-tight);
  color: var(--color-brand);
  margin: 0 0 var(--space-4);
  text-wrap: balance;
}

h1 { font-size: var(--text-3xl); letter-spacing: -0.02em; }
h2 { font-size: var(--text-2xl); letter-spacing: -0.01em; }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

p,
ul,
ol {
  margin: 0 0 var(--space-4);
}

ul,
ol {
  padding-left: var(--space-5);
}

li + li {
  margin-top: var(--space-2);
}

a {
  color: var(--color-brand);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-accent-text);
}

strong { font-weight: 650; }

blockquote {
  margin: 0;
}

hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: var(--space-6) 0;
}

/* =========================================================================
   Accessibility helpers
   ========================================================================= */

:focus-visible {
  outline: 3px solid var(--color-accent-text);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Green doesn't stand out enough against the dark blue, so focus goes white there. */
.hero :focus-visible,
.site-footer :focus-visible {
  outline-color: #fff;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: var(--space-4);
  z-index: 200;
  padding: var(--space-3) var(--space-4);
  background: var(--color-accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transform: translateY(-200%);
  transition: transform var(--transition);
}

.skip-link:focus {
  transform: translateY(0);
  color: #fff;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
