/* race-kit.css — shared styles for AREEP event sites.
   Per-event colors come from event.php 'theme' (brand, brand_ink, spark, spark_ink, mist). */

:root {
  --brand: #10325C;      /* event's main color */
  --brand-ink: #FFFFFF;  /* text on brand */
  --spark: #F5C518;      /* action color: Register buttons, current price */
  --spark-ink: #1A1D21;  /* text on spark */
  --ink: #1A1D21;
  --muted: #586270;
  --paper: #FFFFFF;
  --mist: #EDF1F5;
  --line: #D3DAE2;
  --display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 1140px;
  --radius: 8px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 1.0625rem/1.6 var(--body); color: var(--ink); background: var(--paper); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--spark); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { line-height: 1.15; margin: 0; }
p { margin: 0 0 1em; }
.rk-wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

.rk-skip { position: absolute; left: -9999px; top: 8px; z-index: 200; background: var(--paper); padding: 8px 12px; }
.rk-skip:focus { left: 8px; }

/* ---------- buttons */
.rk-btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: 600 1rem/1.2 var(--body); padding: .75em 1.25em; min-height: 44px;
  border-radius: var(--radius); border: 2px solid transparent; text-decoration: none;
  transition: background-color .15s, color .15s;
}
.rk-btn-go { background: var(--spark); color: var(--spark-ink); }
.rk-btn-go:hover { background: color-mix(in srgb, var(--spark) 85%, #000); }
.rk-btn-line { border-color: currentColor; color: var(--brand); background: transparent; }
.rk-btn-line:hover { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.rk-btn-sm { min-height: 36px; padding: .4em .9em; font-size: .9375rem; }
.rk-btns { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }

/* ---------- top bar */
.rk-top { position: sticky; top: 0; z-index: 50; background: var(--brand); color: var(--brand-ink); }
.rk-top-light { background: var(--paper); color: var(--ink); border-bottom: 1px solid var(--line); }
.rk-top-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; }
.rk-logo { color: inherit; font: 700 1.4rem/1 var(--display); text-decoration: none; }
.rk-logo img { max-height: 44px; width: auto; }
.rk-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 4px; }
.rk-nav a:not(.rk-btn) { color: inherit; text-decoration: none; font-weight: 500; padding: 10px 12px; border-radius: 6px; display: block; }
.rk-nav a:not(.rk-btn):hover { background: color-mix(in srgb, currentColor 12%, transparent); }
.rk-nav-reg { margin-left: 8px; }
.rk-navbtn { display: none; font: 600 1rem var(--body); color: inherit; background: none; border: 2px solid currentColor; border-radius: 6px; padding: 8px 14px; cursor: pointer; }

@media (max-width: 860px) {
  .rk-navbtn { display: block; }
  .rk-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: inherit; padding: 8px 20px 16px; box-shadow: 0 10px 20px rgba(0,0,0,.2); }
  .rk-top { background-clip: padding-box; }
  .rk-top-inner { position: relative; }
  .rk-nav.is-open { display: block; background: var(--brand); }
  .rk-top-light .rk-nav.is-open { background: var(--paper); }
  .rk-nav ul { flex-direction: column; align-items: stretch; }
  .rk-nav-reg { margin: 8px 0 0; }
  .rk-nav-reg .rk-btn { width: 100%; }
}

/* ---------- hero: the race bib */
.rk-hero { position: relative; display: flex; align-items: flex-end; min-height: min(80vh, 760px); background: var(--brand); overflow: hidden; }
.rk-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.rk-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, color-mix(in srgb, var(--brand) 75%, transparent), transparent 55%); }
.rk-hero-inner { position: relative; z-index: 1; width: 100%; padding-top: 72px; padding-bottom: 48px; }

.rk-bib {
  position: relative; max-width: 440px; background: var(--paper); color: var(--ink);
  border-radius: 10px; box-shadow: 0 2px 0 rgba(0,0,0,.08), 0 22px 50px rgba(0,0,0,.35);
  transform: rotate(-1.75deg); transform-origin: 30% 0;
  animation: rk-pin-up .7s cubic-bezier(.2,.9,.3,1.25) both .1s;
}
@keyframes rk-pin-up {
  from { opacity: 0; transform: translateY(40px) rotate(-6deg); }
  to   { opacity: 1; transform: translateY(0) rotate(-1.75deg); }
}
.rk-pin { position: absolute; z-index: 2; width: 13px; height: 13px; border-radius: 50%; background: #B9C2CC; border: 3px solid #E7EBEF; box-shadow: inset 0 1px 2px rgba(0,0,0,.35); }
.rk-pin-tl { top: 10px; left: 10px; } .rk-pin-tr { top: 10px; right: 10px; }
.rk-pin-bl { bottom: 10px; left: 10px; } .rk-pin-br { bottom: 10px; right: 10px; }

.rk-bib-band { background: var(--brand); color: var(--brand-ink); border-radius: 10px 10px 0 0; padding: 16px 36px 12px; text-align: center; }
.rk-bib-band h1 { font: 700 clamp(1.6rem, 4.5vw, 2rem)/1.05 var(--display); letter-spacing: .01em; }
.rk-bib-band p { margin: 4px 0 0; font-size: .9375rem; opacity: .85; }
.rk-bib-num { font: 700 clamp(6rem, 22vw, 9.5rem)/.85 var(--display); text-align: center; letter-spacing: -.02em; padding: 22px 0 10px; font-variant-numeric: lining-nums; }
.rk-bib-meta { text-align: center; padding: 0 28px; margin: 0 0 18px; color: var(--muted); }
.rk-bib-meta strong { color: var(--ink); font-weight: 600; }
.rk-bib-tab {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  border-top: 2px dashed var(--line); padding: 16px 32px 24px;
}
.rk-bib-tab p { margin: 0; }
.rk-price { color: var(--muted); line-height: 1.3; }
.rk-price-now { display: block; font: 700 2rem/1 var(--display); color: var(--ink); }

@media (max-width: 560px) {
  .rk-hero { min-height: 0; }
  .rk-hero-inner { padding-top: 160px; padding-bottom: 28px; }
  .rk-bib { transform: rotate(-1deg); }
  .rk-bib-tab .rk-btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rk-bib { animation: none; }
}

/* ---------- at a glance */
.rk-glance { border-bottom: 1px solid var(--line); }
.rk-glance-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 0 auto; }
.rk-glance-grid > div { padding: 22px 20px 20px; border-left: 1px solid var(--line); }
.rk-glance-grid > div:first-child { border-left: 0; padding-left: 0; }
.rk-glance dt { font-size: .875rem; color: var(--muted); font-weight: 500; }
.rk-glance dd { margin: 2px 0 0; font-weight: 600; line-height: 1.35; }
.rk-glance dd small { display: block; font-weight: 400; color: var(--muted); font-size: .9375rem; }
@media (max-width: 860px) {
  .rk-glance-grid { grid-template-columns: 1fr 1fr; }
  .rk-glance-grid > div { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); }
  .rk-glance-grid > div:nth-child(-n+2) { border-top: 0; }
  .rk-glance-grid > div:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--line); }
}

/* ---------- phase notice */
.rk-notice { background: color-mix(in srgb, var(--spark) 22%, var(--paper)); border-bottom: 1px solid color-mix(in srgb, var(--spark) 60%, var(--paper)); }
.rk-notice-inner { padding-top: 24px; padding-bottom: 12px; }
.rk-notice h2 { font: 700 1.6rem/1.1 var(--display); margin-bottom: 8px; }

/* ---------- details */
.rk-details { padding: 64px 0 24px; }
.rk-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; align-items: start; }
@media (max-width: 960px) { .rk-grid { grid-template-columns: 1fr; gap: 0; } .rk-aside { order: -1; margin-bottom: 40px; } }

.rk-block { margin: 0 0 52px; max-width: 70ch; }
.rk-block h2, .rk-course h2, .rk-sponsors h2, .rk-results h2 {
  font: 700 clamp(1.9rem, 4vw, 2.4rem)/1.05 var(--display); color: var(--brand); margin-bottom: 14px;
}
.rk-block h3, .rk-prose h3 { font: 600 1.15rem/1.3 var(--body); margin: 1.4em 0 .4em; }
.rk-prose ul, .rk-prose ol { padding-left: 1.25em; margin: 0 0 1em; }
.rk-prose li { margin-bottom: .35em; }
.rk-prose .rk-warn { color: #9B2C1F; font-weight: 600; }
.rk-lede { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }

.rk-table { border-collapse: collapse; width: 100%; max-width: 560px; margin: 8px 0 0; }
.rk-table th, .rk-table td { text-align: left; padding: 12px 14px 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.rk-table th { font-weight: 600; white-space: nowrap; }

/* fees */
.rk-tiers { list-style: none; padding: 0; margin: 10px 0 0; max-width: 560px; }
.rk-tiers li { display: flex; align-items: baseline; gap: 18px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.rk-tier-price { font: 700 1.6rem/1 var(--display); min-width: 3ch; }
.rk-tier-when { flex: 1; }
.rk-tiers .is-past { color: var(--muted); }
.rk-tiers .is-past .rk-tier-price { text-decoration: line-through; text-decoration-thickness: 2px; font-weight: 600; }
.rk-tiers .is-now { background: color-mix(in srgb, var(--spark) 28%, var(--paper)); border-radius: 6px; border-bottom-color: transparent; box-shadow: inset 4px 0 0 var(--spark); }
.rk-tier-tag { font-size: .875rem; font-weight: 600; }

/* figures */
.rk-figs { display: flex; flex-wrap: wrap; gap: 16px; margin: 8px 0 4px; }
.rk-figs figure { margin: 0; flex: 0 1 220px; }
.rk-figs img { border: 1px solid var(--line); border-radius: 6px; background: var(--mist); }
.rk-figs figcaption { font-size: .9375rem; color: var(--muted); margin-top: 6px; }

/* promo (e.g. a race series) */
.rk-promo { background: var(--brand); color: var(--brand-ink); border-radius: 12px; padding: 32px; max-width: none; }
.rk-promo h2 { color: var(--brand-ink); }
.rk-promo a:not(.rk-btn) { color: inherit; }
.rk-promo-body { display: grid; grid-template-columns: 200px 1fr; gap: 28px; align-items: start; }
.rk-promo-body img { border-radius: 8px; background: var(--paper); }
.rk-promo .rk-btns { margin-bottom: 0; }
.rk-promo .rk-price-callout { font: 700 1.5rem/1.2 var(--display); }
@media (max-width: 640px) { .rk-promo { padding: 24px 20px; } .rk-promo-body { grid-template-columns: 1fr; } .rk-promo-body img { max-width: 220px; } }

/* aside */
.rk-card { position: sticky; top: 88px; border: 2px solid var(--brand); border-radius: 12px; padding: 22px; }
.rk-card h2 { font: 700 1.5rem var(--display); margin-bottom: 8px; }
.rk-card-label { margin: 0; color: var(--muted); font-weight: 500; }
.rk-card-price { font: 700 3.25rem/1 var(--display); margin: 2px 0 8px; }
.rk-card-note { font-size: .9375rem; color: var(--muted); margin-bottom: 10px; }
.rk-card-btns { display: grid; gap: 10px; margin: 16px 0; }
.rk-quick { list-style: none; padding: 14px 0 0; margin: 0; border-top: 1px solid var(--line); }
.rk-quick li { padding: 4px 0; }
@media (max-width: 960px) { .rk-card { position: static; } }

/* ---------- course */
.rk-course { background: var(--mist); padding: 64px 0; }
.rk-course-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 40px; margin-top: 18px; }
.rk-course-map { background: var(--paper); border-radius: 10px; overflow: hidden; min-height: 200px; }
.rk-course-notes ul { padding-left: 1.2em; }
.rk-course-notes li { margin-bottom: .6em; }
.rk-course-notes h3 { font: 600 1.15rem var(--body); margin-bottom: 8px; }
.rk-finish { margin: 28px 0 0; }
.rk-finish img { border-radius: 8px; }
.rk-finish figcaption { margin-top: 10px; font-size: .9375rem; }
@media (max-width: 860px) { .rk-course-grid { grid-template-columns: 1fr; } }

/* ---------- sponsors */
.rk-sponsors { padding: 64px 0; text-align: center; }
.rk-sponsors .rk-lede { margin: 0 auto 8px; }
.rk-tier { margin-top: 36px; }
.rk-tier h3 { font: 600 1rem var(--body); color: var(--muted); margin-bottom: 14px; }
.rk-tier ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 28px 48px; }
.rk-tier li { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.rk-tier img { max-height: 64px; width: auto; }
.rk-tier-platinum img { max-height: 96px; }
.rk-tier small { color: var(--muted); font-size: .875rem; }
.rk-sponsor-cta { margin: 56px auto 0; padding-top: 36px; border-top: 1px solid var(--line); max-width: 640px; }
.rk-sponsor-cta h3 { font: 700 1.6rem var(--display); margin-bottom: 8px; }
.rk-sponsor-cta .rk-btns { justify-content: center; }

/* ---------- results */
.rk-results { background: var(--mist); padding: 64px 0; }
.rk-results-img { border-radius: 10px; margin: 8px 0 28px; max-height: 480px; width: 100%; object-fit: cover; }
.rk-records { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 8px 0 12px; }
.rk-record { background: var(--paper); border-radius: 10px; padding: 18px 20px; }
.rk-record h3 { font: 600 1.05rem var(--body); margin-bottom: 8px; }
.rk-record dl { margin: 0; }
.rk-record dl div { display: grid; grid-template-columns: 88px 1fr; padding: 4px 0; }
.rk-record dt { color: var(--muted); }
.rk-record dd { margin: 0; }
.rk-record dd strong { font: 700 1.25rem var(--display); margin-right: 4px; }
@media (max-width: 640px) { .rk-records { grid-template-columns: 1fr; } }

.rk-years { list-style: none; padding: 0; margin: 28px 0 0; border-top: 2px solid var(--brand); }
.rk-years > li { display: grid; grid-template-columns: 100px 1fr; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.rk-year { font: 700 2rem/1 var(--display); color: var(--brand); }
.rk-year-links { display: flex; gap: 8px; margin: 0 0 6px; }
.rk-year-note { margin: 0 0 4px; }
.rk-year-extra { margin: 0; font-size: .9375rem; }
.rk-videos { padding-left: 1.2em; }
.rk-results h3 { font: 600 1.15rem var(--body); margin: 32px 0 8px; }

/* ---------- footer */
.rk-foot { background: var(--brand); color: color-mix(in srgb, var(--brand-ink) 85%, transparent); padding: 48px 0 100px; font-size: .9375rem; }
.rk-foot a { color: var(--brand-ink); }
.rk-foot h2 { font: 600 1rem var(--body); color: var(--brand-ink); margin-bottom: 8px; }
.rk-foot ul { list-style: none; padding: 0; margin: 0; }
.rk-foot li { margin-bottom: 4px; }
.rk-foot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; }
.rk-foot-logo { max-height: 52px; width: auto; margin-bottom: 12px; }
.rk-copy { margin: 32px 0 0; opacity: .7; }
.rk-events { margin-bottom: 40px; padding-bottom: 32px; border-bottom: 1px solid color-mix(in srgb, var(--brand-ink) 20%, transparent); }
.rk-events h2 { font: 700 1.6rem var(--display); margin-bottom: 18px; }
.rk-events ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; }
.rk-events a { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; background: var(--paper); color: var(--ink); border-radius: 8px; padding: 12px; }
.rk-events img { max-height: 40px; width: auto; }
.rk-events span { font-size: .8125rem; color: var(--muted); }
@media (max-width: 760px) { .rk-foot-grid { grid-template-columns: 1fr; } }
@media (min-width: 861px) { .rk-foot { padding-bottom: 48px; } }

/* ---------- mobile register bar */
.rk-mobilebar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--paper); border-top: 1px solid var(--line); box-shadow: 0 -6px 18px rgba(0,0,0,.12);
}
.rk-mobilebar[hidden] { display: none; }
.rk-mobilebar p { margin: 0; color: var(--muted); line-height: 1.25; }
.rk-mobilebar strong { font: 700 1.5rem var(--display); color: var(--ink); }
@media (min-width: 861px) { .rk-mobilebar { display: none !important; } }
.rk-nw { white-space: nowrap; }

.rk-social { display: flex; flex-wrap: wrap; gap: 8px; }
.rk-social li { margin: 0; }
.rk-foot .rk-social a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px; text-decoration: none; font-weight: 500;
  border: 1px solid color-mix(in srgb, var(--brand-ink) 45%, transparent);
}
.rk-foot .rk-social a:hover { background: var(--brand-ink); color: var(--brand); }
.rk-social i { width: 1.1em; text-align: center; font-size: 1.1em; }

/* ---------- registration-opens line + video embeds */
.rk-opens { margin: 0; font-weight: 600; color: var(--ink); background: color-mix(in srgb, var(--spark) 22%, var(--paper)); border-radius: var(--radius); padding: .65em 1em; }
.rk-video { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #000; margin: 8px 0 28px; }
.rk-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }


.rk-table-full { max-width: none; font-size: .9375rem; }
.rk-table-full thead th { font-size: .875rem; color: var(--muted); font-weight: 600; border-bottom: 2px solid var(--brand); white-space: nowrap; }
.rk-table-full td { padding-right: 16px; }
.rk-table-full tbody tr:nth-child(even) td { background: var(--mist); }
.rk-table-full td:first-child { padding-left: 8px; }
.rk-table-full thead th:first-child { padding-left: 8px; }

/* ---------- organizer logo on the bib */
.rk-bib-org { display: flex; align-items: center; justify-content: center; gap: 10px; margin: -4px 28px 18px; text-decoration: none; color: var(--muted); font-size: .8125rem; font-weight: 500; }
.rk-bib-org img { height: 30px; width: auto; }
.rk-bib-org:hover span { text-decoration: underline; }

/* ---------- tap-to-enlarge images */
.rk-zoom { cursor: zoom-in; }
.rk-lightbox { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 96vh; overflow: visible; cursor: zoom-out; }
.rk-lightbox::backdrop { background: rgba(0, 0, 0, .82); }
.rk-lightbox img { display: block; max-width: 94vw; max-height: 84vh; width: auto; height: auto; margin: 0 auto; border-radius: 8px; background: #fff; }
.rk-lightbox-cap { margin: 10px 0 0; text-align: center; color: #fff; font-weight: 500; }
.rk-lightbox-cap:empty { display: none; }
.rk-lightbox-close { position: fixed; top: 14px; right: 14px; font: 600 1rem var(--body); color: #fff; background: rgba(0,0,0,.5); border: 2px solid #fff; border-radius: 999px; padding: 8px 16px; cursor: pointer; }