/* =========================
   CARRUSEL DE LA PORTADA (videos) Y REPRODUCTOR AMPLIADO
   Va después de styles.css: reemplaza el ancho fijo del carrusel de 3 imágenes por uno que
   admite cualquier cantidad de diapositivas.
========================= */

.hero-track {
    width: 100%;
}

.hero-slide {
    flex: 0 0 100%;

    width: 100%;
}


/* Diapositiva de video: se reproduce sola y en silencio */

.hero-video {
    position: relative;

    overflow: hidden;

    background: #0d1b3d;

    cursor: zoom-in;
}

.hero-video video {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    pointer-events: none;
}

.hero-video-titulo {
    position: absolute;

    right: 0;
    bottom: 0;
    left: 0;

    padding: 32px 76px 40px 20px;

    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-align: left;

    background: linear-gradient(to top, rgba(13, 27, 61, 0.75), transparent);

    pointer-events: none;
}

.hero-video-ampliar {
    position: absolute;

    top: 14px;
    right: 14px;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 40px;
    height: 40px;

    padding: 0;

    color: var(--primary-dark);

    background: rgba(255, 255, 255, 0.92);

    border: 0;
    border-radius: 50%;

    box-shadow: 0 4px 14px rgba(13, 27, 61, 0.3);

    cursor: pointer;

    transition: transform 0.2s ease, background 0.2s ease;
}

.hero-video-ampliar:hover,
.hero-video-ampliar:focus-visible {
    background: #fff;

    transform: scale(1.08);
}


/* Controles sobre el carrusel: flechas, sonido y puntos */

.hero-arrow,
.hero-sonido,
.hero-video-ampliar:focus-visible {
    outline-offset: 2px;
}

.hero-arrow:focus-visible,
.hero-sonido:focus-visible,
.hero-video-ampliar:focus-visible,
.hero-dots button:focus-visible {
    outline: 3px solid var(--accent);
}

.hero-arrow {
    position: absolute;

    top: 50%;
    z-index: 2;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 44px;
    height: 44px;

    padding: 0;

    color: var(--primary-dark);

    background: rgba(255, 255, 255, 0.9);

    border: 0;
    border-radius: 50%;

    box-shadow: 0 4px 14px rgba(13, 27, 61, 0.3);

    cursor: pointer;

    transform: translateY(-50%);

    transition: background 0.2s ease, transform 0.2s ease;
}

.hero-arrow:hover {
    background: #fff;

    transform: translateY(-50%) scale(1.08);
}

.hero-arrow[hidden],
.hero-sonido[hidden],
.hero-pausa[hidden] {
    display: none;
}

/* Pausa o reanuda los videos y el avance automático */

.hero-pausa {
    position: absolute;

    top: 14px;
    left: 14px;
    z-index: 2;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 40px;
    height: 40px;

    padding: 0;

    color: var(--primary-dark);

    background: rgba(255, 255, 255, 0.92);

    border: 0;
    border-radius: 50%;

    box-shadow: 0 4px 14px rgba(13, 27, 61, 0.3);

    cursor: pointer;
}

.hero-pausa:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

.hero-pausa .hero-pausa-reanudar,
.hero-pausa.is-paused .hero-pausa-pausar {
    display: none;
}

.hero-pausa.is-paused .hero-pausa-reanudar {
    display: block;
}

.hero-arrow-prev {
    left: 12px;
}

.hero-arrow-next {
    right: 12px;
}

.hero-sonido {
    position: absolute;

    bottom: 14px;
    left: 14px;
    z-index: 2;

    display: flex;
    align-items: center;

    gap: 8px;

    height: 40px;

    padding: 0 16px 0 12px;

    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;

    background: rgba(13, 27, 61, 0.78);

    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 999px;

    cursor: pointer;

    transition: background 0.2s ease;
}

.hero-sonido:hover {
    background: rgba(13, 27, 61, 0.95);
}

.hero-sonido .hero-sonido-on,
.hero-sonido.is-on .hero-sonido-off {
    display: none;
}

.hero-sonido.is-on .hero-sonido-on {
    display: block;
}


/* Puntos de navegación */

.hero-dots {
    position: absolute;

    right: 0;
    bottom: 14px;
    left: 0;
    z-index: 1;

    display: flex;
    justify-content: center;

    gap: 8px;

    pointer-events: none;
}

.hero-dots[hidden] {
    display: none;
}

.hero-dots button {
    width: 10px;
    height: 10px;

    padding: 0;

    border: 0;
    border-radius: 50%;

    background: rgba(255, 255, 255, 0.55);

    box-shadow: 0 0 0 1px rgba(13, 27, 61, 0.25);

    cursor: pointer;

    pointer-events: auto;

    transition: background 0.2s ease, transform 0.2s ease;
}

.hero-dots button.is-active {
    background: #fff;

    transform: scale(1.3);
}


/* Reproductor ampliado */

.video-modal {
    width: min(94vw, 1200px);
    max-width: none;
    max-height: 94vh;

    padding: 0;

    overflow: visible;

    color: #fff;

    background: transparent;

    border: 0;
}

.video-modal::backdrop {
    background: rgba(8, 15, 35, 0.88);
}

.video-modal video {
    display: block;

    width: 100%;
    max-height: 82vh;

    background: #000;

    border-radius: 12px;
}

.video-modal-titulo {
    margin: 12px 4px 0;

    font-size: 15px;
    font-weight: 600;
    text-align: center;
}

.video-modal-close {
    position: absolute;

    top: -14px;
    right: -6px;
    z-index: 1;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 40px;
    height: 40px;

    padding: 0 0 4px;

    color: var(--primary-dark);
    font-size: 28px;
    line-height: 1;

    background: #fff;

    border: 0;
    border-radius: 50%;

    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);

    cursor: pointer;
}

.video-modal-close:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

@media (max-width: 640px) {
    .hero-arrow {
        width: 38px;
        height: 38px;
    }

    .hero-arrow-prev {
        left: 8px;
    }

    .hero-arrow-next {
        right: 8px;
    }

    /* En pantallas chicas el botón de sonido queda solo con el ícono. */
    .hero-sonido {
        width: 40px;
        padding: 0;

        justify-content: center;
    }

    .hero-sonido-texto {
        display: none;
    }

    .hero-video-titulo {
        padding-right: 20px;
        padding-left: 14px;
    }

    .video-modal {
        width: 96vw;
    }

    .video-modal-close {
        top: -18px;
        right: 4px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-track,
    .hero-arrow,
    .hero-video-ampliar,
    .hero-dots button {
        transition: none;
    }
}
