/* Winsiders Custom Elements — Scène animée (av_wce_scene_slider).
 * Styles neutres : le composant vit sur n'importe quel thème Enfold. Les
 * couleurs d'accent arrivent par variable CSS inline (--wce-sc-accent) posée
 * par le rendu PHP, avec fallback hex. Les superpositions (légende, pastilles,
 * ligne) portent des couleurs claires fixes : elles vivent sur une photo voilée. */

#top .wce-scene,
#top .wce-scene *,
#top .wce-scene *::before,
#top .wce-scene *::after {
    box-sizing: border-box;
}

#top .wce-scene {
    margin: 1em 0;
}

/* ─── Scène ─────────────────────────────────────────────────────────── */

#top .wce-scene__stage {
    /* Le pan vertical reste natif (scroll de page) ; le geste horizontal
     * revient au slider — indispensable pour le swipe tactile mobile. */
    touch-action: pan-y;
    position: relative;
    overflow: hidden;
    border-radius: var(--wce-sc-radius, 24px);
    background: #0a0a0a;
    min-height: 220px;
}

#top .wce-scene--fixed-stage .wce-scene__stage {
    height: var(--wce-sc-scene-height, 620px);
}

#top .wce-scene--fluid-stage .wce-scene__stage {
    aspect-ratio: 16 / 9;
}

#top .wce-scene__slides {
    position: absolute;
    inset: 0;
}

/*
 * Contenu éditorial aligné à gauche même si le thème justifie .entry-content
 * (héritage) : la légende reste lisible.
 */
#top .wce-scene__caption-num,
#top .wce-scene__caption-title,
#top .wce-scene__caption-text {
    text-align: left;
}

#top .wce-scene__slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1.1s ease;
}

#top .wce-scene__slide--active {
    opacity: 1;
    z-index: 1;
}

#top .wce-scene__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Voile double : lisibilité à gauche (légende) + en bas (pastilles). */
#top .wce-scene__scrim {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(0, 0, 0, 0.73) 0%, rgba(0, 0, 0, 0) 56%),
        linear-gradient(rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.6) 100%);
}

/* ─── Légende bas gauche ────────────────────────────────────────────── */

#top .wce-scene__caption {
    position: absolute;
    bottom: 28px;
    left: 40px;
    z-index: 2;
    max-width: 390px;
    color: #f4f4f0;
}

#top .wce-scene__caption--anim {
    animation: wce-scene-caption-in 0.35s ease both;
}

@keyframes wce-scene-caption-in {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
}

#top .wce-scene__caption-num {
    display: block;
    margin-bottom: 6px;
    color: var(--wce-sc-accent, var(--enfold-main-color-primary, #4a90d9));
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.1em;
    font-variant-numeric: tabular-nums;
}

#top .wce-scene__caption-title {
    margin: 0 0 8px;
    color: #ffffff;
    font-size: clamp(22px, 2.5vw, 30px);
    font-weight: 800;
    line-height: 1.15;
}

#top .wce-scene__caption-text {
    margin: 0;
    color: #f4f4f0;
    line-height: 1.55;
}

/* ─── Pastilles bas droite : conteneur translucide titré ──────────── */

#top .wce-scene__dots {
    position: absolute;
    bottom: 28px;
    right: 28px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    padding: 14px 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    background: rgba(10, 10, 10, 0.55);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

#top .wce-scene__dots-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Petit titre de l'état actif, au-dessus des pastilles : seul le libellé
 * de l'état courant est affiché (les suivants sont superposés). */
#top .wce-scene__dots-title {
    display: block;
    margin: 0;
    min-width: 48px;
    height: 15px;
    text-align: right;
}

#top .wce-scene__dots-label {
    display: none;
    color: #f4f4f0;
    opacity: 0.85;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    line-height: 15px;
    white-space: nowrap;
}

#top .wce-scene__dots-label--active {
    display: inline-block;
    animation: wce-scene-label-in 0.3s ease;
}

@keyframes wce-scene-label-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
}

#top .wce-scene__dot {
    appearance: none;
    position: relative;
    width: 9px;
    height: 9px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    transition: width 0.4s ease, background-color 0.4s ease;
}

#top .wce-scene__dot:hover {
    background: rgba(255, 255, 255, 0.75);
}

/* L'active s'étire en barre : avec autoplay, la barre neutre se remplit
 * d'accent pendant la durée d'affichage de l'état (animation posée par le
 * JS) ; sans autoplay elle reste en teinte accent pleine. */
#top .wce-scene__dot--active {
    width: 150px;
    background: var(--wce-sc-accent, var(--enfold-main-color-primary, #4a90d9));
    overflow: hidden;
}

#top .wce-scene--autoplay .wce-scene__dot--active {
    background: rgba(255, 255, 255, 0.32);
}

#top .wce-scene__dot-fill {
    position: absolute;
    inset: 0;
    background: var(--wce-sc-accent, var(--enfold-main-color-primary, #4a90d9));
    transform: scaleX(0);
    transform-origin: left center;
    pointer-events: none;
}

@keyframes wce-sc-progress {
    from {
        transform: scaleX(0);
    }

    to {
        transform: scaleX(1);
    }
}

#top .wce-scene__dot:focus-visible {
    outline: 2px solid var(--wce-sc-accent, var(--enfold-main-color-primary, #4a90d9));
    outline-offset: 3px;
}

/* ─── Médias de fond alternatifs (vidéo, contenu personnalisé) ─────── */

#top .wce-scene__video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Le contenu personnalisé remplit la scène : l'auteur y place image,
 * canvas ou éléments animés (wp_kses étendu côté serveur, sans script). */
#top .wce-scene__custom {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#top .wce-scene__custom img {
    display: block;
}

/* ─── Instance à un seul état ───────────────────────────────────────── */

#top .wce-scene--single .wce-scene__dots {
    display: none;
}

/* ─── Mobile ────────────────────────────────────────────────────────── */

@media (max-width: 767px) {
    #top .wce-scene--fluid-stage .wce-scene__stage {
        aspect-ratio: 4 / 3;
        max-height: 420px;
    }

    #top .wce-scene--fixed-stage .wce-scene__stage {
        height: min(var(--wce-sc-scene-height, 620px), 420px);
    }

    #top .wce-scene__caption {
        bottom: 16px;
        left: 20px;
        right: 150px;
        max-width: none;
    }

    #top .wce-scene__dots {
        bottom: 14px;
        right: 14px;
        gap: 8px;
        padding: 10px 12px;
        border-radius: 14px;
    }

    #top .wce-scene__dots-title {
        height: 13px;
    }

    #top .wce-scene__dots-label {
        font-size: 11px;
        line-height: 13px;
    }

    #top .wce-scene__dot--active {
        width: 64px;
    }
}

/* ─── Mouvement réduit : autoplay coupé côté JS, animations minimes ─── */

@media (prefers-reduced-motion: reduce) {
    #top .wce-scene__dot-fill {
        display: none;
    }

    #top .wce-scene__slide {
        transition: none;
    }

    #top .wce-scene__caption--anim {
        animation: none;
    }

    #top .wce-scene__dot {
        transition: none;
    }

    #top .wce-scene__dots-label--active {
        animation: none;
    }
}