*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  overflow-x: hidden;
  max-width: 100%;
}

:root {
  --bg: #0d0f14;
  --surface: #161920;
  --surface2: #1e2230;
  --border: #2a2f3d;
  --text: #f0f2f7;
  --muted: #8892a4;
  --gold: #e8b84b;
  --teal: #34d399;
  --blue: #60a5fa;
  --red: #f87171;
  --amber: #fbbf24;
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 1200px;
  --font-serif: 'Playfair Display', serif;
  --font-sans: 'DM Sans', sans-serif;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
}

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Nav ── */
.site-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 60px;
  gap: 12px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav-logo-mark {
  width: 34px; height: 34px;
  background: var(--gold);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif);
  font-weight: 900; font-size: 17px;
  color: #0d0f14;
  flex-shrink: 0;
}

.nav-logo-text {
  font-family: var(--font-serif);
  font-weight: 700; font-size: 18px;
  color: var(--text);
}

.nav-logo-text span { color: var(--gold); }

.nav-links {
  display: flex;
  gap: 4px;
  margin-left: auto;
  list-style: none;
}

.nav-links a {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  transition: all 0.15s;
}

.nav-links a:hover {
  color: var(--text);
  background: var(--surface2);
  text-decoration: none;
}

.nav-links a.active {
  color: var(--gold);
  background: rgba(232,184,75,0.1);
}

/* ── Hero ── */
.hero {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 56px 0 44px;
  width: 100%;
  overflow: hidden;
}

.hero-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}

.hero-eyebrow a {
  color: var(--gold);
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.3px;
  margin-bottom: 14px;
  color: var(--text);
}

.hero h1 em {
  color: var(--gold);
  font-style: normal;
}

.hero-sub {
  font-size: 16px;
  color: var(--muted);
  max-width: 520px;
  margin-bottom: 28px;
  line-height: 1.6;
}

.stat-bar {
  display: flex;
  gap: 20px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  margin-top: 28px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 100%;
}

.stat-item { display: flex; flex-direction: column; }

.stat-value {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}

.stat-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

/* ── Badges ── */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-major    { background: rgba(232,184,75,0.15); color: var(--gold); }
.badge-flat     { background: rgba(52,211,153,0.15); color: var(--teal); }
.badge-pb       { background: rgba(96,165,250,0.15); color: var(--blue); }
.badge-debut    { background: rgba(232,184,75,0.1);  color: var(--amber); }
.badge-dest     { background: rgba(248,113,113,0.15);color: var(--red); }
.badge-active   { background: rgba(52,211,153,0.15); color: var(--teal); }
.badge-cancelled{ background: rgba(248,113,113,0.15);color: var(--red); }
.badge-postponed{ background: rgba(251,191,36,0.15); color: var(--amber); }
.badge-on-hiatus{ background: rgba(136,146,164,0.15);color: var(--muted); }
.badge-open     { background: rgba(52,211,153,0.15); color: var(--teal); }
.badge-ballot   { background: rgba(232,184,75,0.15); color: var(--gold); }

/* ── Hero buttons ── */
.btn-hero {
  display: inline-block;
  background: var(--gold);
  color: #0d0f14;
  padding: 12px 26px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 14px;
  transition: all 0.15s;
  margin-right: 10px;
  margin-bottom: 8px;
}

.btn-hero:hover {
  background: #f0c55a;
  text-decoration: none;
}

.btn-hero-ghost {
  display: inline-block;
  background: transparent;
  color: var(--text);
  padding: 12px 26px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 14px;
  border: 1px solid var(--border);
  transition: all 0.15s;
  margin-bottom: 8px;
}

.btn-hero-ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
  text-decoration: none;
}

/* ── Page layout ── */
.page-body {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  padding: 40px 0 80px;
  align-items: start;
  width: 100%;
  min-width: 0;
}

.page-body > * {
  min-width: 0;
  width: 100%;
}

/* ── Section blocks ── */
.section-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.section-block h2 {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Data rows ── */
.data-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.data-row:last-child { border-bottom: none; }
.data-label { color: var(--muted); font-weight: 500; }
.data-value { color: var(--text); font-weight: 600; text-align: right; }

/* ── Record cards ── */
.record-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.record-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.record-gender {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 8px;
}

.record-time {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: -0.5px;
  line-height: 1;
}

.record-athlete {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-top: 6px;
}

.record-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* ── Tags ── */
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.tag {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

/* ── Sidebar ── */
.side-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.side-card h3 {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.reg-open {
  background: rgba(52,211,153,0.15);
  border: 1px solid rgba(52,211,153,0.3);
  color: var(--teal);
  text-align: center;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 12px;
}

.reg-closed {
  background: rgba(248,113,113,0.15);
  border: 1px solid rgba(248,113,113,0.3);
  color: var(--red);
  text-align: center;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 12px;
}

.reg-ballot {
  background: rgba(232,184,75,0.15);
  border: 1px solid rgba(232,184,75,0.3);
  color: var(--gold);
  text-align: center;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 12px;
}

.btn-primary {
  display: block;
  width: 100%;
  background: var(--gold);
  color: #0d0f14;
  text-align: center;
  padding: 13px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 14px;
  transition: background 0.15s;
}

.btn-primary:hover {
  background: #f0c55a;
  text-decoration: none;
}

.verified-date {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin-top: 8px;
}

/* ── Weather ── */
.weather-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.weather-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}

.weather-value {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.weather-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 3px;
}

/* ── Map & elevation placeholders ── */
.map-container {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 16px;
}

.elevation-container {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
}

/* ── Race cards (browse/index) ── */
.race-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: all 0.15s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.race-card:hover {
  border-color: var(--gold);
  background: var(--surface2);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  text-decoration: none;
}

.race-card-date {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.race-card-name {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.3;
}

.race-card-city {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}

.race-card-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 16px;
}

.race-card-stats {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--muted);
  padding-top: 12px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.race-card-stats span { display: flex; align-items: center; gap: 4px; }

/* ── Cancelled banner ── */
.cancelled-banner {
  background: rgba(248,113,113,0.1);
  border: 1px solid rgba(248,113,113,0.3);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--red);
}

/* ── Section heading ── */
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.section-heading h2 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.section-heading a {
  font-size: 13px;
  color: var(--muted);
}

.section-heading a:hover { color: var(--gold); }

/* ── Grade pills ── */
.grade-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
}

/* ── Footer ── */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 36px 0;
  margin-top: 0;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-logo {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.footer-logo span { color: var(--gold); }

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  color: var(--muted);
  font-size: 13px;
}

.footer-links a:hover { color: var(--gold); text-decoration: none; }

.footer-copy {
  font-size: 12px;
  color: var(--muted);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .page-body { grid-template-columns: 1fr; }
  .hero h1 { font-size: 28px; }
  .stat-bar { gap: 20px; }
  .record-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; gap: 16px; text-align: center; }
  .nav-links li:not(:last-child) { display: none; }
}


/* ── Browse cards ── */
.browse-card {
  display: grid;
  grid-template-columns: 1fr 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s;
}

.browse-card:hover { text-decoration: none; }

.browse-card-info {
  padding: 18px 20px;
}

.browse-card-spark {
  border-left: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--surface2);
}

@media (max-width: 480px) {
  .browse-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }

  .browse-card-spark {
    border-left: none;
    border-top: 1px solid var(--border);
    height: 90px;
    padding: 12px 16px;
  }
}

@media (max-width: 768px) {
  .page-body {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }

  .page-body > * {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* ── Blog ── */
.blog-body {
  font-size: 15px;
  line-height: 1.85;
  color: var(--muted);
}

.blog-body h2 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-top: 36px;
  margin-bottom: 14px;
}

.blog-body h3 {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-top: 28px;
  margin-bottom: 10px;
}

.blog-body p {
  margin-bottom: 16px;
}

.blog-body a {
  color: var(--gold);
  text-decoration: underline;
}

.blog-body ul, .blog-body ol {
  margin-left: 24px;
  margin-bottom: 16px;
}

.blog-body li {
  margin-bottom: 6px;
}

.blog-body strong {
  color: var(--text);
  font-weight: 600;
}

.blog-body blockquote {
  border-left: 3px solid var(--gold);
  padding-left: 16px;
  margin: 24px 0;
  font-style: italic;
  color: var(--muted);
}

.blog-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

@media (max-width: 768px) {
  .blog-post-grid {
    grid-template-columns: 1fr !important;
  }
}