/* matchday-tables — the site's ENTIRE presentation layer. No client JS anywhere;
   every page links exactly this one stylesheet (<link rel="stylesheet"
   href="/static/site.css">). Served immutable: src/lib/publish.ts gives any
   "static/" key `public, max-age=31536000, immutable`, and src/build/static-assets.ts
   content-stamps it at build (a CSS edit changes the published bytes → its sha in
   the manifest → exactly one re-upload, then steady-state byte-identical, so the
   idempotent build never re-ships an unchanged stylesheet).

   Design constraints (design §1 / cineplex parity): minimal, fast, readable,
   dark-mode-first via CSS variables only — never hardcode a color in a template.
   The class vocabulary below is the contract the page templates render against:
     layout/footer : .site-header .site-nav .site-footer .skip-link
     answer-first  : .answer .freshness .stale-banner .no-availability .book
     citation atom : table.availability-table .slot-lists .unbookable .quick-answers
     fixtures      : table.fixtures .match-context
   Builders B–E must reuse these hooks rather than introduce ad-hoc class names. */

:root {
  /* Light palette (the dark overrides live in the media query below). */
  --bg: #ffffff;
  --fg: #1a1d21;
  --muted: #5a6068;
  --link: #0b57d0;
  --link-visited: #6b3fa0;
  --border: #d6dade;
  --surface: #f4f6f8;
  --surface-2: #eceff2;
  --warn-bg: #fff3cd;
  --warn-fg: #664d03;
  --ok-fg: #146c2e;

  /* Tokens (kept tiny; tables + prose only). */
  --measure: 46rem;
  --radius: 6px;
  --gap: 1rem;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;

  /* Let the UA paint form controls / scrollbars for the active scheme. */
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --fg: #e6e8eb;
    --muted: #9aa1a9;
    --link: #8ab4f8;
    --link-visited: #c8a6ff;
    --border: #3a3f45;
    --surface: #1d2025;
    --surface-2: #23272d;
    --warn-bg: #4a3a00;
    --warn-fg: #ffe08a;
    --ok-fg: #7fd491;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0 auto;
  padding: 0 var(--gap) 2.5rem;
  max-width: var(--measure);
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

/* ---- Links ---------------------------------------------------------------- */

a {
  color: var(--link);
  text-underline-offset: 0.15em;
}

a:visited {
  color: var(--link-visited);
}

a:hover,
a:focus {
  text-decoration-thickness: 2px;
}

/* Visible keyboard focus everywhere (a11y; the site is link/table only). */
:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Skip-to-content affordance for the (JS-free) header nav. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
}

.skip-link:focus {
  position: static;
  display: inline-block;
  padding: 0.4rem 0.6rem;
}

/* ---- Headings ------------------------------------------------------------- */

h1 {
  font-size: 1.5rem;
  line-height: 1.25;
  margin: 1.2rem 0 0.6rem;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.18rem;
  margin: 1.7rem 0 0.5rem;
  padding-bottom: 0.2rem;
  border-bottom: 1px solid var(--border);
}

h3 {
  font-size: 1.02rem;
  margin: 1.1rem 0 0.35rem;
}

p {
  margin: 0.6rem 0;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 1.6rem 0;
}

/* ---- Header / nav (crawl-mesh root) --------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--border);
  padding: 0.7rem 0;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

.site-header a,
.site-nav a {
  text-decoration: none;
  font-weight: 500;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.6rem;
  align-items: baseline;
}

/* ---- Answer-first prose (the snippet an assistant lifts) ------------------ */

.answer {
  font-size: 1.08rem;
  line-height: 1.5;
  margin: 0.8rem 0 1rem;
}

/* Freshness + staleness callouts: the honest "as of" / point-in-time banner. */
.freshness,
.stale-banner {
  background: var(--warn-bg);
  color: var(--warn-fg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.8rem;
  margin: 0.8rem 0;
}

.freshness a,
.stale-banner a {
  color: inherit;
}

/* Honest empty / "no tables yet" state — muted, never alarming. */
.no-availability {
  color: var(--muted);
}

.book {
  margin: 1rem 0;
}

/* ---- Tables (shared: fixtures + availability) ----------------------------- */

table {
  border-collapse: collapse;
  width: 100%;
  margin: 0.7rem 0 1.1rem;
  font-variant-numeric: tabular-nums;
}

caption {
  caption-side: top;
  text-align: left;
  font-size: 0.85rem;
  color: var(--muted);
  padding-bottom: 0.3rem;
}

th,
td {
  border: 1px solid var(--border);
  padding: 0.35rem 0.6rem;
  text-align: left;
  vertical-align: top;
}

thead th,
tbody th[scope="row"] {
  background: var(--surface);
  white-space: nowrap;
}

tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--surface) 45%, transparent);
}

/* The citation atom's party-size × slot-count grid: numeric columns right-align. */
.availability-table td:not(:first-child),
.availability-table th:not(:first-child) {
  text-align: right;
}

/* ---- Lists ---------------------------------------------------------------- */

ul,
ol {
  padding-left: 1.4rem;
  margin: 0.5rem 0;
}

li {
  margin: 0.15rem 0;
}

/* Per-party-size bookable-time lists + precomputed quick answers + fixtures:
   flatten the marker so the values read as data, not bullets. */
.slot-lists,
.quick-answers,
.match-context {
  list-style: none;
  padding-left: 0;
}

.slot-lists > li,
.quick-answers > li {
  font-variant-numeric: tabular-nums;
  margin: 0.3rem 0;
}

/* Shown-but-unbookable times — nested, de-emphasized, but NEVER hidden. */
.slot-lists .unbookable {
  list-style: none;
  padding-left: 0.9rem;
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

/* ---- Footer (mandatory disclaimer + data-source note) --------------------- */

.site-footer {
  margin-top: 2.6rem;
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.site-footer p {
  margin: 0.4rem 0;
}

.site-footer a {
  color: inherit;
}

/* ---- Reduced motion: nothing animates here, but honor the signal anyway. -- */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
