/**
 * RadioManager Pro - Radio en direct : bloc [lvdd_radio_live] et bouton [lvdd_live_button]
 * Couleur : attribut color="#…" du shortcode ou Réglages > Affichage.
 */

/* ---------- Bloc « radio en direct » ---------- */
.lvdd-live {
    --lvdd-live-c: #ab2520;
    position: relative; isolation: isolate; box-sizing: border-box;
    display: flex; align-items: center; gap: 22px;
    width: 100%; margin: 16px 0; padding: 14px 32px 14px 14px;
    border-radius: 999px; overflow: hidden; color: #fff;
    background:
        radial-gradient(420px 160px at 12% -40%, rgba(255, 255, 255, .22), transparent 70%),
        linear-gradient(135deg, var(--lvdd-live-c), color-mix(in srgb, var(--lvdd-live-c) 72%, #000));
    box-shadow: 0 14px 40px color-mix(in srgb, var(--lvdd-live-c) 40%, transparent), inset 0 0 0 1px rgba(255, 255, 255, .12);
    font-family: var(--lvdd-font-family, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif);
}
.lvdd-live *, .lvdd-live *::before, .lvdd-live *::after { box-sizing: border-box; }
.lvdd-live h3, .lvdd-live p { margin: 0; padding: 0; }

.lvdd-live .lvdd-live__play {
    all: unset; box-sizing: border-box; position: relative; flex-shrink: 0;
    width: 72px; height: 72px; border-radius: 50%;
    display: grid; place-items: center; cursor: pointer;
    background: #fff; color: var(--lvdd-live-c);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
    transition: transform .2s ease, box-shadow .2s ease;
}
.lvdd-live .lvdd-live__play:hover { transform: scale(1.06); box-shadow: 0 12px 30px rgba(0, 0, 0, .38); }
.lvdd-live .lvdd-live__play:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
.lvdd-live .lvdd-live__play .lvdd-icon { width: 36px; height: 36px; fill: currentColor; margin-left: 3px; }
.lvdd-live .lvdd-live__play .lvdd-play__i-pause { display: none; margin-left: 0; }
.lvdd-live .lvdd-live__play.is-playing .lvdd-play__i-pause { display: block; }
.lvdd-live .lvdd-live__play.is-playing .lvdd-play__i-play { display: none; }
.lvdd-live .lvdd-live__play.is-playing { animation: lvdd-live-ring 2.2s ease-out infinite; }
@keyframes lvdd-live-ring { 0% { box-shadow: 0 8px 24px rgba(0, 0, 0, .3), 0 0 0 0 rgba(255, 255, 255, .5); } 100% { box-shadow: 0 8px 24px rgba(0, 0, 0, .3), 0 0 0 20px rgba(255, 255, 255, 0); } }

.lvdd-live__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 0 1 auto; }
.lvdd-live__badge { align-self: flex-start; display: inline-flex; align-items: center; gap: 7px; padding: 3px 11px; border-radius: 999px; background: rgba(0, 0, 0, .28); font-size: .7rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.lvdd-live__badge i { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: lvdd-live-blink 1.4s ease-in-out infinite; }
@keyframes lvdd-live-blink { 50% { opacity: .25; } }
.lvdd-live .lvdd-live__title { color: #fff; font-size: clamp(1.05rem, .9rem + .9vw, 1.5rem); font-weight: 800; line-height: 1.15; letter-spacing: .03em; text-transform: uppercase; }
.lvdd-live__now { font-size: .9rem; color: rgba(255, 255, 255, .86); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lvdd-live__now[hidden] { display: none; }
.lvdd-live__now span { opacity: .7; }
.lvdd-live__now b { font-weight: 700; }

/* Égaliseur animé */
.lvdd-live__eq { flex: 1 1 140px; min-width: 0; height: 60px; display: flex; align-items: center; gap: 3px; overflow: hidden; }
.lvdd-live__eq i { flex: 1 1 0; min-width: 2px; max-width: 6px; height: var(--h, 50%); border-radius: 3px; background: #fff; opacity: .45; transform: scaleY(.45); transition: transform .4s ease, opacity .4s ease; }
.lvdd-live.is-playing .lvdd-live__eq i { opacity: .92; animation: lvdd-live-eq var(--d, .8s) ease-in-out var(--o, 0s) infinite alternate; }
@keyframes lvdd-live-eq { from { transform: scaleY(.22); } to { transform: scaleY(1); } }

/* ---------- Variantes ---------- */
.lvdd-live--card { border-radius: 28px; padding: 26px 30px; gap: 26px; flex-wrap: wrap; }
.lvdd-live--card .lvdd-live__play { width: 88px; height: 88px; }
.lvdd-live--card .lvdd-live__eq { flex-basis: 100%; height: 72px; order: 3; }

.lvdd-live--minimal { background: none; box-shadow: none; color: inherit; padding: 8px 0; border-radius: 0; }
.lvdd-live--minimal .lvdd-live__play { background: var(--lvdd-live-c); color: #fff; width: 60px; height: 60px; }
.lvdd-live--minimal .lvdd-live__title { color: inherit; }
.lvdd-live--minimal .lvdd-live__badge { background: var(--lvdd-live-c); color: #fff; }
.lvdd-live--minimal .lvdd-live__now { color: inherit; opacity: .8; }
.lvdd-live--minimal .lvdd-live__eq i { background: var(--lvdd-live-c); }

/* ---------- Bouton « écouter en direct » ---------- */
.lvdd-live-btn {
    --lvdd-live-c: #ab2520;
    all: unset; box-sizing: border-box; position: relative; display: inline-flex; align-items: center; gap: 10px;
    min-height: 48px; padding: 0 26px 0 20px; border-radius: 999px; cursor: pointer;
    background: linear-gradient(135deg, var(--lvdd-live-c), color-mix(in srgb, var(--lvdd-live-c) 72%, #000)); color: #fff;
    font: 800 .92rem/1 var(--lvdd-font-family, system-ui, sans-serif); letter-spacing: .06em; text-transform: uppercase;
    box-shadow: 0 8px 24px color-mix(in srgb, var(--lvdd-live-c) 45%, transparent);
    transition: transform .15s ease, box-shadow .15s ease;
}
.lvdd-live-btn:hover { transform: translateY(-2px); }
.lvdd-live-btn:focus-visible { outline: 3px solid var(--lvdd-live-c); outline-offset: 3px; }
.lvdd-live-btn .lvdd-icon { width: 20px; height: 20px; fill: currentColor; }
.lvdd-live-btn .lvdd-play__i-pause { display: none; }
.lvdd-live-btn.is-playing .lvdd-play__i-pause { display: inline-block; }
.lvdd-live-btn.is-playing .lvdd-play__i-play { display: none; }
.lvdd-live-btn__dot { width: 9px; height: 9px; border-radius: 50%; background: #fff; animation: lvdd-live-blink 1.4s ease-in-out infinite; }
.lvdd-live-btn--minimal { background: transparent; color: var(--lvdd-live-c); box-shadow: inset 0 0 0 2px var(--lvdd-live-c); }
.lvdd-live-btn--minimal .lvdd-live-btn__dot { background: var(--lvdd-live-c); }
.lvdd-live-btn--floating { position: fixed; left: 20px; bottom: 90px; z-index: 9990; }

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

/* ---------- Mobile ---------- */
@media (max-width: 700px) {
    .lvdd-live { border-radius: 28px; padding: 14px 18px 14px 14px; gap: 14px; flex-wrap: wrap; }
    .lvdd-live .lvdd-live__play { width: 60px; height: 60px; }
    .lvdd-live .lvdd-live__play .lvdd-icon { width: 30px; height: 30px; }
    .lvdd-live__eq { flex-basis: 100%; height: 44px; order: 3; }
    .lvdd-live__eq i:nth-child(n+30) { display: none; }
    .lvdd-live__body { flex: 1 1 0; }
}

@media (prefers-reduced-motion: reduce) {
    .lvdd-live.is-playing .lvdd-live__eq i, .lvdd-live .lvdd-live__play.is-playing, .lvdd-live__badge i, .lvdd-live-btn__dot { animation: none; }
    .lvdd-live.is-playing .lvdd-live__eq i { transform: scaleY(.8); }
}
