:root {
  --red: #e31e24;
  --red-dark: #b8181d;
  --red-light: #ff3b42;
  --white: #ffffff;
  --black: #1a1a1a;
  --gray: #f5f5f5;
  --gray-text: #444444;
  --blue: #0066cc;
  --nav-height: 80px;
  --font-display: "Montserrat", "Segoe UI", sans-serif;
  --font-body: "Roboto", "Segoe UI", sans-serif;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  --transition: 0.25s ease;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--black);
  background: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul {
  margin: 0;
  padding-left: 1.25rem;
}

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.2;
}

.container {
  width: min(1200px, 100% - 2rem);
  margin-inline: auto;
}

.checkerboard-h {
  height: 12px;
  background: repeating-linear-gradient(
    90deg,
    var(--red) 0 12px,
    var(--white) 12px 24px
  );
}

.checkerboard-v {
  width: 24px;
  background: repeating-linear-gradient(
    180deg,
    var(--red) 0 12px,
    var(--white) 12px 24px
  );
}

/* Navigation */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  box-shadow: var(--shadow);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--nav-height);
  padding-block: 0.5rem;
}

.nav__logo img {
  height: 72px;
  width: auto;
}

.nav__menu {
  display: none;
  list-style: none;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  align-items: center;
}

.nav__menu a {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  transition: color var(--transition), background var(--transition);
}

.nav__menu a:hover,
.nav__menu a:focus-visible {
  color: var(--red);
}

.nav__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--red);
}

.nav__toggle svg {
  width: 32px;
  height: 32px;
}

.nav__overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--red);
  transform: translateX(100%);
  transition: transform 0.35s ease;
}

.nav__overlay.is-open {
  transform: translateX(0);
}

.nav__overlay-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 48px;
  height: 48px;
  border: none;
  background: transparent;
  color: var(--white);
  cursor: pointer;
}

.nav__overlay-links {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  text-align: center;
}

.nav__overlay-links a {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--white);
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
}

@media (min-width: 1024px) {
  .nav__menu {
    display: flex;
  }

  .nav__toggle,
  .nav__overlay {
    display: none;
  }
}

/* Hero */
.hero {
  position: relative;
  min-height: calc(100svh - var(--nav-height));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: url("../assets/img/hero.jpg") center / cover no-repeat;
  color: var(--white);
  overflow: hidden;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.45) 45%, rgba(227, 30, 36, 0.82) 100%);
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  max-width: 920px;
  margin-inline: auto;
  padding: 3rem 1.5rem 2rem;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

.hero__titles {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  width: 100%;
  max-width: 100%;
}

.hero__title-row {
  display: flex;
  align-items: stretch;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
  gap: 0.85rem 1.15rem;
  text-align: left;
}

.hero__edition {
  font-family: var(--font-display);
  font-size: clamp(3.25rem, 13vw, 8rem);
  font-weight: 900;
  line-height: 0.95;
  margin: 0;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  min-width: clamp(2.75rem, 12vw, 8rem);
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.hero__subtitle-stack {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  flex: 0 1 auto;
  width: max-content;
  max-width: calc(100vw - 2.5rem - clamp(2.75rem, 12vw, 8rem));
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(0.88rem, 3.4vw, 1.75rem);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.05;
  text-align: left;
}

.hero__subtitle-stack span {
  display: block;
  white-space: nowrap;
}

.hero__date-block {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin-top: 2rem;
}

.hero__date {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 9vw, 5.25rem);
  font-weight: 900;
  line-height: 1;
  color: var(--white);
}

.hero__location {
  margin-top: 1rem;
  font-weight: 600;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hero__distances {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
  justify-content: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.75rem;
  border-radius: 999px;
  border: 3px solid var(--white);
  background: linear-gradient(180deg, var(--red-light) 0%, var(--red-dark) 100%);
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}

.pill:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 8px 24px rgba(0, 0, 0, 0.2);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.5rem;
  border-radius: 0.35rem;
  border: 2px solid transparent;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}

.btn--primary {
  background: var(--white);
  color: var(--red);
}

.btn--primary:hover {
  background: var(--gray);
  transform: translateY(-1px);
}

.btn--outline {
  background: transparent;
  color: var(--white);
  border-color: var(--white);
}

.btn--outline:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn--disabled {
  opacity: 0.55;
  pointer-events: none;
  cursor: not-allowed;
}

.hero__poster-wrap {
  position: relative;
  width: min(280px, 72%);
  margin: 2rem auto 0;
  border: 4px solid var(--white);
  box-shadow: var(--shadow);
  transform: rotate(2deg);
}

.hero__poster-wrap img {
  display: block;
  width: 100%;
}

.hero__timer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px solid rgba(255, 255, 255, 0.35);
  width: 100%;
  max-width: 420px;
}

.hero__timer-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  margin: 0 0 1rem;
}

.hero__timer-grid {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.hero__timer-item {
  text-align: center;
}

.hero__timer-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

.hero__timer-label {
  font-size: 0.85rem;
  opacity: 0.9;
  margin-top: 0.25rem;
}

@media (max-width: 360px) {
  .hero__subtitle-stack {
    font-size: clamp(0.75rem, 2.85vw, 0.92rem);
  }

  .hero__title-row {
    gap: 0.65rem 0.85rem;
  }
}

@media (min-width: 900px) {
  .hero__poster-wrap {
    width: min(320px, 42%);
  }

  .hero__title-row {
    gap: 1rem 1.5rem;
  }

  .hero__subtitle-stack {
    font-size: clamp(1.25rem, 2.2vw, 1.85rem);
  }
}

/* Sections */
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  text-transform: uppercase;
  text-align: center;
  margin: 3rem 0 2rem;
  color: var(--red);
  letter-spacing: 0.04em;
}

.section-title--light {
  color: var(--white);
}

.section {
  padding-block: 3rem;
}

.section--gray {
  background: var(--gray);
}

.section--red {
  background: var(--red);
  color: var(--white);
}

.about-grid {
  display: grid;
  gap: 2rem;
  align-items: center;
}

.about-grid__text h3 {
  font-size: 1.1rem;
  margin: 1.25rem 0 0.5rem;
  color: var(--red);
}

.about-grid__text a {
  color: var(--blue);
  text-decoration: underline;
}

.about-grid__poster {
  border: 4px solid var(--red);
  box-shadow: var(--shadow);
  transition: transform var(--transition);
}

.about-grid__poster:hover {
  transform: scale(1.02);
}

@media (min-width: 900px) {
  .about-grid {
    grid-template-columns: 1.2fr 0.8fr;
  }
}

.section-lead {
  max-width: 720px;
  margin: -1rem auto 2rem;
  text-align: center;
  color: var(--gray-text);
  font-size: 0.98rem;
}

.section-lead a {
  color: var(--blue);
  text-decoration: underline;
}

.race-split {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.race-split__col {
  background: var(--white);
  border: 2px solid rgba(227, 30, 36, 0.15);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.race-split__title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--red);
  margin: 0 0 0.35rem;
}

.race-split__meta {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  color: var(--gray-text);
  font-weight: 600;
}

.race-split__subtitle {
  font-size: 1rem;
  margin: 0 0 0.75rem;
  color: var(--black);
}

.race-split__list {
  columns: 2;
  column-gap: 1.25rem;
  padding-left: 1.1rem;
  font-size: 0.95rem;
}

.race-split__list li {
  break-inside: avoid;
  margin-bottom: 0.35rem;
}

.race-split__note {
  margin: 1rem 0 0;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 0.9rem;
  color: var(--gray-text);
}

@media (min-width: 900px) {
  .race-split {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

@media (max-width: 520px) {
  .race-split__list {
    columns: 1;
  }
}

.about-grid__text .benefits__grid {
  margin-top: 0.25rem;
}

.benefits__grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.benefits__item {
  background: var(--white);
  border-left: 4px solid var(--red);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}

.benefits__item strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.95rem;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.benefits__item span {
  display: block;
  font-size: 0.9rem;
  color: var(--gray-text);
  line-height: 1.45;
}

.section--map {
  padding-bottom: 0;
}

.race-map {
  width: 100%;
  height: 52vh;
  min-height: 280px;
  max-height: 520px;
  z-index: 1;
}

@media (max-width: 767px) {
  .race-map {
    height: 42vh;
    min-height: 240px;
    max-height: 360px;
  }
}

.map-legend {
  list-style: none;
  padding: 1.25rem 1.5rem 2.5rem;
  margin: 0;
  display: grid;
  gap: 0.65rem;
  font-size: 0.92rem;
}

@media (min-width: 768px) {
  .map-legend {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 2rem;
  }
}

.map-legend a {
  color: var(--blue);
  text-decoration: underline;
}

.map-legend__dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 0.45rem;
  vertical-align: middle;
  border: 2px solid var(--white);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.map-legend__dot--start { background: var(--red); }
.map-legend__dot--office { background: var(--blue); }
.map-legend__dot--parking { background: #2a9d3c; }

.race-map-marker {
  background: transparent;
  border: none;
}

.race-map-marker span {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 3px solid var(--white);
  box-shadow: var(--shadow);
}

.race-map-marker--start span { background: var(--red); }
.race-map-marker--office span { background: var(--blue); }
.race-map-marker--parking span { background: #2a9d3c; }

.leaflet-popup-content a {
  color: var(--blue);
  text-decoration: underline;
}

.prices-box {
  max-width: 600px;
  margin-inline: auto;
  text-align: center;
}

.prices-box h3 {
  font-size: 1.05rem;
  margin: 1.25rem 0 0.5rem;
}

.prices-box ul {
  list-style: none;
  padding: 0;
}

.prices-box li {
  padding: 0.15rem 0;
}

.prices-note {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  opacity: 0.85;
  font-style: italic;
}

.partners-group {
  margin-bottom: 2.5rem;
}

.partners-group__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 1.5rem;
}

.partners-group__title--platinum { color: #b9b7b3; }
.partners-group__title--strategic { color: var(--red); }
.partners-group__title--gold { color: #ffc400; }
.partners-group__title--silver { color: #929292; }
.partners-group__title--bronze { color: #964b00; }

.partners-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
  align-items: center;
}

.partners-grid img {
  max-height: 192px;
  width: auto;
  object-fit: contain;
  filter: grayscale(0);
  transition: transform var(--transition);
}

.partners-grid a:hover img {
  transform: scale(1.05);
}

.partners-grid__purina img {
  max-height: 168px;
  width: auto;
  object-fit: contain;
}

.is-hidden {
  display: none !important;
}

.contact-item__label {
  width: 100%;
  padding-left: 2.75rem;
  font-size: 0.85rem;
  color: var(--gray-text);
}

.contact-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.contact-item a {
  color: var(--red);
  font-weight: 600;
  text-decoration: underline;
}

.contact-item svg {
  flex-shrink: 0;
}

.footer {
  background: var(--black);
  color: var(--white);
  padding: 1.5rem;
  text-align: center;
  font-size: 0.9rem;
}

.footer a {
  color: var(--white);
  text-decoration: underline;
}

.footer a:hover {
  color: var(--red-light);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
