/* ElevateRace — mobile-first card-grid draft */
:root {
  --brand: #e10339;
  --brand-dark: #b8022e;
  --ink: #030303;
  --muted: #5a5a5a;
  --bg: #f4f4f5;
  --bg-alt: #ececee;
  --white: #ffffff;
  --border: #e2e2e5;
  --shadow: 0 8px 24px rgba(3, 3, 3, 0.08);
  --radius: 14px;
  --header-h: 64px;
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --max: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--white);
  line-height: 1.55;
  padding-top: var(--header-h);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.6em; font-weight: 750; letter-spacing: -0.02em; }
h1 { font-size: clamp(1.75rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.85rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1rem; color: var(--ink); }
ul, ol { margin: 0 0 1rem; padding-left: 1.2rem; }
li { margin-bottom: 0.35rem; }
.container { width: min(100% - 2rem, var(--max)); margin-inline: auto; }
.section { padding: 2.5rem 0; }
.section-alt { background: var(--bg); }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 42rem; }

/* Header */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  z-index: 1000;
  overflow: visible;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.logo-link { display: flex; align-items: center; gap: 0.55rem; text-decoration: none; color: var(--ink); }
.logo-link img { height: 40px; width: auto; }
.logo-word { display: none; } /* logo-dark.png already includes wordmark */
.logo-link img { height: 42px; width: auto; max-width: 160px; object-fit: contain; }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--white);
  cursor: pointer;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block; width: 18px; height: 2px; background: var(--ink); position: relative;
}
.nav-toggle span::before, .nav-toggle span::after {
  content: ""; position: absolute; left: 0;
}
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }

.nav-panel {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem 1.25rem;
  display: none;
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
  box-shadow: var(--shadow);
}
.nav-panel.open { display: block; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.nav-list > li > a,
.nav-list .drop-toggle {
  display: block;
  padding: 0.7rem 0.85rem;
  color: var(--ink);
  font-weight: 600;
  border-radius: 10px;
  text-decoration: none;
}
.nav-list > li > a:hover,
.nav-list .drop-toggle:hover { background: var(--bg); text-decoration: none; }
.drop-toggle {
  width: 100%; text-align: left; border: 0; background: transparent; cursor: pointer; font: inherit;
}
.dropdown-menu {
  list-style: none; margin: 0 0 0.5rem; padding: 0 0 0 0.75rem; display: none;
}
.dropdown.is-open > .dropdown-menu { display: block !important; }
.dropdown-menu a {
  display: block; padding: 0.55rem 0.85rem; color: var(--muted); font-weight: 500; border-radius: 8px; text-decoration: none;
}
.dropdown-menu a:hover { color: var(--brand); background: #fff0f3; text-decoration: none; }
.nav-social { display: flex; gap: 0.75rem; padding: 0.75rem 0.85rem; }
.nav-social a { font-weight: 600; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.7rem 1.15rem; border-radius: 999px; font-weight: 700; text-decoration: none;
  border: 2px solid transparent; cursor: pointer; transition: 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: var(--white); }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-outline { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-ghost { background: var(--white); color: var(--ink); border-color: var(--border); }
.header-cta { display: none; }

/* Hero */
.hero {
  position: relative;
  min-height: clamp(320px, 62vw, 520px);
  display: grid; align-items: end;
  color: #fff;
  background: #1a1a1a center/cover no-repeat;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(3,3,3,0.15) 0%, rgba(3,3,3,0.72) 100%);
}
.hero-inner { position: relative; z-index: 1; padding: 2.5rem 0 2.25rem; }
.hero-kicker {
  display: inline-block; margin-bottom: 0.75rem; padding: 0.3rem 0.7rem;
  background: var(--brand); color: #fff; border-radius: 999px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}
.hero h1 { color: #fff; max-width: 18ch; }
.hero p { color: rgba(255,255,255,0.92); max-width: 36rem; font-size: 1.05rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.25rem; }
.page-hero {
  background: var(--bg);
  padding: 2rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
}
.page-hero .breadcrumb { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.5rem; }
.page-hero .breadcrumb a { color: var(--muted); }
.page-hero .breadcrumb a:hover { color: var(--brand); }

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
}
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.card-img { aspect-ratio: 4/3; object-fit: cover; width: 100%; background: var(--bg-alt); }
.card-body { padding: 1.15rem 1.2rem 1.35rem; flex: 1; display: flex; flex-direction: column; }
.card-body h3 { margin-bottom: 0.4rem; }
.card-body p { color: var(--muted); flex: 1; }
.card-link { margin-top: 0.85rem; font-weight: 700; color: var(--brand); }

.stat-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem;
}
.stat {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem 1rem; text-align: center;
}
.stat strong { display: block; font-size: 1.45rem; color: var(--brand); letter-spacing: -0.02em; }
.stat span { font-size: 0.9rem; color: var(--muted); }

.price-cards { display: grid; gap: 1rem; }
.price-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow);
}
.price-card.featured { border-color: var(--brand); box-shadow: 0 10px 30px rgba(225,3,57,0.12); }
.price-card .amount { font-size: 2.4rem; font-weight: 800; color: var(--brand); letter-spacing: -0.03em; }
.price-card ul { margin-top: 1rem; color: var(--muted); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem;
  padding: 0.95rem 0; border-bottom: 1px solid var(--border);
}
.timeline time { font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; }
.timeline .day { grid-column: 1 / -1; margin-top: 0.75rem; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; border: 0; padding-bottom: 0; }

.results-block { margin-bottom: 2rem; }
.results-block h3 { border-left: 4px solid var(--brand); padding-left: 0.65rem; }
.podium { display: grid; gap: 0.5rem; }
.podium-row {
  display: grid; grid-template-columns: 2.6rem 1fr auto; gap: 0.6rem; align-items: center;
  background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 0.65rem 0.8rem;
}
.podium-row .place {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.4rem; height: 2.4rem; border-radius: 999px;
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.02em;
  line-height: 1; color: #1a1a1a; border: 2px solid transparent;
}
.podium-row .place.place-1st {
  background: linear-gradient(145deg, #ffe9a8, #f5c542);
  border-color: #e0a800; color: #5c4300;
}
.podium-row .place.place-2nd {
  background: linear-gradient(145deg, #f0f0f0, #c8c8c8);
  border-color: #9a9a9a; color: #333;
}
.podium-row .place.place-3rd {
  background: linear-gradient(145deg, #f0c9a0, #cd7f32);
  border-color: #a65f1f; color: #4a2a0a;
}

.map-frame {
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border);
  background: var(--bg-alt);
}
.map-frame img { width: 100%; }

.split {
  display: grid; gap: 1.5rem; align-items: center;
}
.split img { border-radius: var(--radius); width: 100%; object-fit: cover; aspect-ratio: 4/3; }

.callout {
  background: #fff0f3; border: 1px solid #ffd0da; border-radius: var(--radius);
  padding: 1.15rem 1.25rem; margin: 1.25rem 0;
}
.callout strong { color: var(--brand); }

/* Footer */
.site-footer {
  background: var(--ink); color: #ddd; padding: 2.5rem 0 6rem;
}
.site-footer a { color: #fff; }
.footer-grid {
  display: grid; gap: 1.5rem;
}
.footer-brand { font-weight: 800; font-size: 1.2rem; color: #fff; }
.footer-meta { font-size: 0.9rem; color: #aaa; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 0.65rem 1.1rem; }
.footer-nav a { color: #ccc; font-size: 0.92rem; }
.footer-nav a:hover { color: #fff; }

/* Mobile sticky register bar (home) */
.mobile-register-bar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
  background: rgba(255,255,255,0.96); border-top: 1px solid var(--border);
  box-shadow: 0 -8px 24px rgba(0,0,0,0.08);
}
.mobile-register-bar .btn { width: 100%; }
body.has-mobile-bar .mobile-register-bar { display: block; }
body.has-mobile-bar .site-footer { padding-bottom: 6.5rem; }

.prose { max-width: 44rem; }
.prose h2 { margin-top: 1.75rem; }
.two-col { display: grid; gap: 1rem; }

@media (min-width: 720px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .price-cards { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1.05fr 1fr; }
  .footer-grid { grid-template-columns: 1.4fr 1fr; }
  .two-col { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 960px) {
  .nav-toggle { display: none; }
  .header-cta { display: inline-flex; }
  .nav-panel {
    position: static; display: block !important; border: 0; padding: 0; box-shadow: none;
    max-height: none; overflow: visible; background: transparent;
  }
  .nav-list { flex-direction: row; align-items: center; gap: 0.15rem; }
  .nav-list > li > a,
  .nav-list .drop-toggle {
    padding: 0.45rem 0.65rem; font-size: 0.92rem; white-space: nowrap;
  }
  .dropdown { position: relative; }
  .dropdown-menu {
    position: absolute; top: calc(100% + 0.35rem); left: 0;
    min-width: 260px; background: var(--white); border: 1px solid var(--border);
    border-radius: 12px; box-shadow: var(--shadow); padding: 0.45rem;
    display: none; margin: 0; z-index: 1100;
  }
  .dropdown.is-open > .dropdown-menu { display: block !important; }
  .nav-social { padding: 0 0.35rem; }
  .card-grid.three { grid-template-columns: repeat(3, 1fr); }
  body.has-mobile-bar .mobile-register-bar { display: none; }
  body.has-mobile-bar .site-footer { padding-bottom: 2.5rem; }
}

@media (min-width: 1100px) {
  .card-grid.home-grid { grid-template-columns: repeat(3, 1fr); }
}


/* Race Details dropdown — click to open on mobile + desktop */
.drop-toggle {
  width: 100%; text-align: left; border: 0; background: transparent; cursor: pointer; font: inherit;
}
.drop-toggle::after { content: " ▾"; }
.dropdown.is-open > .drop-toggle::after { content: " ▴"; }
@media (max-width: 959px) {
  .dropdown.is-open > .dropdown-menu {
    display: block !important;
    position: static;
    border: 0; box-shadow: none; padding-left: 0.75rem; background: transparent;
  }
}

/* Hover bridge so mouse can reach submenu without closing */
@media (min-width: 960px) {
  .dropdown > .dropdown-menu {
    top: 100%;
    padding-top: 0.55rem;
    margin-top: 0;
  }
  .dropdown > .dropdown-menu::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 0.55rem;
  }
  .dropdown:hover > .dropdown-menu,
  .dropdown:focus-within > .dropdown-menu,
  .dropdown.is-open > .dropdown-menu {
    display: block !important;
  }
}
