/* ==========================================================
   Simple Static Starter Kit — styles.css
   Change the colors and fonts in :root to restyle the site.
   ========================================================== */
:root {
  --color-bg: #f8f7f4;
  --color-surface: #ffffff;
  --color-alt: #efede8;
  --color-text: #1d2322;
  --color-muted: #5c6664;
  --color-primary: #c42128;
  --color-primary-dark: #99181e;
  --color-border: #d9d6cf;
  --color-success: #1d6b3a;
  --color-error: #a3262a;

  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: Georgia, "Times New Roman", serif;

  --radius: 10px;
  --max-width: 1080px;
  --space: clamp(3.5rem, 8vw, 6rem);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--color-primary); }
a:hover { color: var(--color-primary-dark); }

h1, h2, h3 {
  font-family: var(--font-heading);
  line-height: 1.2;
  margin: 0 0 0.75rem;
  font-weight: 600;
}
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); max-width: 18ch; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); }
h3 { font-size: 1.25rem; }
p  { margin: 0 0 1rem; }

.container { width: min(100% - 2.5rem, var(--max-width)); margin-inline: auto; }
.narrow > * { max-width: 680px; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--color-primary); color: #fff; padding: 0.5rem 1rem; z-index: 100;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(248, 247, 244, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 1rem 0; gap: 1rem; }
.logo { display: inline-flex; align-items: center; gap: 0.6rem; font-family: var(--font-heading); font-size: 1.25rem; font-weight: 700; color: var(--color-text); text-decoration: none; }
.logo-img { width: auto; height: 60px; }
.nav-list { list-style: none; display: flex; gap: 1.5rem; margin: 0; padding: 0; align-items: center; }
.nav-list a { color: var(--color-text); text-decoration: none; font-size: 0.95rem; }
.nav-list a:hover { color: var(--color-primary); }
.nav-cta { white-space: nowrap; padding: 0.45rem 1rem; border: 1px solid var(--color-primary); border-radius: 999px; color: var(--color-primary) !important; }

/* Rainbow accent stripe under the header (echoes the multicolor runners) */
.site-header::after {
  content: ""; display: block; height: 4px;
  background: linear-gradient(90deg, #f2a51a 0 14.28%, #2bb3d6 0 28.57%, #1f4fa3 0 42.85%, #c42128 0 57.14%, #3aaa4a 0 71.42%, #c9cf1f 0 85.71%, #a340c2 0);
}

/* Hero */
.hero { padding: var(--space) 0; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.8rem; font-weight: 600; color: var(--color-primary); }
.lead { font-size: 1.2rem; color: var(--color-muted); max-width: 55ch; margin-bottom: 2rem; }

.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero-media, .about-media { margin: 0; }
.hero-media img, .about-media img {
  width: 100%; height: auto; border-radius: calc(var(--radius) * 1.6);
  object-fit: cover; box-shadow: 0 18px 40px -24px rgba(29, 35, 34, 0.45);
}
.hero-media img { aspect-ratio: 16 / 11; }

/* About */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.about-media img { aspect-ratio: 4 / 3; }
.about-grid { align-items: start; }
.about-media { position: sticky; top: 110px; }
.about-text { max-width: 60ch; }

.subhead { font-size: 1.15rem; margin-top: 1.75rem; }
.section-intro { color: var(--color-muted); max-width: 65ch; }

/* Buttons */
.button {
  display: inline-block;
  background: var(--color-primary); color: #fff;
  border: none; border-radius: var(--radius);
  padding: 0.85rem 1.6rem;
  font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}
.button:hover { background: var(--color-primary-dark); color: #fff; }
.button:active { transform: translateY(1px); }
.button:disabled { opacity: 0.6; cursor: wait; }
.button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid rgba(196, 33, 40, 0.35); outline-offset: 2px;
}

/* Sections */
.section { padding: var(--space) 0; }
.section.alt { background: var(--color-alt); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; margin-top: 2rem; }
.card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; }
.card img { width: 100%; height: auto; aspect-ratio: 900 / 560; object-fit: cover; }
.card-body { padding: 1.5rem 1.75rem 1.75rem; }
.card p { color: var(--color-muted); margin: 0; }

.cards-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.race-list { margin: 0.75rem 0 0; padding-left: 1.1rem; color: var(--color-muted); columns: 2; column-gap: 1.5rem; }
.race-list li { margin-bottom: 0.3rem; break-inside: avoid; }

/* Gallery */
.gallery-grid { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.75rem; }
.gallery-item { display: block; overflow: hidden; border-radius: var(--radius); background: var(--color-border); }
.gallery-item img { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; transition: transform 0.35s ease; }
.gallery-item:hover img, .gallery-item:focus-visible img { transform: scale(1.04); }

.lightbox { border: none; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox::backdrop { background: rgba(10, 12, 12, 0.9); }
.lightbox[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.lightbox img { max-width: min(92vw, 1400px); max-height: 80vh; width: auto; height: auto; border-radius: 6px; }
.lb-caption { color: #f1f0ef; margin: 0.9rem 1rem 0; text-align: center; font-size: 0.95rem; max-width: 70ch; }
.lb-close, .lb-prev, .lb-next {
  position: fixed; background: rgba(255,255,255,0.12); color: #fff; border: none; cursor: pointer;
  width: 48px; height: 48px; border-radius: 50%; font-size: 2rem; line-height: 1; display: grid; place-items: center;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: rgba(255,255,255,0.25); }
.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 1rem; top: 50%; transform: translateY(-50%); }

/* Contact form */
.contact-form {
  margin-top: 2rem; background: var(--color-surface);
  border: 1px solid var(--color-border); border-radius: var(--radius);
  padding: clamp(1.25rem, 4vw, 2.25rem);
}
.field { margin-bottom: 1.25rem; }
label { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 0.4rem; }
.optional { font-weight: 400; color: var(--color-muted); }
input, textarea {
  width: 100%; font: inherit; color: var(--color-text);
  background: var(--color-bg); border: 1px solid var(--color-border);
  border-radius: 8px; padding: 0.75rem 0.9rem;
  transition: border-color 0.2s ease;
}
input:focus, textarea:focus { border-color: var(--color-primary); background: #fff; }
textarea { resize: vertical; min-height: 140px; }
input.invalid, textarea.invalid { border-color: var(--color-error); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-status { margin: 1rem 0 0; font-weight: 600; min-height: 1.5em; }
.form-status.success { color: var(--color-success); }
.form-status.error { color: var(--color-error); }

/* Footer */
.site-footer { border-top: 1px solid var(--color-border); padding: 2rem 0; color: var(--color-muted); font-size: 0.9rem; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }
.footer-inner p { margin: 0; }

@media (max-width: 820px) {
  .hero-grid, .about-grid { grid-template-columns: 1fr; }
  .hero-media { order: -1; }
  .about-media { position: static; }
}

@media (max-width: 560px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .race-list { columns: 1; }
  .lb-prev, .lb-next { top: auto; bottom: 1rem; transform: none; }
  .logo span { font-size: 1.05rem; white-space: nowrap; }
  .logo-img { height: 38px; }
  .logo { gap: 0.4rem; }
  .logo span { font-size: 0.95rem; }
  .nav-cta { padding: 0.4rem 0.75rem; font-size: 0.85rem !important; }
  .nav-list { gap: 0.9rem; }
  .nav-list li:not(:last-child) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
