/* Shared styles for the past-race pages (race-2023.html … race-2026.html) */
@font-face { font-family: "Rahong"; src: url("fonts/Rahong.woff2") format("woff2"), url("fonts/Rahong.ttf") format("truetype"); font-display: swap; }
:root {
  --bg: #f6f7f8; --fg: #15181c; --muted: #5b636d; --line: #d9dde2; --accent: #1d7348;
  --tile: #ffffff; --ph-a: #e3e7eb; --ph-b: #dadfe4; --ph-fg: #5b636d;
  --header-bg: rgba(246,247,248,.92); --notice-bg: #2fbf71; --notice-fg: #15181c;
  --display: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  --heading: "Noto Sans Modi", "Barlow Condensed", Arial, sans-serif;
  --brand: "Rahong", "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111418; --fg: #eef1f4; --muted: #9aa3ad; --line: #2a3038; --accent: #4fd18b;
    --tile: #1a1f25; --ph-a: #1d2228; --ph-b: #222830; --ph-fg: #9aa3ad; --header-bg: rgba(17,20,24,.9);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111418; --fg: #eef1f4; --muted: #9aa3ad; --line: #2a3038; --accent: #4fd18b;
  --tile: #1a1f25; --ph-a: #1d2228; --ph-b: #222830; --ph-fg: #9aa3ad; --header-bg: rgba(17,20,24,.9);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--fg); font: 400 17px/1.6 var(--body); }
img { max-width: 100%; }
a { color: inherit; }
h1, h2 { font-family: var(--heading); font-weight: 800; text-transform: uppercase; line-height: 1; margin: 0; letter-spacing: .01em; text-wrap: balance; }
p { margin: 0; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: var(--header-bg); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-header .inner { padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { font-family: var(--brand); font-size: 26px; text-transform: uppercase; text-decoration: none; letter-spacing: .02em; white-space: nowrap; }
.nav { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: flex-end; }
.nav a { font: 500 15px var(--body); text-transform: uppercase; letter-spacing: .08em; text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a:focus-visible, .nav a.current { border-color: var(--accent); outline: none; }
.nav a.cta { color: var(--accent); }
.notice { background: var(--notice-bg); color: var(--notice-fg); text-align: center; padding: 8px 16px; font: 500 14px/1.4 var(--body); letter-spacing: .03em; }
.notice a { color: inherit; font-weight: 700; text-underline-offset: 3px; margin-left: 6px; white-space: nowrap; }
.menu-btn { display: none; }

/* Banner */
.banner { position: relative; overflow: hidden; }
/* Moves the main subject left of the centred title (used on TURN02) */
.banner img.shift-left { transform: scale(1.3); transform-origin: 100% 100%; }
@media (max-width: 720px) { .banner img.shift-left { transform: scale(1.15); transform-origin: 80% 100%; } }
/* Height grows with the screen width; photos are anchored to the bottom so their lower edge is never cut off */
.banner img { display: block; width: 100%; height: clamp(280px, 50vw, 92vh); object-fit: cover; object-position: 50% 100%; }
.banner .overlay { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; color: #fff;
  background: radial-gradient(ellipse 55% 55% at 50% 50%, rgba(0,0,0,.7), rgba(0,0,0,.35) 60%, rgba(0,0,0,.2)); }
.banner .overlay > div { display: grid; gap: 10px; justify-items: center; }
.banner h1 { font-size: clamp(38px, 6vw, 78px); text-shadow: 0 2px 6px rgba(0,0,0,.8), 0 0 28px rgba(0,0,0,.6); }
.banner .eyebrow { font: 500 clamp(18px, 2.2vw, 26px)/1.1 var(--display); text-transform: uppercase; letter-spacing: .06em; text-shadow: 0 2px 6px rgba(0,0,0,.8); }
.credit { margin: 0; padding: 10px 24px 0; text-align: right; color: var(--muted); font-size: 12px; }

/* Sections */
.section { padding: 72px 24px; }
.wrap { max-width: 1280px; margin: 0 auto; }
.section h2 { font-size: clamp(29px, 4vw, 52px); text-align: center; margin-bottom: 32px; }
.gallery-section { padding-top: 0; }

/* First finishers: simple table */
.ftable { width: 100%; max-width: 880px; margin: 0 auto; border-collapse: collapse; font-size: 16px; }
.ftable th, .ftable td { text-align: left; padding: 14px 16px 14px 0; border-bottom: 1px solid var(--line); vertical-align: baseline; }
.ftable { border-top: 1.5px solid var(--fg); }
.ftable tbody th { font-weight: 400; color: var(--muted); white-space: nowrap; }
.ftable td:nth-child(2) { font-weight: 600; }
.ftable td:nth-child(3) { color: var(--muted); }
.ftable .num { text-align: right; padding-right: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ftable tr.pending td { color: var(--muted); font-weight: 400; }
.src { max-width: 880px; margin: 14px auto 0; text-align: right; color: var(--muted); font-size: 13px; }
.src a { color: var(--accent); }

/* Gallery: 20 slots. A slot shows a numbered placeholder until its photo exists. */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.shot { position: relative; margin: 0; aspect-ratio: 3 / 2; overflow: hidden;
  background: repeating-linear-gradient(135deg, var(--ph-a) 0 18px, var(--ph-b) 18px 36px); }
.shot::before { content: "Photo " attr(data-n); position: absolute; inset: 0; display: grid; place-items: center;
  font: 600 13px var(--body); text-transform: uppercase; letter-spacing: .1em; color: var(--ph-fg); }
.shot img { position: relative; display: block; width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; transition: transform .3s ease; }
.shot img:hover { transform: scale(1.04); }
.shot.empty img { display: none; }
.gallery-credit { text-align: right; color: var(--muted); font-size: 13px; margin-top: 12px; }
.gallery-credit a { color: inherit; }
.gallery-credit a:hover { color: var(--accent); }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.pager a { display: inline-block; padding: 12px 0; font: 600 15px var(--body); text-transform: uppercase; letter-spacing: .06em; color: var(--accent); text-decoration: none; }
.pager a:hover { text-decoration: underline; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; background: #000; display: grid; place-items: center; padding: 48px 56px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 96px); object-fit: contain; }
.lightbox button { position: absolute; background: none; border: 0; color: #fff; font: 300 44px/1 var(--body); cursor: pointer; padding: 8px 14px; }
.lb-close { top: 8px; right: 8px; }
.lb-prev { left: 4px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 4px; top: 50%; transform: translateY(-50%); }

/* Footer */
.site-footer { padding: 56px 24px 40px; border-top: 1px solid var(--line); }
.site-footer .wrap { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.site-footer h4 { margin: 0 0 10px; font: 600 13px var(--body); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.copy-note { color: var(--muted); font-size: 14px; margin-top: 12px; }

@media (max-width: 560px) { .ftable { font-size: 14px; } .ftable th:nth-child(3), .ftable td:nth-child(3) { display: none; } .ftable th, .ftable td { padding-right: 10px; } }
@media (max-width: 860px) {
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .site-footer .wrap { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .site-header .inner { padding: 10px 16px; position: relative; }
  .logo { font-size: 20px; }
  .menu-btn { display: grid; align-content: center; gap: 5px; width: 44px; height: 44px; padding: 0 10px; margin-right: -10px; background: none; border: 0; cursor: pointer; color: var(--fg); }
  .menu-btn span { display: block; height: 2px; background: currentColor; border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
  .menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0; padding: 4px 16px 12px; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: 0 12px 24px -12px rgba(0,0,0,.25); }
  .nav.open { display: flex; }
  .nav a { font-size: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .nav a.current { border-bottom-color: var(--line); color: var(--accent); }
  .nav a:last-child { border-bottom: 0; }
  .notice { font-size: 13px; padding: 7px 12px; }
  .section { padding: 48px 16px; }
  .gallery-section { padding-top: 0; }
  .credit { padding: 8px 16px 0; }
  .gallery { gap: 8px; }
  .lightbox { padding: 48px 8px; }
  .site-footer { padding: 40px 16px 32px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .shot img { transition: none; } }

/* ---------- Language switch (very right of the header) ---------- */
.site-header .inner { justify-content: flex-start; }
.site-header .inner > .logo { margin-right: auto; }
.lang { display: flex; align-items: center; gap: 8px; flex: none; margin-left: 28px; }
.lang a { display: block; line-height: 0; padding: 2px; border-radius: 3px; opacity: .45; transition: opacity .15s ease; }
.lang a svg { display: block; width: 21px; height: 14px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.18); }
.lang a[aria-current] { opacity: 1; box-shadow: 0 0 0 2px var(--fg); }
.lang a:not([aria-current]):hover, .lang a:not([aria-current]):focus-visible { opacity: 1; outline: none; }
.lang a:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
@media (max-width: 720px) {
  .site-header .inner { gap: 6px; }
  .menu-btn { order: 2; flex: none; margin-right: 0 !important; }
  .site-header .inner > .logo { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 400px) { .site-header .inner > .logo { font-size: 18px; } }
@media (max-width: 340px) { .site-header .inner > .logo { font-size: 16px; } }

/* Per-photo credit: small label on the tile (on hover / always on touch) and under the photo in the lightbox */
.shot figcaption { position: absolute; right: 6px; bottom: 6px; z-index: 1; padding: 2px 7px; border-radius: 2px; background: rgba(0,0,0,.55); color: #fff; font: 500 11px/1.4 var(--body); letter-spacing: .02em; opacity: 0; transition: opacity .2s ease; pointer-events: none; }
.shot:hover figcaption { opacity: 1; }
/* Phones / touch screens: no credit on the tiles, only in the opened photo (lightbox) */
@media (hover: none), (max-width: 720px) { .shot figcaption { display: none; } }
.shot.empty figcaption { display: none; }
.lb-cap { position: absolute; left: 0; right: 0; bottom: 14px; margin: 0; text-align: center; color: rgba(255,255,255,.8); font: 500 13px var(--body); letter-spacing: .03em; }

/* Mobile: hamburger at the far right; the language switch moves into the menu (see script) */
@media (max-width: 720px) {
  .nav .lang { order: 0; margin: 0; padding: 16px 0 6px; gap: 14px; }
  .nav .lang a svg { width: 30px; height: 20px; }
}
