/* Story pictures (pictures.js): the plate between passages, its dialog, the
   first-open question and the settings rows. Kit tokens only (tests/test_style_budget.py). */

/* The kit's buttons and rows set their own display, which beats [hidden]. */
#picture-btn[hidden], #set-pictures[hidden], #pictures-owner-note[hidden],
.pic-modal [hidden] { display: none !important; }

/* ---------- the plate in the story ---------- */
/* Keeps the turn's own width and side padding, so the plate lines up with the text. */
#story-log .turn.story-picture { margin-top: var(--sv-space-4); margin-bottom: var(--sv-space-5); border: 0; background: none; }
/* An inset plate, not a wall: at most 560px wide and 45% of the screen tall, so
   the end of the passage it shows stays in view above it. */
.story-picture__open { display: block; width: min(100%, 560px, calc(45vh * 4 / 3)); margin: 0 auto; padding: 0;
  border: 1px solid var(--sv-line); border-radius: var(--sv-r-card);
  background: var(--sv-panel-soft); overflow: hidden; cursor: zoom-in; }
.story-picture__open:hover { border-color: var(--sv-line-hover); }
.story-picture__open:focus-visible { outline: var(--sv-focus); outline-offset: 2px; }
.story-picture__img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
/* What the picture cost at the provider, top right of it (Lucas, 2026-10-23). */
.story-picture__open { position: relative; }
.story-picture__cost { position: absolute; top: var(--sv-space-2); right: var(--sv-space-2); z-index: 1;
  padding: 2px var(--sv-space-2); border: 1px solid var(--sv-line); border-radius: var(--sv-r);
  background: rgba(var(--sv-ground-rgb), .72); color: var(--sv-text); font-size: var(--sv-fs-11); line-height: 1.4;
  pointer-events: none; }
#story-log .turn.story-picture.is-new { animation: sv-picture-in var(--sv-t3) var(--sv-ease-out) both; }
@keyframes sv-picture-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { #story-log .turn.story-picture.is-new { animation: none; } }
:root[data-reduce-motion="1"] #story-log .turn.story-picture.is-new { animation: none; }

/* ---------- the dialog ---------- */
.pic-modal { width: min(880px, 100%); }
.pic-modal__img { display: block; width: 100%; height: auto; max-height: 62vh; object-fit: contain;
  border-radius: var(--sv-r-card); background: var(--sv-panel-soft); }
.pic-modal__label { display: block; margin-top: var(--sv-space-4); }
.pic-modal__prompt { width: 100%; margin-top: var(--sv-space-2); resize: vertical; }
.pic-modal__err:empty { display: none; }

.pic-ask { width: min(480px, 100%); }
