/* ==========================================================================
   Stratford Sharks ASC — shared site styles
   Based on the Splashvember volunteers page. Light + dark themes.
   Every page links this file; page-group extras live in assets/*.css
   ========================================================================== */

/* Fonts are loaded by a <link> in each page head (Barlow + Barlow Condensed). */

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

/* ── TOKENS: LIGHT (default) ─────────────────────────────────────────────── */
:root {
  color-scheme: light;

  /* brand — same in both themes */
  --navy: #0a1628;
  --navy-mid: #1e3058;
  --gold: #e8c84a;
  --gold-dark: #c9a830;
  --on-gold: #0a1628;

  /* surfaces */
  --bg: #f0f4f8;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #eef2f7;
  --row-hover: #f7f9fc;

  /* text */
  --text: #1a2a3a;
  --text-2: #3d4f66;
  --muted: #6b7f99;

  /* lines */
  --border: #e6eaf0;
  --border-strong: #d3dbe5;

  --shadow: 0 2px 16px rgba(10,22,40,0.10);
  --shadow-hover: 0 6px 24px rgba(10,22,40,0.16);

  /* header + card header (stay navy in both themes) */
  --head-bg: #0a1628;
  --head-text: #ffffff;
  --head-muted: #8fa3c0;
  --card-head-bg: #0a1628;
  --card-head-text: #e8c84a;

  /* interactive */
  --accent: #1a6fa8;
  --accent-soft: #e8f4fd;
  --focus: #1a6fa8;

  /* status / categories (text colour + soft background) */
  --blue: #1a6fa8;    --blue-soft: #e8f4fd;
  --green: #2a7a35;   --green-soft: #edf7ee;
  --red: #c0392b;     --red-soft: #fdecea;
  --orange: #b85c00;  --orange-soft: #fff3e0;
  --amber: #b26a00;   --amber-soft: #fff8e1;
  --purple: #6b3bbf;  --purple-soft: #f3eefe;
  --pink: #880e4f;    --pink-soft: #fce4ec;
  --teal: #00796b;    --teal-soft: #e0f2f1;

  /* medals */
  --medal-gold: #a8890f;   --medal-gold-soft: #fbf3d3;
  --medal-silver: #5f7590; --medal-silver-soft: #e9eef4;
  --medal-bronze: #a0673a; --medal-bronze-soft: #f5e6da;

  --radius: 12px;
  --radius-sm: 6px;
  --maxw: 960px;
  --font: 'Barlow', system-ui, sans-serif;
  --font-cond: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --font-mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;
}

/* ── TOKENS: DARK ────────────────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b1424; --surface: #13213a; --surface-2: #182a47; --surface-3: #1e3253; --row-hover: #1a2d4c;
    --text: #e6edf6; --text-2: #b8c6d9; --muted: #8fa3c0;
    --border: #22365a; --border-strong: #2d4570;
    --shadow: 0 2px 16px rgba(0,0,0,0.35); --shadow-hover: 0 6px 24px rgba(0,0,0,0.5);
    --head-bg: #060e1b; --card-head-bg: #0a1628;
    --accent: #5fb3ea; --accent-soft: rgba(95,179,234,0.14); --focus: #5fb3ea;
    --blue: #6cbcf0;   --blue-soft: rgba(108,188,240,0.15);
    --green: #72d07e;  --green-soft: rgba(114,208,126,0.15);
    --red: #ff8a80;    --red-soft: rgba(255,138,128,0.15);
    --orange: #ffab5e; --orange-soft: rgba(255,171,94,0.15);
    --amber: #ffcc4d;  --amber-soft: rgba(255,204,77,0.15);
    --purple: #b99cff; --purple-soft: rgba(185,156,255,0.16);
    --pink: #f48fb1;   --pink-soft: rgba(244,143,177,0.15);
    --teal: #4fd1c0;   --teal-soft: rgba(79,209,192,0.15);
    --medal-gold: #e8c84a;   --medal-gold-soft: rgba(232,200,74,0.16);
    --medal-silver: #b9c6d6; --medal-silver-soft: rgba(185,198,214,0.14);
    --medal-bronze: #d9915a; --medal-bronze-soft: rgba(217,145,90,0.16);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1424; --surface: #13213a; --surface-2: #182a47; --surface-3: #1e3253; --row-hover: #1a2d4c;
  --text: #e6edf6; --text-2: #b8c6d9; --muted: #8fa3c0;
  --border: #22365a; --border-strong: #2d4570;
  --shadow: 0 2px 16px rgba(0,0,0,0.35); --shadow-hover: 0 6px 24px rgba(0,0,0,0.5);
  --head-bg: #060e1b; --card-head-bg: #0a1628;
  --accent: #5fb3ea; --accent-soft: rgba(95,179,234,0.14); --focus: #5fb3ea;
  --blue: #6cbcf0;   --blue-soft: rgba(108,188,240,0.15);
  --green: #72d07e;  --green-soft: rgba(114,208,126,0.15);
  --red: #ff8a80;    --red-soft: rgba(255,138,128,0.15);
  --orange: #ffab5e; --orange-soft: rgba(255,171,94,0.15);
  --amber: #ffcc4d;  --amber-soft: rgba(255,204,77,0.15);
  --purple: #b99cff; --purple-soft: rgba(185,156,255,0.16);
  --pink: #f48fb1;   --pink-soft: rgba(244,143,177,0.15);
  --teal: #4fd1c0;   --teal-soft: rgba(79,209,192,0.15);
  --medal-gold: #e8c84a;   --medal-gold-soft: rgba(232,200,74,0.16);
  --medal-silver: #b9c6d6; --medal-silver-soft: rgba(185,198,214,0.14);
  --medal-bronze: #d9915a; --medal-bronze-soft: rgba(217,145,90,0.16);
}

/* ── BASE ────────────────────────────────────────────────────────────────── */
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.45;
  transition: background-color .2s, color .2s;
}
a { color: var(--accent); }
img, svg { max-width: 100%; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.mono, .time { font-variant-numeric: tabular-nums; }

/* ── HEADER ──────────────────────────────────────────────────────────────── */
.header { background: var(--head-bg); position: relative; overflow: hidden; }
.header::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(-45deg, transparent, transparent 18px,
    rgba(255,255,255,0.02) 18px, rgba(255,255,255,0.02) 36px);
}
.header-inner {
  position: relative; max-width: var(--maxw); margin: 0 auto;
  padding: 2rem 1.5rem 1.75rem;
  display: flex; align-items: center; gap: 1.25rem;
}
.header-logo { flex-shrink: 0; display: block; line-height: 0; }
.header-logo img { width: 64px; height: 64px; filter: drop-shadow(0 2px 8px rgba(232,200,74,0.3)); }
.header-text { flex: 1; min-width: 0; }
.header-text .club {
  font-family: var(--font-cond); font-size: 13px; font-weight: 600;
  letter-spacing: 0.15em; text-transform: uppercase; color: var(--gold); margin-bottom: 4px;
}
.header-text .club a { color: inherit; text-decoration: none; }
.header-text .club a:hover { text-decoration: underline; }
.header-text h1 {
  font-family: var(--font-cond); font-size: clamp(28px, 5vw, 42px); font-weight: 800;
  color: var(--head-text); line-height: 1.05; text-transform: uppercase; letter-spacing: 0.02em;
}
.header-text .sub {
  font-size: 14px; color: var(--head-muted); margin-top: 6px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; align-self: flex-start; }
.header-bar { height: 4px; background: var(--gold); }

.nav-link, .theme-toggle {
  font-family: var(--font-cond); font-size: 13px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--head-text); background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14); border-radius: 999px;
  padding: 6px 12px; text-decoration: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; line-height: 1;
  transition: background .15s, border-color .15s;
}
.nav-link:hover, .theme-toggle:hover { background: rgba(255,255,255,0.16); border-color: rgba(232,200,74,0.6); }
.theme-toggle { width: 34px; height: 34px; padding: 0; justify-content: center; }
.theme-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

/* ── SUB-NAV (tabs under the header) ─────────────────────────────────────── */
.subnav { background: var(--surface); border-bottom: 1px solid var(--border); }
.subnav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem;
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
}
.subnav-inner::-webkit-scrollbar { display: none; }
.subnav a {
  font-family: var(--font-cond); font-size: 14px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted); text-decoration: none; white-space: nowrap;
  padding: 12px 12px 10px; border-bottom: 3px solid transparent;
}
.subnav a:hover { color: var(--text); }
.subnav a.active, .subnav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--gold); }

/* ── BADGES ──────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-cond); font-size: 12px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  border-radius: 4px; padding: 3px 10px; white-space: nowrap; line-height: 1.3;
  background: var(--surface-3); color: var(--text-2);
}
.badge-gold   { background: var(--gold); color: var(--on-gold); }
.badge-navy   { background: var(--navy); color: var(--gold); }
.badge-blue,   .badge-tk  { background: var(--blue-soft);   color: var(--blue); }
.badge-green,  .badge-j1, .badge-rec { background: var(--green-soft); color: var(--green); }
.badge-purple, .badge-j2  { background: var(--purple-soft); color: var(--purple); }
.badge-orange, .badge-j2s { background: var(--orange-soft); color: var(--orange); }
.badge-amber,  .badge-ru, .badge-medals { background: var(--amber-soft); color: var(--amber); }
.badge-pink,   .badge-ann { background: var(--pink-soft);   color: var(--pink); }
.badge-red    { background: var(--red-soft);    color: var(--red); }
.badge-teal   { background: var(--teal-soft);   color: var(--teal); }
.badge-outline { background: transparent; border: 1px solid var(--border-strong); color: var(--muted); }
.header .badge-outline { border-color: rgba(255,255,255,0.25); color: var(--head-muted); }

/* ── SECTION HEADINGS ────────────────────────────────────────────────────── */
.section-heading {
  max-width: var(--maxw); margin: 2rem auto 0.75rem; padding: 0 1.5rem;
  font-family: var(--font-cond); font-size: 12px; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; gap: 10px;
}
.section-heading::after { content: ''; flex: 1; height: 1px; background: var(--border-strong); }
.content .section-heading, .wrap .section-heading { padding: 0; margin: 1.5rem 0 0.5rem; grid-column: 1 / -1; }

/* ── LAYOUT ──────────────────────────────────────────────────────────────── */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0.5rem 1.5rem 3rem; }
.wrap-wide { max-width: 1200px; }
.content {
  max-width: var(--maxw); margin: 0 auto; padding: 0.5rem 1.5rem 3rem;
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; align-items: start;
}
.stack { display: flex; flex-direction: column; gap: 1.25rem; }
.col-stack { display: flex; flex-direction: column; gap: 1.25rem; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }

/* ── CARDS ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); color: var(--text);
}
.card.full-width { grid-column: 1 / -1; }
.card-header {
  background: var(--card-head-bg); padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border-bottom: 2px solid var(--gold);
}
.card-header-title {
  font-family: var(--font-cond); font-size: 13px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--card-head-text);
}
.card-header .meta { font-size: 12px; color: var(--head-muted); }
.card-body { padding: 14px 16px; }
.card-body > * + * { margin-top: 0.6rem; }
.card-body p, .card-body li { font-size: 14px; color: var(--text-2); }
.card-body ul, .card-body ol { padding-left: 1.2rem; }
.card-body h3 {
  font-family: var(--font-cond); font-size: 15px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text); margin-top: 1rem;
}
.card-body h3:first-child { margin-top: 0; }

/* list rows */
.row, .vol-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; border-bottom: 1px solid var(--border); transition: background .15s;
}
.row:last-child, .vol-row:last-child { border-bottom: none; }
.row:hover, .vol-row:hover { background: var(--row-hover); }
.vol-num, .row-num {
  font-family: var(--font-cond); font-size: 12px; font-weight: 600; color: var(--muted);
  width: 20px; flex-shrink: 0; text-align: right;
}
.vol-name, .row-main { flex: 1; min-width: 0; font-size: 14px; font-weight: 500; color: var(--text); }
.se-num, .row-sub { color: var(--muted); font-weight: 400; font-size: 12px; }

/* link cards (home + hubs) */
.link-card {
  display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--text);
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px; border-left: 4px solid var(--card-accent, var(--gold));
  transition: transform .15s, box-shadow .15s;
}
.link-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.link-card .lc-text { flex: 1; min-width: 0; }
.link-card .lc-label {
  font-family: var(--font-cond); font-size: 11px; font-weight: 700; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 2px;
}
.link-card .lc-title {
  font-family: var(--font-cond); font-size: 22px; font-weight: 800; letter-spacing: 0.02em;
  text-transform: uppercase; line-height: 1.05; color: var(--text);
}
.link-card .lc-desc { font-size: 13px; color: var(--muted); margin-top: 4px; }
.link-card .lc-arrow { font-size: 18px; color: var(--muted); transition: transform .15s, color .15s; }
.link-card:hover .lc-arrow { transform: translateX(3px); color: var(--text); }

/* key / legend */
.key {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; grid-column: 1 / -1;
}
.key-label {
  font-family: var(--font-cond); font-size: 11px; font-weight: 700; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--muted); margin-right: 4px;
}

/* stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; }
.stat { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.stat-label {
  font-family: var(--font-cond); font-size: 11px; font-weight: 700; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--muted);
}
.stat-value {
  font-family: var(--font-cond); font-size: 32px; font-weight: 800; line-height: 1.1; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.stat-sub { font-size: 12px; color: var(--muted); }

/* callouts */
.note {
  background: var(--surface); border-left: 4px solid var(--gold); border-radius: var(--radius-sm);
  padding: 12px 16px; font-size: 14px; color: var(--text-2); box-shadow: var(--shadow);
}
.note-blue { border-left-color: var(--blue); }
.note-red { border-left-color: var(--red); }
.note-green { border-left-color: var(--green); }
.note strong { color: var(--text); }

/* ── TABLES ──────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  font-family: var(--font-cond); font-size: 12px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); text-align: left;
  padding: 9px 12px; border-bottom: 2px solid var(--border-strong); background: var(--surface-2);
  white-space: nowrap;
}
.table td { padding: 9px 12px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
.table tbody tr:hover td { background: var(--row-hover); }
.table tbody tr:last-child td { border-bottom: none; }
.table .num, .table td.time, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ── CONTROLS ────────────────────────────────────────────────────────────── */
.btn, .pill {
  font-family: var(--font-cond); font-size: 13px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; cursor: pointer; border-radius: 999px; padding: 7px 14px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2);
  transition: background .15s, color .15s, border-color .15s; line-height: 1.1;
}
.btn:hover, .pill:hover { border-color: var(--gold-dark); color: var(--text); }
.pill.active, .pill[aria-pressed="true"], .pill[aria-selected="true"], .btn-primary {
  background: var(--navy); color: var(--gold); border-color: var(--navy);
}
:root[data-theme="dark"] .pill.active, :root[data-theme="dark"] .pill[aria-pressed="true"],
:root[data-theme="dark"] .pill[aria-selected="true"], :root[data-theme="dark"] .btn-primary {
  background: var(--gold); color: var(--on-gold); border-color: var(--gold);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .pill.active, :root:not([data-theme="light"]) .pill[aria-pressed="true"],
  :root:not([data-theme="light"]) .pill[aria-selected="true"], :root:not([data-theme="light"]) .btn-primary {
    background: var(--gold); color: var(--on-gold); border-color: var(--gold);
  }
}
.btn-gold { background: var(--gold); color: var(--on-gold); border-color: var(--gold); }
.btn-gold:hover { background: var(--gold-dark); border-color: var(--gold-dark); color: var(--on-gold); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }

input[type="text"], input[type="search"], input[type="number"], select, textarea {
  font-family: var(--font); font-size: 14px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 8px 10px;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
label { color: var(--text-2); }

/* ── FOOTER ──────────────────────────────────────────────────────────────── */
.footer {
  text-align: center; padding: 1.5rem; font-size: 12px; color: var(--muted); letter-spacing: 0.05em;
  border-top: 1px solid var(--border-strong); max-width: var(--maxw); margin: 0 auto;
}
.footer a { color: var(--muted); }

/* ── UTILITIES ───────────────────────────────────────────────────────────── */
.muted { color: var(--muted); }
.hidden { display: none !important; }
.cond { font-family: var(--font-cond); }

/* ── RESPONSIVE ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .content { grid-template-columns: 1fr; }
  .card.full-width { grid-column: 1; }
  .header-inner { flex-wrap: wrap; padding: 1.5rem 1rem 1.25rem; gap: 0.9rem; }
  .header-logo img { width: 48px; height: 48px; }
  .header-actions { order: -1; width: 100%; justify-content: flex-end; margin-bottom: -0.5rem; }
  .wrap, .content, .section-heading, .subnav-inner { padding-left: 1rem; padding-right: 1rem; }
  .table th, .table td { padding: 8px 8px; }
}

@media print {
  .header-actions, .theme-toggle, .subnav { display: none !important; }
  body { background: #fff; }
}
