/* ==========================================================
   FICHE CLIP : complète album-fiche.css et single-fiche.css (à charger APRÈS eux)
   Emplacement : /templates/Moon_Music_2024_Dark/css/clip-fiche.css
   Mise en page pensée pour la colonne de contenu ÉTROITE du site sur mobile :
   les adaptations utilisent des « container queries » (largeur de la fiche elle-même,
   pas celle de l'écran), donc elles suivent la place réellement disponible.
   Contenu : titre + écran « pellicule vintage » + infos, cartes des autres vidéos,
   navigation précédent / suivant, même époque, tous les clips, pop-up vidéo sécurisé.
   ========================================================== */

.clp, .clp-nav { container: clp / inline-size; }

/* ---------------- HERO : CENTRÉ & RESPONSIVE ---------------- */
.alb-hero.clp-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 24px 20px 36px;
    box-sizing: border-box;
    position: relative;
}

.clp-stage-wrap {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
    gap: 18px;
    box-sizing: border-box;
}

.clp-head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    min-width: 0;
}
.clp-head .alb-title {
    margin: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    font-size: clamp(2rem, 5.5vw, 3.4rem);
    line-height: 1.15;
}
.clp-stage {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    min-width: 0;
}
@supports (width: 1cqw) {
    .clp-head .alb-title { font-size: clamp(1.8rem, 7cqw, 3.4rem); }
}

/* ---------------- ÉCRAN : PELLICULE VINTAGE ---------------- */
.clp-film {
    position: relative;
    border-radius: 10px;
    background: #0d0a07;
    box-shadow: 0 28px 54px rgba(0, 0, 0, 0.62), 0 0 0 1px rgba(255, 226, 170, 0.16), 0 0 80px color-mix(in srgb, var(--c) 14%, transparent);
}
.clp-rail { position: relative; display: flex; flex-direction: column; gap: 5px; padding: 7px 10px 6px; background: linear-gradient(180deg, #1a140d, #0d0a07); }
.clp-rail--top { border-radius: 10px 10px 0 0; }
.clp-rail--bot { border-radius: 0 0 10px 10px; background: linear-gradient(0deg, #1a140d, #0d0a07); }
/* perforations */
.clp-holes {
    display: block;
    height: 8px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='8'%3E%3Crect x='3' y='.5' width='14' height='7' rx='2' fill='%23f3e6c8' fill-opacity='.55'/%3E%3C/svg%3E") repeat-x 0 0 / 22px 8px;
}
/* marquage des bords (comme sur une vraie pellicule) */
.clp-edge {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: -4px 0;
    padding: 4px 0;
    overflow: hidden;
    white-space: nowrap;
    font: 700 0.58rem/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
    letter-spacing: 0.18em;
    color: #e0a93f;
    opacity: 0.88;
    text-shadow: 0 0 6px rgba(224, 169, 63, 0.35);
}
.clp-edge span { position: relative; flex: 0 0 auto; }
.clp-edge--nums { -webkit-mask-image: linear-gradient(90deg, #000 58%, transparent 76%); mask-image: linear-gradient(90deg, #000 58%, transparent 76%); }
/* numéro d'image entouré au crayon gras */
.clp-edge span.is-circled { color: #ff8576; }
.clp-edge span.is-circled::after { content: ""; position: absolute; inset: -3px -8px; border: 1.5px solid #ff8576; border-radius: 50%; transform: rotate(-3deg); }
/* note manuscrite */
.clp-note {
    position: absolute;
    right: 12px;
    top: 0px;
    max-width: 46%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: "Segoe Print", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Marker Felt", cursive;
    font-size: 0.93rem;
    line-height: 1.2;
    color: #ff8576;
    transform: rotate(-5deg);
    text-shadow: 0 0 10px rgba(255, 133, 118, 0.45), 0 1px 0 rgba(0,0,0,0.4);
    pointer-events: none;
    filter: blur(0.2px);
}

.alb .clp-poster,
.alb .clp-poster:hover,
.alb .clp-poster:focus {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    cursor: pointer;
    background: #000;
}
.alb .clp-poster img { display: block; width: 100% !important; height: 100% !important; object-fit: cover; filter: sepia(0.3) contrast(1.06) saturate(0.92) brightness(0.97); transition: transform 0.5s cubic-bezier(.2, .8, .2, 1), filter 0.45s ease; }
.alb .clp-poster:hover img, .alb .clp-poster:focus-visible img { transform: scale(1.045); filter: sepia(0) contrast(1.03) saturate(1.05) brightness(1.04); }
.alb .clp-poster img.clp-cover-fb { object-fit: cover; filter: sepia(0.25) saturate(1.1) brightness(0.8); }
.alb .clp-poster:focus-visible { outline: 3px solid var(--c); outline-offset: -3px; }
/* vignettage + reflet chaud + dégradé bas */
.clp-poster::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(120% 100% at 50% 50%, transparent 52%, rgba(0, 0, 0, 0.55)),
        linear-gradient(115deg, rgba(255, 214, 150, 0.18), transparent 36%),
        linear-gradient(180deg, transparent 58%, rgba(0, 0, 0, 0.5));
}
/* rayure verticale qui apparaît de temps en temps */
.clp-poster::before {
    content: "";
    position: absolute;
    z-index: 1;
    top: 0;
    bottom: 0;
    left: 18%;
    width: 1px;
    pointer-events: none;
    opacity: 0;
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.55), transparent);
    animation: clp-scratch 7s steps(1) infinite;
}
@keyframes clp-scratch {
    0%   { left: 18%; opacity: 0; }
    8%   { opacity: 0.55; }
    9.5% { opacity: 0; }
    40%  { left: 71%; opacity: 0; }
    41%  { opacity: 0.45; }
    42.5% { opacity: 0; }
    70%  { left: 42%; opacity: 0; }
    71%  { opacity: 0.5; }
    72.5% { opacity: 0; }
    100% { opacity: 0; }
}
/* grain argentique */
.clp-grain {
    position: absolute;
    inset: -20%;
    z-index: 1;
    pointer-events: none;
    opacity: 0.38;
    mix-blend-mode: overlay;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    animation: clp-grain 0.7s steps(1) infinite;
}
@keyframes clp-grain {
    0%   { transform: translate(0, 0) scale(1.05); }
    14%  { transform: translate(-5%, 3%) scale(1.03); }
    28%  { transform: translate(4%, -6%) scale(1.06); }
    42%  { transform: translate(-6%, -3%) scale(1.04); }
    57%  { transform: translate(5%, 5%) scale(1.03); }
    71%  { transform: translate(-3%, 4%) scale(1.05); }
    85%  { transform: translate(6%, -4%) scale(1.04); }
}
/* REC clignotant */
.clp-rec { position: absolute; z-index: 2; top: 9px; left: 11px; display: inline-flex; align-items: center; gap: 6px; font: 800 0.62rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0.14em; color: #fff; text-shadow: 0 1px 3px #000; }
.clp-rec i { width: 8px; height: 8px; border-radius: 50%; background: #ff3b30; box-shadow: 0 0 8px #ff3b30; animation: clp-blink 1.4s steps(1) infinite; }
@keyframes clp-blink { 0% { opacity: 1; } 50% { opacity: 0.15; } }

/* bouton lecture */
.clp-play {
    position: absolute;
    z-index: 2;
    left: 50%;
    top: 50%;
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    margin: -38px 0 0 -38px;
    border-radius: 50%;
    color: #0e0f16;
    background: var(--c);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55), 0 0 0 8px color-mix(in srgb, var(--c) 28%, transparent);
    transition: transform 0.3s cubic-bezier(.2, .8, .2, 1), box-shadow 0.3s ease;
    animation: clp-pulse 2.6s ease-out infinite;
}
.clp-play svg { display: block; width: 34px; height: 34px; margin-left: 4px; }
.alb .clp-poster:hover .clp-play, .alb .clp-poster:focus-visible .clp-play { transform: scale(1.1); animation: none; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.6), 0 0 0 12px color-mix(in srgb, var(--c) 34%, transparent); }
@keyframes clp-pulse {
    0%   { box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55), 0 0 0 0 color-mix(in srgb, var(--c) 55%, transparent); }
    70%  { box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55), 0 0 0 22px transparent; }
    100% { box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55), 0 0 0 0 transparent; }
}

.clp-poster__lab,
.clp-poster__ext {
    position: absolute;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: calc(100% - 24px);
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
    background: rgba(8, 8, 14, 0.74);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.clp-poster__lab { left: 12px; bottom: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clp-poster__ext { right: 12px; top: 8px; }
.clp-poster__ext svg { width: 14px; height: 14px; }

/* ---------------- DÉTAILS SOUS LA PHOTO (2 COLONNES) ---------------- */
.clp-details {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 12px 18px;
    align-items: stretch;
    width: 100%;
    box-sizing: border-box;
}
.clp-details--no-album {
    grid-template-columns: minmax(0, 1fr);
}

.clp-details__left {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    justify-content: space-between;
}

.clp-m {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    padding: 8px 12px;
    border-radius: 14px;
    background: var(--alb-card);
    border: 1px solid var(--alb-line);
    box-sizing: border-box;
    transition: border-color 0.25s ease, background-color 0.25s ease;
}
.clp-m:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.18);
}

.clp-m--dir {
    width: 100%;
    flex: 1 1 auto;
}

.clp-m-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 10px;
    width: 100%;
    flex: 1 1 auto;
}

.clp-m__lbl {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--alb-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.1;
    margin-bottom: 4px;
}

.clp-m__val {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.clp-m__val strong {
    font-size: 0.94rem;
    line-height: 1.2;
    font-weight: 800;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clp-m__ico {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    color: var(--c);
    background: color-mix(in srgb, var(--c) 16%, transparent);
    border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
}
.clp-m__ico svg {
    display: block;
    width: 14px;
    height: 14px;
}

/* Logos officiels dans la pastille plateforme */
.clp-m__ico--logo {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
}
.clp-m--platform.is-youtube .clp-m__ico--logo {
    background: rgba(255, 0, 0, 0.14);
    border-color: rgba(255, 0, 0, 0.4);
}
.clp-m--platform.is-youtube .clp-m__ico--logo svg {
    width: 18px;
    height: 18px;
}
.clp-m--platform.is-vimeo .clp-m__ico--logo {
    background: rgba(26, 183, 234, 0.14);
    border-color: rgba(26, 183, 234, 0.4);
}
.clp-m--platform.is-facebook .clp-m__ico--logo {
    background: rgba(24, 119, 242, 0.14);
    border-color: rgba(24, 119, 242, 0.4);
}

/* ---------------- CÔTÉ DROIT : UNE SEULE PASTILLE (JUSTE LES POCHETTES CÔTE À CÔTE) ---------------- */
.clp-details__right {
    display: flex;
    min-width: 0;
    height: 100%;
}

.clp-m--albums {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    padding: 8px 14px 10px;
    box-sizing: border-box;
}

.clp-covers-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex: 1 1 auto;
    width: 100%;
    padding: 4px 0 2px;
}

.alb .clp-cover-link {
    display: block;
    flex: 0 0 auto;
    border-radius: 12px;
    overflow: hidden;
    line-height: 0;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
    transition: transform 0.25s cubic-bezier(.2, .8, .2, 1), box-shadow 0.25s ease, border-color 0.25s ease;
    text-decoration: none !important;
}

.alb .clp-cover-link img {
    display: block;
    object-fit: cover;
    border-radius: 11px;
    transition: filter 0.3s ease;
}

/* 1 seul album */
.clp-m--albums.is-single .clp-cover-link img {
    width: 82px !important;
    height: 82px !important;
}

/* 2 albums côte à côte (ex: Lost! avec Viva la Vida + Prospekt's March) */
.clp-m--albums.count-2 .clp-cover-link img {
    width: 76px !important;
    height: 76px !important;
}

/* 3 albums côte à côte */
.clp-m--albums.count-3 .clp-cover-link img {
    width: 62px !important;
    height: 62px !important;
}
.clp-m--albums.count-3 .clp-covers-row {
    gap: 10px;
}

.alb a.clp-cover-link:hover,
.alb a.clp-cover-link:focus-visible {
    transform: scale(1.08);
    border-color: var(--c) !important;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.65), 0 0 16px color-mix(in srgb, var(--c) 40%, transparent);
}

/* ---------------- ACTIONS / BOUTONS ---------------- */
.alb-actions.clp-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin-top: 4px;
}

/* bouton principal « Regarder » : plein */
.alb .alb-btn.clp-watch,
.alb .alb-btn.clp-watch:focus { color: #0e0f16 !important; background: var(--c); box-shadow: 0 8px 22px color-mix(in srgb, var(--c) 32%, transparent); }
.alb .alb-btn.clp-watch:hover, .alb .alb-btn.clp-watch:focus-visible { color: #0e0f16 !important; background: #fff; }

/* ---------------- TITRES DE SECTION : jamais de débordement ---------------- */
.clp .alb-sec__title, .clp-nav .alb-sec__title { min-width: 0; max-width: 100%; }
.clp .alb-sec__title > span, .clp-nav .alb-sec__title > span { min-width: 0; max-width: 100%; white-space: normal !important; overflow-wrap: anywhere; }

/* ---------------- VERSIONS & VIDÉOS / AUTRES CLIPS : cartes ---------------- */
.clp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 18px; }
.clp-grid--sm { grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 14px; }

.alb .clp-card,
.alb .clp-card:hover,
.alb .clp-card:focus {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border-radius: 14px;
    color: #fff !important;
    background: var(--alb-card);
    border: 1px solid var(--alb-line) !important;
    transition: border-color 0.25s ease, background-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.alb a.clp-card:hover, .alb a.clp-card:focus-visible {
    border-color: var(--c) !important;
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4);
}
.alb a.clp-card:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.clp-card__thumb { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #000; }
.alb .clp-card__thumb img { display: block; width: 100% !important; height: 100% !important; object-fit: cover; transition: transform 0.45s cubic-bezier(.2, .8, .2, 1); }
.alb a.clp-card:hover .clp-card__thumb img { transform: scale(1.06); }
.alb .clp-card__thumb img.clp-cover-fb { filter: saturate(1.1) brightness(0.8); }
.clp-card__thumb::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.55)); }

.clp-card__play {
    position: absolute;
    z-index: 2;
    right: 10px;
    bottom: 10px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #0e0f16;
    background: var(--c);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
    transition: transform 0.25s ease;
}
.clp-card__play svg { display: block; width: 18px; height: 18px; }
.alb a.clp-card:hover .clp-card__play { transform: scale(1.12); }

.clp-card__n,
.clp-card__host {
    position: absolute;
    z-index: 2;
    top: 10px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    font-variant-numeric: tabular-nums;
    color: #fff;
    background: rgba(8, 8, 14, 0.74);
    border: 1px solid rgba(255, 255, 255, 0.16);
}
.clp-card__n { left: 10px; }
.clp-card__host { right: 10px; text-transform: uppercase; }

.clp-card__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 12px 14px 14px; }
.clp-card__body strong { font-size: 0.98rem; line-height: 1.25; font-weight: 800; color: #fff; overflow-wrap: anywhere; }
.clp-card__body small { font-size: 0.82rem; color: var(--alb-muted); overflow-wrap: anywhere; }
.clp-card__body em { font-style: normal; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.04em; color: var(--c); overflow-wrap: anywhere; }
.clp-grid--sm .clp-card__body { padding: 10px 12px 12px; }
.clp-grid--sm .clp-card__body strong { font-size: 0.9rem; }
.clp-grid--sm .clp-card__play { width: 30px; height: 30px; right: 8px; bottom: 8px; }
.clp-grid--sm .clp-card__play svg { width: 15px; height: 15px; }

/* ---------------- NAVIGATION : PRÉCÉDENT / SUIVANT ---------------- */
.clp-nav { margin-top: 32px; }
.clp-pns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.clp-pns.clp-pns--single { grid-template-columns: minmax(0, 520px); }
.alb .clp-pn,
.alb .clp-pn:hover,
.alb .clp-pn:focus {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 12px 16px 12px 12px;
    border-radius: 16px;
    color: #fff !important;
    background: var(--alb-card);
    border: 1px solid var(--alb-line) !important;
    transition: border-color 0.25s ease, background-color 0.25s ease, transform 0.25s ease;
}
.alb a.clp-pn:hover, .alb a.clp-pn:focus-visible { border-color: var(--c) !important; background: rgba(255, 255, 255, 0.09); transform: translateY(-2px); }
.alb .clp-pn.is-empty { display: none; }
.clp-pn > svg { flex: 0 0 auto; width: 22px; height: 22px; color: var(--c); transition: transform 0.25s ease; }
.clp-pn--next > svg { margin-left: auto; }
.alb a.clp-pn--prev:hover > svg { transform: translateX(-3px); }
.alb a.clp-pn--next:hover > svg { transform: translateX(3px); }
.clp-pn__thumb { position: relative; flex: 0 0 auto; display: block; width: 116px; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 9px; background: #000; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12); }
.alb .clp-pn__thumb img { display: block; width: 100% !important; height: 100% !important; object-fit: cover; }
.alb .clp-pn__thumb img.clp-cover-fb { filter: saturate(1.1) brightness(0.8); }
.clp-pn__t { display: flex; flex: 1 1 auto; flex-direction: column; gap: 2px; min-width: 0; }
.clp-pn__t small { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--alb-muted); }
.clp-pn__t strong { font-size: 1rem; line-height: 1.25; font-weight: 800; color: #fff; overflow-wrap: anywhere; }
.clp-pn__t em { font-style: normal; font-size: 0.8rem; color: var(--c); overflow-wrap: anywhere; }

/* ---------------- TOUS LES CLIPS ---------------- */
.clp-all { border-radius: 16px; background: var(--alb-card); border: 1px solid var(--alb-line); overflow: hidden; }
.clp-all > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    cursor: pointer;
    list-style: none;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
}
.clp-all > summary::-webkit-details-marker { display: none; }
.clp-all > summary:hover { background: rgba(255, 255, 255, 0.05); }
.clp-all > summary:focus-visible { outline: 2px solid var(--c); outline-offset: -2px; }
.clp-all > summary i { flex: 0 0 auto; width: 9px; height: 9px; margin-right: 4px; border-right: 2px solid var(--c); border-bottom: 2px solid var(--c); transform: rotate(45deg); transition: transform 0.25s ease; }
.clp-all[open] > summary i { transform: rotate(-135deg); }
.clp-all[open] > summary { border-bottom: 1px solid var(--alb-line); }
.clp-year { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 12px 18px; border-top: 1px solid var(--alb-line); }
.clp-all > summary + .clp-year { border-top: 0; }
.clp-year > b { padding-top: 5px; font-size: 1rem; font-weight: 800; color: var(--c); font-variant-numeric: tabular-nums; }
.clp-chips { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.alb .clp-chip,
.alb .clp-chip:hover,
.alb .clp-chip:focus {
    max-width: 100%;
    padding: 6px 13px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.3;
    overflow-wrap: anywhere;
    color: #f1f2f8 !important;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--alb-line) !important;
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.alb a.clp-chip:hover, .alb a.clp-chip:focus-visible { color: #0e0f16 !important; background: var(--c); border-color: var(--c) !important; transform: translateY(-1px); }
.alb a.clp-chip.is-current { border-color: var(--c) !important; background: color-mix(in srgb, var(--c) 20%, transparent); color: #fff !important; }

/* ==========================================================
   ADAPTATION À LA PLACE DISPONIBLE (largeur de la fiche, pas de l'écran)
   ========================================================== */

/* fiche large : navigation sur deux colonnes */
@container clp (min-width: 760px) {
    .clp-pns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .clp-pns.clp-pns--single { grid-template-columns: minmax(0, 520px); }
    .alb .clp-pn.is-empty { display: none !important; }
}

/* fiche moyenne ou étroite : passage en une colonne */
@container clp (max-width: 780px) {
    .clp-details { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .clp-details__left { gap: 10px; }
    .clp-m--albums { min-height: auto; }
    .clp-m--albums.is-single .clp-cover-link img { width: 72px !important; height: 72px !important; }
    .clp-pns { grid-template-columns: minmax(0, 1fr); }
}

/* fiche étroite (mobile) */
@container clp (max-width: 520px) {
    .alb-hero.clp-hero { padding: 14px 10px 24px; }
    .clp-stage-wrap { gap: 14px; }
    .clp-m-row { grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 8px; }
    .clp-m { padding: 7px 10px; }
    .clp-m__lbl { font-size: 0.6rem; }
    .clp-m__val strong { font-size: 0.84rem; }
    .clp-m__ico { width: 22px; height: 22px; }
    .clp-m__ico svg { width: 12px; height: 12px; }
    .clp-m--platform.is-youtube .clp-m__ico--logo svg { width: 15px; height: 15px; }
    .clp-rail { padding: 6px 8px 5px; gap: 4px; }
    .clp-rail--top .clp-edge span:nth-child(n+3) { display: none; }
    .clp-edge--nums span:nth-child(n+5) { display: none; }
    .clp-edge { font-size: 0.54rem; letter-spacing: 0.14em; }
    .clp-note { right: 8px; font-size: 0.82rem; }
    .clp-play { width: 58px; height: 58px; margin: -29px 0 0 -29px; }
    .clp-play svg { width: 27px; height: 27px; }
    .clp-poster__lab { left: 8px; bottom: 7px; font-size: 0.66rem; padding: 4px 9px; }
    .clp-rec { top: 7px; left: 8px; font-size: 0.56rem; }
    .clp-m--albums.is-single .clp-cover-link img { width: 66px !important; height: 66px !important; }
    .clp-m--albums.count-2 .clp-cover-link img { width: 60px !important; height: 60px !important; }
    .alb-actions.clp-actions .alb-btn { flex: 1 1 100%; justify-content: center; }
    .clp-grid { grid-template-columns: minmax(0, 1fr); }
}

/* navigation précédent / suivant : carte verticale quand la place manque */
@container clp (max-width: 600px) {
    .alb .clp-pn,
    .alb .clp-pn:hover,
    .alb .clp-pn:focus {
        flex-direction: row;
        align-items: center;
        gap: 12px;
        padding: 10px 12px;
    }
    .clp-pn__thumb {
        width: 88px;
        flex-shrink: 0;
        border-radius: 8px;
        aspect-ratio: 16 / 9;
    }
    .clp-pn > svg { display: none; }
    .clp-pn--prev .clp-pn__t small::before { content: "← "; }
    .clp-pn--next .clp-pn__t small::after { content: " →"; }
    .clp-pn__t strong { font-size: 0.88rem; }
    .clp-pn__t small { font-size: 0.65rem; }
    .clp-pn__t em { font-size: 0.72rem; }
}

/* autres clips : rangée à faire glisser quand la place manque */
@container clp (max-width: 460px) {
    .clp-grid--sm {
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: 68%;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        padding: 4px 2px 10px;
        margin: -4px -2px -10px;
    }
    .clp-grid--sm::-webkit-scrollbar { display: none; }
    .clp-grid--sm > .clp-card { scroll-snap-align: start; }
    .clp-year { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 12px 14px; }
    .clp-year > b { padding-top: 0; }
    .clp-all > summary { padding: 12px 14px; }
}

/* ==========================================================
   POP-UP VIDÉO : toujours dans le cadre de l'écran
   (le pop-up est ajouté au <body> par fiche-shared.php ; ces règles l'empêchent de déborder)
   ========================================================== */
.alb-modal { left: 0; right: 0; width: 100%; max-width: 100%; overflow: hidden; }
.alb-modal__dialog { width: min(1080px, 100%, calc((100vh - 150px) * 1.7778)); max-width: 100%; }
@supports (height: 100dvh) {
    .alb-modal { height: 100dvh; }
    .alb-modal__dialog { width: min(1080px, 100%, calc((100dvh - 150px) * 1.7778)); }
}
.alb-modal.is-image .alb-modal__dialog { width: auto; max-width: 100%; }
@media (max-width: 520px) {
    .alb-modal {
        padding: 8px;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    .alb-modal__dialog {
        padding: 10px 10px 12px;
        border-radius: 16px;
        width: 100% !important;
        max-width: calc(100vw - 16px) !important;
        box-sizing: border-box;
        overflow: hidden;
    }
    .alb-modal__bar { gap: 8px; margin-bottom: 8px; }
    .alb-modal__badge-txt { display: none; }
    .alb-modal__badge { padding: 6px 8px; }
}

@media (prefers-reduced-motion: reduce) {
    .clp-play, .clp-grain, .clp-rec i, .clp-poster::before { animation: none !important; }
}
