/* ──────────────────────────────────────────────────────────────────────────────
   fileWindowMedia — la vidéo et le son dans la fenêtre de lecture, et la lecture qui survit à la fenêtre (lot 4b, 2026-10-11).
   public/js/fileWindowVideo.js (fwv-), fileWindowAudio.js (fwa-), mediaBackground.js (mbg-). Les jetons viennent de variables.css, avec repli ; aucun filet visible.
   ────────────────────────────────────────────────────────────────────────────── */

/* ── Vidéo : la scène noire, la barre native, et la pastille posée SOUS elle ─────────────────────────────────────────────────────── */
.fwv { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.fwv-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; background: #000; outline: none; }
.fwv-stage video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
/* La fenêtre a SON plein écran (fileWindowVideo.js pose controlsList=nofullscreen) : le bouton de la barre native, désactivé, n'a plus lieu d'être. L'iPhone n'a pas l'attribut : il garde le sien. */
.fwv-stage video[controlslist~="nofullscreen"]::-webkit-media-controls-fullscreen-button { display: none; }
/* La pastille « dock » : dans le flux, sous le contenu (64 px avec ses marges : DOCK_H de fileWindowVideo.js) */
.fwf--dock { position: static; left: auto; bottom: auto; transform: none; flex: none; margin: 8px auto 10px; }

/* ── Plein écran, image ET vidéo : le média occupe TOUT l'écran, à ses proportions ; la barre de titre, la pastille et la bande de vignettes se posent PAR-DESSUS lui (aucune place réservée : rien ne bouge quand elles paraissent ou
   s'effacent). La barre native d'une vidéo (56 px, au bas de l'IMAGE) reste libre : --fw-lift (fileWindowVideo.js) lève la pastille et la bande au-dessus d'elle. Les flèches restent au centre de l'écran. ───────────────────────── */
.aqw-backdrop--max:has(.fwi, .fwv) .aqw-bar { position: absolute; top: 0; left: 0; right: 0; z-index: 5; background: color-mix(in srgb, var(--color-surface, #fff) 82%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.aqw-backdrop--max:has(.fwi, .fwv) .aqw-footer { position: absolute; left: 0; right: 0; bottom: var(--fw-lift, 0px); z-index: 5; }
.aqw-backdrop--max:has(.fwv) .fwf--dock { position: absolute; left: 50%; bottom: calc(var(--fw-lift, 0px) + 12px); transform: translateX(-50%); margin: 0; z-index: 5; }
.aqw-backdrop--max.fw-strip:has(.fwv) .fwf--dock { bottom: calc(var(--fw-lift, 0px) + 96px); }
.aqw-backdrop--max.fw-strip .fwi .fwf { bottom: 100px; }
.aqw-backdrop--max .fwi-badge { top: 70px; }

/* ── Son : la pochette, le nom, la position, le transport ──────────────────────────────────────────────────────────────────────────── */
.fwa { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 22px 36px 0; text-align: center; outline: none; }
.fwa audio { display: none; }
.fwa-art {
    flex: none; width: 120px; height: 120px; display: flex; align-items: center; justify-content: center; overflow: hidden;
    border-radius: 50%; background: color-mix(in srgb, var(--color-text, #1d1d1f) 7%, transparent); color: var(--color-text-secondary, #86868b);
    transition: border-radius .25s ease;
}
.fwa-art.has-cover { width: 160px; height: 160px; border-radius: 14px; }
.fwa-cover { display: block; width: 100%; height: 100%; object-fit: cover; }
.fwa-title { max-width: 100%; font-size: 15px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fwa-ext { margin-top: -12px; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--color-text-tertiary, #aeaeb2); }
.fwa-seek { width: 100%; display: flex; align-items: center; gap: 10px; }
.fwa-cur, .fwa-tot { min-width: 32px; font-size: 11.5px; font-variant-numeric: tabular-nums; color: var(--color-text-tertiary, #aeaeb2); }
.fwa-tot { text-align: right; }
.fwa-range { flex: 1; height: 4px; border-radius: 2px; -webkit-appearance: none; appearance: none; background: color-mix(in srgb, var(--color-text, #1d1d1f) 16%, transparent); cursor: pointer; outline: none; }
.fwa-range::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--color-text, #1d1d1f); cursor: pointer; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
.fwa-range::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--color-text, #1d1d1f); cursor: pointer; }
.fwa-range:focus-visible { outline: 2px solid var(--color-primary, #007aff); outline-offset: 5px; }
.fwa-btns { display: flex; align-items: center; gap: 12px; }
.fwa-btn {
    width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 50%;
    background: transparent; color: var(--color-text-secondary, #86868b); cursor: pointer; transition: background .14s, color .14s;
}
.fwa-btn:hover { background: color-mix(in srgb, var(--color-text, #1d1d1f) 9%, transparent); color: var(--color-text, #1d1d1f); }
.fwa-btn:focus-visible { outline: 2px solid var(--color-primary, #007aff); outline-offset: 2px; }
.fwa-play { width: 54px; height: 54px; background: color-mix(in srgb, var(--color-text, #1d1d1f) 10%, transparent); color: var(--color-text, #1d1d1f); }
.fwa-play.playing { background: var(--color-primary, #007aff); color: #fff; }
.fwa .fwf--dock { margin-top: auto; }

/* ── La lecture qui survit à la fenêtre : la mini-fenêtre vidéo et le son sous la page (mediaBackground.js) ───────────────────────── */
.mbg-holder { position: fixed; left: -9999px; top: 0; width: 1px; height: 1px; overflow: hidden; pointer-events: none; }
.mbg-bar {
    position: fixed; z-index: 9999; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
    display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 24px); padding: 6px 8px 6px 14px; border-radius: 999px;
    background: color-mix(in srgb, var(--color-surface, #fff) 90%, transparent); color: var(--color-text, #1d1d1f);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 12px 40px rgba(0, 0, 0, .3);
    animation: mbg-in .25s ease;
}
@keyframes mbg-in { from { transform: translate(-50%, 16px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.mbg-icon { flex: none; display: inline-flex; color: var(--color-text-secondary, #86868b); }
.mbg-icon svg { width: 18px; height: 18px; }
.mbg-name { max-width: 160px; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mbg-info { display: flex; flex-direction: column; min-width: 120px; max-width: 220px; line-height: 1.2; }
.mbg-info .mbg-name { max-width: none; }
.mbg-time { margin-top: 2px; font-size: 11px; font-variant-numeric: tabular-nums; color: var(--color-text-tertiary, #aeaeb2); }
.mbg-back { flex: none; padding: 8px 14px; border: 0; border-radius: 999px; font: inherit; font-size: 12.5px; font-weight: 700; white-space: nowrap; background: var(--color-primary, #007aff); color: #fff; cursor: pointer; }
.mbg-btn {
    flex: none; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 50%;
    background: color-mix(in srgb, var(--color-text, #1d1d1f) 8%, transparent); color: var(--color-text, #1d1d1f); cursor: pointer; transition: background .12s;
}
.mbg-btn:hover { background: color-mix(in srgb, var(--color-text, #1d1d1f) 16%, transparent); }
.mbg-btn svg { width: 16px; height: 16px; }
.mbg-back:focus-visible, .mbg-btn:focus-visible { outline: 2px solid var(--color-primary, #007aff); outline-offset: 2px; }
/* La pastille d'une image se relève au-dessus de cette barre (sinon elle la couvrirait : l'image reste ouverte pendant qu'on écoute) */
.has-media-bar .fwi .fwf { bottom: calc(16px + 64px + env(safe-area-inset-bottom, 0px)); }

@media (max-width: 480px) {
    .mbg-bar--pip .mbg-name { max-width: 90px; }
    .fwa { padding: 18px 20px 0; }
}
@media (prefers-reduced-motion: reduce) {
    .mbg-bar { animation: none; }
    .fwa-art { transition: none; }
}
