/* ==========================================================================
   Carrera ESPN 2026 · Estilos
   ========================================================================== */

@font-face {
  font-family: 'ESPNProLoud';
  src: url('../img/ESPNProLoud-Medium.ttf') format('truetype');
  font-weight: 500;
  font-display: swap;
}

:root {
  --rojo: #f32735;
  --morado: #440959;
  --morado-oscuro: #37094a;
  --azul: #62c3e8;
  --negro: #0a0a0a;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'ESPNProLoud', 'Arial Narrow', Impact, sans-serif;
  background: var(--rojo);
  color: #fff;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 90px;
}

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

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

/* Contenido solo para lectores de pantalla */
.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;
}

/* Bloquea el scroll de fondo mientras hay un modal abierto */
body.sin-scroll {
  overflow: hidden;
}


/* ==========================================================================
   Pleca superior
   ========================================================================== */
.pleca-desktop {
  display: block;
  width: 100%;
}

.pleca-mobile {
  display: none;
  width: 100%;
}


/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
}

.hero-desktop {
  display: block;
  width: 100%;
}

.hero-mobile {
  display: none;
  width: 100%;
}

.hero-botones {
  position: absolute;
  left: calc(52.5% + 20px);
  top: 59%;
  width: 41%;
  display: flex;
  gap: 4%;
}

.hero-botones a {
  flex: 1;
  transition: transform .15s ease, filter .15s ease;
}

.hero-botones a:hover {
  transform: scale(1.05);
  filter: brightness(1.15);
}


/* ==========================================================================
   Sección info · fecha / lugar / distancias
   ========================================================================== */
.seccion-info {
  position: relative;
  background: var(--rojo);
  padding: 60px 20px 30px;
  overflow: hidden;
}

/* Textura de papel compartida por las secciones rojas */
.seccion-info::before,
.seccion-cuotas::before,
.divisor-puntos::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../img/backdrop%20paper.png') center center / cover no-repeat;
  mix-blend-mode: multiply;
  opacity: .35;
  pointer-events: none;
}

.seccion-info .ornamento {
  position: absolute;
  top: 40px;
  width: 300px;
  opacity: .9;
  pointer-events: none;
}

.ornamento-izq {
  left: -40px;
}

.ornamento-der {
  right: -40px;
  transform: scaleX(-1);
}

.info-contenido {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.etiqueta {
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-style: italic;
  margin: 28px 0 14px;
}

.etiqueta:first-child {
  margin-top: 0;
}

/* Anchos proporcionales al tamaño real de cada recorte (1027x142, 853x142, 987x252)
   para conservar las proporciones entre sí, no solo el aspect-ratio individual. */
.badge-img {
  display: inline-block;
  height: auto;
}

.badge-img-fecha {
  width: clamp(220px, 32vw, 400px);
}

.badge-img-lugar {
  width: clamp(183px, 26.6vw, 332px);
}

.badge-img-distancias {
  width: clamp(211px, 30.8vw, 384px);
  margin-top: 10px;
}


/* ==========================================================================
   Divisor de puntos
   ========================================================================== */
.divisor-puntos {
  position: relative;
  height: 60px;
  background-color: var(--rojo);
  background-image: radial-gradient(circle 8px at 24px 30px, var(--morado) 98%, transparent 100%);
  background-size: 48px 60px;
  background-repeat: repeat-x;
  overflow: hidden;
}


/* ==========================================================================
   Sección cuotas
   ========================================================================== */
.seccion-cuotas {
  position: relative;
  background: var(--rojo);
  padding: 50px 20px 70px;
  overflow: hidden;
}

.seccion-cuotas .splash {
  position: absolute;
  width: 170px;
  pointer-events: none;
}

.splash-izq-arriba {
  left: 2%;
  top: 12%;
}

.splash-der-arriba {
  right: 2%;
  top: 12%;
  transform: scaleX(-1);
}

.splash-izq-abajo {
  left: 2%;
  bottom: 8%;
  width: 120px;
}

.splash-der-abajo {
  right: 2%;
  bottom: 8%;
  width: 120px;
  transform: scaleX(-1);
}

.cuotas-contenido {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.cuota-titulo {
  color: var(--blanco);
  font-style: italic;
  text-transform: uppercase;
  font-size: clamp(24px, 3.4vw, 36px);
  letter-spacing: 1px;
  margin-bottom: 24px;
}

.cuota-texto {
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(14px, 1.8vw, 18px);
  font-weight: bold;
  line-height: 1.7;
}

.cuota-nota {
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(12px, 1.5vw, 15px);
  margin-top: 22px;
}

.btn-inscribete {
  display: inline-block;
  width: min(340px, 70%);
  margin: 34px auto 60px;
  transition: transform .15s ease, filter .15s ease;
}

.btn-inscribete:hover {
  transform: scale(1.05);
  filter: brightness(1.2);
}

.btn-inscribete:last-child {
  margin-bottom: 0;
}

.cuota-fisica {
  font-family: Arial, Helvetica, sans-serif;
  font-style: italic;
  font-size: clamp(13px, 1.6vw, 16px);
  line-height: 1.7;
  max-width: 620px;
  margin: 10px auto 0;
}

.cuota-fisica a {
  text-decoration: underline;
}


/* ==========================================================================
   Bandas de sección
   ========================================================================== */
.banda {
  display: block;
  width: 100%;
  text-align: center;
  padding: clamp(34px, 5vw, 80px) 20px;
  color: #fff;
  font-family: inherit;
  font-style: italic;
  text-transform: uppercase;
  font-size: clamp(22px, 3.4vw, 48px);
  letter-spacing: 1px;
  border: 0;
  cursor: pointer;
  transition: filter .15s ease;
}

.banda:hover {
  filter: brightness(1.35);
}

.banda:focus-visible {
  outline: 3px solid var(--azul);
  outline-offset: -6px;
}

.banda-negra {
  background: var(--negro);
}

.banda-morada {
  background: var(--morado);
}

.banda-roja {
  background: var(--rojo);
}


/* ==========================================================================
   Modal / pop-up
   ========================================================================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, .82);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}

.modal.abierto {
  opacity: 1;
  visibility: visible;
}

/* La caja no scrollea: así el botón de cerrar queda siempre a la vista.
   El scroll vive en .modal-scroll. */
.modal-caja {
  position: relative;
  display: flex;
  width: 100%;
  max-width: 800px;
  max-height: 100%;
  overflow: hidden;
  border-radius: 6px;
  transform: translateY(16px);
  transition: transform .2s ease;
  background: var(--rojo);
}

.modal.abierto .modal-caja {
  transform: translateY(0);
}

.modal-scroll {
  width: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-scroll img {
  display: none;
}

.modal-texto {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #fff;
  padding: 60px 40px 40px;
  width: 100%;
}

.modal-texto .modal-titulo {
  font-family: 'ESPNProLoud', 'Arial Narrow', Impact, sans-serif;
  font-style: italic;
  text-transform: uppercase;
  font-size: clamp(26px, 4vw, 36px);
  letter-spacing: 1px;
  text-align: center;
  margin-bottom: 22px;
}

.modal-texto p {
  margin-bottom: 14px;
}

.modal-texto ul {
  list-style: disc;
  padding-left: 20px;
}

.modal-texto li {
  margin-bottom: 12px;
}

.modal-texto a {
  text-decoration: underline;
  color: var(--azul);
}

.modal-texto a:hover {
  filter: brightness(1.2);
}

.modal-cerrar {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 26px;
  line-height: 1;
  color: #fff;
  background: var(--morado);
  border: 2px solid #fff;
  border-radius: 50%;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}

.modal-cerrar:hover {
  background: var(--negro);
  transform: scale(1.08);
}

.modal-cerrar:focus-visible {
  outline: 3px solid var(--azul);
  outline-offset: 2px;
}

/* Modales para contenidos pendientes */
.modal-caja-pendiente {
  max-width: 600px;
  background: var(--rojo);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.modal-scroll-pendiente {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 250px;
  padding: 40px 20px;
  width: 100%;
}

.modal-texto-pendiente {
  font-family: 'ESPNProLoud', 'Arial Narrow', Impact, sans-serif;
  font-style: italic;
  text-transform: uppercase;
  color: #fff;
  font-size: clamp(36px, 6vw, 60px);
  text-align: center;
  margin: 0;
  letter-spacing: 1px;
}


/* ==========================================================================
   Footer (fijo al hacer scroll)
   ========================================================================== */
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 90;
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s ease, opacity 0.35s ease;
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.35);
}

footer.footer-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.footer-desktop {
  display: block;
  width: 100%;
}

.footer-mobile {
  display: none;
  width: 100%;
}


/* ==========================================================================
   Responsive · móvil
   ========================================================================== */
@media (max-width: 767px) {
  body {
    padding-bottom: 60px;
  }

  .pleca-desktop {
    display: none;
  }

  .pleca-mobile {
    display: block;
  }

  .hero-desktop {
    display: none;
  }

  .hero-mobile {
    display: block;
  }

  .hero-botones {
    position: absolute;
    top: auto;
    bottom: 150px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 480px;
    background: none;
    padding: 0;
    gap: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero-botones a {
    flex: none;
    width: 70%;
  }

  .hero-botones a:first-child {
    position: relative;
    top: -20px;
  }

  .banda {
    font-size: clamp(30px, 4.6vw, 48px);
  }

  .seccion-info {
    padding: 44px 18px 20px;
  }

  .etiqueta {
    font-size: clamp(32px, 4.6vw, 42px);
  }

  .badge-img-fecha {
    width: clamp(253px, 36.8vw, 400px);
  }

  .badge-img-lugar {
    width: clamp(210px, 30.6vw, 332px);
  }

  .badge-img-distancias {
    width: clamp(243px, 35.4vw, 384px);
  }

  .seccion-info .ornamento {
    width: 150px;
    top: 10px;
    opacity: 1;
  }

  .ornamento-izq {
    left: -50px;
  }

  .ornamento-der {
    right: -50px;
  }

  .seccion-cuotas .splash {
    display: none;
  }

  .btn-inscribete {
    width: min(280px, 80%);
    margin: 28px auto 46px;
  }

  /* El texto de los pop-ups viene quemado dentro de la imagen y a este ancho
     resultaría ilegible, así que en móvil se muestra la versión en texto real
     (la misma que leen los lectores de pantalla) y se oculta la imagen. */
  .modal {
    padding: 12px;
  }

  .modal-texto {
    padding: 60px 22px 34px;
    font-size: 15px;
  }

  .footer-desktop {
    display: none;
  }

  .footer-mobile {
    display: block;
  }
}