/* Video Lightbox — facade MP4 + off-canvas */

.evl {
    --evl-ease: cubic-bezier(0.22, 1, 0.36, 1);
    display: block;
    width: 100%;
}

/* ---------- Trigger ---------- */

/* Double classe : surpasse les styles globaux Elementor (.elementor-kit-* button) */
.evl .evl-trigger {
    position: relative;
    display: block;
    width: 100%;
    height: auto;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 16px;
    overflow: hidden;
    background: #0a0814;
    box-shadow: none;
    color: inherit;
    font-family: inherit;
    text-transform: none;
    line-height: normal;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* Espaceur : donne la hauteur au bouton selon le ratio (plus fiable
   qu'aspect-ratio face aux styles Elementor/WP Rocket) */
.evl-trigger::before {
    content: "";
    display: block;
    padding-top: var(--evl-pad, 56.25%);
}

.evl .evl-trigger:hover,
.evl .evl-trigger:focus,
.evl .evl-trigger:focus-visible,
.evl .evl-trigger:active {
    padding: 0;
    border: 0;
    background: #0a0814;
    box-shadow: none;
    color: inherit;
    text-decoration: none;
    outline: none;
}

.evl .evl-trigger:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 4px;
}

.evl-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100% !important;
    object-fit: cover;
    display: block;
    transition: transform 0.6s var(--evl-ease), opacity 0.4s ease;
}

.evl-trigger:hover .evl-thumb {
    transform: scale(1.04);
    opacity: 0.9;
}

.evl-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 62px;
    height: 62px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: #676EB2;
    border: 2px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
    transition: transform 0.45s var(--evl-ease), background 0.3s ease;
}

.evl-play svg {
    width: 22px;
    height: 22px;
}

.evl-trigger:hover .evl-play {
    transform: translate(-50%, -50%) scale(1.1);
    background: #5a61a0;
}

/* Info sous l'icône play */
.evl-meta {
    position: absolute;
    top: calc(50% + 48px);
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 12px;
    border-radius: 20px;
    background: #F9F8FE;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #676EB2;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    pointer-events: none;
    font-family: "Nunito", Sans-serif;
}

/* ---------- Overlay / Off-canvas ---------- */

.evl-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    visibility: hidden;
    pointer-events: none;
}

.evl-overlay.is-open {
    visibility: visible;
    pointer-events: auto;
}

.evl-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 8, 20, 0.55);
    backdrop-filter: blur(10px) saturate(140%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    opacity: 0;
    transition: opacity 0.5s var(--evl-ease);
}

.evl-overlay.is-open .evl-backdrop {
    opacity: 1;
}

/* Desktop : panneau latéral droit */
.evl-panel {
    position: relative;
    margin-left: auto;
    width: min(760px, 94vw);
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
    box-sizing: border-box;
    transform: translateX(100%);
    transition: transform 0.6s var(--evl-ease);
    will-change: transform;
}

.evl-overlay.is-open .evl-panel {
    transform: translateX(0);
}

/* Wrapper sheet : transparent sur desktop (display: contents), stylé sur mobile */
.evl-sheet {
    display: contents;
}

.evl-handle {
    display: none;
}

.evl-video {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
    opacity: 0;
    transform: scale(0.94);
    transition: opacity 0.5s var(--evl-ease) 0.15s, transform 0.5s var(--evl-ease) 0.15s;
}

.evl-overlay.is-open .evl-video {
    opacity: 1;
    transform: scale(1);
}

.evl-video video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: #000;
}

.evl .evl-close {
    position: static;
    align-self: flex-end;
    order: -1;
    margin: 0 0 16px;
    z-index: 2;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    border: 0;
    box-shadow: none;
    font-family: inherit;
    text-transform: none;
    line-height: normal;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s var(--evl-ease);
}

/* Neutralise les états button:hover/focus/active du kit Elementor */
.evl .evl-close:hover,
.evl .evl-close:focus,
.evl .evl-close:focus-visible,
.evl .evl-close:active {
    padding: 0;
    border: 0;
    border-radius: 50%;
    box-shadow: none;
    color: #fff;
    text-decoration: none;
    outline: none;
    background: rgba(255, 255, 255, 0.12);
    background-color: rgba(255, 255, 255, 0.12);
}

.evl .evl-close:hover {
    background-color: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg);
}

.evl .evl-close:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.evl .evl-close:active {
    transform: scale(0.92);
}

/* ---------- Mobile : bottom sheet ---------- */

@media (max-width: 767px) {
    /* Hauteur fixe mobile : neutralise l'espaceur ::before et garantit
       une hauteur même si le ratio est écrasé par un autre style */
    .evl .evl-trigger {
        height: 200px;
    }

    .evl-trigger::before {
        padding-top: 0;
    }

    .evl-play {
        width: 48px;
        height: 48px;
    }

    .evl-meta {
        top: calc(50% + 38px);
        font-size: 11px;
    }

    .evl-panel {
        width: 100%;
        margin: 0;
        padding: 0;
        align-items: stretch;
        justify-content: flex-end;
        transform: translateY(100%);
    }

    .evl-overlay.is-open .evl-panel {
        transform: translateY(0);
    }

    .evl-sheet {
        display: flex;
        flex-direction: column;
        background: #fff;
        border-radius: 24px 24px 0 0;
        padding: 10px 12px calc(14px + env(safe-area-inset-bottom, 0px));
        box-shadow: 0 -12px 40px rgba(10, 8, 20, 0.25);
    }

    .evl-handle {
        display: block;
        width: 36px;
        height: 4px;
        margin: 0 auto 12px;
        border-radius: 2px;
        background: rgba(20, 16, 40, 0.18);
        flex: none;
    }

    .evl-video {
        border-radius: 16px;
        box-shadow: none;
        flex: none;
    }

    /* Bouton fermeture : juste au-dessus de la sheet, aligné à droite */
    .evl .evl-close,
    .evl .evl-close:hover,
    .evl .evl-close:focus,
    .evl .evl-close:focus-visible,
    .evl .evl-close:active {
        position: static;
        align-self: flex-end;
        margin: 0 6px 12px 0;
        flex: none;
        order: -1;
        color: #fff;
        background: rgba(255, 255, 255, 0.16);
        background-color: rgba(255, 255, 255, 0.16);
    }

    .evl .evl-close:hover {
        background-color: rgba(255, 255, 255, 0.28);
    }
}

/* Scroll lock */
html.evl-lock,
html.evl-lock body {
    overflow: hidden;
}

/* Accessibilité : réduit les animations si demandé */
@media (prefers-reduced-motion: reduce) {
    .evl-thumb,
    .evl-play,
    .evl-backdrop,
    .evl-panel,
    .evl-video,
    .evl-close {
        transition-duration: 0.01ms !important;
    }
}
