/* ==========================================================================
   LMC theme – design direction A "Nachtlauf"
   Mobile first. Tokens derived from the logo (yellow #FCF217, blue #3939FF).
   Contrast checked against WCAG 2.2 AA (see docs/02b-design.md).
   ========================================================================== */

/* ---------- Fonts (self-hosted, SIL OFL) ---------- */
@font-face { font-family: "Saira"; font-style: normal; font-weight: 500 800; font-stretch: 100% 125%; font-display: swap; src: url("../fonts/saira-normal.woff2") format("woff2"); }
@font-face { font-family: "Saira"; font-style: italic; font-weight: 500 800; font-stretch: 100% 125%; font-display: swap; src: url("../fonts/saira-italic.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/barlow-400.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/barlow-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/barlow-700.woff2") format("woff2"); }

/* Metric-matched fallbacks: until the web fonts arrive, local Arial is scaled so lines break as with Saira/Barlow,
   so the swap causes no reflow (CLS). Generated by tools/test/browser/fallback-fonts.py, do not edit by hand.
   Without Arial (Android) the stack falls through to system-ui as before. */
@font-face { font-family: "Saira Fallback"; font-style: normal; font-weight: 500 800; font-stretch: 100% 105%; src: local("Arial Bold"), local("Arial-BoldMT"); size-adjust: 95.7%; ascent-override: 118.6%; descent-override: 45.9%; line-gap-override: 0%; }
@font-face { font-family: "Saira Fallback"; font-style: normal; font-weight: 500 800; font-stretch: 106% 113%; src: local("Arial Bold"), local("Arial-BoldMT"); size-adjust: 102.6%; ascent-override: 110.6%; descent-override: 42.8%; line-gap-override: 0%; }
@font-face { font-family: "Saira Fallback"; font-style: normal; font-weight: 500 800; font-stretch: 114% 117%; src: local("Arial Bold"), local("Arial-BoldMT"); size-adjust: 105.1%; ascent-override: 107.9%; descent-override: 41.8%; line-gap-override: 0%; }
@font-face { font-family: "Saira Fallback"; font-style: normal; font-weight: 500 800; font-stretch: 118% 122%; src: local("Arial Bold"), local("Arial-BoldMT"); size-adjust: 108.3%; ascent-override: 104.8%; descent-override: 40.5%; line-gap-override: 0%; }
@font-face { font-family: "Saira Fallback"; font-style: normal; font-weight: 500 800; font-stretch: 123% 125%; src: local("Arial Bold"), local("Arial-BoldMT"); size-adjust: 111.4%; ascent-override: 101.9%; descent-override: 39.4%; line-gap-override: 0%; }
@font-face { font-family: "Saira Fallback"; font-style: italic; font-weight: 500 800; font-stretch: 100% 105%; src: local("Arial Bold Italic"), local("Arial-BoldItalicMT"); size-adjust: 97.2%; ascent-override: 116.8%; descent-override: 45.2%; line-gap-override: 0%; }
@font-face { font-family: "Saira Fallback"; font-style: italic; font-weight: 500 800; font-stretch: 106% 113%; src: local("Arial Bold Italic"), local("Arial-BoldItalicMT"); size-adjust: 103.0%; ascent-override: 110.2%; descent-override: 42.6%; line-gap-override: 0%; }
@font-face { font-family: "Saira Fallback"; font-style: italic; font-weight: 500 800; font-stretch: 114% 117%; src: local("Arial Bold Italic"), local("Arial-BoldItalicMT"); size-adjust: 105.1%; ascent-override: 107.9%; descent-override: 41.8%; line-gap-override: 0%; }
@font-face { font-family: "Saira Fallback"; font-style: italic; font-weight: 500 800; font-stretch: 118% 122%; src: local("Arial Bold Italic"), local("Arial-BoldItalicMT"); size-adjust: 107.8%; ascent-override: 105.3%; descent-override: 40.7%; line-gap-override: 0%; }
@font-face { font-family: "Saira Fallback"; font-style: italic; font-weight: 500 800; font-stretch: 123% 125%; src: local("Arial Bold Italic"), local("Arial-BoldItalicMT"); size-adjust: 110.5%; ascent-override: 102.7%; descent-override: 39.7%; line-gap-override: 0%; }
@font-face { font-family: "Barlow Fallback"; font-style: normal; font-weight: 400; src: local("Arial"), local("ArialMT"); size-adjust: 94.6%; ascent-override: 105.7%; descent-override: 21.1%; line-gap-override: 0%; }
@font-face { font-family: "Barlow Fallback"; font-style: normal; font-weight: 600; src: local("Arial Bold"), local("Arial-BoldMT"); size-adjust: 90.7%; ascent-override: 110.3%; descent-override: 22.1%; line-gap-override: 0%; }
@font-face { font-family: "Barlow Fallback"; font-style: normal; font-weight: 700; src: local("Arial Bold"), local("Arial-BoldMT"); size-adjust: 91.4%; ascent-override: 109.4%; descent-override: 21.9%; line-gap-override: 0%; }

/* ---------- Tokens ---------- */
:root {
  --c-bg: #0f1012;
  --c-surface: #17191d;
  --c-surface-2: #1f2227;
  --c-line: #2c3037;
  --c-text: #f3f3ef;          /* 17.1:1 on bg */
  --c-muted: #a9acb4;         /*  8.4:1 on bg, 7.8:1 on surface */
  --c-accent: #fcf217;        /* logo yellow, 16.2:1 on bg */
  --c-on-accent: #0f1012;
  --c-blue: #3939ff;          /* logo blue: decorative lines only (2.9:1 on bg) */
  --c-blue-text: #9a9aff;     /* lightened logo blue for links, 7.7:1 on bg */
  --c-danger: #ff8a7a;
  --c-success: #8ee59a;

  --f-display: "Saira", "Saira Fallback", system-ui, sans-serif;
  --f-body: "Barlow", "Barlow Fallback", system-ui, sans-serif;

  --s-1: .25rem; --s-2: .5rem; --s-3: .75rem; --s-4: 1rem; --s-5: 1.5rem;
  --s-6: 2rem; --s-7: 3rem; --s-8: 4rem; --s-9: 6rem;
  --radius: 2px;
  --skew: -12deg;
  --maxw: 74rem;
  --maxw-text: 44rem;

  /* motion: short, decisive, no loops; all off with prefers-reduced-motion (see "Motion" below) */
  --dur-fast: 150ms;          /* colour/hover feedback */
  --dur: 250ms;               /* menus, lightbox, wipes */
  --dur-slow: 500ms;          /* scroll reveal, line draw */
  --ease-out: cubic-bezier(.2, .8, .2, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }
body {
  margin: 0; background: var(--c-bg); color: var(--c-text);
  font: 400 1.0625rem/1.6 var(--f-body);
  text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; height: auto; }
img { display: block; }
a { color: var(--c-blue-text); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { color: var(--c-text); }
:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 3px; }
::selection { background: var(--c-accent); color: var(--c-on-accent); }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 var(--s-4); overflow-wrap: break-word; }
.hyphenate { hyphens: auto; } /* set by main.js only on headings with a word wider than the heading (Safari would split words that fit) */
p { margin: 0 0 var(--s-4); }
hr { border: 0; border-top: 1px solid var(--c-line); margin: var(--s-7) 0; }

.wrap { width: min(100% - 2.5rem, var(--maxw)); margin-inline: auto; }
.section { padding-block: var(--s-7); }
.muted { color: var(--c-muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; z-index: 100; background: var(--c-accent); color: var(--c-on-accent); padding: var(--s-3) var(--s-4); font-weight: 700; }
.skip:focus { left: var(--s-4); top: var(--s-4); }
.icon { width: 1.2em; height: 1.2em; flex: none; vertical-align: -.2em; }

/* ---------- Type helpers ---------- */
.display {
  font-family: var(--f-display); font-style: italic; font-stretch: 125%; font-weight: 800;
  letter-spacing: -.01em; line-height: .98; text-transform: uppercase;
}
.eyebrow {
  display: flex; align-items: center; gap: var(--s-3); margin: 0 0 var(--s-3);
  font: 600 .8125rem/1.2 var(--f-display); font-stretch: 110%; letter-spacing: .14em; text-transform: uppercase; color: var(--c-muted);
}
.eyebrow::before { content: ""; width: 2.5rem; height: 1px; background: var(--c-blue); flex: none; }
.lead { font-size: 1.1875rem; color: var(--c-muted); max-width: var(--maxw-text); }
.more {
  display: inline-flex; align-items: center; gap: var(--s-2); text-decoration: none;
  min-height: 2.75rem; /* touch target */
  font: 600 .9375rem/1.2 var(--f-display); font-stretch: 110%; letter-spacing: .06em; text-transform: uppercase;
}
.more .icon { transition: transform .2s; }
.more:hover .icon { transform: translateX(3px); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 3rem; padding: .9rem 1.5rem; border: 2px solid var(--c-accent); border-radius: var(--radius);
  font: 700 1rem/1 var(--f-display); font-stretch: 115%; letter-spacing: .06em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; background: none; color: var(--c-text);
}
.btn-primary { background: var(--c-accent); color: var(--c-on-accent); }
.btn-primary:hover { background: #fff; border-color: #fff; color: var(--c-on-accent); }
.btn-ghost { position: relative; isolation: isolate; }
.btn-ghost:hover { color: var(--c-text); }
/* hover/focus: a yellow tint wipes in from the left (follows the button's skew on larger screens) */
.btn-ghost::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(252, 242, 23, .14);
  transform: scaleX(0); transform-origin: left; transition: transform var(--dur) var(--ease-out);
}
.btn-ghost:hover::before, .btn-ghost:focus-visible::before { transform: none; }
.actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.actions .btn { flex: 1 1 100%; }

/* ---------- Header & navigation ---------- */
.site-header { position: relative; z-index: 20; background: var(--c-bg); border-bottom: 1px solid var(--c-line); }
.site-header.is-overlay { position: absolute; inset: 0 0 auto; background: transparent; border-bottom: 0; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--s-5); padding-block: var(--s-3); }
.logo { display: block; flex: none; }
.logo img { width: 168px; height: auto; }

.nav-toggle {
  display: inline-flex; align-items: center; gap: var(--s-2); min-height: 2.75rem; padding: 0 var(--s-3);
  background: rgba(15, 16, 18, .6); border: 1px solid var(--c-line); border-radius: var(--radius); color: var(--c-text);
  font: 600 .875rem/1 var(--f-display); letter-spacing: .1em; text-transform: uppercase; cursor: pointer;
}
.nav-toggle .icon-close, .nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: inline; }
.nav-toggle[aria-expanded="true"] { border-color: var(--c-accent); }
.nav {
  display: none; position: absolute; top: 100%; left: 0; right: 0; max-height: calc(100vh - 4.5rem); max-height: calc(100dvh - 4.5rem); overflow-y: auto;
  background: var(--c-surface); border-block: 1px solid var(--c-line); box-shadow: 0 1.5rem 2rem rgba(0, 0, 0, .5);
}
.nav.is-open { display: block; }
.nav ul { list-style: none; margin: 0 auto; padding: var(--s-2) 1.25rem var(--s-4); max-width: calc(var(--maxw) + 2.5rem); }
.nav a {
  display: block; padding: var(--s-4) 0; border-bottom: 1px solid var(--c-line); color: var(--c-text); text-decoration: none;
  font: 600 1.0625rem/1 var(--f-display); font-stretch: 112%; letter-spacing: .06em; text-transform: uppercase;
}
.nav a[aria-current], .nav .current-menu-item > a { color: var(--c-accent); }

/* ---------- Page header (inner pages) ---------- */
.page-header { position: relative; overflow: hidden; padding-block: var(--s-7) var(--s-6); border-bottom: 1px solid var(--c-line); background: var(--c-surface); }
/* construction lines as in the logo: horizontal (::before) and diagonal (::after) apart, so each can animate on its own */
.page-header::before, .page-header::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .7; }
.page-header::before { background: linear-gradient(var(--c-blue), var(--c-blue)) 100% 30% / 35% 1px no-repeat; }
.page-header::after { background: linear-gradient(105deg, transparent calc(70% - .5px), var(--c-blue) 70%, transparent calc(70% + .5px)) no-repeat; }
.page-header h1 { font-size: clamp(2.25rem, 8vw, 4.5rem); margin: 0; position: relative; z-index: 1; }
.page-header .lead { margin: var(--s-4) 0 0; position: relative; z-index: 1; }

/* ---------- Prose (editor content) ---------- */
.prose { max-width: var(--maxw-text); }
.prose h2 { font: 800 clamp(1.5rem, 4vw, 2rem)/1.1 var(--f-display); font-style: italic; font-stretch: 115%; text-transform: uppercase; margin: var(--s-7) 0 var(--s-4); }
.prose h3 { font: 700 1.25rem/1.2 var(--f-display); font-stretch: 110%; margin: var(--s-6) 0 var(--s-3); }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.25rem; margin: 0 0 var(--s-5); }
.prose li { margin-bottom: var(--s-2); }
.prose li::marker { color: var(--c-accent); }
.prose strong { font-weight: 700; }
.prose blockquote { margin: var(--s-5) 0; padding-left: var(--s-5); border-left: 2px solid var(--c-accent); color: var(--c-muted); }
.prose figure { margin: var(--s-6) 0; }
.prose figcaption, .wp-element-caption { font-size: .875rem; color: var(--c-muted); margin-top: var(--s-2); }
.prose table { width: 100%; border-collapse: collapse; margin: var(--s-5) 0; font-size: 1rem; }
.prose th, .prose td { text-align: left; padding: var(--s-3) var(--s-3); border-bottom: 1px solid var(--c-line); vertical-align: top; }
.prose thead th { font: 600 .75rem/1.2 var(--f-display); letter-spacing: .1em; text-transform: uppercase; color: var(--c-muted); }
.prose .wp-block-table { overflow-x: auto; margin: var(--s-4) 0 var(--s-5); }
.prose .wp-block-table table { margin: 0; }
.prose th:first-child, .prose td:first-child { padding-left: 0; }
.prose th:last-child, .prose td:last-child { padding-right: 0; }
.prose .wp-block-table table { border: 0; }
.prose .wp-block-table td, .prose .wp-block-table th { border: 0; border-bottom: 1px solid var(--c-line); }
.prose .wp-block-table thead { border-bottom: 0; }
.prose .placeholder, .placeholder { color: var(--c-muted); font-style: normal; border-left: 2px dashed var(--c-line); padding-left: var(--s-3); }
.alignwide { max-width: var(--maxw); }

.link-list { list-style: none; padding: 0; margin: 0; max-width: var(--maxw-text); border-top: 1px solid var(--c-line); }
.link-list a { display: block; padding: var(--s-4) 0; border-bottom: 1px solid var(--c-line); text-decoration: none; font: 600 1.125rem var(--f-display); font-stretch: 110%; }

/* ---------- News ---------- */
.news-list { display: grid; gap: 0; max-width: var(--maxw-text); }
.news-item { padding-block: var(--s-5); border-bottom: 1px solid var(--c-line); }
.news-item time { font: 600 .8125rem var(--f-display); letter-spacing: .1em; text-transform: uppercase; color: var(--c-muted); }
.news-item h3 { margin: var(--s-1) 0 var(--s-2); font-size: 1.3125rem; }
.news-item h3 a { color: var(--c-text); text-decoration: none; }
.news-item h3 a:hover { color: var(--c-accent); }
.news-item p { margin: 0; color: var(--c-muted); }
.post-image { margin: 0 0 var(--s-6); }
.back { margin-top: var(--s-7); }
.nav-links { display: flex; gap: var(--s-4); margin-top: var(--s-6); }

/* ---------- Section heads ---------- */
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 0 var(--s-5); margin-bottom: var(--s-5); }
.section-head h2 { font-size: clamp(2rem, 6vw, 3.25rem); margin: 0; }
.h-small { font-size: clamp(1.5rem, 4vw, 2rem); }

/* ---------- Events: season list (timing-screen style) ---------- */
.season { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--c-line); }
.event-row { /* phones: date and actions share the first line, title below; actions wrap under the date if they don't fit */
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2);
  padding: var(--s-4) var(--s-3); border-bottom: 1px solid var(--c-line);
}
.event-date { display: flex; align-items: baseline; gap: var(--s-3); }
.event-date .d { font: 700 1.25rem/1 var(--f-display); font-stretch: 115%; font-style: italic; font-variant-numeric: tabular-nums; white-space: nowrap; }
.event-date .w { display: none; font: 600 .75rem/1 var(--f-display); letter-spacing: .12em; text-transform: uppercase; color: var(--c-muted); }
.event-name a { color: var(--c-text); text-decoration: none; font-weight: 600; font-size: 1.1875rem; line-height: 1.3; display: inline-block; padding-block: .6rem; margin-block: -.6rem; /* 44px touch target, same layout */ }
.event-name a:hover { color: var(--c-accent); }
.event-name { order: 3; flex: 1 1 100%; }
.event-name small { display: block; color: var(--c-muted); font-size: .9375rem; }
.event-actions { order: 2; margin-left: auto; display: flex; justify-content: flex-end; gap: .375rem; }
.event-actions .tag { min-height: 2.25rem; padding-inline: .55rem; letter-spacing: .06em; }
.event-actions .tag-icon { min-width: 2.25rem; }
.event-row.is-past, .event-row.is-past .event-name a, .event-row.is-past .event-date .d { color: var(--c-muted); }
.event-row.is-next { background: linear-gradient(90deg, rgba(252, 242, 23, .12), transparent 75%); box-shadow: inset 3px 0 0 var(--c-accent); }
.event-row.is-running { box-shadow: inset 3px 0 0 var(--c-accent); }

.tag {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-1); min-height: 2.75rem; padding: .4rem .85rem;
  border: 1px solid currentColor; border-radius: var(--radius); white-space: nowrap; text-decoration: none;
  font: 600 .75rem/1 var(--f-display); letter-spacing: .1em; text-transform: uppercase; color: var(--c-blue-text);
}
.tag:hover { color: var(--c-text); }
.tag-primary { background: var(--c-accent); border-color: var(--c-accent); color: var(--c-on-accent); }
.tag-primary:hover { background: #fff; border-color: #fff; color: var(--c-on-accent); }
.tag-muted { color: var(--c-muted); border-color: var(--c-line); }
.tag-icon { min-width: 2.75rem; padding-inline: .55rem; }
.tag-icon .icon { width: 1.1rem; height: 1.1rem; }

.subscribe {
  display: grid; gap: var(--s-4); margin-top: var(--s-7); padding: var(--s-5);
  background: var(--c-surface); border: 1px solid var(--c-line); border-left: 3px solid var(--c-blue);
}
.subscribe > .icon { width: 2rem; height: 2rem; color: var(--c-accent); }
.subscribe p { margin: 0; color: var(--c-muted); }
.subscribe strong { color: var(--c-text); }

.older-season { border-top: 1px solid var(--c-line); }
.older-season:last-of-type { border-bottom: 1px solid var(--c-line); margin-bottom: var(--s-6); }
.older-season summary { cursor: pointer; padding: var(--s-4) 0; font: 700 1.125rem var(--f-display); font-stretch: 112%; text-transform: uppercase; }
.older-season .season { border-top: 0; margin-bottom: var(--s-4); }

/* ---------- Countdown ---------- */
.countdown { display: flex; gap: var(--s-2); margin: 0 0 var(--s-6); }
.countdown div {
  flex: 1; min-width: 0; padding: var(--s-3) var(--s-2) var(--s-2); text-align: center;
  background: rgba(23, 25, 29, .85); border: 1px solid var(--c-line); border-top: 2px solid var(--c-accent);
}
.countdown b { display: block; font: 700 clamp(1.75rem, 7vw, 2.75rem)/1 var(--f-display); font-stretch: 120%; font-style: italic; font-variant-numeric: tabular-nums; }
.countdown small { font: 600 .75rem/1 var(--f-display); letter-spacing: .14em; text-transform: uppercase; color: var(--c-muted); }

/* ---------- Race-day facts ---------- */
.raceday { background: var(--c-surface); border-block: 1px solid var(--c-line); }
.facts { display: grid; gap: var(--s-6); }
.fact { border-left: 1px solid var(--c-blue); padding-left: var(--s-5); }
.fact h3 { font: 700 1.25rem/1.2 var(--f-display); font-stretch: 115%; font-style: italic; text-transform: uppercase; margin: 0 0 var(--s-3); }
.fact ul { margin: 0; padding: 0; list-style: none; }
.fact li { display: flex; gap: var(--s-2); padding-block: var(--s-1); }
.fact .t { flex: none; min-width: 4rem; color: var(--c-accent); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Event detail ---------- */
.specs { display: grid; grid-template-columns: auto 1fr; gap: var(--s-2) var(--s-5); margin: 0 0 var(--s-6); max-width: var(--maxw-text); }
.specs dt { font: 600 .8125rem/1.8 var(--f-display); letter-spacing: .1em; text-transform: uppercase; color: var(--c-muted); }
.specs dd { margin: 0; font-weight: 600; }
.event-single .countdown { max-width: 32rem; }
.event-single .actions { margin-bottom: var(--s-7); }

/* ---------- Front page: hero ---------- */
.hero { --hero-img: 18rem; position: relative; isolation: isolate; overflow: hidden; display: grid; align-items: end; min-height: 34rem; }
/* phones: the picture fills only the upper part (above the text) and fades into the page */
.hero picture, .hero-bg { position: absolute; inset: 0 0 auto; width: 100%; height: var(--hero-img); object-fit: cover; object-position: 68% 42%; z-index: -2; }
.hero::before { /* darker on the left like on desktop (logo, eyebrow), the car on the right stays bright */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(15, 16, 18, .85) 0%, rgba(15, 16, 18, .5) 50%, rgba(15, 16, 18, .1) 100%) 0 0 / 100% var(--hero-img) no-repeat,
    linear-gradient(180deg, rgba(15, 16, 18, .55) 0, rgba(15, 16, 18, .12) 4.5rem, rgba(15, 16, 18, .25) calc(var(--hero-img) - 8.5rem), var(--c-bg) var(--hero-img));
}
.hero::after { /* construction lines from the logo: the right one here, the left one on .hero-content */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .8;
  background: linear-gradient(var(--c-blue), var(--c-blue)) 100% 4.75rem / 30% 1px no-repeat;
}
.hero-content { --hero-pad: 10.5rem; --line-gap: 1.25rem; position: relative; padding-block: var(--hero-pad) var(--s-6); }
/* the left line keeps a fixed distance above the eyebrow, whatever the hero height and content */
.hero-content::before {
  content: ""; position: absolute; left: calc(50% - 50vw); width: 45vw; height: 1px; top: calc(var(--hero-pad) - var(--line-gap));
  background: var(--c-blue); opacity: .8; pointer-events: none;
}
.hero-title { font-size: clamp(2rem, 11vw, 6.25rem); font-size: clamp(2rem, min(11vw, 16svh), 6.25rem); margin: 0 0 var(--s-4); }
.hero-title a { color: var(--c-text); text-decoration: none; }
.hero-title a:hover { color: var(--c-accent); }
.hero .meta { font-size: 1.125rem; margin: 0 0 var(--s-6); }
.hero .meta strong { font-weight: 700; }
.hero .meta .keep { display: inline-block; } /* wrap between date, time and place, not inside them */

/* ---------- Cards (gallery teasers) ---------- */
.cards { display: grid; gap: var(--s-4); }
.card {
  position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: flex-end; min-height: 15rem;
  background: var(--c-surface); border-radius: var(--radius); color: var(--c-text); text-decoration: none;
}
.card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .4s ease; }
.card::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(15, 16, 18, .92), transparent 65%); }
.card:hover img { transform: scale(1.04); }
.card > div { padding: var(--s-5); }
.card h3 { margin: 0; font: 700 1.375rem/1.1 var(--f-display); font-stretch: 115%; font-style: italic; text-transform: uppercase; }
.card p { margin: var(--s-1) 0 0; color: var(--c-muted); font-size: .9375rem; }
.card:hover h3, .card:focus-visible h3 { color: var(--c-accent); }
.card-all { align-items: center; justify-content: center; text-align: center; border: 1px solid var(--c-line); background: var(--c-surface-2); min-height: 9rem; }
.card-all::before { display: none; }
.card-all h3 { color: var(--c-accent); }

/* ---------- Front page: news + newcomers ---------- */
.split { display: grid; gap: var(--s-7); }
.newbie { background: var(--c-surface); border: 1px solid var(--c-line); border-top: 3px solid var(--c-accent); padding: var(--s-6) var(--s-5); align-self: start; }
.newbie h2 { font-size: clamp(1.75rem, 5vw, 2.5rem); margin: 0 0 var(--s-4); }
.newbie-text > :last-child { margin-bottom: 0; }
.newbie ul { list-style: none; margin: var(--s-5) 0 0; padding: 0; }
.newbie li + li { margin-top: var(--s-2); }
.newbie ul a {
  display: inline-flex; align-items: center; gap: var(--s-2); min-height: 2.75rem; text-decoration: none;
  font: 700 1.125rem var(--f-display); font-stretch: 112%; text-transform: uppercase; letter-spacing: .04em;
}

/* ---------- Galleries ---------- */
.year-nav { position: sticky; top: 0; z-index: 5; margin: calc(var(--s-6) * -1) 0 var(--s-6); padding-block: var(--s-3); background: var(--c-bg); border-bottom: 1px solid var(--c-line); }
.year-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--s-2); overflow-x: auto; scrollbar-width: thin; }
.year-nav a {
  display: inline-flex; align-items: center; min-height: 2.5rem; padding: 0 var(--s-3); border: 1px solid var(--c-line); border-radius: var(--radius);
  color: var(--c-text); text-decoration: none; font: 700 .9375rem/1 var(--f-display); font-style: italic; font-variant-numeric: tabular-nums;
}
.year-nav a:hover { border-color: var(--c-accent); color: var(--c-accent); }
.year-group { padding-top: var(--s-6); scroll-margin-top: 4.5rem; }
.year-title { font-size: clamp(2rem, 6vw, 3rem); margin-bottom: var(--s-4); color: var(--c-accent); }
.gallery-grid { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.gallery-grid .card { min-height: 12rem; }
.gallery-grid .card h3 { font-size: 1.125rem; }

/* gallery block (frontend) */
.gallery-page .wp-block-gallery, .gallery-page .gallery {
  display: grid !important; gap: var(--s-1); grid-template-columns: repeat(3, 1fr); margin: 0;
}
.gallery-page .wp-block-gallery figure.wp-block-image, .gallery-page .gallery-item {
  width: auto !important; margin: 0 !important; aspect-ratio: 1; overflow: hidden; background: var(--c-surface); position: relative;
}
.gallery-page .wp-block-gallery img, .gallery-page .gallery-item img { width: 100%; height: 100% !important; object-fit: cover; transition: transform .3s; }
.gallery-page .wp-block-gallery a:hover img, .gallery-page .wp-block-gallery a:focus-visible img { transform: scale(1.05); }
.gallery-page .wp-block-gallery figcaption { display: none; }
.gallery-page a:focus-visible { outline-offset: -3px; }
.gallery-pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-4); padding-bottom: var(--s-8); }
.gallery-pager span { display: flex; gap: 0 var(--s-5); flex-wrap: wrap; }
.gallery-pager a { display: inline-flex; align-items: center; min-height: 2.75rem; }

/* lightbox */
.lightbox { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(10, 10, 12, .97); color: var(--c-text); }
.lightbox::backdrop { background: rgba(0, 0, 0, .8); }
.lightbox figure { margin: 0; height: 100%; display: grid; place-items: center; padding: 3.5rem 0.5rem 3rem; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 7rem); max-height: calc(100dvh - 7rem); width: auto; height: auto; object-fit: contain; }
.lightbox figcaption { color: var(--c-muted); margin-top: var(--s-2); text-align: center; }
.lb-count { position: absolute; left: var(--s-4); top: var(--s-4); margin: 0; font: 600 .875rem var(--f-display); letter-spacing: .1em; color: var(--c-muted); }
.lb-btn {
  position: absolute; display: grid; place-items: center; width: 3rem; height: 3rem; border: 1px solid var(--c-line); border-radius: var(--radius);
  background: rgba(23, 25, 29, .85); color: var(--c-text); cursor: pointer;
}
.lb-btn:hover { border-color: var(--c-accent); color: var(--c-accent); }
.lb-close { top: var(--s-3); right: var(--s-3); }
.lb-prev, .lb-next { bottom: var(--s-3); }
.lb-prev { left: calc(50% - 3.5rem); }
.lb-prev .icon { transform: rotate(180deg); }
.lb-next { left: calc(50% + .5rem); }

/* videos */
.video-grid { display: grid; gap: var(--s-5); }
.video-grid > * { margin: 0; }
.video-consent { margin: 0; }
.video-frame { position: relative; aspect-ratio: 16 / 9; background: var(--c-surface); overflow: hidden; display: grid; place-items: center; }
.video-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-play {
  position: relative; display: inline-flex; align-items: center; gap: var(--s-2); min-height: 3rem; padding: .8rem 1.25rem;
  background: var(--c-accent); color: var(--c-on-accent); border: 0; border-radius: var(--radius); cursor: pointer;
  font: 700 .9375rem/1.2 var(--f-display); font-stretch: 112%; text-transform: uppercase; letter-spacing: .04em; max-width: calc(100% - 2rem);
}
.video-play:hover { background: #fff; }
.video-note { position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: var(--s-2) var(--s-3); font-size: .8125rem; background: rgba(15, 16, 18, .85); color: var(--c-muted); }
.video-consent figcaption { margin-top: var(--s-2); color: var(--c-muted); }

/* ---------- Team ---------- */
.team-section + .team-section { padding-top: 0; }
.section-title { font-size: clamp(1.75rem, 5vw, 2.5rem); margin-bottom: var(--s-5); }
.team-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-5) var(--s-4); grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); }
.person img, .person-placeholder { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--c-surface); border-bottom: 2px solid var(--c-accent); }
.person-placeholder { display: grid; place-items: center; font: 800 3rem var(--f-display); font-style: italic; color: var(--c-line); }
.person-name { margin: var(--s-3) 0 0; font-weight: 700; }
.person-function { margin: 0; color: var(--c-muted); font: 600 .8125rem/1.4 var(--f-display); letter-spacing: .08em; text-transform: uppercase; }

/* ---------- Link lists (Links page) ---------- */
.prose .link-items { list-style: none; padding: 0; border-top: 1px solid var(--c-line); }
.prose .link-items li { margin: 0; padding: var(--s-4) 0; border-bottom: 1px solid var(--c-line); color: var(--c-muted); }
.prose .link-items a { font: 700 1.125rem var(--f-display); font-stretch: 110%; margin-right: var(--s-2); }

/* ---------- Results ---------- */
.results table { font-variant-numeric: tabular-nums; }
.results td:first-child { width: 3rem; color: var(--c-accent); font-weight: 700; }
.results tbody tr:nth-child(-n+3) td:nth-child(2) { font-weight: 700; }

/* ---------- Forms ---------- */
.contact-form { max-width: var(--maxw-text); margin-top: var(--s-6); }
.field { margin-bottom: var(--s-5); }
.field label { display: block; margin-bottom: var(--s-2); font-weight: 600; }
.req { font-weight: 400; color: var(--c-muted); font-size: .875rem; }
input[type="text"], input[type="email"], select, textarea {
  width: 100%; min-height: 3rem; padding: .7rem .9rem; border: 1px solid #4a4f58; border-radius: var(--radius);
  background: var(--c-surface); color: var(--c-text); font: inherit;
}
textarea { min-height: 10rem; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 1px; border-color: var(--c-accent); }
[aria-invalid="true"] { border-color: var(--c-danger); }
.field-error { color: var(--c-danger); margin: var(--s-2) 0 0; font-size: .9375rem; }
.form-errors { border: 1px solid var(--c-danger); border-left-width: 4px; padding: var(--s-4) var(--s-5); margin-bottom: var(--s-6); }
.form-errors ul { margin: 0; padding-left: 1.25rem; }
.form-errors a { color: var(--c-danger); }
.form-success { border: 1px solid var(--c-success); border-left-width: 4px; padding: var(--s-4) var(--s-5); }
.form-success p { margin: 0; }
.form-note { color: var(--c-muted); font-size: .9375rem; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Footer ---------- */
.checker { height: 10px; background: repeating-conic-gradient(var(--c-accent) 0 25%, transparent 0 50%) 0 0 / 10px 10px; }
.site-footer { padding-block: var(--s-7); color: var(--c-muted); font-size: .9375rem; }
.site-footer .wrap { display: grid; gap: var(--s-5); }
.footer-brand img { width: 150px; margin-bottom: var(--s-3); }
.footer-brand p { margin: 0; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 var(--s-5); }
.site-footer a { color: var(--c-text); text-decoration: none; display: inline-flex; align-items: center; min-height: 2.75rem; }
.site-footer a:hover { color: var(--c-accent); }
.footer-social { margin: 0; }

/* ==========================================================================
   Larger screens
   ========================================================================== */
@media (min-width: 640px) {
  .actions .btn { flex: 0 0 auto; transform: skewX(var(--skew)); }
  .actions .btn > * { transform: skewX(calc(var(--skew) * -1)); }
  .section { padding-block: var(--s-8); }
  .section-head { margin-bottom: var(--s-6); }
  .hero { --hero-img: 22rem; }
  .hero-content { --hero-pad: 13rem; padding-block: var(--hero-pad) var(--s-7); }
  .event-row { display: grid; grid-template-columns: 8.5rem 1fr auto; gap: var(--s-2) var(--s-4); padding: var(--s-4) var(--s-5); }
  .event-name { order: 0; }
  .event-name a { font-size: 1.125rem; }
  .event-actions { order: 0; margin-left: 0; flex-wrap: wrap; gap: var(--s-2); }
  .event-actions .tag { min-height: 2.75rem; padding-inline: .85rem; letter-spacing: .1em; }
  .event-actions .tag-icon { min-width: 2.75rem; padding-inline: .55rem; }
  .event-date .w { display: block; }
  .gallery-page .wp-block-gallery, .gallery-page .gallery { gap: var(--s-2); grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); }
  .event-date { grid-column: auto; flex-direction: column; gap: var(--s-1); }
  .subscribe { grid-template-columns: auto 1fr auto; align-items: center; }
  .countdown div { flex: 0 0 auto; min-width: 5.5rem; padding-inline: var(--s-3); }
}

@media (min-width: 640px) and (pointer: fine) {
  .tag, .event-actions .tag { min-height: 2.25rem; padding-inline: .7rem; }
  .tag-icon, .event-actions .tag-icon { min-width: 0; padding-inline: .55rem; }
}

@media (min-width: 861px) {
  .hero { min-height: min(90vh, 50rem); }
  .hero picture, .hero-bg { inset: 0; height: 100%; object-position: 70% 40%; }
  .hero::after { background: linear-gradient(var(--c-blue), var(--c-blue)) 100% 22% / 30% 1px no-repeat; }
  .hero::before { background: linear-gradient(90deg, rgba(15, 16, 18, .96) 0%, rgba(15, 16, 18, .75) 45%, rgba(15, 16, 18, .1) 100%), linear-gradient(0deg, var(--c-bg) 0%, transparent 35%); }
  .hero-content { --hero-pad: 10rem; --line-gap: 2.5rem; padding-block: var(--hero-pad) var(--s-8); }
  .facts { grid-template-columns: repeat(3, 1fr); }
  .cards { grid-template-columns: 2fr 1fr 1fr; }
  .card { min-height: 20rem; }
  .split { grid-template-columns: 1.3fr 1fr; }
  .split-single { grid-template-columns: minmax(0, 40rem); }
  .video-grid { grid-template-columns: 1fr 1fr; }
  .lb-prev, .lb-next { bottom: auto; top: 50%; transform: translateY(-50%); }
  .lb-prev { left: var(--s-3); }
  .lb-next { left: auto; right: var(--s-3); }
  .lightbox figure { padding: 3.5rem 4.5rem; }
  .lightbox img { max-height: calc(100vh - 6rem); }
  .logo img { width: 210px; }
  .is-overlay .logo img { width: clamp(220px, 24vw, 320px); }
  .nav-toggle { display: none; }
  .nav { display: block; position: static; max-height: none; overflow: visible; background: none; border: 0; box-shadow: none; }
  .nav ul { display: flex; gap: var(--s-5); margin: 0; padding: 0; max-width: none; }
  .nav a { position: relative; border: 0; border-bottom: 2px solid transparent; padding: var(--s-2) 0; font-size: .9375rem; }
  /* underline grows from the left; the transparent border keeps its space so nothing moves */
  .nav a::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--c-accent);
    transform: scaleX(0); transform-origin: left; transition: transform var(--dur) var(--ease-out);
  }
  .nav a:hover, .nav a[aria-current], .nav .current-menu-item > a { color: var(--c-text); }
  .nav a:hover::after, .nav a:focus-visible::after, .nav a[aria-current]::after, .nav .current-menu-item > a::after { transform: none; }
  .section { padding-block: var(--s-9); }
  .page-header { padding-block: var(--s-9) var(--s-7); }
  .site-footer .wrap { grid-template-columns: auto 1fr auto; align-items: end; gap: var(--s-6); }
  .footer-nav ul { justify-content: flex-end; }
}

/* Narrow desktop: the seven menu items have to fit next to the logo */
@media (min-width: 861px) and (max-width: 1099px) {
  .nav ul { gap: var(--s-4); }
  .nav a { font-size: .8125rem; letter-spacing: .04em; }
  .logo img { width: 180px; }
  .is-overlay .logo img { width: 200px; }
}

/* Phones in landscape: little height, so less empty space above the race */
@media (orientation: landscape) and (max-height: 500px) and (max-width: 960px) {
  .hero-content { --hero-pad: 6.5rem; --line-gap: 1rem; }
  .hero picture, .hero-bg { inset: 0; height: 100%; object-position: 70% 40%; }
  .hero::before { background: linear-gradient(0deg, var(--c-bg) 40%, rgba(15, 16, 18, .72) 100%); }
  .hero::after { background: linear-gradient(var(--c-blue), var(--c-blue)) 100% 5rem / 30% 1px no-repeat; }
}

/* ==========================================================================
   Motion
   Rules: only transform and opacity move (colour changes may fade); nothing starts
   hidden unless main.js has set html.js-reveal; the hero title, image and buttons
   (LCP) are never delayed; no loops. prefers-reduced-motion switches everything off.
   ========================================================================== */

/* colour feedback on links and controls */
a, .btn, .tag, .lb-btn, .nav-toggle, .video-play {
  transition: color var(--dur-fast) ease, background-color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}

/* construction lines draw in once on load (decorative pseudo-elements, never the LCP element) */
@keyframes lmc-draw { from { transform: scaleX(0); } }
@keyframes lmc-fade-in { from { opacity: 0; } }
.hero::after, .page-header::before { transform-origin: right; animation: lmc-draw var(--dur-slow) var(--ease-out) .15s both; }
.hero-content::before { transform-origin: left; animation: lmc-draw var(--dur-slow) var(--ease-out) .3s both; }
.page-header::after { animation: lmc-fade-in var(--dur-slow) ease .3s both; }

/* gallery cards: a yellow line runs in along the bottom edge */
.card::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--c-accent);
  transform: scaleX(0); transform-origin: left; transition: transform var(--dur) var(--ease-out);
}
.card:hover::after, .card:focus-visible::after { transform: none; }
.card:focus-visible img { transform: scale(1.04); }

@media (hover: hover) {
  .event-row { transition: background-color var(--dur-fast) ease; }
  .event-row:hover { background-color: rgba(255, 255, 255, .035); }
}

/* scroll reveal: main.js marks only elements below the first screen with .reveal (never with JS off) */
.js-reveal .reveal { opacity: 0; transform: translateY(.75rem); }
.js-reveal .reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

/* mobile menu: short fade and slide; browsers without @starting-style just show it */
@media (width < 861px) {
  .nav { transition: opacity var(--dur) ease, transform var(--dur) var(--ease-out), display var(--dur) allow-discrete; }
  .nav:not(.is-open) { opacity: 0; transform: translateY(-.5rem); }
  @starting-style { .nav.is-open { opacity: 0; transform: translateY(-.5rem); } }
}

/* lightbox: fade in/out, picture settles from 97 %; image changes are animated in main.js */
.lightbox, .lightbox::backdrop { transition: opacity var(--dur) ease, display var(--dur) allow-discrete, overlay var(--dur) allow-discrete; }
.lightbox:not([open]), .lightbox:not([open])::backdrop { opacity: 0; }
.lightbox figure { transition: transform var(--dur) var(--ease-out); }
.lightbox:not([open]) figure { transform: scale(.97); }
@starting-style {
  .lightbox[open], .lightbox[open]::backdrop { opacity: 0; }
  .lightbox[open] figure { transform: scale(.97); }
}

/* page changes cross-fade (Chrome/Edge, Safari 18.2+); others navigate as before */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-group(root), ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 200ms; }
}

@media print {
  .js-reveal .reveal { opacity: 1 !important; transform: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .js-reveal .reveal { opacity: 1 !important; transform: none !important; }
}
