/* Winsiders Custom Elements — Slider à onglets (av_wce_showcase_slider).
 * Styles neutres : le composant vit sur n'importe quel thème Enfold. Les
 * couleurs d'accent/fond de panneau arrivent par variables CSS inline
 * (--wce-ss-*) posées par le rendu PHP, avec fallbacks hex. */

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

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

/* ─── Corps : stage + colonne d'onglets ─────────────────────────────── */

#top .wce-showcase__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 18px;
    align-items: stretch;
}

/* ─── Stage ─────────────────────────────────────────────────────────── */

#top .wce-showcase__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-ss-radius, 28px);
    background: #0a0a0a;
    min-height: 240px;
}

#top .wce-showcase--fixed-stage .wce-showcase__stage {
    height: var(--wce-ss-stage-height, 640px);
}

#top .wce-showcase--fluid-stage .wce-showcase__stage {
    aspect-ratio: 4 / 3;
}

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

/*
 * Contenu éditorial aligné à gauche même si le thème justifie .entry-content
 * (héritage) : les légendes restent lisibles.
 */
#top .wce-showcase__caption-title,
#top .wce-showcase__caption-text,
#top .wce-showcase__tab-label,
#top .wce-showcase__cta,
#top .wce-showcase__counter {
    text-align: left;
}

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

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

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

#top .wce-showcase__scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        rgba(0, 0, 0, 0) 28%,
        rgba(0, 0, 0, 0.13) 48%,
        rgba(0, 0, 0, 0.6) 78%,
        rgba(0, 0, 0, 0.93) 100%
    );
}

/* ─── Contenu superposé ─────────────────────────────────────────────── */

#top .wce-showcase__caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0 36px 34px;
    max-width: 640px;
    color: #f4f4f0;
}

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

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

/* ─── Position du texte superposé (choisie par diapositive) ────────── */

/* Bas gauche : position par défaut (règles ci-dessus). */

#top .wce-showcase__caption--bottom-right {
    left: auto;
}

#top .wce-showcase__caption--bottom-right .wce-showcase__caption-title,
#top .wce-showcase__caption--bottom-right .wce-showcase__caption-text,
#top .wce-showcase__caption--center-right .wce-showcase__caption-title,
#top .wce-showcase__caption--center-right .wce-showcase__caption-text {
    text-align: right;
}

#top .wce-showcase__caption--center-left {
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    max-width: 460px;
}

#top .wce-showcase__caption--center {
    top: 50%;
    bottom: auto;
    left: 50%;
    right: auto;
    transform: translate(-50%, -50%);
    max-width: 560px;
}

#top .wce-showcase__caption--center .wce-showcase__caption-title,
#top .wce-showcase__caption--center .wce-showcase__caption-text {
    text-align: center;
}

#top .wce-showcase__caption--center .wce-showcase__cta {
    justify-content: center;
    width: 100%;
}

#top .wce-showcase__caption--center-right {
    top: 50%;
    bottom: auto;
    left: auto;
    transform: translateY(-50%);
    max-width: 460px;
}

/* Positions centrées : le dégradé bas par défaut ne couvre pas le milieu
 * de l'image, on l'étend en voile doux sur toute la diapositive. */
#top .wce-showcase__slide:has(> .wce-showcase__caption--center-left) .wce-showcase__scrim,
#top .wce-showcase__slide:has(> .wce-showcase__caption--center) .wce-showcase__scrim,
#top .wce-showcase__slide:has(> .wce-showcase__caption--center-right) .wce-showcase__scrim {
    background:
        linear-gradient(180deg, rgba(4, 4, 4, 0.44) 0%, rgba(4, 4, 4, 0.18) 50%, rgba(4, 4, 4, 0.66) 100%);
}

#top .wce-showcase__cta {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 14px;
    color: #ffffff;
    font-weight: 800;
    text-decoration: none;
    transition: transform 0.2s ease;
}

#top .wce-showcase__cta svg {
    flex: 0 0 auto;
}

#top .wce-showcase__cta:hover,
#top .wce-showcase__cta:focus-visible {
    color: #ffffff;
    transform: translateX(4px);
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* ─── Compteur ──────────────────────────────────────────────────────── */

#top .wce-showcase__counter {
    position: absolute;
    top: 24px;
    left: 26px;
    z-index: 2;
    padding: 0.45em 1em;
    border-radius: 999px;
    background: rgba(5, 5, 5, 0.66);
    color: #f4f4f0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    font-variant-numeric: tabular-nums;
}

/* ─── Flèches ───────────────────────────────────────────────────────── */

#top .wce-showcase__nav {
    position: absolute;
    bottom: 34px;
    right: 34px;
    z-index: 2;
    display: flex;
    gap: 9px;
}

#top .wce-showcase__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    background: rgba(8, 8, 8, 0.74);
    color: #ffffff;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

#top .wce-showcase__arrow:hover {
    border-color: var(--wce-ss-accent, var(--enfold-main-color-primary, #4a90d9));
}

#top .wce-showcase__arrow:focus-visible,
#top .wce-showcase__tab:focus-visible,
#top .wce-showcase__cta:focus-visible {
    outline: 2px solid var(--wce-ss-accent, var(--enfold-main-color-primary, #4a90d9));
    outline-offset: 2px;
}

/* ─── Colonne d'onglets ─────────────────────────────────────────────── */

#top .wce-showcase__tabs {
    display: flex;
    flex-direction: column;
    padding: 12px 26px;
    border-radius: var(--wce-ss-radius, 28px);
    background: var(--wce-ss-panel-bg, #101010);
}

#top .wce-showcase__tab {
    appearance: none;
    position: relative;
    display: block;
    width: 100%;
    padding: 24px 0;
    border: 0;
    border-bottom: 1px solid #2a2a2a;
    background: none;
    text-align: left;
    font-family: inherit;
    cursor: pointer;
}

#top .wce-showcase__tab:last-child {
    border-bottom: 0;
}

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

#top .wce-showcase__tab-label {
    color: #7e817e;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
    transition: color 0.2s ease;
}

#top .wce-showcase__tab:hover .wce-showcase__tab-label,
#top .wce-showcase__tab--active .wce-showcase__tab-label {
    color: #ffffff;
}

/* Indicateur timer : la ligne sous l'onglet actif se remplit pendant la
 * durée d'affichage de la diapo (animation posée par le JS d'autoplay ;
 * sans autoplay, elle reste invisible). */
#top .wce-showcase__tab-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background: var(--wce-ss-accent, var(--enfold-main-color-primary, #4a90d9));
    transform: scaleX(0);
    transform-origin: left center;
    pointer-events: none;
}

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

    to {
        transform: scaleX(1);
    }
}

/* ─── Instance à une seule diapositive : navigation masquée ─────────── */

#top .wce-showcase--single .wce-showcase__nav,
#top .wce-showcase--single .wce-showcase__tabs {
    display: none;
}

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

@media (max-width: 767px) {
    #top .wce-showcase__body {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    #top .wce-showcase--fixed-stage .wce-showcase__stage {
        height: min(var(--wce-ss-stage-height, 640px), 480px);
    }

    #top .wce-showcase__caption {
        padding: 0 20px 20px;
    }

    #top .wce-showcase__caption--center-left,
    #top .wce-showcase__caption--center-right {
        max-width: 78%;
    }

    #top .wce-showcase__caption--center {
        max-width: 88%;
    }

    #top .wce-showcase__nav {
        bottom: 16px;
        right: 16px;
    }

    #top .wce-showcase__arrow {
        width: 44px;
        height: 44px;
    }

    #top .wce-showcase__counter {
        top: 14px;
        left: 14px;
    }

    /* Onglets : rangée horizontale scrollable de chips pill. */
    #top .wce-showcase__tabs {
        flex-direction: row;
        align-items: center;
        gap: 10px;
        padding: 10px 14px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        scroll-snap-type: x proximity;
    }

    #top .wce-showcase__tabs::-webkit-scrollbar {
        display: none;
    }

    #top .wce-showcase__tab {
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        width: auto;
        padding: 10px 18px;
        border: 1px solid transparent;
        border-radius: 999px;
        overflow: hidden;
        scroll-snap-align: start;
    }

    #top .wce-showcase__tab--active {
        border-color: var(--wce-ss-accent, var(--enfold-main-color-primary, #4a90d9));
    }

    #top .wce-showcase__tab-num {
        margin-bottom: 0;
        font-size: 11px;
    }

    #top .wce-showcase__tab-label {
        font-size: 14px;
    }
}

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

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

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

    #top .wce-showcase__cta,
    #top .wce-showcase__arrow,
    #top .wce-showcase__tab-label {
        transition: none;
    }
}