/* ============================================
   RunShahRun — shared stylesheet
   ============================================ */

:root {
  --bg: #faf7f2;
  --bg-card: #ffffff;
  --text: #1c1c1c;
  --text-muted: #6b6459;
  --accent: #d9502f;
  --accent-dark: #b23c20;
  --border: #e9e2d6;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(28, 22, 14, 0.08);
  --max-width: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Poppins', 'Inter', sans-serif;
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1.1em; color: var(--text); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

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

/* ---------- Header / Nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 247, 242, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

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

.brand {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  letter-spacing: -0.02em;
}
.brand:hover { text-decoration: none; }
.brand span { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
}
.nav-links a:hover, .nav-links a.active { color: var(--accent); text-decoration: none; }

.nav-toggle { display: none; }

@media (max-width: 700px) {
  .nav-links { gap: 16px; }
  .nav-links a { font-size: 0.85rem; }
}

/* ---------- Hero ---------- */

.hero {
  padding: 64px 0 40px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

@media (max-width: 800px) {
  .hero-grid { grid-template-columns: 1fr; }
}

.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 14px;
}

.hero-photo {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hero-photo img { width: 100%; height: 100%; object-fit: cover; }

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 12px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  margin-top: 8px;
}
.btn:hover { background: var(--accent-dark); text-decoration: none; }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Section headings ---------- */

.section {
  padding: 56px 0;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.section-head p { color: var(--text-muted); margin: 0; max-width: 520px; }

/* ---------- Race grid / timeline ---------- */

.race-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px;
}

.race-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  color: var(--text);
}
.race-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(28,22,14,0.14);
  text-decoration: none;
}

.race-card-photo {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #eee;
}
.race-card-photo img { width: 100%; height: 100%; object-fit: cover; }

.race-card-body { padding: 18px 20px 22px; flex: 1; display: flex; flex-direction: column; }

.race-card-meta {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 6px;
}

.race-card h3 { margin-bottom: 8px; font-size: 1.1rem; }

.race-card-quote {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
  flex: 1;
}

/* ---------- Stats strip ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 32px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stat { text-align: center; }
.stat .num {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  color: var(--accent);
}
.stat .label {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
@media (max-width: 700px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Race detail page ---------- */

.race-hero {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 32px;
}
.race-hero img { width: 100%; max-height: 460px; object-fit: cover; }

/* Prevent floated side-photos from ever spilling past race-body into the nav/footer below */
.race-body::after { content: ""; display: table; clear: both; }

/* Photos that float alongside the text instead of breaking it up into full-width blocks */
.race-body .side-photo { float: right; clear: right; width: 260px; max-width: 38%; margin: 6px 0 24px 26px; }
.race-body .side-photo.left { float: left; clear: left; margin: 6px 26px 24px 0; }
.race-body .side-photo .race-photo { margin: 0 0 14px; }
.race-body .side-photo .race-photo:last-child { margin-bottom: 0; }
.race-body .side-photo .race-photo img { width: 100%; height: 220px; object-fit: cover; }
.race-body h2 { clear: both; }
@media (max-width: 700px) {
  .race-body .side-photo, .race-body .side-photo.left { float: none; width: 100%; max-width: 100%; margin: 20px 0; }
  .race-body .side-photo .race-photo img { height: auto; }
}

.race-hero-caption {
  position: absolute;
  inset: auto 0 0 0;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.65));
  color: #fff;
  padding: 40px 28px 22px;
}
.race-hero-caption .eyebrow { color: #ffd3c2; }
.race-hero-caption h1 { color: #fff; margin-bottom: 4px; }

.pull-quote {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(1.2rem, 2.6vw, 1.6rem);
  font-weight: 600;
  color: var(--accent-dark);
  border-left: 4px solid var(--accent);
  padding: 4px 0 4px 20px;
  margin: 24px 0 32px;
}

.highlight-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin: 30px 0 8px;
}
.highlight-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: var(--shadow);
}
.highlight-card h4 {
  font-size: 0.95rem;
  color: var(--accent);
  margin-bottom: 8px;
}
.highlight-card p { margin: 0; font-size: 0.94rem; color: var(--text-muted); }

/* Tap-to-expand highlight cards (used via <details class="highlight-card">) */
.highlight-card summary {
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.highlight-card summary::-webkit-details-marker { display: none; }
.highlight-card summary::after {
  content: '+';
  font-size: 1.3rem;
  line-height: 1;
  color: var(--text-muted);
  flex-shrink: 0;
}
.highlight-card[open] summary::after { content: '\2212'; }
.highlight-card[open] summary { margin-bottom: 8px; }

.race-photo {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin: 28px 0;
}

.photo-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 28px 0;
}
.photo-row img, .photo-row .race-photo { margin: 0; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }

.race-body h2, .race-body h3 { margin-top: 1.4em; }

.race-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.race-nav a {
  font-weight: 600;
  color: var(--text);
}
.race-nav a:hover { color: var(--accent); text-decoration: none; }
.race-nav .dir {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 2px;
}
.race-nav .next { text-align: right; }

/* ---------- About page ---------- */

.about-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 48px;
  align-items: start;
}
@media (max-width: 800px) {
  .about-grid { grid-template-columns: 1fr; }
}
.about-photo {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  position: sticky;
  top: 100px;
}
@media (max-width: 800px) {
  .about-photo { position: static; }
}

/* ---------- Contact page ---------- */

.contact-card {
  max-width: 640px;
  margin: 40px auto 0;
  text-align: center;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 48px 36px;
}
.contact-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 24px;
  box-shadow: var(--shadow);
}
.contact-photo img { width: 100%; height: 100%; object-fit: cover; }
.contact-email {
  display: inline-block;
  margin-top: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 10px 22px;
  border-radius: 999px;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  margin-top: 60px;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-inner a { color: var(--text-muted); }
