/* =========================================================
   FUNDACIÓN LUZ EN LAS TINIEBLAS
   Modal: Historias de Luz / Stories of Light
   Archivo: /assets/css/historias-luz.css
   ========================================================= */

/* Fondo general del modal */
.story-video-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;

    width: 100%;
    height: 100%;

    padding: 20px;

    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);

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

    overflow-y: auto;
}

/* Estado abierto */
.story-video-modal.active {
    display: flex;
    animation: storyFadeIn 0.25s ease;
}

/* Caja principal */
.story-video-content {
    position: relative;

    width: 100%;
    max-width: 900px;

    margin: auto;
    padding: 28px;

    background: #ffffff;
    border-radius: 22px;

    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.30),
        0 5px 20px rgba(0, 0, 0, 0.15);

    animation: storyScaleIn 0.25s ease;
}

/* Título */
.story-video-title {
    margin: 0 50px 20px 0;

    color: var(--primary, #133c7a);
    font-size: 1.5rem;
    line-height: 1.3;
}

/* Botón cerrar */
.story-video-close {
    position: absolute;
    top: 10px;
    right: 16px;

    width: 42px;
    height: 42px;

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

    padding: 0;

    border: 0;
    border-radius: 50%;

    background: transparent;
    color: #555555;

    font-family: Arial, sans-serif;
    font-size: 32px;
    font-weight: 400;
    line-height: 1;

    cursor: pointer;

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

.story-video-close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--primary, #133c7a);
    transform: scale(1.05);
}

.story-video-close:focus-visible {
    outline: 3px solid var(--secondary, #d4a64f);
    outline-offset: 2px;
}

/* =========================================================
   VIDEO YOUTUBE RESPONSIVO 16:9
   ========================================================= */

.story-video-container {
    position: relative;

    width: 100%;
    height: 0;

    padding-bottom: 56.25%;

    overflow: hidden;

    background: #000000;
    border-radius: 14px;
}

.story-video-container iframe {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    border: 0;
}

/* Evita scroll del sitio mientras el modal está abierto */
body.story-video-open {
    overflow: hidden;
}

/* =========================================================
   ANIMACIONES
   ========================================================= */

@keyframes storyFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes storyScaleIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Accesibilidad: reduce animaciones si el usuario lo prefiere */
@media (prefers-reduced-motion: reduce) {
    .story-video-modal.active,
    .story-video-content {
        animation: none;
    }
}

/* =========================================================
   TABLETS
   ========================================================= */

@media (max-width: 768px) {
    .story-video-modal {
        padding: 15px;
    }

    .story-video-content {
        padding: 22px;
        border-radius: 18px;
    }

    .story-video-title {
        margin-bottom: 16px;
        font-size: 1.3rem;
    }
}

/* =========================================================
   MÓVILES
   ========================================================= */

@media (max-width: 480px) {
    .story-video-modal {
        padding: 10px;
    }

    .story-video-content {
        padding: 16px;
        border-radius: 16px;
    }

    .story-video-title {
        margin-right: 40px;
        margin-bottom: 14px;
        font-size: 1.15rem;
    }

    .story-video-close {
        top: 5px;
        right: 8px;

        width: 38px;
        height: 38px;

        font-size: 28px;
    }

    .story-video-container {
        border-radius: 10px;
    }
}
