/**
 * RadioManager Pro - Slider (shortcode [lvdd_slider])
 * Couleur d'accent : Réglages > Styles globaux (variable --lvdd-accent).
 */

.lvdd-slider {
    --s-accent: var(--lvdd-accent, #e94560);
    --s-dark: var(--lvdd-primary, #1a1a2e);
    --s-h: clamp(340px, 38vw, 520px);
    --s-o: .55;
    --s-pad: clamp(24px, 5vw, 72px);

    position: relative;
    isolation: isolate;
    width: 100%;
    margin: 24px 0;
    border-radius: 20px;
    overflow: hidden;
    background: var(--s-dark);
    color: #fff;
    font-family: var(--lvdd-font-family, inherit);
    -webkit-font-smoothing: antialiased;
}
.lvdd-slider *, .lvdd-slider *::before, .lvdd-slider *::after { box-sizing: border-box; }
.lvdd-slider h2, .lvdd-slider p { margin: 0; padding: 0; }

.lvdd-slider--h-compact { --s-h: clamp(260px, 28vw, 380px); }
.lvdd-slider--h-medium  { --s-h: clamp(340px, 38vw, 520px); }
.lvdd-slider--h-large   { --s-h: clamp(440px, 50vw, 700px); }
.lvdd-slider--o-light  { --s-o: .35; }
.lvdd-slider--o-medium { --s-o: .6; }
.lvdd-slider--o-strong { --s-o: .8; }

.lvdd-slider__viewport { height: var(--s-h); overflow: hidden; }
.lvdd-slider__track {
    display: flex; height: 100%;
    transition: transform .75s cubic-bezier(.22, .61, .36, 1);
    will-change: transform;
}

/* ---------- Diapositive ---------- */
.lvdd-slide { position: relative; flex: 0 0 100%; min-width: 0; height: 100%; display: flex; align-items: center; overflow: hidden; }
.lvdd-slide__media { position: absolute; inset: 0; z-index: 0; background: linear-gradient(135deg, var(--s-dark), color-mix(in srgb, var(--s-accent) 70%, #000)); }
.lvdd-slide__img { width: 100%; height: 100%; object-fit: cover; display: block; transform-origin: 70% 50%; }
.lvdd-slide.is-active .lvdd-slide__img { animation: lvdd-kenburns 9s ease-out both; }
@keyframes lvdd-kenburns { from { transform: scale(1.07); } to { transform: scale(1); } }

/* Voile : garantit la lisibilité du texte, quelle que soit l'image */
.lvdd-slide::after {
    content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background:
        linear-gradient(90deg, rgba(8, 10, 20, var(--s-o)) 0%, rgba(8, 10, 20, calc(var(--s-o) * .55)) 48%, rgba(8, 10, 20, 0) 85%),
        linear-gradient(0deg, rgba(8, 10, 20, calc(var(--s-o) * .7)) 0%, rgba(8, 10, 20, 0) 45%);
}
.lvdd-slider--a-center .lvdd-slide::after {
    background:
        radial-gradient(ellipse at center, rgba(8, 10, 20, calc(var(--s-o) * .9)) 0%, rgba(8, 10, 20, calc(var(--s-o) * .6)) 100%),
        linear-gradient(0deg, rgba(8, 10, 20, calc(var(--s-o) * .6)) 0%, rgba(8, 10, 20, 0) 45%);
}

.lvdd-slide__content {
    position: relative; z-index: 2;
    display: flex; flex-direction: column; align-items: flex-start; gap: 14px;
    width: 100%; max-width: 680px;
    padding: var(--s-pad) var(--s-pad) calc(var(--s-pad) + 20px);
}
.lvdd-slider--a-center .lvdd-slide__content { margin: 0 auto; align-items: center; text-align: center; max-width: 820px; }

.lvdd-slide__badge {
    display: inline-flex; align-items: center; padding: 5px 14px; border-radius: 999px;
    background: var(--s-accent); color: #fff;
    font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
}
.lvdd-slide__title {
    color: #fff; font-size: clamp(1.7rem, 1rem + 3.2vw, 3.2rem); line-height: 1.07; font-weight: 800; letter-spacing: -.02em;
    text-wrap: balance; text-shadow: 0 2px 18px rgba(0, 0, 0, .35);
}
.lvdd-slide__title a { color: inherit; text-decoration: none; }
.lvdd-slide__title a:hover { text-decoration: underline; text-underline-offset: 5px; }
.lvdd-slide__text {
    max-width: 52ch; color: rgba(255, 255, 255, .92); font-size: clamp(1rem, .9rem + .5vw, 1.2rem); line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
    text-shadow: 0 1px 10px rgba(0, 0, 0, .35);
}
.lvdd-slide__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.lvdd-slider--a-center .lvdd-slide__actions { justify-content: center; }

.lvdd-slide__btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px; padding: 0 24px; border: 0; border-radius: 999px;
    font: inherit; font-size: .98rem; font-weight: 700; line-height: 1; text-decoration: none; cursor: pointer;
    transition: transform .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease;
}
.lvdd-slide__btn:hover { transform: translateY(-2px); text-decoration: none; }
.lvdd-slide__btn .lvdd-icon { width: 1.2em; height: 1.2em; fill: currentColor; }
.lvdd-slide__btn--link { background: #fff; color: #14161f; }
.lvdd-slide__btn--link:hover { background: #fff; color: var(--s-accent); box-shadow: 0 10px 28px rgba(0, 0, 0, .3); }
.lvdd-slide__btn--play { background: var(--s-accent); color: #fff; box-shadow: 0 8px 24px color-mix(in srgb, var(--s-accent) 45%, transparent); }
.lvdd-slide__btn--play:hover { filter: brightness(1.08); color: #fff; }
.lvdd-slide__btn--play .lvdd-play__i-pause { display: none; }
.lvdd-slide__btn--play.is-playing .lvdd-play__i-pause { display: inline-block; }
.lvdd-slide__btn--play.is-playing .lvdd-play__i-play { display: none; }
.lvdd-slider :focus-visible { outline: 3px solid #fff; outline-offset: 3px; border-radius: 8px; }

/* Entrée du texte */
.lvdd-slider.is-ready .lvdd-slide.is-active .lvdd-slide__content > * { animation: lvdd-rise .75s cubic-bezier(.22, .61, .36, 1) both; }
.lvdd-slider.is-ready .lvdd-slide.is-active .lvdd-slide__content > :nth-child(2) { animation-delay: .08s; }
.lvdd-slider.is-ready .lvdd-slide.is-active .lvdd-slide__content > :nth-child(3) { animation-delay: .16s; }
.lvdd-slider.is-ready .lvdd-slide.is-active .lvdd-slide__content > :nth-child(4) { animation-delay: .24s; }
@keyframes lvdd-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ---------- Transition : fondu ---------- */
.lvdd-slider--fade .lvdd-slider__track { display: grid; transform: none !important; transition: none; }
.lvdd-slider--fade .lvdd-slide { grid-area: 1 / 1; opacity: 0; visibility: hidden; transition: opacity .9s ease, visibility 0s linear .9s; }
.lvdd-slider--fade .lvdd-slide.is-active { opacity: 1; visibility: visible; transition-delay: 0s; z-index: 1; }

/* ---------- Navigation ---------- */
.lvdd-slider__nav {
    position: absolute; top: 50%; z-index: 5; transform: translateY(-50%);
    width: 48px; height: 48px; padding: 0; display: grid; place-items: center;
    border: 1px solid rgba(255, 255, 255, .25); border-radius: 50%;
    background: rgba(10, 12, 22, .4); color: #fff; cursor: pointer;
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    opacity: 0; transition: opacity .2s ease, background .2s ease, transform .2s ease;
}
.lvdd-slider__nav .lvdd-icon { width: 22px; height: 22px; fill: currentColor; }
.lvdd-slider__nav--prev { left: 20px; }
.lvdd-slider__nav--next { right: 20px; }
.lvdd-slider:hover .lvdd-slider__nav, .lvdd-slider:focus-within .lvdd-slider__nav { opacity: 1; }
.lvdd-slider__nav:hover { background: var(--s-accent); border-color: transparent; transform: translateY(-50%) scale(1.06); }

.lvdd-slider__bar {
    position: absolute; left: 0; right: 0; bottom: 18px; z-index: 5;
    display: flex; align-items: center; gap: 14px; padding: 0 var(--s-pad);
}
.lvdd-slider--a-center .lvdd-slider__bar { justify-content: center; }
.lvdd-slider__dots { display: flex; align-items: center; gap: 8px; }
.lvdd-dot {
    position: relative; width: 10px; height: 10px; padding: 0; overflow: hidden;
    border: 0; border-radius: 999px; background: rgba(255, 255, 255, .45); cursor: pointer;
    transition: width .35s ease, background .2s ease;
}
.lvdd-dot:hover { background: rgba(255, 255, 255, .8); }
.lvdd-dot.is-active { width: 38px; background: rgba(255, 255, 255, .35); }
.lvdd-dot::after { content: ''; position: absolute; inset: 0; width: 0; background: #fff; border-radius: inherit; }
.lvdd-dot.is-active::after { width: 100%; }
.lvdd-slider.is-playing .lvdd-dot.is-active::after { width: 0; animation: lvdd-dot-fill var(--s-delay, 6s) linear forwards; }
.lvdd-slider.is-held .lvdd-dot.is-active::after { animation-play-state: paused; }
@keyframes lvdd-dot-fill { to { width: 100%; } }

.lvdd-slider__pause {
    width: 32px; height: 32px; padding: 0; display: grid; place-items: center;
    border: 1px solid rgba(255, 255, 255, .35); border-radius: 50%; background: rgba(10, 12, 22, .35); color: #fff; cursor: pointer;
}
.lvdd-slider__pause .lvdd-icon { width: 16px; height: 16px; fill: currentColor; }
.lvdd-slider__pause .i-play { display: none; }
.lvdd-slider__pause[aria-pressed="true"] .i-play { display: block; }
.lvdd-slider__pause[aria-pressed="true"] .i-pause { display: none; }

.lvdd-slider-error { padding: 14px 18px; border-left: 4px solid #d63638; background: #fcf0f1; color: #50575e; border-radius: 4px; font-size: .9rem; }

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
    .lvdd-slider { border-radius: 16px; margin: 16px 0; }
    .lvdd-slider--h-compact { --s-h: 300px; }
    .lvdd-slider--h-medium  { --s-h: 380px; }
    .lvdd-slider--h-large   { --s-h: 460px; }
    .lvdd-slider__nav { display: none; }
    .lvdd-slide__content { gap: 10px; padding-bottom: 56px; }
    .lvdd-slide__btn { min-height: 44px; padding: 0 20px; }
    .lvdd-slide__actions { margin-top: 4px; }
    .lvdd-slider__bar { bottom: 14px; }
    .lvdd-slide::after { background: linear-gradient(0deg, rgba(8, 10, 20, calc(var(--s-o) + .25)) 0%, rgba(8, 10, 20, calc(var(--s-o) * .6)) 55%, rgba(8, 10, 20, calc(var(--s-o) * .3)) 100%); }
}

@media (prefers-reduced-motion: reduce) {
    .lvdd-slider__track, .lvdd-slider--fade .lvdd-slide, .lvdd-dot, .lvdd-slider__nav { transition: none !important; }
    .lvdd-slide.is-active .lvdd-slide__img, .lvdd-slider.is-ready .lvdd-slide.is-active .lvdd-slide__content > * { animation: none !important; }
    .lvdd-slider.is-playing .lvdd-dot.is-active::after { animation: none; width: 100%; }
}
