/* Carrusel de portada — solo estilos del banner; el resto vive en estilos.css */

.carrusel {
  position: relative;
  min-height: 28rem;
  background: var(--marino);
  color: #f7f4ee;
  overflow: hidden;
}

.pista,
.diapositiva,
.velo,
.hero-texto {
  position: absolute;
  inset: 0;
}

.pista {
  z-index: 0;
}

.diapositiva {
  opacity: 0;
  transition: opacity 0.75s ease;
  background: var(--marino);
  overflow: hidden;
  pointer-events: none;
}

.diapositiva.activa {
  opacity: 1;
  z-index: 1;
}

.diapositiva img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  max-width: none;
  transform: scale(1);
  transform-origin: center center;
  transition: transform 1.2s ease;
  will-change: transform;
}

.diapositiva.foto img {
  object-position: center 40%;
}

.diapositiva.banner {
  background: #0b3a73;
}

.diapositiva.banner img {
  object-fit: cover;
  object-position: center center;
  background: #0b3a73;
}

.diapositiva.activa img {
  animation: kenburns 6s ease-out forwards;
}

.carrusel:hover .diapositiva.activa img {
  animation: none;
  transform: scale(1.07);
  transition: transform 1.15s ease;
}

@keyframes kenburns {
  from {
    transform: scale(1);
  }

  to {
    transform: scale(1.08);
  }
}

.velo {
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(12, 35, 64, 0.9) 0%, rgba(12, 35, 64, 0.72) 34%, rgba(12, 35, 64, 0.22) 62%, rgba(12, 35, 64, 0.08) 100%),
    linear-gradient(180deg, rgba(12, 35, 64, 0.05), rgba(12, 35, 64, 0.38));
}

.hero-texto {
  z-index: 3;
  inset: auto auto auto 0;
  right: 0;
  top: 0;
  bottom: auto;
  pointer-events: none;
  padding: 2.4rem max(1rem, calc((100% - var(--max)) / 2)) 0;
  max-width: none;
}

.hero-texto h1 {
  margin: 0 0 0.4rem;
  font-family: Georgia, "Liberation Serif", serif;
  font-weight: 700;
  line-height: 1.2;
  font-size: clamp(2.1rem, 4vw, 3.3rem);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.hero-texto p {
  max-width: 40rem;
  margin: 0 0 1.2rem;
  font-size: 1.08rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.hero-texto .acciones,
.hero-texto .boton,
.ctrl,
.puntos {
  pointer-events: auto;
}

.ctrl {
  position: absolute;
  z-index: 4;
  bottom: 1rem;
  min-height: 2.75rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 0.3rem;
  background: rgba(12, 35, 64, 0.72);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.ctrl:hover {
  background: rgba(12, 35, 64, 0.9);
}

.anterior {
  left: max(0.75rem, calc((100% - var(--max)) / 2));
}

.siguiente {
  right: max(0.75rem, calc((100% - var(--max)) / 2));
}

.puntos {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 1.15rem;
  transform: translateX(-50%);
  display: flex;
  gap: 0.35rem;
  max-width: calc(100% - 13rem);
  justify-content: center;
}

.puntos button {
  width: 0.75rem;
  height: 0.75rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
}

.puntos button[aria-selected="true"] {
  background: #fff;
  outline: 2px solid rgba(255, 255, 255, 0.35);
  outline-offset: 2px;
}

@media (max-width: 860px) {
  .carrusel {
    min-height: 34rem;
  }

  .hero-texto {
    padding: 1.3rem 1rem 0;
  }

  .hero-texto p {
    font-size: 1rem;
  }

  .puntos {
    max-width: calc(100% - 2rem);
    bottom: 4.3rem;
  }

  .ctrl {
    bottom: 0.7rem;
  }
}

@media (max-width: 420px) {
  .carrusel {
    min-height: 36rem;
  }

  .ctrl {
    padding: 0.4rem 0.6rem;
    font-size: 0.92rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .diapositiva {
    transition: none;
  }

  .diapositiva img,
  .diapositiva.activa img,
  .carrusel:hover .diapositiva.activa img {
    animation: none;
    transform: none;
    transition: none;
  }
}
