/* Styles du module js/viewer (préfixe dédié, voir docs/DESIGN.md). Réutiliser base.css avant de créer un style.
   Esprit : WeTransfer / Smash pour la page du lien, Frame.io pour la revue. Pas d'ombre, pas de bordure. */

/* ---------- Page du lien ---------- */
.vw-page { min-height: 100vh; display: flex; flex-direction: column; }
.vw-top { max-width: var(--maxw); width: 100%; margin: 0 auto; }
.vw-main { display: flex; flex-direction: column; gap: 24px; padding-top: 24px; padding-bottom: 64px; }
.vw-main--narrow { max-width: 760px; }
.vw-narrow { max-width: 520px; padding-top: 8vh; }

.vw-hero { display: flex; flex-direction: column; gap: 12px; padding: 40px; border-radius: var(--radius-panel); background: var(--grey-50); }
.vw-hero__msg { max-width: 62ch; font-size: 17px; line-height: 1.5; color: var(--ink); white-space: pre-line; }
.vw-hero__meta { margin-top: 4px; }
.vw-bar { margin-top: 8px; }

.vw-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.vw-card { display: flex; flex-direction: column; gap: 0; height: 100%; border-radius: var(--radius-card); background: var(--grey-50); text-decoration: none; color: inherit; overflow: hidden; transition: background .15s; }
.vw-card:hover { background: var(--grey-100); }
.vw-card:hover .vw-thumb img, .vw-card:hover .vw-thumb video, .vw-card:hover .vw-thumb canvas { transform: scale(1.02); }
.vw-card__body { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 16px; }
.vw-card__size { margin-left: auto; }
.vw-empty { text-align: center; padding: 40px; color: var(--ink-2); }
.vw-foot { text-align: center; }

/* Vignettes */
.vw-thumb { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; background: var(--grad-grey); overflow: hidden; }
.vw-thumb img, .vw-thumb video, .vw-thumb canvas { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.vw-thumb--pdf.has-canvas { background: var(--grey-200); padding: 14px 14px 0; align-items: start; }
.vw-thumb--pdf.has-canvas canvas { height: auto; object-fit: contain; border-radius: 4px 4px 0 0; background: var(--paper); }
.vw-thumb__ext { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--ink-2); font-family: var(--font-display); font-style: italic; font-weight: 600; font-size: 14px; letter-spacing: .04em; }
.vw-thumb__play { position: absolute; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(20, 28, 39, .72); color: var(--on-accent); }
.vw-thumb__play .icon { fill: currentColor; margin-left: 2px; }

/* États (mot de passe, expiré) */
.vw-state { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 40px; }
.vw-state .stack { width: 100%; margin-top: 4px; }
.vw-state__icon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--grad-navy); color: var(--on-accent); }
.vw-error { margin: 0; color: var(--red-700); font-family: var(--font-ui); font-size: 13px; }

/* Lien de dépôt */
.vw-drop { min-height: 300px; }
.vw-queue:empty { display: none; }
.vw-queue__item.is-done .progress > i { background: var(--grad-navy); }
.vw-queue__item.is-error .vw-queue__state { color: var(--red-700); }
.vw-queue__state { flex: none; }
.vw-done { display: flex; align-items: center; gap: 16px; padding: 20px 24px; background: var(--ok-bg); }
.vw-done__icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--ok); color: var(--on-accent); flex: none; }

/* Identification */
.vw-gate .field small { margin-top: -4px; }

/* ---------- Revue ---------- */
body.vw-body-review { overflow: hidden; }
.vw-review { height: 100vh; height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) 380px; grid-template-rows: auto minmax(0, 1fr); background: var(--paper); }

.vw-rv-top { grid-column: 1 / -1; position: relative; display: flex; align-items: center; gap: 14px; padding: 12px 20px; min-height: 64px; }
.vw-rv-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vw-rv-title h1 { font-size: 17px; }
.vw-rv-sub { gap: 10px; flex-wrap: nowrap; min-width: 0; }
.vw-rv-sub .t-desc { min-width: 0; }
.vw-rv-actions { flex: none; gap: 8px; }
.vw-nav { gap: 2px; padding: 0 4px; }
.vw-nav .t-desc { min-width: 40px; text-align: center; }
.vw-nav a[aria-disabled="true"] { opacity: .35; pointer-events: none; }
.vw-vselect { min-height: 32px; width: auto; padding: 4px 30px 4px 12px; border-radius: var(--radius-pill); font-family: var(--font-ui); font-size: 13px; }
.vw-file-btn { position: relative; cursor: pointer; }
.vw-upload-toast { position: absolute; right: 20px; top: calc(100% - 4px); z-index: 5; width: 280px; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: var(--radius-card); background: var(--grey-100); }

.vw-media { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; margin: 0 0 16px 16px; border-radius: 28px; background: var(--grey-100); overflow: hidden; }
.vw-tools { flex: none; display: flex; justify-content: center; padding: 10px 12px 0; }
.vw-tools:empty { display: none; }
.vw-stage { position: relative; flex: 1 1 auto; min-height: 0; display: flex; }
.vw-stage > * { flex: 1 1 auto; min-width: 0; min-height: 0; }
.vw-stage__loading, .vw-stage__empty { flex: 1; }
.vw-stage__fallback { flex: 1; gap: 12px; padding: 24px; color: var(--ink-2); }
.vw-stage__fallback img { max-height: 100%; object-fit: contain; }

.vw-side { display: flex; flex-direction: column; min-height: 0; padding: 0 16px 16px; gap: 12px; }
.vw-side__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 4px 0; }
.vw-count { min-width: 26px; }

.vw-comments { flex: 1 1 auto; min-height: 120px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 2px; scrollbar-width: thin; }
.vw-comments__empty { margin: auto 0; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 32px 24px; text-align: center; color: var(--ink-3); }

.vw-comment { padding: 14px 16px; border-radius: var(--radius-card); background: var(--grey-50); transition: background .15s; }
.vw-comment:hover { background: var(--grey-100); }
.vw-comment.is-active { background: var(--grey-100); box-shadow: inset 3px 0 0 var(--red-500); }
.vw-comment.is-resolved .vw-comment__body { color: var(--ink-3); }
.vw-comment__main { display: flex; align-items: center; gap: 10px; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
.vw-comment__meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; min-width: 0; }
.vw-comment__who { font-family: var(--font-display); font-style: italic; font-weight: 600; font-size: 14px; }
.vw-comment__at { font-family: var(--font-ui); font-size: 12px; color: var(--ink); padding: 1px 8px; border-radius: var(--radius-pill); background: var(--paper); }
.vw-comment__body { margin: 8px 0 0 34px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.vw-comment__actions { display: flex; align-items: center; gap: 4px; margin: 8px 0 0 28px; }
.vw-act { display: inline-flex; align-items: center; gap: 4px; min-height: 28px; padding: 2px 8px; border: 0; border-radius: var(--radius-pill); background: none; color: var(--ink-2); font-family: var(--font-ui); font-size: 12px; cursor: pointer; }
.vw-act:hover { background: var(--paper); color: var(--ink); }
.vw-act--quiet { margin-left: auto; color: var(--ink-3); }
.vw-reply__meta .vw-act--quiet { min-height: 24px; }

.vw-replies { display: flex; flex-direction: column; gap: 10px; margin: 12px 0 0 34px; padding-left: 12px; box-shadow: inset 2px 0 0 var(--grey-200); }
.vw-reply__meta { gap: 8px; }
.vw-reply .vw-comment__body { margin: 4px 0 0; }
.vw-reply__box { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 0 34px; }
.vw-reply__input { min-height: 64px; background: var(--paper); }
.vw-reply__btns { justify-content: flex-end; gap: 6px; }

.vw-composer { flex: none; display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 20px; background: var(--grey-50); }
.vw-composer__input { min-height: 72px; background: var(--paper); }
.vw-chip { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; border-radius: var(--radius-pill); background: var(--grey-200); font-family: var(--font-ui); font-size: 12px; }
.vw-chip.is-draft { background: var(--grad-red); color: var(--on-accent); }
.vw-chip__x { display: grid; place-items: center; width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .22); color: inherit; cursor: pointer; }
.vw-chip__x[hidden] { display: none; }

.vw-decision { flex: none; display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 20px; background: var(--grey-100); max-height: 50vh; overflow-y: auto; }
.vw-decision:empty { display: none; }
.vw-decision__btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vw-decision__btns .btn { white-space: normal; text-align: center; line-height: 1.15; }
.vw-decided { display: flex; gap: 12px; align-items: flex-start; }
.vw-decided__icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--ok); color: var(--on-accent); }
.vw-decided.is-changes .vw-decided__icon { background: var(--warn); }
.vw-decided__title { margin: 0; font-family: var(--font-display); font-style: italic; font-weight: 600; }
.vw-statement { font-family: var(--font-display); font-style: italic; font-weight: 600; background: var(--grey-100); }

/* ---------- Mobile / tablette ---------- */
@media (max-width: 899px) {
  body.vw-body-review { overflow: auto; }
  .vw-review { height: auto; min-height: 100vh; display: flex; flex-direction: column; }
  .vw-rv-top { flex-wrap: wrap; padding: 10px 12px; gap: 10px; }
  .vw-rv-title { flex: 1 1 calc(100% - 60px); }
  .vw-rv-actions { width: 100%; flex-wrap: wrap; justify-content: flex-start; }
  .vw-rv-actions > .btn:last-child { margin-left: auto; }
  .vw-media { margin: 0 12px; border-radius: 22px; height: 62vh; min-height: 320px; flex: none; }
  .vw-side { padding: 16px 12px 32px; }
  .vw-comments { overflow: visible; min-height: 0; }
  .vw-decision { max-height: none; }
  .vw-hide-sm { display: none; }
  .vw-upload-toast { right: 12px; left: 12px; width: auto; }
}

@media (max-width: 640px) {
  .vw-hero { padding: 26px 22px; border-radius: 28px; }
  .vw-main { gap: 18px; padding-top: 8px; }
  .vw-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .vw-card__body { padding: 10px 12px 12px; gap: 8px; }
  .vw-card__size { display: none; }
  .vw-state { padding: 26px 22px; }
  .vw-narrow { padding-top: 4vh; }
  .vw-drop { min-height: 220px; }
  .vw-media { height: 54vh; }
  .vw-act { min-height: 36px; }
}

/* ---------- Ajustements après relecture visuelle ---------- */
ul.list, .vw-queue { margin: 0; padding: 0; list-style: none; }
.vw-drop { align-content: center; gap: 6px; }
.vw-drop .drop__plus { margin-bottom: 10px; }
.vw-top--narrow { max-width: 760px; }
.vw-decision .btn--ghost { background: var(--paper); }
.vw-decision .btn--ghost:hover { background: var(--grey-50); }
.vw-composer .btn { margin-left: auto; }
.vw-top--state { max-width: 520px; }
.vw-card__body .t-sub.ellipsis { padding-right: 3px; }
