/* widget-video.css — Bloc vidéo DP (YouTube / Vimeo / hébergée WordPress) */

.dp-video {
    /* Variables locales (overrides Elementor) -> fallback charte -> fallback hex */
    --dp-video-radius:      var(--dp-vid-radius, var(--dp-radius-lg, 20px));
    --dp-video-accent:      var(--dp-vid-accent, var(--dp-color-primary, #1a86a2));
    --dp-video-accent-dark: var(--dp-vid-accent-dark, var(--dp-color-primary-dark, #0d5e76));
    --dp-video-icon:        var(--dp-vid-icon, var(--dp-color-surface, #ffffff));
    --dp-video-bg:          var(--dp-vid-bg, var(--dp-color-text, #3c3c3b));
    --dp-video-shadow:      var(--dp-vid-shadow, 0 10px 30px rgba(0, 0, 0, 0.18));

    font-family: var(--dp-font-base, inherit);
    font-weight: var(--dp-font-base-weight, 400);
    width: 100%;
}

/* Cadre responsive avec ratio piloté en inline (--dp-vid-ratio) */
.dp-video__frame {
    position: relative;
    width: 100%;
    padding-top: var(--dp-vid-ratio, 56.25%); /* 16:9 par défaut */
    overflow: hidden;
    border-radius: var(--dp-video-radius);
    background: var(--dp-video-bg);
    box-shadow: var(--dp-video-shadow);
}

.dp-video__frame iframe,
.dp-video__frame video,
.dp-video__poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    margin: 0;
}

.dp-video__frame video {
    object-fit: cover;
    display: block;
    background: var(--dp-video-bg);
}

/* Façade « click-to-load » (perf : pas d'iframe avant le clic) */
.dp-video__poster {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    background: var(--dp-video-bg);
    overflow: hidden;
}

.dp-video__poster-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease, filter 0.3s ease;
}

.dp-video__poster::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.35) 100%);
    transition: opacity 0.3s ease;
    opacity: 0.8;
}

.dp-video__poster:hover .dp-video__poster-img {
    transform: scale(1.04);
}

.dp-video__poster:hover::after {
    opacity: 1;
}

/* Bouton play à la charte */
.dp-video__play {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: var(--dp-radius-pill, 999px);
    background: var(--dp-video-accent);
    color: var(--dp-video-icon);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    transition: transform 0.25s ease, background 0.25s ease;
}

.dp-video__poster:hover .dp-video__play,
.dp-video__poster:focus-visible .dp-video__play {
    transform: scale(1.08);
    background: var(--dp-video-accent-dark);
}

.dp-video__poster:focus-visible {
    outline: 3px solid var(--dp-video-accent);
    outline-offset: 3px;
}

.dp-video__play svg {
    width: 28px;
    height: 28px;
    margin-left: 4px; /* recentrage optique du triangle */
    fill: currentColor;
}

/* Légende optionnelle */
.dp-video__caption {
    margin: 12px 2px 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--dp-vid-caption, var(--dp-color-text-muted, #6b7280));
    font-family: var(--dp-font-base, inherit);
    font-weight: var(--dp-font-base-weight, 400);
}

@media (max-width: 600px) {
    .dp-video__play {
        width: 60px;
        height: 60px;
    }

    .dp-video__play svg {
        width: 24px;
        height: 24px;
    }
}
