/**
 * RadioManager Pro - Design system des pages (podcast, épisode, programme, alerte)
 *
 * Principes : une seule échelle d'espacement (4/8/12/16/24/32/48/64), une échelle typographique fluide,
 * des composants réutilisables (.lvdd-hero, .lvdd-btn, .lvdd-ep, .lvdd-play, .lvdd-card, .lvdd-tile),
 * et tout se pilote par les couleurs globales définies dans Réglages > Styles globaux.
 */

/* ---------- Jetons ---------- */
.lvdd-page {
    --u-accent: var(--lvdd-accent, #e94560);
    --u-dark: var(--lvdd-primary, #1a1a2e);
    --u-ink: var(--lvdd-text-primary, #1a1a2e);
    --u-muted: var(--lvdd-text-muted, #5f6b7a);
    --u-bg: var(--lvdd-bg-primary, #fff);
    --u-bg-alt: var(--lvdd-bg-secondary, #f5f7fa);
    --u-line: var(--lvdd-border-color, #e3e8ef);
    --u-r: 16px;
    --u-r-lg: 24px;
    --u-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .08);

    color: var(--u-ink);
    font-family: var(--lvdd-font-family, inherit);
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
.lvdd-page *, .lvdd-page *::before, .lvdd-page *::after { box-sizing: border-box; }
.lvdd-page img { max-width: 100%; height: auto; }
.lvdd-page h1, .lvdd-page h2, .lvdd-page h3, .lvdd-page p, .lvdd-page ul, .lvdd-page dl, .lvdd-page dd { margin: 0; padding: 0; }
.lvdd-page ul { list-style: none; }
.lvdd-icon { width: 1.25em; height: 1.25em; fill: currentColor; flex-shrink: 0; }

.lvdd-wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }

.lvdd-page :focus-visible { outline: 3px solid var(--u-accent); outline-offset: 3px; border-radius: 6px; }

/* ---------- Boutons ---------- */
.lvdd-page .lvdd-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 46px; padding: 0 22px;
    border: 1.5px solid transparent; border-radius: 999px;
    font: inherit; font-weight: 600; font-size: .95rem; line-height: 1; text-decoration: none;
    cursor: pointer; transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.lvdd-page .lvdd-btn:hover { transform: translateY(-1px); text-decoration: none; }
.lvdd-page .lvdd-btn:active { transform: translateY(0); }
.lvdd-page .lvdd-btn--primary { background: var(--u-accent); color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--u-accent) 40%, transparent); }
.lvdd-page .lvdd-btn--primary:hover { color: #fff; filter: brightness(1.07); }
.lvdd-page .lvdd-btn--glass { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .28); color: #fff; }
.lvdd-page .lvdd-btn--glass:hover { background: rgba(255, 255, 255, .18); color: #fff; }
.lvdd-page .lvdd-btn--line { background: transparent; border-color: var(--u-line); color: var(--u-ink); }
.lvdd-page .lvdd-btn--line:hover { border-color: var(--u-ink); color: var(--u-ink); }
.lvdd-page .lvdd-btn--sm { min-height: 38px; padding: 0 16px; font-size: .88rem; }
.lvdd-page .lvdd-btn .lvdd-icon { width: 1.15em; height: 1.15em; }
.lvdd-page .lvdd-btn .lvdd-play__i-pause { display: none; }
.lvdd-page .lvdd-btn.is-playing .lvdd-play__i-pause { display: inline-block; }
.lvdd-page .lvdd-btn.is-playing .lvdd-play__i-play { display: none; }

/* Bouton lecture rond */
.lvdd-page .lvdd-play {
    position: relative; flex-shrink: 0;
    width: 44px; height: 44px; padding: 0;
    display: grid; place-items: center;
    border: 0; border-radius: 50%;
    background: var(--u-accent); color: #fff; cursor: pointer;
    transition: transform .15s ease, box-shadow .2s ease;
}
.lvdd-page .lvdd-play:hover { transform: scale(1.08); }
.lvdd-page .lvdd-play .lvdd-icon { width: 22px; height: 22px; }
.lvdd-page .lvdd-play__i-pause { display: none; }
.lvdd-page .lvdd-play.is-playing .lvdd-play__i-pause { display: block; }
.lvdd-page .lvdd-play.is-playing .lvdd-play__i-play { display: none; }
.lvdd-page .lvdd-play.is-current { box-shadow: 0 0 0 5px color-mix(in srgb, var(--u-accent) 28%, transparent); }

/* ---------- Pastilles ---------- */
.lvdd-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 12px; border-radius: 999px;
    background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); color: #fff;
    font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
}
.lvdd-chip--accent { background: var(--u-accent); border-color: transparent; }
.lvdd-chip--live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: lvdd-blink 1.4s ease-in-out infinite; }
@keyframes lvdd-blink { 50% { opacity: .3; } }

/* ---------- Hero ---------- */
.lvdd-hero {
    position: relative; isolation: isolate; color: #fff;
    background:
        radial-gradient(800px 380px at 88% -20%, color-mix(in srgb, var(--u-accent) 50%, transparent), transparent 65%),
        var(--u-dark);
    /* pleine largeur sans barre de défilement horizontale, même dans un conteneur de thème étroit */
    box-shadow: 0 0 0 100vmax var(--u-dark);
    clip-path: inset(0 -100vmax);
}
.lvdd-hero__in {
    display: grid; grid-template-columns: minmax(0, 280px) minmax(0, 1fr); gap: 48px; align-items: center;
    max-width: 1120px; margin: 0 auto; padding: 56px 24px;
}
.lvdd-hero--compact .lvdd-hero__in { grid-template-columns: minmax(0, 200px) minmax(0, 1fr); gap: 40px; padding: 44px 24px; }
.lvdd-hero__cover {
    aspect-ratio: 1; width: 100%; border-radius: var(--u-r-lg); overflow: hidden;
    background: linear-gradient(135deg, color-mix(in srgb, var(--u-accent) 70%, #000), var(--u-dark));
    box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
    display: grid; place-items: center;
}
.lvdd-hero__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lvdd-hero__cover .lvdd-icon { width: 38%; height: 38%; opacity: .35; }
.lvdd-hero__body { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.lvdd-crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .85rem; color: rgba(255, 255, 255, .7); }
.lvdd-crumbs a { color: inherit; text-decoration: none; }
.lvdd-crumbs a:hover { color: #fff; text-decoration: underline; }
.lvdd-page .lvdd-hero__title {
    color: #fff; font-size: clamp(1.9rem, 1.2rem + 3vw, 3.25rem); line-height: 1.08; font-weight: 800; letter-spacing: -.02em;
    text-wrap: balance;
}
.lvdd-hero__num { color: color-mix(in srgb, var(--u-accent) 70%, #fff); margin-right: .15em; }
.lvdd-hero__lead { color: rgba(255, 255, 255, .82); font-size: 1.1rem; max-width: 60ch; }
.lvdd-meta { display: flex; flex-wrap: wrap; gap: 8px 24px; color: rgba(255, 255, 255, .8); font-size: .95rem; }
.lvdd-meta li { display: inline-flex; align-items: center; gap: 8px; }
.lvdd-meta .lvdd-icon { opacity: .75; width: 1.1em; height: 1.1em; }
.lvdd-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

/* Progression en page (synchronisée avec le lecteur) */
.lvdd-prog { display: none; align-items: center; gap: 12px; width: 100%; max-width: 520px; color: rgba(255, 255, 255, .85); font-size: .85rem; font-variant-numeric: tabular-nums; }
.lvdd-prog.is-active { display: flex; }
.lvdd-prog input[type=range] {
    -webkit-appearance: none; appearance: none; flex: 1; height: 18px; background: transparent; cursor: pointer; margin: 0;
}
.lvdd-prog input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 99px; background: rgba(255, 255, 255, .25); }
.lvdd-prog input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: #fff; }
.lvdd-prog input[type=range]::-moz-range-track { height: 4px; border-radius: 99px; background: rgba(255, 255, 255, .25); }
.lvdd-prog input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff; }

/* ---------- Mise en page ---------- */
.lvdd-main { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 56px; max-width: 1120px; margin: 0 auto; padding: 56px 24px 80px; align-items: start; }
.lvdd-main--single { grid-template-columns: minmax(0, 1fr); max-width: 800px; }
.lvdd-aside { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 24px; }
body.admin-bar .lvdd-aside { top: 56px; }
.lvdd-section + .lvdd-section { margin-top: 56px; }
.lvdd-page .lvdd-h2 { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; font-size: 1.4rem; font-weight: 750; letter-spacing: -.01em; color: var(--u-ink); }
.lvdd-h2 small { font-size: .9rem; font-weight: 500; color: var(--u-muted); }
.lvdd-h2 a { font-size: .9rem; font-weight: 600; color: var(--u-accent); text-decoration: none; }
.lvdd-h2 a:hover { text-decoration: underline; }

/* ---------- Texte riche ---------- */
.lvdd-prose { font-size: 1.06rem; line-height: 1.78; max-width: 68ch; color: var(--u-ink); }
.lvdd-prose > * + * { margin-top: 1.1em; }
.lvdd-prose a { color: var(--u-accent); text-underline-offset: 3px; }
.lvdd-prose h2, .lvdd-prose h3 { margin-top: 1.8em; line-height: 1.25; }
.lvdd-prose img, .lvdd-prose video, .lvdd-prose iframe { border-radius: var(--u-r); max-width: 100%; }
.lvdd-prose blockquote { margin-left: 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--u-accent); color: var(--u-muted); font-style: italic; }
.lvdd-prose ul, .lvdd-prose ol { padding-left: 1.4em; list-style: revert; }

.lvdd-details { border: 1px solid var(--u-line); border-radius: var(--u-r); background: var(--u-bg); }
.lvdd-details summary { cursor: pointer; padding: 16px 20px; font-weight: 700; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.lvdd-details summary::-webkit-details-marker { display: none; }
.lvdd-details summary::after { content: '+'; font-size: 1.4rem; line-height: 1; color: var(--u-muted); }
.lvdd-details[open] summary::after { content: '–'; }
.lvdd-details .lvdd-prose { padding: 0 20px 20px; font-size: 1rem; }

/* ---------- Ligne d'épisode ---------- */
.lvdd-eps { display: flex; flex-direction: column; }
.lvdd-ep {
    display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; gap: 20px; align-items: center;
    padding: 16px; margin: 0 -16px; border-radius: var(--u-r);
    transition: background .15s ease;
}
.lvdd-ep[hidden] { display: none; }
.lvdd-ep + .lvdd-ep { box-shadow: 0 -1px 0 var(--u-line); }
.lvdd-ep:hover, .lvdd-ep:has(.is-current) { background: var(--u-bg-alt); box-shadow: none; }
.lvdd-ep:hover + .lvdd-ep, .lvdd-ep:has(.is-current) + .lvdd-ep { box-shadow: none; }
.lvdd-ep__thumb { display: block; width: 88px; height: 88px; border-radius: 14px; overflow: hidden; background: var(--u-bg-alt); }
.lvdd-ep__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.lvdd-ep:hover .lvdd-ep__thumb img { transform: scale(1.05); }
.lvdd-ep__ph { width: 100%; height: 100%; display: grid; place-items: center; color: var(--u-muted); background: linear-gradient(135deg, var(--u-bg-alt), var(--u-line)); }
.lvdd-ep__ph .lvdd-icon { width: 34px; height: 34px; }
.lvdd-ep__body { min-width: 0; }
.lvdd-ep__kicker { font-size: .76rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--u-muted); }
.lvdd-page .lvdd-ep__title { margin: 4px 0 6px; font-size: 1.12rem; line-height: 1.3; font-weight: 700; }
.lvdd-ep__title a { color: var(--u-ink); text-decoration: none; }
.lvdd-ep__title a:hover { color: var(--u-accent); }
.lvdd-ep:has(.is-current) .lvdd-ep__title a { color: var(--u-accent); }
.lvdd-ep__excerpt { color: var(--u-muted); font-size: .94rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lvdd-ep__side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.lvdd-ep__dur { font-size: .85rem; color: var(--u-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Cartes ---------- */
.lvdd-card { background: var(--u-bg-alt); border-radius: var(--u-r-lg); padding: 24px; }
.lvdd-page .lvdd-card h3 { font-size: 1.05rem; font-weight: 750; margin-bottom: 16px; }
.lvdd-dl { display: grid; gap: 14px; }
.lvdd-dl div { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
.lvdd-dl dt { color: var(--u-muted); font-size: .9rem; }
.lvdd-dl dd { font-weight: 600; text-align: right; }
.lvdd-links { display: grid; gap: 10px; }
.lvdd-links a {
    display: flex; align-items: center; gap: 12px; padding: 12px 14px;
    border: 1px solid var(--u-line); border-radius: 12px; background: var(--u-bg);
    color: var(--u-ink); font-weight: 600; text-decoration: none; transition: border-color .15s, transform .15s;
}
.lvdd-links a:hover { border-color: var(--u-accent); transform: translateX(2px); }
.lvdd-links a .lvdd-icon { color: var(--u-accent); }
.lvdd-links a .lvdd-icon:last-child { margin-left: auto; color: var(--u-muted); width: 1em; height: 1em; }

.lvdd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 24px; }
.lvdd-tile { display: block; color: inherit; text-decoration: none; }
.lvdd-tile__img { aspect-ratio: 1; border-radius: var(--u-r); overflow: hidden; background: linear-gradient(135deg, color-mix(in srgb, var(--u-accent) 60%, #000), var(--u-dark)); }
.lvdd-tile__img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.lvdd-tile:hover .lvdd-tile__img img { transform: scale(1.05); }
.lvdd-page .lvdd-tile__title { margin-top: 12px; font-size: 1rem; font-weight: 700; line-height: 1.3; color: var(--u-ink); }
.lvdd-tile:hover .lvdd-tile__title { color: var(--u-accent); }
.lvdd-tile__sub { color: var(--u-muted); font-size: .88rem; }

.lvdd-empty { text-align: center; padding: 56px 24px; border: 2px dashed var(--u-line); border-radius: var(--u-r-lg); color: var(--u-muted); }
.lvdd-empty .lvdd-icon { width: 40px; height: 40px; opacity: .5; margin-bottom: 8px; }
.lvdd-page .lvdd-empty h3 { color: var(--u-ink); font-size: 1.1rem; margin-bottom: 4px; }

/* ---------- Alerte (article) ---------- */
.lvdd-article { max-width: 760px; margin: 0 auto; padding: 48px 24px 80px; }
.lvdd-article__head { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; margin-bottom: 32px; }
.lvdd-badge { --c: var(--u-accent); display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: color-mix(in srgb, var(--c) 14%, transparent); color: color-mix(in srgb, var(--c) 80%, #000); font-size: .78rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.lvdd-badge::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.lvdd-badge--urgent::before { animation: lvdd-blink 1.2s ease-in-out infinite; }
.lvdd-page .lvdd-article__title { font-size: clamp(1.8rem, 1.1rem + 2.8vw, 2.9rem); line-height: 1.12; font-weight: 800; letter-spacing: -.02em; text-wrap: balance; }
.lvdd-meta--dark { color: var(--u-muted); }
.lvdd-article__figure { margin: 0 0 32px; }
.lvdd-article__figure img { width: 100%; border-radius: var(--u-r-lg); display: block; }

.lvdd-share { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 48px; padding: 20px 0; border-top: 1px solid var(--u-line); border-bottom: 1px solid var(--u-line); }
.lvdd-share__label { font-weight: 700; font-size: .9rem; }
.lvdd-share__list { display: flex; flex-wrap: wrap; gap: 8px; }
.lvdd-share__list a, .lvdd-share__list button {
    display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px;
    border: 1px solid var(--u-line); border-radius: 999px; background: var(--u-bg); color: var(--u-ink);
    font: inherit; font-size: .88rem; font-weight: 600; text-decoration: none; cursor: pointer;
    transition: border-color .15s, background .15s;
}
.lvdd-share__list a:hover, .lvdd-share__list button:hover { border-color: var(--u-ink); background: var(--u-bg-alt); }

.lvdd-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 40px; }
.lvdd-pager a { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; border: 1px solid var(--u-line); border-radius: var(--u-r); color: var(--u-ink); text-decoration: none; transition: border-color .15s, transform .15s; }
.lvdd-pager a:hover { border-color: var(--u-accent); transform: translateY(-2px); }
.lvdd-pager small { color: var(--u-muted); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: .72rem; }
.lvdd-pager a:last-child:not(:first-child) { text-align: right; grid-column: 2; }
.lvdd-pager a:only-child { grid-column: 1 / -1; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .lvdd-main { grid-template-columns: minmax(0, 1fr); gap: 40px; padding: 40px 24px 64px; }
    .lvdd-aside { position: static; }
    .lvdd-hero__in, .lvdd-hero--compact .lvdd-hero__in { grid-template-columns: minmax(0, 200px) minmax(0, 1fr); gap: 32px; padding: 40px 24px; }
}

@media (max-width: 640px) {
    .lvdd-wrap, .lvdd-main, .lvdd-article, .lvdd-hero__in { padding-left: 16px; padding-right: 16px; }
    .lvdd-hero__in, .lvdd-hero--compact .lvdd-hero__in { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 32px; padding-bottom: 32px; }
    .lvdd-hero__cover { max-width: 220px; border-radius: 20px; }
    .lvdd-hero--compact .lvdd-hero__cover { max-width: 160px; }
    .lvdd-actions .lvdd-btn { flex: 1 1 100%; }
    .lvdd-actions .lvdd-btn--sm { flex: 1 1 auto; }
    .lvdd-ep { grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; padding: 12px; margin: 0 -12px; }
    .lvdd-ep__thumb { width: 64px; height: 64px; border-radius: 12px; }
    .lvdd-ep__excerpt { display: none; }
    .lvdd-page .lvdd-ep__title { font-size: 1rem; }
    .lvdd-pager { grid-template-columns: 1fr; }
    .lvdd-pager a:last-child:not(:first-child) { grid-column: 1; }
    .lvdd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
    .lvdd-card { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
    .lvdd-page *, .lvdd-page *::before { transition: none !important; animation: none !important; }
}
@media print {
    .lvdd-hero { background: none; box-shadow: none; clip-path: none; color: #000; }
    .lvdd-play, .lvdd-actions, .lvdd-share, .lvdd-pager { display: none; }
}

/* ======================================================================
   Blindage anti-thème : certains thèmes imposent une couleur (parfois quasi blanche) à tous les titres.
   Les titres des pages du plugin gardent leurs couleurs, quel que soit le thème.
   ====================================================================== */
.lvdd-page .lvdd-article__title,
.lvdd-page .lvdd-h2,
.lvdd-page .lvdd-card h3,
.lvdd-page .lvdd-empty h3,
.lvdd-page .lvdd-tile__title,
.lvdd-page .lvdd-ep__title,
.lvdd-page .lvdd-ep__title a,
.lvdd-page .lvdd-prose h1, .lvdd-page .lvdd-prose h2, .lvdd-page .lvdd-prose h3, .lvdd-page .lvdd-prose h4 { color: var(--u-ink) !important; }
.lvdd-page .lvdd-ep__title a:hover, .lvdd-page .lvdd-ep:has(.is-current) .lvdd-ep__title a, .lvdd-page .lvdd-tile:hover .lvdd-tile__title { color: var(--u-accent) !important; }
.lvdd-page .lvdd-h2 a { color: var(--u-accent) !important; }
.lvdd-page .lvdd-hero__title, .lvdd-page .lvdd-hero__title * { color: #fff !important; }
.lvdd-page .lvdd-hero__num { color: color-mix(in srgb, var(--u-accent) 70%, #fff) !important; }
.lvdd-page .lvdd-prose, .lvdd-page .lvdd-prose p, .lvdd-page .lvdd-prose li { color: var(--u-ink); }
.lvdd-page .lvdd-meta--dark, .lvdd-page .lvdd-meta--dark li { color: var(--u-muted) !important; }
