/* Fenêtre d'un contenu Image ou Vidéo (maquettes/applications-image-video.html, validée le 2026-12-02). */
.content-window, .slideshow-window { max-height: calc(100vh - 64px); }
.content-window .modal-split-media, .slideshow-window .modal-split-media { flex: 1 1 auto; min-height: 0; grid-template-rows: minmax(0, 1fr); }
.content-window .modal-body.settings, .slideshow-window .modal-body.settings { position: relative; padding: 0; gap: 0; min-height: 0; overflow-y: auto; }
.content-window .preview, .slideshow-window .preview { min-height: 0; overflow: hidden; }
.set { padding: 18px 24px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.set:first-child { border-top: 0; }
.set-title { font-size: 13px; color: var(--text-2); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.set-title b { font-weight: 500; color: var(--text); font-size: 14px; }
.set .hint { font-size: 12px; color: var(--text-2); line-height: 1.45; }
.set .error { font-size: 12px; color: var(--danger-text); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mono { font-family: "JetBrains Mono", monospace; }
.media-pick { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; align-items: center; }
.media-pick-thumb { position: relative; display: block; aspect-ratio: 16 / 10; border-radius: var(--r); overflow: hidden; background: var(--surface-2); }
.media-pick-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.media-pick b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-pick small { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }

/* Choix segmenté, interrupteur, couleurs, curseur */
.seg-field { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.seg-field legend { padding: 0; margin-bottom: 6px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1px solid var(--border-strong); border-radius: var(--r); overflow: hidden; }
.seg label { height: var(--h-sm); display: grid; place-items: center; font-size: 13px; color: var(--text-2); padding: 0 8px; white-space: nowrap; cursor: pointer; }
.seg label + label { border-left: 1px solid var(--border-strong); }
.seg label:hover { background: var(--hover); }
.seg label:has(input:checked) { background: var(--primary); color: var(--primary-text); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: -2px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; font-weight: 500; cursor: pointer; }
.switch .track { width: 36px; height: 20px; border-radius: 999px; background: var(--border-strong); position: relative; flex: none; transition: background 0.15s; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); transition: left 0.15s; }
.switch:has(input:checked) .track { background: var(--primary); }
.switch:has(input:checked) .track::after { left: 18px; background: var(--primary-text); }
.switch:has(input:focus-visible) .track { outline: 2px solid var(--focus); outline-offset: 2px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.swatch { width: 24px; height: 24px; padding: 0; border-radius: 50%; border: 1px solid var(--border-strong); cursor: pointer; }
.swatch.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--focus); }
.swatch-code { width: 96px; height: var(--h-sm); padding: 0 8px; font-family: "JetBrains Mono", monospace; font-size: 12px; border: 1px solid var(--border-strong); border-radius: var(--r); color: var(--text); background: var(--surface); }
.invalid .swatch-code { border-color: var(--danger); }
.volume { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 13px; }
.volume .range { flex: 1; accent-color: var(--primary); }
.volume output { width: 44px; text-align: right; font-family: "JetBrains Mono", monospace; }
.total { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); font-size: 13px; color: var(--text-2); }
.total b { font-family: "JetBrains Mono", monospace; font-weight: 500; color: var(--text); font-size: 15px; }

/* Partie à garder, extrait */
.focus-pick { position: relative; border-radius: var(--r); overflow: hidden; cursor: crosshair; background: #000; line-height: 0; }
.focus-pick:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.focus-pick img { display: block; width: 100%; user-select: none; }
.focus-pick .ring { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 2px rgba(11, 31, 58, 0.6); pointer-events: none; }
.focus-pick .keep { position: absolute; border: 2px dashed rgba(255, 255, 255, 0.95); box-shadow: 0 0 0 999px rgba(11, 31, 58, 0.45); pointer-events: none; }
.focus-pick .keep[hidden] { display: none; }
.trim { display: flex; flex-direction: column; gap: 6px; }
.trim-track { position: relative; height: 36px; border-radius: var(--r); background: linear-gradient(90deg, var(--surface-2), var(--border-strong)); touch-action: none; }
.trim-out { position: absolute; top: 0; bottom: 0; background: rgba(11, 31, 58, 0.45); }
.trim-before { left: 0; border-radius: var(--r) 0 0 var(--r); }
.trim-after { right: 0; border-radius: 0 var(--r) var(--r) 0; }
.trim-sel { position: absolute; top: 0; bottom: 0; border: 2px solid #f2a81d; border-radius: var(--r); }
.trim-handle { position: absolute; top: 0; bottom: 0; width: 12px; margin-left: -6px; background: #f2a81d; border-radius: 3px; display: grid; place-items: center; cursor: ew-resize; }
.trim-handle::after { content: ""; width: 2px; height: 14px; background: rgba(11, 31, 58, 0.6); border-radius: 1px; }
.trim-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); font-family: "JetBrains Mono", monospace; }

/* Ce qui dépend d'un choix, sans script */
.when-whole, .when-fill { display: flex; flex-direction: column; gap: 10px; }
.content-window:has([name="Fit"][value="fill"]:checked) .when-whole,
.content-window:has([name="Fit"][value="whole"]:checked) .when-fill,
.content-window:not(:has([name="Background"][value="color"]:checked)) .when-color,
.content-window:not(:has([name="Period"]:checked)) .when-period,
.content-window:has([name="Period"]:checked) .when-always,
.content-window:not(:has([name="Sound"]:checked)) .when-sound { display: none; }
.slideshow-window:has([name="Fit"][value="fill"]:checked) .when-whole,
.slideshow-window:has([name="Fit"][value="whole"]:checked) .when-fill,
.slideshow-window:not(:has([name="Background"][value="color"]:checked)) .when-color,
.slideshow-window:not(:has([name="Period"]:checked)) .when-period,
.slideshow-window:has([name="Period"]:checked) .when-always,
.slideshow-window:not(:has([name="Sound"]:checked)) .when-sound { display: none; }

/* Aperçu : comme le player le montrera */
.look-stage .look-backdrop { position: absolute; inset: -8%; width: 116%; height: 116%; object-fit: cover; filter: blur(24px) brightness(0.7); display: none; }
.look-stage[data-background="blur"] .look-backdrop { display: block; }
.look-stage[data-background="color"] { background: var(--look-color); }
.look-stage .look-media, .look-stage.video-stage .look-media { position: relative; width: 100%; height: 100%; object-fit: contain; object-position: center; background: transparent; }
.look-stage[data-fit="fill"] { background: #000; }
.look-stage[data-fit="fill"] .look-backdrop { display: none; }
.look-stage[data-fit="fill"] .look-media, .look-stage.video-stage[data-fit="fill"] .look-media { object-fit: cover; object-position: var(--look-x) var(--look-y); }
.look-stage[data-motion="zoom-in"] .look-media { animation: look-zoom-in var(--look-seconds, 10s) linear infinite; }
.look-stage[data-motion="zoom-out"] .look-media { animation: look-zoom-out var(--look-seconds, 10s) linear infinite; }
@keyframes look-zoom-in { from { transform: scale(1); } to { transform: scale(1.08); } }
@keyframes look-zoom-out { from { transform: scale(1.08); } to { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .look-stage .look-media { animation: none !important; } }

/* Dans la liste */
.content-type .badge { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); white-space: nowrap; }

@media (max-width: 720px) {
  .content-window .preview { order: -1; }
  .content-window { max-height: none; }
  .content-window .modal-body.settings, .content-window .preview { overflow: visible; }
}

/* Images of the video in the bar of the clip (maquettes/applications-video-scenes.html, validée le 2026-12-03; ADR 0018). */
.trim-track.has-film { height: 56px; background: #0b1f3a; }
.trim-film { position: absolute; inset: 0; display: flex; border-radius: var(--r); overflow: hidden; }
.trim-frame { flex: 1 1 0; min-width: 0; background-image: var(--film); background-size: 1000% 100%; border-right: 1px solid rgba(0, 0, 0, 0.25); }
.trim-frame:last-child { border-right: 0; }
.trim-film.is-loading .trim-frame { background: linear-gradient(90deg, var(--surface-2) 0%, var(--border) 50%, var(--surface-2) 100%); background-size: 300% 100%; animation: film-wait 1.4s ease-in-out infinite; border-right-color: var(--surface); }
@keyframes film-wait { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .trim-film.is-loading .trim-frame { animation: none; } }
.has-film .trim-out { background: rgba(11, 31, 58, 0.62); }
.has-film .trim-sel { border-width: 3px 0; border-radius: 0; }
.has-film .trim-handle { width: 14px; z-index: 2; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); }
.has-film .trim-handle[data-handle="start"] { border-radius: var(--r) 2px 2px var(--r); margin-left: -12px; }
.has-film .trim-handle[data-handle="end"] { border-radius: 2px var(--r) var(--r) 2px; margin-left: -2px; }
.trim-handle.is-active { background: #ffb938; box-shadow: 0 0 0 3px rgba(242, 168, 29, 0.35); }
.trim-tip { position: absolute; bottom: calc(100% + 8px); transform: translateX(-50%); padding: 3px 8px; border-radius: var(--r-sm); background: var(--text); color: var(--surface); font: 500 12px "JetBrains Mono", monospace; white-space: nowrap; z-index: 3; pointer-events: none; }
.trim-tip::after { content: ""; position: absolute; left: 50%; top: 100%; margin-left: -5px; border: 5px solid transparent; border-top-color: var(--text); }
.trim-playhead { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(11, 31, 58, 0.45); border-radius: 1px; z-index: 1; pointer-events: none; }
.trim-track { cursor: pointer; }
.look-moment { position: absolute; top: 12px; left: 12px; z-index: 2; padding: 4px 10px; border-radius: var(--r-sm); background: rgba(11, 31, 58, 0.8); color: #fff; font-size: 12px; pointer-events: none; }
.trim-film[hidden], .trim-tip[hidden], .trim-playhead[hidden], .look-moment[hidden] { display: none; }

/* Diaporamas : les médias en liste, un réglage par ligne (maquettes/applications-diaporamas.html) */
.set.line { flex-direction: row; align-items: center; gap: 12px; padding: 8px 24px; flex-wrap: wrap; }
.set.line > label:first-child, .set.line > .line-label { font-size: 13px; color: var(--text-2); width: 104px; flex: none; }
.set.line > .seg-field { flex: 1; }
.set.line .stepper { margin-left: auto; }
.slides { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 150px; overflow-y: auto; }
.slide { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); cursor: pointer; }
.slide.on { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
.slide .grip { cursor: grab; border: 0; background: none; color: var(--text-3); padding: 0; }
.slide-thumb { width: 56px; height: 34px; object-fit: cover; border-radius: var(--r-sm); flex: none; background: var(--surface-2); }
.slide-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.slide-extract { display: flex; align-items: center; gap: 4px; }
.slide-extract input { width: 56px; height: var(--h-sm); padding: 0 6px; font-size: 12px; border: 1px solid var(--border-strong); border-radius: var(--r); background: var(--surface); color: var(--text); }
.slide-extract.invalid input { border-color: var(--danger); }
.slide .icon-btn.danger { color: var(--danger-text); }
.slide-nav { display: flex; align-items: center; gap: 6px; font-size: 12px; }
@media (min-width: 721px) {
  .slideshow-window .modal-split-media { grid-template-columns: 500px minmax(0, 1fr); }
}
.set.line .seg { grid-auto-columns: auto; }
.set.line .seg label { padding: 0 7px; }
.set.line .switch { width: 100%; }
