/* APEL — released Design A, matchday-programme design language.
   Navy ground, hairline rules instead of cards, gold as the single accent, one paper band (honours) in the crest's royal blue.
   No web fonts. GA4 loads only after consent.

   Type system. Three voices, used deliberately:
   - display: condensed capitals, reserved for numerals, page titles and the club name;
   - label:   the system text face in tracked capitals, for team names, rows and navigation;
   - text:    sentence-case reading text.
   The display stack degrades to a normal-width face on phones without a condensed font, so every size below is chosen
   to hold at that wider fallback. Sizes are tokens; components pick a role, they do not invent a size. */
:root {
  color-scheme: dark;
  --navy: #08182d;
  --navy-deep: #051020;
  --navy-raise: #0e2542;
  --ink: #f4f1ea;
  --soft: #cfd6e2;
  --muted: #a5b3c8;
  --gold: #e2b25a;
  --royal: #1d17a6;
  --paper: #efe9dc;
  --paper-ink: #0a1a33;
  --paper-muted: #4b5873;
  --line: #f4f1ea24;
  --line-strong: #f4f1ea5c;
  --accent: var(--gold);
  --rule: var(--line);
  --page: 1200px;
  --gutter: max(20px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  --edge: max(var(--gutter), calc((100% - var(--page)) / 2));
  --display: Bahnschrift, "Roboto Condensed", "sans-serif-condensed", "Helvetica Neue", "Arial Narrow", "Segoe UI", system-ui, sans-serif;
  --text: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  /* Type scale (phone). */
  --t-micro: 12px;     /* section labels, table heads, match-day tags */
  --t-small: 13px;     /* dates, venues, captions */
  --t-body: 14.5px;    /* team names in lists, table rows, descriptions */
  --t-strong: 16px;    /* row titles, primary team names */
  --t-score: 24px;     /* score or kick-off inside a list row */
  --t-score-lg: 32px;  /* home-page last result */
  --t-kickoff: 46px;   /* home-page next-match time */
  --t-h2: clamp(21px, 6vw, 25px);
  --t-h1: clamp(28px, 9.8vw, 42px);
  --t-hero: clamp(49px, 15vw, 64px);
  font-family: var(--text);
  color: var(--ink);
  background: var(--navy);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 0; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; font-size: 16px; line-height: 1.5; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
a:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
h1, h2, p, ol, ul, dl, dd { margin: 0; }
ol, ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
.hub { flex: 1; min-width: 0; }
.masthead, footer, .home > *, .inner { padding-inline: var(--edge); }

/* Display voice: condensed capitals. */
h1, .match-kickoff, .result-score, .season-score, .scorer-goals, .scorer-rank, .home-ground-title, .history-entry-title,
.achievement-title, .championship-distribution dt, .achievement-years, .masthead-name, .masthead-nav, .season-selector,
.season-summary, .league-position, .league-table td:last-child, .archive-achievement, .history-milestone h2, .footer-name, .footer-nav {
  font-family: var(--display);
  font-stretch: 75%;
  font-weight: 700;
  font-variant-numeric: tabular-nums lining-nums;
  text-transform: uppercase;
}
/* Label voice: the text face in tracked capitals, lighter than the display voice. */
.result-team, .season-team, .match-navigation-link, .football-crossnav a, .link-title {
  font-family: var(--text);
  font-weight: 650;
  letter-spacing: .04em;
  text-transform: uppercase;
}
/* Section label: small tracked capitals leading a hairline. */
.match-section h2, .links h2, .home-ground-card h2, .season-scorers h2, .archive-stage h2 {
  display: flex; align-items: center; gap: 14px; color: var(--gold);
  font-family: var(--text); font-size: var(--t-micro); font-weight: 650; letter-spacing: .16em; line-height: 1.5; text-transform: uppercase;
}
.match-section h2::after, .links h2::after, .home-ground-card h2::after, .archive-stage h2::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Shared masthead across all pages. */
.masthead { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; padding-top: env(safe-area-inset-top, 0px); background: var(--navy); border-bottom: 1px solid var(--line); }
.masthead-brand { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.masthead-brand img { width: 38px; height: 38px; }
.masthead-name { display: none; font-size: 19px; letter-spacing: .02em; }
.masthead-nav { display: flex; align-self: stretch; gap: 18px; font-size: 15px; letter-spacing: .06em; }
.masthead-nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--soft); border-block: 2px solid transparent; transition: color 150ms ease; }
.masthead-nav a[aria-current] { color: var(--ink); border-bottom-color: var(--gold); }
@media (hover: hover) { .masthead-nav a:hover { color: var(--gold); } }

/* Home hero: a faint street map of Lagkadas (real OpenStreetMap roads, static SVG) runs behind the whole hero, strongest around the crest and fading out behind the title. */
.hero { --crest: 92px; position: relative; overflow: hidden; padding-block: 28px 32px; border-bottom: 1px solid var(--line); }
.hero::before { --map: clamp(900px, 175vw, 3000px); content: ""; position: absolute; pointer-events: none; top: calc(24px + var(--crest) / 2 - var(--map) / 2); right: calc(var(--edge) + var(--crest) / 2 - var(--map) / 2); width: var(--map); height: var(--map); background: url("/assets/lagkadas-roads.svg") center / 100% 100% no-repeat; --fade: radial-gradient(circle closest-side, #000 0, rgba(0, 0, 0, .92) 11%, rgba(0, 0, 0, .44) 30%, rgba(0, 0, 0, .17) 58%, transparent 100%); -webkit-mask-image: var(--fade); mask-image: var(--fade); }
.crest-frame { position: absolute; z-index: 1; top: 24px; right: var(--edge); width: var(--crest); }
.hero > :not(.crest-frame) { position: relative; z-index: 2; }
.eyebrow { max-width: calc(100% - var(--crest) - 16px); color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .16em; line-height: 1.6; }
.hero h1 { width: min-content; margin-top: 22px; font-size: var(--t-hero); line-height: .9; letter-spacing: -.01em; }
.brand-subtitle { margin-top: 14px; color: var(--gold); font-family: var(--serif); font-size: 17px; font-style: italic; line-height: 1.35; }

/* Home matchday: the next match leads; the last result is a quieter second line. */
.match-section { display: grid; gap: 30px; padding-block: 28px 24px; min-width: 0; }
.match-next, .match-last { min-width: 0; }
.match-card, .match-result { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "date date" "home num" "away num" "meta meta"; align-items: center; column-gap: 16px; row-gap: 3px; min-width: 0; padding-top: 14px; overflow-wrap: anywhere; }
.result-team { font-size: var(--t-strong); font-weight: 500; line-height: 1.25; color: var(--soft); text-wrap: balance; }
.result-team-apel { color: var(--ink); font-weight: 700; }
.result-team:first-child { grid-area: home; align-self: end; }
.result-team:nth-child(3) { grid-area: away; align-self: start; }
.match-kickoff, .result-score { grid-area: num; white-space: nowrap; line-height: .95; letter-spacing: 0; transition: color 150ms ease; }
.match-kickoff { color: var(--gold); font-size: var(--t-kickoff); }
.result-score { font-size: var(--t-score-lg); }
.match-date { grid-area: date; margin-bottom: 6px; color: var(--ink); font-size: var(--t-small); font-weight: 650; letter-spacing: .1em; line-height: 1.5; text-transform: uppercase; }
.match-meta, .match-result .match-round { grid-area: meta; margin-top: 8px; color: var(--muted); font-size: var(--t-small); letter-spacing: .05em; line-height: 1.5; }
.match-venue, .match-last-date { text-transform: uppercase; }
.match-last .result-team { font-size: var(--t-body); }
@media (hover: hover) { .match-card:hover .match-kickoff { color: var(--ink); } .match-result:hover .result-score { color: var(--gold); } }

/* Index rows: tracked capitals on a hairline, gold arrow at the edge. */
.match-navigation { display: grid; padding-block: 0 40px; }
.match-navigation-link, .football-crossnav a { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; padding-block: 10px; border-top: 1px solid var(--line-strong); font-size: var(--t-body); letter-spacing: .07em; line-height: 1.25; transition: color 150ms ease; }
.match-navigation-link::after { content: "→"; color: var(--gold); font-weight: 400; letter-spacing: 0; }
.match-navigation-link:last-child, .football-crossnav a { border-bottom: 1px solid var(--line-strong); }
@media (hover: hover) { .match-navigation-link:hover, .football-crossnav a:hover { color: var(--gold); } }

/* Club: social index and home ground */
.club { display: grid; gap: 40px; padding-block: 0 48px; }
.links { min-width: 0; scroll-margin-top: 84px; }
.links ul { margin-top: 4px; }
.links li { border-bottom: 1px solid var(--line); }
.link-card { display: grid; grid-template-columns: 22px minmax(0, 1fr) 16px; align-items: center; gap: 16px; min-height: 62px; padding-block: 10px; }
.link-icon { display: grid; place-items: center; color: var(--gold); }
.link-icon svg { width: 20px; height: 20px; }
.link-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.link-title { font-size: var(--t-body); letter-spacing: .06em; line-height: 1.3; transition: color 150ms ease; }
.link-subtitle { color: var(--muted); font-size: var(--t-small); line-height: 1.45; overflow-wrap: anywhere; }
.chevron { display: inline-block; width: 16px; color: var(--muted); font-size: 16px; line-height: 1; text-align: center; transition: transform 150ms ease, color 150ms ease; }
@media (hover: hover) { .link-card:hover .link-title { color: var(--gold); } .link-card:hover .chevron { color: var(--gold); transform: translateX(4px); } }
.home-ground { min-width: 0; }
.home-ground-card { display: block; overflow-wrap: anywhere; }
.home-ground-title { margin-top: 16px; font-size: var(--t-h2); line-height: 1.05; }
.home-ground-location { margin-top: 8px; color: var(--muted); font-size: var(--t-body); }
.home-ground-action { display: inline-flex; align-items: center; min-height: 44px; margin-top: 4px; color: var(--gold); font-size: var(--t-body); font-weight: 600; }
@media (hover: hover) { .home-ground-card:hover .home-ground-title { color: var(--gold); } }

/* Honours deliberately keep oversized numbers. The legacy `.glass` class is an unstyled markup hook retained for tests. */
.honours { --accent: var(--royal); --rule: #0a1a3326; display: grid; gap: 40px; padding-block: 44px 36px; background: var(--paper); color: var(--paper-ink); border-top: 4px solid var(--gold); }
.achievement { min-width: 0; }
.achievement-title { display: flex; align-items: flex-end; gap: 16px; }
.achievement-count { color: var(--accent); font-size: clamp(120px, 36vw, 208px); line-height: .76; letter-spacing: -.03em; }
.achievement-label { min-width: 0; padding-bottom: 2px; font-size: var(--t-micro); letter-spacing: .16em; line-height: 1.3; }
.championship-type, .achievement-cup { display: block; margin-top: 2px; font-size: var(--t-h2); letter-spacing: .01em; line-height: 1.05; }
.championship-distribution { margin-top: 24px; border-bottom: 1px solid var(--rule); }
.championship-distribution div { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: baseline; gap: 8px; padding-block: 10px; border-top: 1px solid var(--rule); }
.championship-distribution dt { color: var(--accent); font-size: 19px; line-height: 1; }
.championship-distribution dd { min-width: 0; font-size: var(--t-strong); font-weight: 500; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.championship-separator { display: none; }
.achievement-years { margin-top: 24px; padding-block: 11px; border-block: 1px solid var(--rule); font-size: 21px; line-height: 1.3; word-spacing: .1em; }
.achievement-years a { position: relative; display: inline-block; text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 5px; transition: color 150ms ease; }
/* Extend the tap area without changing the year row's layout. */
.achievement-years a::before { content: ""; position: absolute; inset: -10px -4px; }
@media (hover: hover) { .achievement-years a:hover { color: var(--accent); } }
.history-entry { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 64px; padding-top: 20px; border-top: 2px solid var(--paper-ink); }
.history-entry-title { display: block; font-size: var(--t-h2); line-height: 1.05; transition: color 150ms ease; }
.history-entry-intro { display: block; margin-top: 6px; color: var(--paper-muted); font-family: var(--serif); font-size: 16px; font-style: italic; line-height: 1.4; }
.history-arrow { display: inline-block; flex-shrink: 0; color: var(--royal); font-size: 30px; line-height: 1; transition: transform 150ms ease; }
@media (hover: hover) { .history-entry:hover .history-entry-title { color: var(--royal); } .history-entry:hover .history-arrow { transform: translateX(6px); } }

/* Footer */
footer { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding-block: 24px calc(24px + env(safe-area-inset-bottom, 0px)); background: var(--navy-deep); border-top: 1px solid var(--line); }
.footer-crest { width: 36px; height: 36px; }
.footer-name { font-size: 15px; letter-spacing: .06em; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 0 20px; width: 100%; font-size: var(--t-small); letter-spacing: .08em; }
.footer-nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); transition: color 150ms ease; }
@media (hover: hover) { .footer-nav a:hover { color: var(--gold); } }
.map-credit { width: 100%; margin: 0; color: var(--muted); font-size: var(--t-micro); line-height: 1.5; }
.map-credit a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; transition: color 150ms ease; }
@media (hover: hover) { .map-credit a:hover { color: var(--gold); } }

/* Inner pages */
.inner { padding-block: 10px 52px; }
.page-head { margin-bottom: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line-strong); }
.history-nav { font-size: var(--t-small); color: var(--muted); }
.history-nav a { display: inline-flex; align-items: center; min-height: 44px; transition: color 150ms ease; }
@media (hover: hover) { .history-nav a:hover { color: var(--gold); } }
.page-head h1 { margin-top: 4px; font-size: var(--t-h1); line-height: 1; letter-spacing: 0; overflow-wrap: break-word; }
.page-head .brand-subtitle { margin-top: 10px; }
.football-brand .brand-subtitle { font-family: var(--text); font-size: var(--t-small); font-style: normal; font-weight: 650; letter-spacing: .14em; line-height: 1.4; }

/* History */
.history-timeline { border-top: 1px solid var(--line); }
.history-milestone { display: grid; grid-template-columns: 78px minmax(0, 1fr); align-items: baseline; gap: 14px; min-width: 0; padding-block: 15px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.history-milestone h2 { color: var(--gold); font-size: 19px; line-height: 1.2; white-space: nowrap; }
.history-milestone p { color: var(--soft); font-size: var(--t-body); line-height: 1.6; }
.history-page .achievement { margin-top: 52px; }

/* Season navigation */
.season-selector { display: flex; flex-wrap: wrap; gap: 0 22px; margin-bottom: 22px; border-bottom: 1px solid var(--line); font-size: 15px; letter-spacing: .05em; color: var(--muted); }
.season-selector span { display: none; }
.next-jump { margin: -10px 0 8px; }
.next-jump a { display: inline-flex; align-items: center; min-height: 44px; color: var(--gold); font-size: var(--t-small); font-weight: 650; letter-spacing: .08em; text-transform: uppercase; transition: color 150ms ease; }
@media (hover: hover) { .next-jump a:hover { color: var(--ink); } }
#next-match { scroll-margin-top: 88px; }
.season-selector a { display: inline-flex; align-items: center; min-height: 44px; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color 150ms ease; }
.season-selector a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--gold); }
@media (hover: hover) { .season-selector a:not([aria-current="page"]):hover { color: var(--gold); } }

/* Season summary: a stat strip */
.season-summary { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); margin-bottom: 26px; border-block: 1px solid var(--line-strong); overflow-wrap: anywhere; }
.season-summary > * { grid-column: 1 / -1; }
.season-summary-played { padding-block: 14px 10px; font-size: 30px; line-height: .95; }
.season-summary-record { display: flex; border-top: 1px solid var(--line); font-size: 0; }
.season-summary-record span { flex: 1 1 0; min-width: 0; padding: 10px 8px 10px 0; font-size: var(--t-body); font-weight: 600; letter-spacing: .04em; line-height: 1.2; }
.season-summary-record span + span { padding-left: 12px; border-left: 1px solid var(--line); }
.season-summary > .season-summary-goals { grid-column: 1; padding: 10px 8px 10px 0; border-top: 1px solid var(--line); color: var(--gold); font-size: var(--t-body); font-weight: 600; letter-spacing: .04em; line-height: 26px; }
.season-summary > .season-summary-form { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 0 10px 12px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); color: var(--muted); font-family: var(--text); font-size: var(--t-micro); font-weight: 650; letter-spacing: .14em; }
.season-form { display: flex; gap: 4px; }
.season-form li { display: grid; place-items: center; width: 24px; height: 26px; border: 1px solid var(--line-strong); color: var(--muted); font-family: var(--display); font-size: 14px; letter-spacing: 0; }
.season-form abbr { text-decoration: none; }
.season-form .season-form-win { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.season-form .season-form-draw { color: var(--ink); }

/* Scorers */
.season-scorers { margin-bottom: 30px; }
.scorers-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line-strong); }
.scorers-list li { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding-block: 8px; border-bottom: 1px solid var(--line); }
.scorer-rank { color: var(--muted); font-size: var(--t-body); }
.scorer-name { min-width: 0; font-size: var(--t-body); font-weight: 500; overflow-wrap: anywhere; }
.scorer-goals { color: var(--gold); font-size: 19px; line-height: 1; text-align: right; }
.scorers-more { position: relative; display: inline-flex; align-items: center; color: var(--muted); font-size: var(--t-micro); font-weight: 650; letter-spacing: .1em; white-space: nowrap; transition: color 150ms ease; }
.scorers-more::before { content: ""; position: absolute; inset: -13px -4px; }
@media (hover: hover) { .scorers-more:hover { color: var(--gold); } }
.scorers-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: var(--t-body); }
.scorers-goals-col { width: 60px; }
.scorers-table th, .scorers-table td { padding: 11px 6px; border-bottom: 1px solid var(--line); text-align: left; font-weight: 500; }
.scorers-table tbody th { overflow-wrap: anywhere; }
.scorers-table thead th { padding-block: 4px 10px; border-bottom-color: var(--line-strong); color: var(--muted); font-size: var(--t-micro); font-weight: 650; letter-spacing: .12em; }
.scorers-table th:last-child, .scorers-table td:last-child { text-align: right; }
.scorers-table td:first-child { color: var(--muted); font-family: var(--display); font-stretch: 75%; font-size: var(--t-body); font-weight: 700; }

/* Fixtures: a results ledger. On phones each row is the match-day tag and date, the two clubs stacked in official
   home/away order, and the score as a ruled axis on the right; the venue closes the row. */
.season-fixtures { border-top: 1px solid var(--line-strong); }
.season-fixtures li { min-width: 0; border-bottom: 1px solid var(--line); }
.archive-stage + .archive-stage { margin-top: 36px; }
.archive-stage h2 { margin-bottom: 12px; }
.archive-achievement { margin-bottom: 20px; padding-block: 11px; border-block: 1px solid var(--gold); color: var(--gold); font-size: clamp(14px, 4vw, 16px); letter-spacing: .05em; line-height: 1.3; }
.season-fixture { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "heading date" "pair pair" "venue venue"; column-gap: 12px; align-items: baseline; min-width: 0; padding: 11px 10px 12px; }
.season-fixture-heading { grid-area: heading; display: flex; flex-direction: column; gap: 1px; color: var(--muted); font-size: var(--t-micro); font-weight: 650; letter-spacing: .1em; line-height: 1.4; }
.season-date { grid-area: date; color: var(--soft); font-size: var(--t-small); line-height: 1.4; text-align: right; overflow-wrap: anywhere; }
.season-pair { grid-area: pair; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "home score" "away score"; align-items: center; row-gap: 2px; margin-block: 8px 2px; }
.season-team { grid-area: home; min-width: 0; color: var(--soft); font-size: var(--t-body); font-weight: 500; line-height: 1.25; overflow-wrap: anywhere; text-wrap: balance; }
.season-team:last-child { grid-area: away; }
.season-team-apel { color: var(--ink); font-weight: 700; }
.season-score { grid-area: score; align-self: stretch; display: grid; place-items: center; min-width: 66px; margin-left: 12px; border-left: 1px solid var(--line); font-size: var(--t-score); line-height: 1; white-space: nowrap; }
.season-won .season-score { color: var(--gold); }
.season-lost .season-score { color: var(--soft); }
.season-venue { grid-area: venue; margin-top: 4px; color: var(--muted); font-size: var(--t-small); line-height: 1.4; overflow-wrap: anywhere; }
.season-unscheduled { padding-block: 10px 11px; }
.season-unscheduled .season-pair { grid-template-columns: minmax(0, 1fr); grid-template-areas: "home" "away"; margin-top: 6px; }
.season-unscheduled .season-team { color: var(--muted); }
.season-unscheduled .season-team-apel { color: var(--soft); }
.season-scheduled .season-score { color: var(--ink); }
.season-scheduled .season-date { color: var(--ink); font-weight: 600; }
@media (max-width: 759px) { .season-fixture-heading { font-size: 11px; } .season-date { font-size: 12.5px; text-wrap: balance; } }
.season-home { box-shadow: inset 2px 0 var(--line-strong); }
.season-next { background: var(--navy-raise); box-shadow: inset 3px 0 var(--gold); }
.season-next .season-fixture-heading, .season-next .season-score { color: var(--gold); }
@media (hover: hover) { a.season-fixture { transition: background-color 150ms ease; } a.season-fixture:hover { background: var(--navy-raise); } }

/* League table */
.league-surface { min-width: 0; }
.league-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: var(--t-body); line-height: 1.3; font-variant-numeric: tabular-nums; }
.league-rank-col { width: 38px; }
.league-number-col { width: 36px; }
.league-goal-col { width: 42px; }
.league-table th, .league-table td { padding: 11px 5px; text-align: right; font-weight: 500; vertical-align: middle; }
.league-table td:nth-child(4) { white-space: nowrap; color: var(--soft); }
.league-table td:nth-child(3) { color: var(--soft); }
.league-table th:nth-child(2) { text-align: left; font-weight: 600; overflow-wrap: anywhere; }
.league-table thead th { padding-block: 4px 10px; border-bottom: 1px solid var(--line-strong); color: var(--muted); font-size: var(--t-micro); font-weight: 650; letter-spacing: .1em; }
.league-table tbody tr { border-bottom: 1px solid var(--line); }
.league-table abbr { text-decoration: none; }
.league-table .league-position, .league-table thead th:first-child { padding-left: 13px; text-align: left; color: var(--muted); }
.league-position { position: relative; font-size: var(--t-body); }
.league-table td:last-child { color: var(--ink); font-size: var(--t-strong); }
.league-table .league-apel { background: var(--navy-raise); box-shadow: inset 0 1px var(--gold), inset 0 -1px var(--gold); }
.league-table .league-apel th, .league-table .league-apel td { color: var(--gold); font-weight: 700; }
.league-marker { display: inline-block; width: 4px; height: 14px; flex: 0 0 4px; background: var(--zone-color); }
.league-position .league-marker { position: absolute; left: 0; top: 50%; transform: translateY(-50%); }
.league-zone-promotion { --zone-color: #3f9a74; }
.league-zone-playoff { --zone-color: #a9c96b; }
.league-zone-playout { --zone-color: #d39a52; }
.league-zone-relegation { --zone-color: #d0736c; }
.league-key { display: flex; flex-wrap: wrap; gap: 2px 18px; margin-top: 14px; color: var(--muted); font-size: var(--t-small); line-height: 1.5; }
.league-key b { color: var(--soft); font-weight: 650; letter-spacing: .06em; }
/* Zone boundaries: a stronger rule on the first row after a zone ends (progressive: no :has() support keeps the existing hairlines; the APEL row keeps its own gold rules). */
.league-table tbody tr:has(.league-zone-promotion) + tr:not(:has(.league-zone-promotion)):not(.league-apel) > *,
.league-table tbody tr:has(.league-zone-playoff) + tr:not(:has(.league-zone-playoff)):not(.league-apel) > *,
.league-table tbody tr:has(.league-zone-playout) + tr:not(:has(.league-zone-playout)):not(.league-apel) > *,
.league-table tbody tr:has(.league-zone-relegation) + tr:not(:has(.league-zone-relegation)):not(.league-apel) > *,
.league-table tbody tr:not(:has(.league-marker)) + tr:has(.league-marker):not(.league-apel) > * { box-shadow: inset 0 2px 0 var(--line-strong); }
.league-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 16px; color: var(--muted); font-size: var(--t-micro); font-weight: 600; letter-spacing: .08em; line-height: 1.6; }
.league-legend li { display: flex; align-items: center; gap: 8px; }
.league-legend .league-marker { height: 11px; }
.league-source { display: inline-flex; align-items: center; min-height: 44px; margin-top: 12px; color: var(--muted); font-size: var(--t-small); }
a.league-source { color: var(--gold); font-weight: 600; }
.league-updated { color: var(--muted); font-size: var(--t-small); line-height: 1.6; }
.football-crossnav { margin-top: 36px; }
@media (hover: hover) { a.league-source:hover { color: var(--ink); } }

.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; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 10; padding: 12px; color: var(--navy); background: var(--gold); font-weight: 600; transform: translateY(-220%); }
.skip-link:focus { transform: translateY(0); }
@supports (text-wrap: balance) { .page-head h1, .home-ground-title, .history-entry-title { text-wrap: balance; } }

/* Narrow phones */
@media (max-width: 350px) {
  :root { --gutter: max(16px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px)); --t-body: 14px; --t-score: 21px; --t-kickoff: 40px; }
  .masthead-nav { gap: 12px; font-size: 13.5px; letter-spacing: .03em; }
  .eyebrow { letter-spacing: .07em; }
  .history-milestone { grid-template-columns: 68px minmax(0, 1fr); gap: 12px; }
  .history-milestone h2 { font-size: 17px; }
  .season-score { min-width: 58px; }
  .season-fixture { grid-template-areas: "heading heading" "date date" "pair pair" "venue venue"; padding-inline: 6px; }
  .season-date { text-align: left; }
}
@media (min-width: 560px) {
  .masthead-name { display: block; }
  .match-navigation { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
  .match-navigation-link { border-bottom: 1px solid var(--line-strong); }
  .links ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
}
@media (min-width: 760px) {
  :root {
    --gutter: max(40px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
    --t-micro: 12px; --t-small: 13.5px; --t-body: 16px; --t-strong: 18px;
    --t-score: 30px; --t-score-lg: 44px; --t-kickoff: clamp(62px, 8vw, 100px);
    --t-h2: 30px; --t-h1: 56px; --t-hero: clamp(93px, 12.2vw, 164px);
  }
  .masthead { min-height: 72px; }
  .masthead-brand img { width: 44px; height: 44px; }
  .masthead-nav { gap: 32px; font-size: 16px; letter-spacing: .08em; }
  .hero { --crest: 200px; padding-block: 60px 64px; }
  .hero::before { top: calc(50% - var(--map) / 2); }
  .crest-frame { top: calc(50% - var(--crest) / 2); }
  .eyebrow { max-width: none; font-size: 12px; letter-spacing: .2em; }
  .hero h1 { margin-top: 26px; }
  .brand-subtitle { margin-top: 18px; font-size: 24px; }
  .match-section { padding-block: 48px 40px; }
  .match-next .result-team { font-size: clamp(20px, 2.6vw, 30px); }
  .match-last .result-team { font-size: var(--t-strong); }
  .match-navigation { padding-bottom: 64px; column-gap: 56px; }
  .match-navigation-link, .football-crossnav a { min-height: 60px; letter-spacing: .08em; }
  .club { padding-bottom: 64px; gap: 48px; }
  .link-card { min-height: 68px; }
  .honours { padding-block: 64px 48px; gap: 48px; }
  .achievement-count { font-size: clamp(170px, 19vw, 236px); }
  .achievement-label { font-size: var(--t-micro); }
  .championship-distribution div { grid-template-columns: 72px minmax(0, 1fr); }
  .championship-distribution dt { font-size: 24px; }
  .achievement-years { font-size: 28px; }
  .history-entry-title { font-size: 40px; }
  .history-entry-intro { font-size: 18px; }
  .history-arrow { font-size: 44px; }
  footer { padding-block: 30px calc(30px + env(safe-area-inset-bottom, 0px)); }
  .footer-name { font-size: 17px; }
  .footer-nav { width: auto; margin-left: auto; gap: 0 32px; }
  .inner { padding-block: 22px 80px; }
  .page-head { margin-bottom: 26px; padding-bottom: 22px; }
  .football-brand .brand-subtitle { font-size: var(--t-small); }
  .history-milestone { grid-template-columns: 130px minmax(0, 1fr); gap: 28px; padding-block: 20px; }
  .history-milestone h2 { font-size: 28px; }
  .history-milestone p { font-size: var(--t-strong); }
  .history-page .achievement-count { font-size: 170px; }
  .season-summary-played { font-size: 40px; }
  .season-summary:has(+ .season-scorers) { float: left; width: calc(50% - 28px); }
  .season-summary + .season-scorers { margin-left: calc(50% + 28px); }
  .season-fixtures, .archive-stage { clear: both; }
  .scorer-goals { font-size: 22px; }
  .league-table th, .league-table td { padding: 13px 10px; }
  .league-rank-col { width: 58px; }
  .league-number-col { width: 64px; }
  .league-goal-col { width: 72px; }
  .league-table .league-position, .league-table thead th:first-child { padding-left: 18px; }
  .league-table td:last-child { font-size: 20px; }
}
/* Fixtures become single-line ledger rows once there is room for them. */
@media (min-width: 900px) {
  .season-fixture { grid-template-columns: 148px minmax(0, 1fr) 190px; grid-template-areas: "heading pair date" "heading pair venue"; align-items: center; column-gap: 20px; padding: 13px 16px; }
  .season-fixture-heading { grid-area: heading; }
  .season-pair { grid-area: pair; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); grid-template-areas: "home score away"; margin: 0; gap: 12px; }
  .season-team { text-align: left; }
  .season-team:first-child { text-align: right; }
  .season-score { min-width: 84px; margin: 0; border: 0; }
  .season-date { grid-area: date; align-self: end; }
  .season-venue { grid-area: venue; align-self: start; margin: 0; text-align: right; }
  .season-date:only-of-type, .season-date:last-child { grid-row: 1 / -1; align-self: center; }
  .season-unscheduled { padding-block: 12px; }
  .season-unscheduled .season-pair { grid-template-columns: minmax(0, 1fr) 84px minmax(0, 1fr); grid-template-areas: "home . away"; margin-top: 0; }
}
/* Home: primary column and a narrower sidebar share one vertical rule down the page. */
@media (min-width: 1000px) {
  .match-section { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 0 56px; padding-block: 52px 40px; }
  .match-last { padding-left: 56px; border-left: 1px solid var(--line); }
  .club { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 0 56px; padding-bottom: 72px; }
  .home-ground { padding-left: 56px; border-left: 1px solid var(--line); }
  .honours { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 56px; padding-block: 68px 52px; }
  .honours .achievement + .achievement { padding-left: 56px; border-left: 1px solid var(--rule); }
  .history-entry { grid-column: 1 / -1; padding-top: 28px; }
}
/* Wide screens: the page title becomes a fixed left column beside the data. */
@media (min-width: 1240px) {
  .inner { display: grid; grid-template-columns: 316px minmax(0, 1fr); align-items: start; column-gap: 52px; padding-top: 44px; }
  .inner > * { grid-column: 2; min-width: 0; }
  .inner > .page-head { grid-column: 1; grid-row: 1 / span 4; position: sticky; top: 104px; margin: 0; padding: 0; border: 0; }
  .page-head h1 { font-size: 36px; }
  .history-page .page-head h1 { font-size: 52px; }
  .season-fixture { grid-template-columns: 136px minmax(0, 1fr) 220px; column-gap: 16px; }
}
@media (prefers-contrast: more) {
  :root { --muted: #dfe6f0; --soft: #f4f1ea; --line: #f4f1ea66; --line-strong: #f4f1eacc; --paper-muted: #0a1a33; }
}
@media (forced-colors: active) {
  .hero::before { display: none; }
  .honours { background: Canvas; color: CanvasText; border-top-color: CanvasText; }
  .season-form .season-form-win { background: Canvas; color: CanvasText; border-color: CanvasText; }
  .season-next, .league-table .league-apel { outline: 1px solid CanvasText; outline-offset: -1px; }
  .league-marker { forced-color-adjust: none; }
}
/* Shared by all static pages; unsupported browsers keep ordinary navigation. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition { pointer-events: none; }
  ::view-transition-group(root) { animation: none; }
  ::view-transition-old(root) { animation: page-fade-out 200ms ease-out both; mix-blend-mode: normal; }
  ::view-transition-new(root) { animation: page-fade-in 200ms ease-out both; mix-blend-mode: normal; }
}
@keyframes page-fade-out { to { opacity: 0; } }
@keyframes page-fade-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* Legal pages share the editorial shell; prose styles stay confined to these routes. */
.legal-status { margin-top:12px; color:var(--gold); font-size:var(--t-small); }
.legal-content { max-width:720px; min-width:0; color:var(--soft); font-size:var(--t-body); line-height:1.75; overflow-wrap:anywhere; }
.legal-content section + section { margin-top:28px; }
.legal-content h2 { margin:0 0 10px; color:var(--ink); font-size:var(--t-strong); font-weight:650; line-height:1.4; }
.legal-content p + p { margin-top:12px; }
.legal-content address { margin-top:8px; font-style:normal; }
.legal-content a { color:var(--gold); text-decoration:underline; text-underline-offset:3px; }
.legal-content ul { margin-top:10px; padding-left:1.2em; list-style:disc; }
.legal-content li + li { margin-top:8px; }
.legal-content .legal-links { margin-top:0; padding:0; list-style:none; }
.legal-links a, .legal-content address a, .legal-related a { display:inline-flex; align-items:center; min-height:44px; }
.legal-related { margin-top:24px; padding-top:12px; border-top:1px solid var(--line); }
/* Legal links can put the settings control on its own footer row. */
.footer-nav .footer-consent { min-height:44px; }

/* Discreet equal-weight choices for optional analytics consent. */
.footer-consent { border:0; padding:0; background:transparent; color:inherit; font:inherit; cursor:pointer; text-align:left; }
.footer-consent:hover, .footer-consent:focus-visible { color:var(--gold); }
.consent-banner[hidden] { display:none!important; }
.consent-banner { position:fixed; z-index:100; bottom:max(12px,env(safe-area-inset-bottom)); left:max(12px,env(safe-area-inset-left)); right:max(12px,env(safe-area-inset-right)); max-width:640px; margin-inline:auto; padding:12px 14px; border:1px solid var(--line); background:var(--navy); color:var(--ink); box-shadow:0 3px 12px #0003; display:flex; gap:12px; align-items:center; }
.consent-content { flex:1; min-width:0; }
.consent-content p { margin:0; color:var(--soft); font-size:13px; line-height:1.45; }
.consent-content .consent-heading { display:flex; align-items:center; justify-content:space-between; gap:6px; color:var(--ink); font-size:13px; font-weight:600; margin-bottom:2px; }
.consent-content .consent-heading .consent-policy-link { display:inline-flex; align-items:center; flex:0 0 auto; min-height:24px; margin-block:-2.5px; color:var(--gold); font-size:10px; font-weight:500; white-space:nowrap; text-decoration:underline; text-underline-offset:2px; }
.consent-content .consent-heading .consent-policy-link:hover { color:var(--ink); }
.consent-actions { display:flex; gap:8px; flex-shrink:0; }
.consent-actions button { min-width:100px; min-height:44px; padding:8px; border:1px solid var(--line-strong); background:transparent; color:var(--ink); font:inherit; font-size:13px; font-weight:600; cursor:pointer; }
.consent-actions button:hover,.consent-actions button:focus-visible { background:var(--gold); color:var(--navy-deep); }
.consent-actions button:focus-visible { outline:2px solid var(--gold); outline-offset:2px; }
@media (max-width:640px) { .consent-banner { display:block; padding:12px; } .consent-actions { margin-top:10px; } .consent-actions button { flex:1; } }
