/*
 * How a figure of Quo's picture sits on a page wearing the rubric: the
 * frame, the caption, the glossary card. Laid beside `scenes.css` for
 * every page that places a scene, so a figure looks the same everywhere and
 * a site keeps only its page layout.
 *
 * Every value is a slot of the tokens. The classes are the ones `svg()` in
 * the website's `src/browser/draw.js` writes, `.fig`, and the ones a component wraps them in.
 */

/* A scene: full width of its column, never taller than a screen, its
   caption in the reading face under it with the scene's id in mono and
   red before the words. */
.qs-scene {
  margin: var(--nv-space-5, 1.5rem) 0 var(--nv-space-7, 2.5rem);
}

.qs-scene .fig {
  display: block;
  width: 100%;
  height: auto;
  max-height: 18rem;
}

/* A square scene, one house seen alone, is a small figure beside the
   words and never a wall across the page: `.qs-scene-square` on the figure says
   so, from the scene's own frame. */
.qs-scene-square .fig {
  max-height: 13rem;
}

.qs-scene figcaption {
  margin-top: var(--nv-space-2, 0.5rem);
  font-family: var(--nv-font-sans);
  font-size: var(--nv-text-sm, 0.9375rem);
  line-height: var(--nv-leading-normal, 1.5);
  color: var(--nv-color-fg-muted);
}


/* The steps of a moving scene, beside it or under it, as a plain ordered
   list: what a reader under reduced motion gets, and what everyone can
   read while the scene plays. */
.qs-scene-steps {
  display: grid;
  gap: var(--nv-space-2, 0.5rem);
  margin: var(--nv-space-3, 0.75rem) 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--nv-font-sans);
  font-size: var(--nv-text-sm, 0.9375rem);
  color: var(--nv-color-fg-body);
}

/* Each step hangs from a hairline, which the scene's clock turns red while
   its beat plays. Its first words, in `strong`, are the step's name. */
.qs-scene-steps li {
  padding-inline-start: var(--nv-space-3, 0.75rem);
  border-inline-start: 2px solid var(--nv-color-border);
}

.qs-scene-steps strong {
  font-weight: 600;
  color: inherit;
}

/* A glossary: one card per concept, the figure over its number, its name
   in the display face and its sentence in the reading face. */
.qs-glossary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: var(--nv-space-6, 2rem) var(--nv-space-5, 1.25rem);
}

/* A card's drawing is an icon of its concept, one fixed height in every
   card and every column, so the titles of a row stand on one line. */
.qs-card .fig {
  display: block;
  width: 100%;
  height: 10rem;
  margin-block-end: var(--nv-space-2, 0.5rem);
}

.qs-card .qs-card-no {
  font-family: var(--nv-font-mono);
  font-size: var(--nv-text-2xs, 0.6875rem);
  letter-spacing: 0.08em;
  color: var(--nv-color-accent);
}

.qs-card h3 {
  margin: var(--nv-space-1, 0.25rem) 0 0.125rem;
  font-family: var(--nv-font-display);
  font-size: var(--nv-text-xl, 1.25rem);
  font-weight: normal;
  line-height: var(--nv-leading-tight, 1.2);
}

.qs-card p {
  margin: 0;
  font-family: var(--nv-font-sans);
  font-size: var(--nv-text-sm, 0.9375rem);
  color: var(--nv-color-fg-muted);
}

/* Every word drawn inside a figure is a name or a label, in mono. */
.fig text {
  font-family: var(--nv-font-mono);
}

/*
 * The ink of a drawing. A drawing's shape names its paint by a class, because the allowlist holds
 * neither a style nor a `var()`: `.qs-fill-<ink>` fills, `.qs-stroke-<ink>` strokes, `.qs-stop-<ink>` colours
 * a gradient's stop. The inks are the picture's: the wall, the paper, the muted and body inks, the hairline,
 * you in the accent, the other side, and the figure ink a state is named in.
 */
.qs-fill-ink {
  fill: var(--nv-color-fg);
}
.qs-fill-wall {
  fill: var(--nv-color-role-wall);
}
.qs-fill-bg {
  fill: var(--nv-color-bg);
}
.qs-fill-muted {
  fill: var(--nv-color-fg-muted);
}
.qs-fill-border {
  fill: var(--nv-color-border);
}
.qs-fill-you {
  fill: var(--nv-color-accent);
}
.qs-fill-other {
  fill: var(--nv-color-role-other);
}
.qs-fill-body {
  fill: var(--nv-color-fg-body);
}
.qs-fill-figure {
  fill: var(--nv-color-role-figure-3);
}
.qs-stroke-ink {
  stroke: var(--nv-color-fg);
}
.qs-stroke-wall {
  stroke: var(--nv-color-role-wall);
}
.qs-stroke-bg {
  stroke: var(--nv-color-bg);
}
.qs-stroke-muted {
  stroke: var(--nv-color-fg-muted);
}
.qs-stroke-border {
  stroke: var(--nv-color-border);
}
.qs-stroke-you {
  stroke: var(--nv-color-accent);
}
.qs-stroke-other {
  stroke: var(--nv-color-role-other);
}
.qs-stroke-body {
  stroke: var(--nv-color-fg-body);
}
.qs-stroke-figure {
  stroke: var(--nv-color-role-figure-3);
}
.qs-stop-you {
  stop-color: var(--nv-color-accent);
}
.qs-stop-other {
  stop-color: var(--nv-color-role-other);
}

/* A booth's halves stretch from the door they stand at, which `scenes.css` scales: each grows from its outer edge. */
.merge-a {
  transform-box: fill-box;
  transform-origin: 100% 50%;
}

.merge-b {
  transform-box: fill-box;
  transform-origin: 0% 50%;
}
