:root {
  --bg: #f3f4f6;
  --text: #1f2937;
  --muted: #6b7280;
  --white: #ffffff;
  --primary: #111827;
  --accent: #16a34a;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  padding-bottom: 130px;
}

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

.container {
  width: min(100% - 32px, 980px);
  margin: 0 auto;
}

.site-header {
  position: relative;
  background: linear-gradient(135deg, #111827, #166534);
  color: white;
  padding: 54px 0 34px;
}

.brand-label {
  margin: 0 0 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #bbf7d0;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 8vw, 4rem);
  line-height: 1;
}

.header-text {
  max-width: 680px;
  margin: 18px 0 0;
  color: #e5e7eb;
  font-size: 1.05rem;
}

/* Menú hamburguesa */
.menu-toggle {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 80;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 999px;
  background: #ffffff;
  color: #111827;
  font-size: 1.5rem;
  font-weight: 900;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
  cursor: pointer;
}

.mobile-menu {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(84vw, 340px);
  background: #ffffff;
  color: #111827;
  z-index: 100;
  transform: translateX(-105%);
  transition: transform 220ms ease;
  padding: 20px;
  box-shadow: 12px 0 30px rgba(0, 0, 0, 0.22);
  overflow-y: auto;
}

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

.menu-close {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: #f3f4f6;
  color: #111827;
  font-size: 1.6rem;
  font-weight: 900;
  cursor: pointer;
}

.menu-title {
  margin: 18px 0 4px;
  font-size: 1.25rem;
  font-weight: 900;
}

.menu-subtitle {
  margin: 0 0 14px;
  color: var(--muted);
  font-weight: 700;
}

.month-menu-list {
  display: grid;
  gap: 8px;
}

.month-link,
.menu-contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 11px 14px;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 800;
}

.month-link {
  background: #f3f4f6;
}

.month-link:hover,
.menu-contact:hover {
  filter: brightness(0.97);
}

.menu-contact {
  margin-top: 18px;
  background: #111827;
  color: white;
}

.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.menu-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

body.menu-open { overflow: hidden; }

.main-content { padding: 28px 0; }

.intro-section,
.calendar-section,
.contact-section {
  background: var(--white);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.intro-section h2,
.calendar-section h2,
.contact-section h2 {
  margin-top: 0;
  font-size: 1.5rem;
}

.section-description { color: var(--muted); }

.calendar-list {
  display: grid;
  gap: 18px;
}

.day-block {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 12px;
  align-items: stretch;
  scroll-margin-top: 20px;
}

.day-date {
  border-radius: var(--radius);
  padding: 14px 10px;
  text-align: center;
  color: white;
  display: grid;
  place-content: center;
  min-height: 110px;
  box-shadow: var(--shadow);
}

.day-date .month {
  font-weight: 900;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.day-date .weekday {
  font-size: 0.9rem;
  margin-top: 4px;
}

.day-date .day-number {
  font-size: 2.1rem;
  font-weight: 900;
  line-height: 1;
  margin-top: 4px;
}

.race-group {
  display: grid;
  gap: 12px;
}

.race-card {
  background: var(--white);
  border: 1px solid #e5e7eb;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.race-summary {
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 14px;
  padding: 12px;
  text-align: left;
  color: var(--text);
}

.race-summary:focus-visible,
.menu-toggle:focus-visible,
.menu-close:focus-visible,
.action-button:focus-visible,
.month-link:focus-visible,
.menu-contact:focus-visible {
  outline: 3px solid #22c55e;
  outline-offset: 3px;
}

.race-image {
  width: 86px;
  height: 86px;
  object-fit: cover;
  border-radius: 14px;
  background: #e5e7eb;
}

.race-time {
  font-weight: 900;
  color: var(--accent);
  margin: 0 0 4px;
}

.race-name {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.2;
}

.race-place {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.race-details {
  display: none;
  padding: 0 14px 16px 112px;
}

.race-card.is-open .race-details { display: block; }

.detail-list {
  display: grid;
  gap: 8px;
  margin: 10px 0 16px;
}

.detail-item { margin: 0; color: var(--text); }
.detail-item strong { color: #111827; }

.race-description {
  color: var(--muted);
  margin-bottom: 16px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 999px;
  background: #111827;
  color: white;
  text-decoration: none;
  font-weight: 800;
}

.action-button.secondary { background: #e5e7eb; color: #111827; }
.action-button.ghost { background: #dcfce7; color: #166534; }

.month-1 { background: #2563eb; }
.month-2 { background: #f472b6; }
.month-3 { background: #86efac; color: #064e3b; }
.month-4 { background: #fde047; color: #713f12; }
.month-5 { background: #16a34a; }
.month-6 { background: #7c3aed; }
.month-7 { background: #f97316; }
.month-8 { background: #38bdf8; color: #0c4a6e; }
.month-9 { background: #15803d; }
.month-10 { background: #c2410c; }
.month-11 { background: #b45309; }
.month-12 { background: #dc2626; }

.sponsor-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 50;
  background: white;
  border-radius: 18px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.sponsor-content {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  text-decoration: none;
  color: var(--text);
}

.sponsor-content img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 14px;
  background: #e5e7eb;
}

.sponsor-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  color: #166534;
  background: #dcfce7;
  padding: 3px 8px;
  border-radius: 999px;
  margin-bottom: 4px;
}

.sponsor-title {
  margin: 0;
  font-weight: 900;
  line-height: 1.15;
}

.sponsor-subtitle {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.sponsor-cta {
  background: #111827;
  color: white;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 900;
  white-space: nowrap;
}

.site-footer {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 12px 0 40px;
  text-align: center;
}

.site-footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.loading-text,
.empty-text { color: var(--muted); }

/* Contacto */
.contact-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-field {
  display: grid;
  gap: 6px;
}

.form-field.full { grid-column: 1 / -1; }

.form-field label {
  font-weight: 800;
}

.form-field input,
.form-field textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  background: white;
  color: var(--text);
}

.form-field textarea {
  min-height: 130px;
  resize: vertical;
}

.form-help {
  color: var(--muted);
  font-size: 0.92rem;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.submit-button {
  border: 0;
  cursor: pointer;
  min-height: 46px;
  padding: 12px 18px;
  border-radius: 999px;
  background: #111827;
  color: white;
  font-weight: 900;
  font: inherit;
}

.back-link {
  color: #166534;
  font-weight: 900;
  text-decoration: none;
}

@media (max-width: 640px) {
  body { padding-bottom: 150px; }

  .site-header { padding-top: 70px; }

  .intro-section,
  .calendar-section,
  .contact-section { padding: 18px; }

  .day-block { grid-template-columns: 70px 1fr; }

  .day-date {
    min-height: 96px;
    padding: 10px 8px;
  }

  .day-date .day-number { font-size: 1.8rem; }

  .race-summary {
    grid-template-columns: 76px 1fr;
    gap: 12px;
  }

  .race-image {
    width: 76px;
    height: 76px;
  }

  .race-details { padding: 0 14px 16px 14px; }

  .sponsor-content { grid-template-columns: 58px 1fr; }

  .sponsor-content img {
    width: 58px;
    height: 58px;
  }

  .sponsor-cta {
    grid-column: 1 / -1;
    text-align: center;
  }

  .form-grid { grid-template-columns: 1fr; }
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-logo {
  width: 72px;
  height: auto;
  object-fit: contain;
}

.menu-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.menu-logo {
  width: 72px;
  height: auto;
  object-fit: contain;
}

.menu-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 900;
  color: #111827;
}

.menu-subtitle {
  margin: 2px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 700;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  width: 100%;
  margin: 14px auto 0;
  text-align: center;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
}

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

.pagina-anunciate {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 18px 96px;
}

.hero-anunciate {
  text-align: center;
  padding: 48px 20px;
  border-radius: 24px;
  background: #111827;
  color: #ffffff;
}

.hero-anunciate h1 {
  font-size: clamp(2rem, 6vw, 4rem);
  margin-bottom: 16px;
}

.hero-anunciate p {
  max-width: 720px;
  margin: 0 auto 28px;
  font-size: 1.1rem;
  line-height: 1.6;
}

.btn-principal {
  display: inline-block;
  padding: 14px 22px;
  border-radius: 999px;
  background: #f97316;
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
}

.bloque-anunciate {
  margin-top: 40px;
}

.bloque-anunciate h2 {
  font-size: 2rem;
  margin-bottom: 18px;
}

.grid-anunciate {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.grid-anunciate article,
.destacado,
.contacto-anunciate {
  padding: 22px;
  border-radius: 20px;
  background: #f3f4f6;
}

.grid-anunciate h3 {
  margin-bottom: 8px;
}

.lista-anunciate {
  padding-left: 22px;
  line-height: 1.9;
}

.destacado {
  background: #fff7ed;
}

.contacto-anunciate {
  text-align: center;
}

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

  .hero-anunciate {
    padding: 36px 18px;
  }
}