/* css/widgets/slider.css
   Estilos de js/widgets/slider.js y de los dos sliders de la home
   (js/features/initializeslider.js):
     1. .anuncios    → banner de anuncios debajo del header
     2. .olimpiadas  → "Conoce las demás Olimpiadas de Ciencias"
   Ambas secciones usan el mismo ancho que .header__contenedor
   (máx. 1280px, 40px de margen lateral; 24px en móvil). */


/* ============================================================
   1. ANUNCIOS
   Distribución de cada slide:
     · título + descripción  → arriba a la izquierda
     · flechas ‹ ›           → arriba a la derecha
     · botón                 → abajo al centro
   ============================================================ */

.anuncios {
  width: min(1280px, calc(100% - 80px));
  margin: 110px auto 0; /* deja libre el header fijo */
}

.anuncios__slider {
  border-radius: 24px;
  overflow: hidden; /* recorta imagen, degradado y flechas a las esquinas */
}

.anuncios__slide {
  position: relative; /* para encimar degradado y texto sobre la imagen */
  aspect-ratio: 16 / 9;
  max-height: 520px;
}

.anuncios__slide picture {
  display: block;
  width: 100%;
  height: 100%;
}

.anuncios__slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Degradado oscuro arriba (texto) y abajo (botón) */
.anuncios__slide::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.5) 0%,
    rgba(0, 0, 0, 0) 45%,
    rgba(0, 0, 0, 0) 60%,
    rgba(0, 0, 0, 0.45) 100%
  );
}

/* ---------- Contenido (textos arriba, botón abajo) ---------- */

.anuncios__contenido {
  position: absolute;
  inset: 0;
  z-index: 1; /* encima del degradado */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between; /* textos arriba · botón abajo */
  padding: clamp(24px, 4.5vw, 56px);
  padding-bottom: clamp(20px, 3.5vw, 40px);
  text-align: left;
  color: #ffffff;
}

.anuncios__textos {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.anuncios__titulo {
  /* deja libre el espacio de las flechas (≈100px) para no encimarse */
  max-width: min(700px, calc(100% - 120px));
  font-family: 'Host Grotesk', sans-serif;
  font-weight: 600;
  font-size: clamp(1.7rem, 4.2vw, 3.2rem);
  line-height: 1.1;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55),
               0 1px 3px rgba(0, 0, 0, 0.4);
}

.anuncios__descripcion {
  max-width: 480px;
  font-family: var(--fuente-base);
  font-weight: 400;
  font-size: clamp(0.95rem, 1.5vw, 1.2rem);
  line-height: 1.4;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55),
               0 1px 3px rgba(0, 0, 0, 0.4);
}

/* ---------- Botón: píldora + círculo con flecha ---------- */

/* "a.anuncios__boton" para ganarle a la regla a:link de reset.css,
   que fuerza el color de todos los enlaces a negro */
.anuncios a.anuncios__boton {
  align-self: center; /* centrado horizontalmente */
  display: inline-flex;
  align-items: center;
  gap: 0px;
  color: #000000;
  font-family: 'Source Sans 3', sans-serif;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.anuncios a.anuncios__boton:hover {
  transform: translateY(-2px);
  opacity: 0.85;
}

.anuncios__boton-texto {
  padding: 14px 32px;
  border-radius: 999px;
  background: #ffffff;
  font-weight: 600;
  font-size: 0.9rem;
}

.anuncios__boton-icono {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #ffffff;
  font-size: 22px !important;
}

/* ---------- Bloque inferior: botón + etiqueta, centrados ---------- */

.anuncios__accion {
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.anuncios__etiqueta {
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.2;
  text-align: center;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6),
               0 1px 2px rgba(0, 0, 0, 0.4);
}

/* ---------- Flechas (arriba a la derecha) ---------- */

/* Splide posiciona cada flecha por separado a media altura; aquí las
   agrupamos en la esquina superior derecha, una junto a la otra. */
.anuncios .splide__arrows {
  position: absolute;
  top: clamp(16px, 3vw, 36px);
  right: clamp(16px, 3vw, 36px);
  z-index: 3;
  display: flex;
  gap: 8px;
}

.anuncios .splide__arrow {
  position: static;
  transform: none;
  width: 40px;
  height: 40px;
  background: #ffffff;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.anuncios .splide__arrow svg {
  width: 16px;
  height: 16px;
  fill: #000000;
}

.anuncios .splide__arrow:hover:not(:disabled) {
  opacity: 0.85;
}


/* ============================================================
   2. OLIMPIADAS
   ============================================================ */

.olimpiadas {
  width: min(1280px, calc(100% - 80px));
  margin: 0 auto;
  padding: 48px 0 64px;
  box-sizing: border-box;
}

.olimpiadas__titulo {
  margin: 0 0 32px 0;
  color: #000000;
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 700;
  font-size: clamp(1.4rem, 2vw, 1.6rem);
  line-height: 1.25;
}

/* ---------- Logos ---------- */

.olimpiadas__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 120px;
}

.olimpiadas__logo a,
.olimpiadas__logo span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.olimpiadas__logo img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* ---------- Paginación (puntos) ---------- */

/* Splide la posiciona en absolute sobre el slider; la volvemos parte
   del flujo para que quede debajo de los logos. */
.olimpiadas .splide__pagination {
  position: static;
  padding: 0;
  margin-top: 24px;
  gap: 10px;
}

.olimpiadas .splide__pagination li {
  display: flex;
}

.olimpiadas .splide__pagination__page {
  width: 12px;
  height: 12px;
  margin: 0;
  background: #7a9bad;
  opacity: 1;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.olimpiadas .splide__pagination__page.is-active {
  background: #2F4E62;
  transform: scale(1.15);
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 960px) {
  .anuncios {
    width: calc(100% - 48px); /* igual al padding del header en móvil */
    margin-top: 100px;
  }

  .olimpiadas {
    width: calc(100% - 48px);
  }
}

@media (max-width: 768px) {
  /* Banner a todo el ancho de la pantalla y sin esquinas redondeadas */
  .anuncios {
    width: 100%;
    margin-top: 91px; /* altura del header en móvil: 20 + 50 + 20 + 1px de borde */
  }

  .anuncios__slider {
    border-radius: 0;
  }

  .anuncios__slide {
    aspect-ratio: 7 / 10; /* más alto en móvil */
    max-height: none;
  }

  .anuncios__contenido {
    padding: 20px 20px 24px;
  }

  .anuncios__titulo {
    font-size: clamp(1.5rem, 7vw, 2rem);
  }

  .anuncios__descripcion {
    font-size: 0.95rem;
    max-width: none;
  }

  .anuncios__boton-texto {
    padding: 11px 24px;
    font-size: 0.95rem;
  }

  .anuncios__boton-icono {
    width: 42px;
    height: 42px;
    font-size: 20px !important;
  }

  .anuncios__accion {
    gap: 10px;
  }

  .anuncios__etiqueta {
    font-size: 0.9rem;
  }

  .anuncios .splide__arrows {
    top: 16px;
    right: 16px;
    gap: 6px;
  }

  .anuncios .splide__arrow {
    width: 34px;
    height: 34px;
  }

  .olimpiadas {
    padding: 40px 0 48px;
  }

  .olimpiadas__titulo {
    max-width: 260px; /* parte el título en 2 líneas */
  }

  .olimpiadas__logo {
    height: 100px;
  }
}