/* ==========================================================================
   VIDEO MODAL - Modale riutilizzabile per video YouTube
   Fullscreen con overlay nero, nessun padding bianco
   ========================================================================== */

.s4w-video-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 400ms ease-in-out;
}

.s4w-video-modal[aria-hidden="false"] {
    display: flex;
    opacity: 1;
}

/* Overlay nero */
.s4w-video-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

/* Container - nessun background bianco, nessun padding */
.s4w-video-modal__container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    z-index: 1;
    padding: 0 var(--spacing-md);
    transform: scale(0.95);
    transition: transform 400ms ease-out;
}

.s4w-video-modal[aria-hidden="false"] .s4w-video-modal__container {
    transform: scale(1);
}

/* Pulsante chiudi - posizionato in alto a destra dello schermo */
.s4w-video-modal__close {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    color: var(--text-main-900);
    transition: opacity var(--transition-fast);
    z-index: 10000;
}

.s4w-video-modal__close:hover {
    opacity: 0.8;
}

.s4w-video-modal__close:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
}

.s4w-video-modal__close svg {
    width: 24px;
    height: 24px;
}

/* Video wrapper - aspect ratio 16:9, nessun background */
.s4w-video-modal__video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: #000;
}

.s4w-video-modal__video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Responsive */
@media (max-width: 768px) {
    .s4w-video-modal__container {
        padding: 0 var(--spacing-sm);
    }

    .s4w-video-modal__close {
        top: 16px;
        right: 16px;
        width: 36px;
        height: 36px;
    }

    .s4w-video-modal__close svg {
        width: 20px;
        height: 20px;
    }
}

/* Accessibilità - classe helper per nascondere visivamente */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
