/* West Sussex Fun Run League. Brand tokens first; every colour in the site comes from these. */
/* Fonts: self-hosted latin subsets from Google Fonts (SIL OFL, licences in assets/fonts). Both are variable fonts, so
   one file covers every weight used. */
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 700 800; font-display: swap; src: url(/assets/fonts/montserrat-latin.woff2) format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: italic; font-weight: 800; font-display: swap; src: url(/assets/fonts/montserrat-italic-latin.woff2) format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/assets/fonts/plus-jakarta-sans-latin.woff2) format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: italic; font-weight: 600; font-display: swap; src: url(/assets/fonts/plus-jakarta-sans-italic-latin.woff2) format("woff2"); }

:root {
  --wsfrl-ink: #142B3B;
  --wsfrl-coral: #F05A4F;
  --wsfrl-teal: #39AFA0;
  --wsfrl-sky: #8BBBD0;
  --wsfrl-offwhite: #F5F3ED;
  --wsfrl-font-heading: "Montserrat", "Avenir Next", "Segoe UI", sans-serif;
  --wsfrl-font-body: "Plus Jakarta Sans", "Avenir Next", "Segoe UI", system-ui, sans-serif;

  /* Derived: tints for surfaces, and darker versions of coral/teal for small text so it passes WCAG AA on off-white. */
  --surface: #fff;
  --line: color-mix(in srgb, var(--wsfrl-ink) 12%, transparent);
  --field-line: color-mix(in srgb, var(--wsfrl-ink) 50%, #fff);   /* form field borders: 3:1 on white */
  --muted: color-mix(in srgb, var(--wsfrl-ink) 68%, var(--wsfrl-offwhite));
  --coral-text: #C2392F;
  --teal-text: #18675D;
  --teal-wash: color-mix(in srgb, var(--wsfrl-teal) 14%, var(--wsfrl-offwhite));
  --sky-wash: color-mix(in srgb, var(--wsfrl-sky) 22%, var(--wsfrl-offwhite));
  --coral-wash: color-mix(in srgb, var(--wsfrl-coral) 12%, var(--wsfrl-offwhite));

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 72px; --space-9: 104px;
  --radius-s: 8px; --radius-m: 14px; --radius-l: 22px; --radius-pill: 999px;
  --shadow-1: 0 1px 2px rgb(20 43 59 / .06), 0 4px 14px rgb(20 43 59 / .06);
  --shadow-2: 0 2px 6px rgb(20 43 59 / .08), 0 18px 40px rgb(20 43 59 / .12);
  --content: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }
body { margin: 0; background: var(--wsfrl-offwhite); color: var(--wsfrl-ink); font: 400 17px/1.6 var(--wsfrl-font-body); }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--wsfrl-coral); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, .display { font-family: var(--wsfrl-font-heading); line-height: 1.08; letter-spacing: -.02em; margin: 0; }
h1 { font-weight: 800; font-size: clamp(36px, 6vw, 64px); }
h2 { font-weight: 800; font-size: clamp(28px, 4vw, 44px); }
h3, .h3 { font-weight: 700; font-size: 20px; letter-spacing: -.01em; }
/* Visually hidden, still read by screen readers (headings that complete the outline, live status text). */
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
p { margin: 0 0 var(--space-4); }
.wrap { width: min(var(--content), 100% - 2 * var(--gutter)); margin-inline: auto; }
.eyebrow { font: 700 13px/1.2 var(--wsfrl-font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--teal-text); margin-bottom: var(--space-3); display: block; }
.lede { font-size: clamp(18px, 2vw, 21px); color: var(--muted); max-width: 62ch; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--wsfrl-ink); color: #fff; padding: 10px 16px; border-radius: var(--radius-s); z-index: 99; }
.skip:focus { left: 8px; }
.num { font-variant-numeric: tabular-nums; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 12px 22px; border-radius: var(--radius-pill); font: 700 16px/1 var(--wsfrl-font-body); text-decoration: none; border: 2px solid transparent; transition: transform .15s ease, background .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--wsfrl-coral); color: var(--wsfrl-ink); font-size: 19px; } /* navy on coral is 4.4:1, so keep it large text */
.btn-primary:hover { background: #F3746B; }
.btn-ghost { border-color: currentColor; color: inherit; }
.btn-ink { background: var(--wsfrl-ink); color: #fff; }
.btn .arrow { transition: transform .15s ease; }
.btn:hover .arrow { transform: translateX(3px); }
.link-arrow { font-weight: 700; text-decoration: none; color: var(--wsfrl-ink); border-bottom: 2px solid var(--wsfrl-coral); padding-bottom: 2px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--wsfrl-offwhite) 92%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--wsfrl-ink); }
.brand img { width: 130px; height: auto; flex: none; }
.brand-text { display: grid; font-family: var(--wsfrl-font-heading); font-weight: 800; line-height: 1; letter-spacing: .01em; text-transform: uppercase; }
.brand-text span:first-child { font-size: 17px; }
.brand-text span:nth-child(2) { font-size: 11.5px; color: var(--coral-text); letter-spacing: .09em; margin-top: 4px; }
.brand-text span:nth-child(3) { display: flex; align-items: center; gap: 6px; font-size: 9px; letter-spacing: .4em; margin-top: 5px; }
.brand-text span:nth-child(3)::before, .brand-text span:nth-child(3)::after { content: ""; flex: 1; height: 1.5px; background: var(--wsfrl-teal); }
.nav { display: flex; align-items: center; gap: var(--space-1); }
.nav a { padding: 10px 14px; border-radius: var(--radius-pill); text-decoration: none; font-weight: 600; font-size: 15px; }
.nav a:hover { background: var(--teal-wash); }
.nav a[aria-current="page"] { background: var(--wsfrl-ink); color: #fff; }
.nav .nav-login { margin-left: var(--space-2); border: 1.5px solid var(--line); font-size: 14px; }
.menu { display: none; }
@media (max-width: 960px) {
  .nav { display: none; }
  .menu { display: block; position: relative; }
  .menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px; border-radius: var(--radius-pill); background: var(--wsfrl-ink); color: #fff; font-weight: 700; font-size: 15px; }
  .menu summary::-webkit-details-marker { display: none; }
  .menu[open] .nav { display: grid; position: absolute; right: 0; top: calc(100% + 10px); width: min(300px, calc(100vw - 32px)); background: var(--surface); border-radius: var(--radius-m); box-shadow: var(--shadow-2); padding: var(--space-2); }
  .menu[open] .nav a { padding: 14px 16px; }
  .menu[open] .nav .nav-login { margin: var(--space-2) 0 0; }
}
@media (max-width: 420px) { .brand img { width: 92px; } .brand-text span:first-child { font-size: 14px; } .brand-text span:nth-child(2) { font-size: 9.5px; } }

/* Hero */
.hero { position: relative; color: #fff; background: var(--wsfrl-ink); isolation: isolate; overflow: hidden; }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero .hero-photo { object-position: 100% 35%; } /* photo-65: second runner cloned out and the plain field on the left stretched, so the runner sits right of the headline */
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgb(20 43 59 / .7) 0%, rgb(20 43 59 / .35) 38%, transparent 62%); }
.hero .wrap { padding: clamp(80px, 10vw, 140px) 0 clamp(160px, 16vw, 220px); }
.hero h1 { font-size: clamp(52px, 7vw, 100px); letter-spacing: -.035em; line-height: .92; font-style: italic; text-transform: uppercase; text-shadow: 0 2px 24px rgb(20 43 59 / .35); }
.hero .tagline { font: 600 italic clamp(18px, 2vw, 24px)/1.3 var(--wsfrl-font-body); margin: var(--space-4) 0 var(--space-6); text-shadow: 0 1px 12px rgb(20 43 59 / .5); }
.hero .btn-primary { text-transform: uppercase; letter-spacing: .04em; color: #fff; background: var(--wsfrl-coral); font-size: 19px; }
.hero .btn-ghost { background: rgb(20 43 59 / .25); backdrop-filter: blur(4px); }
.hero-contours { position: absolute; right: 0; bottom: clamp(40px, 6vw, 90px); width: min(420px, 45vw); opacity: .75; pointer-events: none; }
@media (max-width: 760px) {
  .hero::before, .hero-contours { display: none; }
  .hero .hero-photo { position: relative; inset: auto; z-index: auto; width: 100%; height: 78vw; object-position: 84% 30%; }
  .hero .wrap { padding-top: 28px; }
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.hills { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: clamp(60px, 9vw, 120px); }
.page-hero { position: relative; background: var(--wsfrl-ink); color: #fff; overflow: hidden; }
.page-hero .wrap { padding: clamp(48px, 7vw, 88px) 0 clamp(80px, 10vw, 128px); position: relative; }
.page-hero h1 { max-width: 20ch; }
.page-hero .lede { color: color-mix(in srgb, #fff 78%, var(--wsfrl-sky)); margin-top: var(--space-4); }
.page-hero .eyebrow { color: var(--wsfrl-sky); }
.page-hero .eyebrow a { color: inherit; display: inline-block; padding: 14px 0; margin: -14px 0; } /* 44px tap target, same layout */
.contours { position: absolute; right: -60px; top: -40px; width: min(720px, 90vw); opacity: .16; pointer-events: none; }

/* Sections */
.section { padding: clamp(56px, 8vw, var(--space-9)) 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: var(--space-5); flex-wrap: wrap; margin-bottom: var(--space-6); }
.section-head p { margin: var(--space-3) 0 0; }
.band-ink { background: var(--wsfrl-ink); color: #fff; }
.band-ink .eyebrow { color: var(--wsfrl-sky); }
.band-ink .muted, .band-ink .lede { color: color-mix(in srgb, #fff 72%, var(--wsfrl-sky)); }
.band-teal { background: var(--teal-wash); --muted: color-mix(in srgb, var(--wsfrl-ink) 80%, var(--wsfrl-offwhite)); }
.card { background: var(--surface); border-radius: var(--radius-l); box-shadow: var(--shadow-1); padding: clamp(20px, 3vw, 32px); }

/* Next race */
.next-race { position: relative; z-index: 2; margin-top: clamp(-120px, -12vw, -80px); }
.next-card { display: grid; grid-template-columns: auto 1fr auto; gap: clamp(20px, 3vw, 40px); align-items: center; background: var(--surface); border-radius: var(--radius-l); box-shadow: var(--shadow-2); padding: clamp(20px, 3vw, 36px); }
.datetile { width: 128px; text-align: center; border-radius: var(--radius-m); background: var(--wsfrl-ink); color: #fff; padding: 14px 10px 16px; font-family: var(--wsfrl-font-heading); }
.datetile .dow { font: 700 13px/1 var(--wsfrl-font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--wsfrl-sky); }
.datetile .day { font-weight: 800; font-size: 60px; line-height: 1; margin: 6px 0 4px; }
.datetile .mon { font-weight: 700; font-size: 15px; letter-spacing: .08em; text-transform: uppercase; color: var(--wsfrl-sky); }
.next-card h2 { font-size: clamp(26px, 3.4vw, 38px); }
.next-card .meta { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-3) 0; }
.next-card p { margin: 0; color: var(--muted); max-width: 62ch; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--radius-pill); background: var(--teal-wash); font-size: 14px; font-weight: 600; }
.chip.coral { background: var(--coral-wash); }
.chip.sky { background: var(--sky-wash); }
.chip svg { width: 15px; height: 15px; }
.countdown { font: 700 14px/1.2 var(--wsfrl-font-body); color: var(--coral-text); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 6px; }
@media (max-width: 760px) {
  .next-card { grid-template-columns: 1fr; gap: 16px; }
  .next-card .btn { justify-content: center; }
  .datetile { width: auto; display: flex; align-items: baseline; justify-content: center; gap: 10px; padding: 12px 16px; }
  .datetile .day { font-size: 34px; margin: 0; }
}

/* League explainer */
.league-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-4); counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 52px 1fr; gap: var(--space-4); align-items: start; background: var(--surface); border-radius: var(--radius-m); padding: var(--space-5); box-shadow: var(--shadow-1); }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--wsfrl-teal); color: var(--wsfrl-ink); font: 800 22px/1 var(--wsfrl-font-heading); }
.steps li:nth-child(2)::before { background: var(--wsfrl-coral); }
.steps li:nth-child(3)::before { background: var(--wsfrl-sky); }
.steps h3 { margin-bottom: 4px; }
.steps p { margin: 0; color: var(--muted); }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); margin-top: var(--space-7); }
.fact { border-top: 3px solid var(--wsfrl-teal); padding-top: var(--space-4); }
.fact:nth-child(2) { border-color: var(--wsfrl-coral); } .fact:nth-child(3) { border-color: var(--wsfrl-sky); } .fact:nth-child(4) { border-color: var(--wsfrl-ink); }
.fact b { display: block; font: 800 clamp(32px, 4.4vw, 52px)/1 var(--wsfrl-font-heading); letter-spacing: -.03em; }
.fact span { color: var(--muted); font-size: 15px; }
.band-ink .fact span { color: color-mix(in srgb, #fff 72%, var(--wsfrl-sky)); }
@media (max-width: 860px) { .league-grid { grid-template-columns: 1fr; } .facts { grid-template-columns: repeat(2, 1fr); } }

/* Tables */
.tables { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--space-5); align-items: start; }
.tables.season { grid-template-columns: 340px minmax(0, 1fr); }
@media (max-width: 960px) { .tables, .tables.season { grid-template-columns: minmax(0, 1fr); } }
.table-card :is(h2, h3) { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); margin-bottom: var(--space-4); }
.table-card :is(h2, h3) small { font: 600 14px var(--wsfrl-font-body); color: var(--muted); letter-spacing: 0; }
.standings { width: 100%; border-collapse: collapse; font-size: 15px; }
.standings th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; padding: 0 8px 10px; }
.standings td { padding: 9px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
.standings .pos { width: 40px; font-weight: 800; font-family: var(--wsfrl-font-heading); }
.standings .total { text-align: right; font-weight: 700; width: 70px; }
.standings th.total { text-align: right; }
.standings tr.top td { background: var(--coral-wash); }
.standings tr.top td:first-child { border-radius: 10px 0 0 10px; } .standings tr.top td:last-child { border-radius: 0 10px 10px 0; }
.bar { height: 6px; border-radius: 3px; background: var(--wsfrl-teal); margin-top: 6px; }
.standings tr.top .bar { background: var(--wsfrl-coral); }
.trophy { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--wsfrl-ink); margin-left: 6px; text-transform: uppercase; letter-spacing: .06em; }

.data { width: 100%; border-collapse: collapse; font-size: 15px; background: var(--surface); }
.data th { position: sticky; top: 72px; background: var(--wsfrl-ink); color: #fff; text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; padding: 12px 10px; font-weight: 700; z-index: 1; }
.data td { padding: 10px; border-top: 1px solid var(--line); }
.data tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--wsfrl-offwhite) 55%, #fff); }
.data tbody tr:hover td { background: var(--teal-wash); }
.data .r { text-align: right; }
.data td.name { font-weight: 600; }
.data .sub { display: none; }
.scroll-box { position: relative; }
.scroll { overflow-x: auto; border-radius: var(--radius-m); box-shadow: var(--shadow-1); -webkit-overflow-scrolling: touch; }
.scroll .data th { top: 0; }
/* A fade on the right edge while there is more table to scroll to (site.js sets .more). */
.scroll-box.more::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 36px; border-radius: 0 var(--radius-m) var(--radius-m) 0; background: linear-gradient(90deg, transparent, rgb(20 43 59 / .18)); pointer-events: none; }
/* No overflow here, so the results header sticks to the viewport under the site header (inside .scroll it can't). */
.table-wrap { border-radius: var(--radius-m); box-shadow: var(--shadow-1); }
.grid-table td, .grid-table th { white-space: nowrap; }
.grid-table th.rot { padding: 10px 6px; font-size: 11px; letter-spacing: .04em; vertical-align: bottom; text-align: left; }
.grid-table th.rot span { display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); max-height: 190px; white-space: normal; line-height: 1.25; }
/* Position and club stay put while the race columns scroll under them. */
.grid-table :is(td, th):nth-child(-n+2) { position: sticky; left: 0; z-index: 2; background: var(--surface); }
.grid-table :is(td, th):nth-child(2) { left: 40px; box-shadow: 1px 0 0 var(--line); }
.grid-table :is(td, th):first-child { width: 40px; min-width: 40px; max-width: 40px; }
.grid-table thead th:nth-child(-n+2) { background: var(--wsfrl-ink); z-index: 3; }
.grid-table tbody tr:nth-child(even) td:nth-child(-n+2) { background: color-mix(in srgb, var(--wsfrl-offwhite) 55%, #fff); }
.grid-details summary { list-style: none; cursor: default; margin-bottom: 12px; }
.grid-details summary::-webkit-details-marker { display: none; }
@media (max-width: 640px) {
  .grid-details summary { cursor: pointer; list-style: revert; display: list-item; min-height: 44px; padding: 10px 0; margin-bottom: 0; }
  .grid-details summary h3 { display: inline; }
  .grid-details[open] summary { margin-bottom: 12px; }
  .grid-table td.name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
}
.grid-table th.rot a { color: #fff; text-decoration: underline; text-decoration-color: var(--wsfrl-sky); text-underline-offset: 3px; }   /* linked races must look different from unlinked */
.grid-table td.c { text-align: center; color: var(--muted); }
.sex { display: inline-block; min-width: 34px; text-align: center; font-size: 12px; font-weight: 700; border-radius: 6px; padding: 2px 6px; }
.sex.m { background: var(--sky-wash); } .sex.f { background: var(--coral-wash); }
/* Fixture type: its own colours, so coral keeps meaning Female on results pages. */
.kind { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 6px; padding: 2px 8px; }
.kind.s { background: var(--wsfrl-ink); color: #fff; } .kind.j { background: var(--teal-wash); color: var(--teal-text); }
.table-note { font-size: 14px; margin: var(--space-3) 0 0; }
@media (max-width: 640px) { .data .hide-s { display: none; } .data .sub { display: block; font: 400 13px/1.3 var(--wsfrl-font-body); color: var(--muted); } .data td, .data th { padding: 9px 7px; } }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; margin-bottom: var(--space-4); }
.filters input, .filters select { min-height: 46px; border: 1.5px solid var(--field-line); border-radius: var(--radius-pill); padding: 0 18px; font: inherit; font-size: 16px; background: var(--surface); color: var(--wsfrl-ink); }
.filters input { flex: 1 1 240px; }
.seg { display: inline-flex; background: var(--surface); border: 1.5px solid var(--field-line); border-radius: var(--radius-pill); padding: 3px; }
.seg button { border: 0; background: none; font: 600 15px var(--wsfrl-font-body); padding: 9px 16px; border-radius: var(--radius-pill); cursor: pointer; color: var(--wsfrl-ink); min-height: 44px; }
.seg button[aria-pressed="true"] { background: var(--wsfrl-ink); color: #fff; }
.count { color: var(--muted); font-size: 14px; }

/* Calendar */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; display: grid; gap: var(--space-3); }
.timeline::before { content: ""; position: absolute; left: 35px; top: 12px; bottom: 12px; border-left: 3px dashed color-mix(in srgb, var(--wsfrl-teal) 60%, transparent); }
.timeline li { position: relative; display: grid; grid-template-columns: 72px 1fr auto; gap: var(--space-4); align-items: center; background: var(--surface); border-radius: var(--radius-m); padding: var(--space-4) var(--space-5) var(--space-4) 0; box-shadow: var(--shadow-1); }
.timeline .when { position: relative; z-index: 1; justify-self: center; text-align: center; width: 56px; padding: 6px 0; border-radius: 12px; background: var(--wsfrl-teal); color: var(--wsfrl-ink); font-family: var(--wsfrl-font-heading); }
.timeline .when b { display: block; font-size: 22px; line-height: 1; font-weight: 800; }
.timeline .when small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.timeline li.done .when { background: var(--wsfrl-ink); color: #fff; }
.timeline li.next .when { background: var(--coral-wash); box-shadow: inset 0 0 0 2px var(--wsfrl-coral); }
.timeline h3 { font-size: 18px; }
.timeline h3 a { text-decoration: none; }
.timeline h3 a:hover { text-decoration: underline; }
.timeline p { margin: 2px 0 0; color: var(--muted); font-size: 15px; }
.timeline .side { text-align: right; font-size: 14px; color: var(--muted); }
.timeline .side a { font-weight: 700; color: var(--wsfrl-ink); }
@media (max-width: 640px) { .timeline li { grid-template-columns: 72px 1fr; } .timeline .side { grid-column: 2; text-align: left; } }

.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-4); }
.race-tile { display: block; text-decoration: none; --stripe: var(--wsfrl-teal); background: linear-gradient(var(--stripe) 0 0) top / 100% 5px no-repeat, var(--surface); border-radius: var(--radius-m); overflow: hidden; padding: var(--space-5); box-shadow: var(--shadow-1); transition: transform .15s ease, box-shadow .15s ease; }
.race-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.race-tile:nth-child(3n+2) { --stripe: var(--wsfrl-coral); } .race-tile:nth-child(3n) { --stripe: var(--wsfrl-sky); }
.race-tile .date { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.race-tile h3 { margin: 6px 0 10px; font-size: 19px; }
.race-tile dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: 14px; }
.race-tile dt { color: var(--muted); }
.race-tile dd { margin: 0; font-weight: 600; }

/* Year archive */
.years { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--space-3); }
.year { display: block; text-decoration: none; border-radius: var(--radius-m); background: var(--surface); padding: var(--space-4) var(--space-5); box-shadow: var(--shadow-1); }
.year:hover { background: var(--teal-wash); }
.year b { display: block; font: 800 30px/1 var(--wsfrl-font-heading); letter-spacing: -.02em; }
.year span { display: block; font-size: 13px; color: var(--muted); margin-top: 6px; }
.year.off { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }

/* Clubs */
.clubs { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: var(--space-4); }
.club { background: var(--surface); border-radius: var(--radius-l); overflow: hidden; box-shadow: var(--shadow-1); display: flex; flex-direction: column; scroll-margin-top: 90px; }
.club .ph { aspect-ratio: 16 / 9; background: var(--sky-wash); position: relative; overflow: hidden; }
.club .ph img { width: 100%; height: 100%; object-fit: cover; }
.club .ph .mono { position: absolute; inset: 0; display: grid; place-items: center; font: 800 44px/1 var(--wsfrl-font-heading); color: var(--wsfrl-ink); letter-spacing: -.02em; }
.club .ph svg { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 40%; }
.club .body { padding: var(--space-5); flex: 1; display: flex; flex-direction: column; gap: var(--space-2); }
.club h3 { font-size: 19px; }
.club .town { margin: 0; font-size: 14px; color: var(--muted); }
.club .stats { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.club .reps { font-size: 14px; color: var(--muted); margin: 0; }
.club .reps svg { width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; }
.club .links { margin-top: auto; padding-top: var(--space-2); font-size: 14px; font-weight: 700; }
.club-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.club-chips a { text-decoration: none; padding: 10px 16px; border-radius: var(--radius-pill); background: rgb(255 255 255 / .08); border: 1.5px solid rgb(255 255 255 / .18); font-weight: 600; font-size: 15px; }
.club-chips a:hover { background: var(--wsfrl-coral); color: var(--wsfrl-ink); border-color: var(--wsfrl-coral); }
.club-chips a b { color: var(--wsfrl-sky); margin-right: 6px; font-family: var(--wsfrl-font-heading); }
.club-chips a:hover b { color: var(--wsfrl-ink); }

/* Photos */
.mosaic { display: grid; grid-template-columns: repeat(6, 1fr); grid-auto-rows: 150px; gap: var(--space-3); }
.mosaic figure { margin: 0; border-radius: var(--radius-m); overflow: hidden; position: relative; }
.mosaic img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.mosaic figure:hover img { transform: scale(1.04); }
.mosaic .w2 { grid-column: span 2; } .mosaic .w3 { grid-column: span 3; } .mosaic .h2 { grid-row: span 2; }
.credit { font-size: 13px; color: var(--muted); margin-top: var(--space-3); }
@media (max-width: 760px) { .mosaic { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 120px; } .mosaic .w2, .mosaic .w3 { grid-column: span 2; } }
.films { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--space-4); margin-top: var(--space-6); }
.film { text-decoration: none; }
.film img { aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-m); width: 100%; }
.film b { display: block; margin-top: 8px; font-size: 15px; }
.film span { font-size: 13px; color: var(--muted); }

/* Prose (content pages and race info) */
.prose { max-width: 72ch; }
.prose h2 { font-size: 26px; margin: var(--space-6) 0 var(--space-3); }
.prose h3 { font-size: 19px; margin: var(--space-5) 0 var(--space-2); color: var(--wsfrl-ink); }
.prose.docs h2 { font-size: 19px; margin: var(--space-5) 0 var(--space-2); } /* AGM and constitution: list headings, h3 size */
.prose h2:first-child, .prose h3:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 var(--space-4); }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--teal-text); font-weight: 600; }
.prose table { border-collapse: collapse; }
.layout-side { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(24px, 4vw, 56px); align-items: start; }
.layout-side aside { position: sticky; top: 96px; display: grid; gap: var(--space-4); }
@media (max-width: 900px) { .layout-side { grid-template-columns: 1fr; } .layout-side aside { position: static; } }
.facts-list { margin: 0; display: grid; gap: var(--space-3); }
.facts-list div { display: grid; grid-template-columns: 110px 1fr; gap: var(--space-3); }
.facts-list dt { color: var(--muted); font-size: 14px; }
.facts-list dd { margin: 0; font-weight: 600; }
.notice { background: var(--sky-wash); border-radius: var(--radius-m); padding: var(--space-4) var(--space-5); font-size: 15px; }
.pager { display: flex; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-5); }
.pager a { position: relative; } .pager a::after { content: ""; position: absolute; inset: -12px -8px; } /* 44px tap target */
.year-links { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.year-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: var(--radius-pill); background: var(--surface); box-shadow: var(--shadow-1); text-decoration: none; font-weight: 700; }
.subnav { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-5); }
.subnav a { text-decoration: none; padding: 8px 14px; border-radius: var(--radius-pill); border: 1.5px solid rgb(255 255 255 / .25); font-weight: 600; font-size: 14px; }
.subnav a[aria-current="page"], .subnav a:hover { background: #fff; color: var(--wsfrl-ink); border-color: #fff; }

/* Login */
.login { max-width: 520px; display: grid; gap: 6px; }
.login label { font-weight: 700; font-size: 15px; margin-top: 12px; }
.login label:first-of-type { margin-top: 0; }
.login input[type=text], .login input[type=password] { min-height: 52px; border: 1.5px solid var(--field-line); border-radius: var(--radius-s); padding: 0 14px; font: inherit; color: var(--wsfrl-ink); background: #fff; }
.login input:focus { outline: 3px solid color-mix(in srgb, var(--wsfrl-teal) 45%, transparent); border-color: var(--wsfrl-teal); }
.login .hint { font-size: 14px; color: var(--muted); margin: 0; }
.login-actions { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-top: 20px; }
.login-actions button { cursor: pointer; }
.login-actions a { font-size: 15px; font-weight: 600; color: var(--teal-text); }

/* App and social buttons */
.store, .social { white-space: nowrap; display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 18px; border-radius: 12px; text-decoration: none; font-weight: 700; }
.store { background: #000; color: #fff; font: 600 20px/1 var(--wsfrl-font-body); letter-spacing: -.01em; }
.store small { display: block; font-size: 11px; font-weight: 500; letter-spacing: .02em; margin-bottom: 3px; }
.store svg { width: 26px; height: 26px; }
.store.soon { opacity: .75; cursor: default; }
.social { background: #1464D8; color: #fff; font-size: 16px; }
.social svg { width: 24px; height: 24px; }
.store:hover, .social:hover { text-decoration: none; filter: brightness(1.12); }
.app-band { display: grid; grid-template-columns: 1fr auto; gap: var(--space-6); align-items: center; background: var(--sky-wash); border-radius: var(--radius-l); padding: clamp(28px, 5vw, 56px); }
.app-band .lede { margin: var(--space-4) 0 var(--space-5); color: var(--wsfrl-ink); }
.app-band img { width: clamp(200px, 26vw, 320px); height: auto; }
.app-ctas, .footer-links { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.footer-links { margin-top: var(--space-5); }
.footer-links .store, .footer-links .social { min-height: 44px; font-size: 15px; padding: 6px 14px; }
.footer-links .store { font-size: 17px; }
@media (max-width: 760px) { .app-band { grid-template-columns: 1fr; } .app-band img { order: -1; width: 180px; } }

/* Footer */
.site-footer { position: relative; background: var(--wsfrl-ink); color: #fff; padding: 0 0 var(--space-6); margin-top: var(--space-8); }
.site-footer .hills { position: static; display: block; height: clamp(50px, 7vw, 90px); background: var(--wsfrl-offwhite); }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: var(--space-6); padding-top: var(--space-6); }
.footer-logo { display: inline-block; background: var(--wsfrl-offwhite); border-radius: var(--radius-l); padding: 18px 22px; }
.footer-logo img { width: 260px; height: auto; }
.site-footer h2 { font: 700 13px var(--wsfrl-font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--wsfrl-sky); margin-bottom: var(--space-3); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer .strap { font: 800 italic 28px/1 var(--wsfrl-font-heading); margin: var(--space-5) 0 6px; }
.site-footer .strap + p { color: color-mix(in srgb, #fff 72%, var(--wsfrl-sky)); }
.legal { border-top: 1px solid rgb(255 255 255 / .14); margin-top: var(--space-7); padding-top: var(--space-5); font-size: 14px; color: color-mix(in srgb, #fff 65%, var(--wsfrl-sky)); display: flex; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
@media print { .site-header, .site-footer, .filters, .hero-ctas { display: none; } .data th { position: static; } }

/* Race pages with results: results first; the pre-race text folds away below, and on phones the facts and winners
   card comes above the (long) table rather than after it. */
.race-info { margin: 32px 0; border-top: 1px solid var(--line); padding-top: 16px; }
.race-info summary { cursor: pointer; font: 700 20px/1.3 var(--wsfrl-font-heading); padding: 12px 0; min-height: 44px; }
@media (max-width: 900px) { .layout-side.has-results aside { order: -1; } }

/* Home: latest result, straight under the next-race card. */
.latest-strip { margin-top: var(--space-5); }
.latest-strip a { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; min-height: 44px; background: var(--surface); border-radius: var(--radius-m); box-shadow: var(--shadow-1); padding: var(--space-4) var(--space-5); text-decoration: none; }
.latest-strip b { font: 800 20px/1.2 var(--wsfrl-font-heading); }
.latest-strip .link-arrow { margin-left: auto; font-weight: 700; color: var(--teal-text); }

/* Results filter: the "No runners match" row and its clear button. */
.link-button { background: none; border: 0; padding: 10px 4px; min-height: 44px; font: inherit; font-weight: 700; color: var(--teal-text); text-decoration: underline; cursor: pointer; }

/* Club logos: square tiles made by tools/logo_tiles.py (the logo's own background edge to edge), so here they only
   get rounded corners and a hairline edge. A small mark in league tables, a badge on club cards, a large tile on club
   pages. */
.mini, .badge, .hero-logo { object-fit: cover; flex: none; background: #fff; box-shadow: 0 0 0 1px rgb(20 43 59 / .1); }
.mini { width: 24px; height: 24px; border-radius: 6px; vertical-align: -7px; margin-right: 8px; display: inline-grid; place-items: center; }
.club .ph .badge { position: absolute; left: 12px; bottom: 12px; width: 56px; height: 56px; border-radius: 13px; box-shadow: 0 0 0 1px rgb(255 255 255 / .6), var(--shadow-2); display: grid; place-items: center; z-index: 1; }
.hero-logo { width: 96px; height: 96px; border-radius: 22px; display: grid; place-items: center; box-shadow: 0 0 0 1px rgb(255 255 255 / .25); }
.initials { font: 800 13px/1 var(--wsfrl-font-heading); color: var(--wsfrl-ink); letter-spacing: -.02em; }
.mini.initials { font-size: 8px; }
.badge.initials { font-size: 18px; }
.hero-logo.initials { font-size: 30px; }
.club h3 a { text-decoration: none; }
.club h3 a:hover { text-decoration: underline; }
.club .links { display: flex; gap: var(--space-4); flex-wrap: wrap; }
.club-title { display: flex; align-items: center; gap: var(--space-5); }
.club-photo { margin: 0 0 var(--space-6); border-radius: var(--radius-l); overflow: hidden; box-shadow: var(--shadow-1); aspect-ratio: 16 / 9; }
.club-photo img { width: 100%; height: 100%; object-fit: cover; }
.club-facts { margin: 0 0 var(--space-7); }
.layout-side > div > h2 { margin: var(--space-7) 0 var(--space-4); font-size: clamp(24px, 3vw, 30px); }
.pos-chart { width: 100%; height: auto; margin: 0 0 var(--space-4); background: var(--surface); border-radius: var(--radius-m); box-shadow: var(--shadow-1); }
.pos-chart polyline { fill: none; stroke: var(--wsfrl-teal); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.pos-chart circle { fill: var(--wsfrl-teal); }
.pos-chart circle.win { fill: var(--wsfrl-coral); }
.pos-chart text { font: 600 12px var(--wsfrl-font-body); fill: var(--muted); text-anchor: middle; }
.pos-chart text.axis { text-anchor: start; }
.loyal { margin: 0; padding: 0; list-style: none; counter-reset: loyal; }
.loyal li { display: flex; justify-content: space-between; gap: var(--space-3); padding: 8px 0; border-top: 1px solid var(--line); font-size: 15px; }
.loyal li:first-child { border-top: 0; }
@media (max-width: 640px) { .hero-logo { width: 72px; height: 72px; border-radius: 18px; } .club-title { gap: var(--space-4); } }
