/* ── A story to play (templates/story.html, crate::worlds) ───────────────
   Every beat is in the page; the one the address's fragment names is the
   one shown (:target), so a choice, which is a link to the next beat, plays
   the story with no script, and the beginning shows when no beat is named.
   Nothing here moves by itself. */

.story {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.5rem var(--gutter, 1rem) 4rem;
}

.story-head { margin-bottom: 1rem; }
.story-kicker { margin: 0; color: var(--text-muted); font-size: var(--step--1, 0.9rem); }
.story-kicker cite { font-style: italic; }
.story-title { margin: 0.25rem 0 0.25rem; }
.story-by { margin: 0; color: var(--text-muted); }

.story-summary { font-size: 1.1rem; line-height: 1.55; margin: 1rem 0 0.5rem; }
.story-made { margin-bottom: 1.25rem; }
.story-who { line-height: 1.55; margin: 0 0 1rem; }
.story-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0 0 0.75rem; }
.story-actions [hidden] { display: none; }
.story-note { color: var(--text-muted); font-size: var(--step--1, 0.9rem); margin: 0 0 1.5rem; }
.story-not-offered {
  border-left: 4px solid var(--warning);
  padding: 0.5rem 0 0.5rem 1rem;
  margin: 0 0 1.5rem;
  line-height: 1.5;
}
.story-not-offered a { color: var(--accent-text); text-decoration: underline; }

.story-facts { display: grid; gap: 0.6rem; margin: 1.5rem 0 0; padding: 1rem 0 0; border-top: 1px solid var(--border); }
.story-facts div { display: grid; grid-template-columns: 8rem 1fr; gap: 1rem; }
.story-facts dt { color: var(--text-muted); font-weight: 600; }
.story-facts dd { margin: 0; line-height: 1.5; }
.story-facts a { color: var(--accent-text); text-decoration: underline; }
@media (max-width: 480px) {
  .story-facts div { grid-template-columns: 1fr; gap: 0.15rem; }
}

/* One beat at a time: the target, else the beginning. */
.story-beat { display: none; scroll-margin-top: 5rem; }
.story-beat:target { display: block; }
.story:has(.story-beat:target) .story-intro { display: none; }

.story-place {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--step--1, 0.9rem);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.story-beat-title { margin: 0.2rem 0 1rem; font-size: 1.6rem; line-height: 1.25; }
.story-beat-title:focus { outline: none; }
.story-beat-title:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 4px; }

.story-text p { font-size: 1.1rem; line-height: 1.65; margin: 0 0 1rem; }

.story-figure { margin: 0 0 1.5rem; }
.story-figure img {
  display: block;
  max-width: min(100%, 22rem);
  height: auto;
  background: var(--surface);
  border-radius: var(--radius, 8px);
}
.story-figure figcaption { margin-top: 0.5rem; color: var(--text-muted); font-size: var(--step--1, 0.9rem); line-height: 1.45; }
.story-caption { color: var(--text); font-style: italic; }

.story-prompt { margin: 1.5rem 0 0.75rem; font-weight: 600; }
.story-choices { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0 0 1.5rem; }
.story-choice {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.65rem 1.1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius, 8px);
  background: var(--bg-raised);
  color: var(--text);
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
}
.story-choice:hover { background: var(--bg-hover); }
.story-choice:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }

.story-end {
  margin: 1.5rem 0 1rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius, 8px);
  background: var(--surface);
  border-left: 4px solid var(--text-muted);
}
.story-end--solved { border-left-color: var(--success); }
.story-end--lost { border-left-color: var(--danger); }
.story-end-title { margin: 0 0 0.4rem; font-weight: 700; font-size: 1.15rem; }
.story-end p:last-child { margin-bottom: 0; line-height: 1.55; }

.story-from { margin: 0.5rem 0 0; border-top: 1px solid var(--border); padding-top: 0.75rem; }
.story-from summary { cursor: pointer; color: var(--text-muted); font-weight: 600; padding: 0.4rem 0; }
.story-from summary:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.story-quote {
  margin: 0.75rem 0;
  padding: 0 0 0 1rem;
  border-left: 3px solid var(--border-strong);
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.55;
}
.story-quote p { margin: 0 0 0.25rem; }
.story-quote a { color: var(--accent-text); text-decoration: underline; font-size: var(--step--1, 0.9rem); }
.story-quote-by { color: var(--text-muted); font-size: var(--step--1, 0.9rem); }
.story-quote-by a { color: var(--accent-text); text-decoration: underline; }

/* From across a room: larger text, choices as big targets. */
:root[data-tv] .story { max-width: 60rem; }
:root[data-tv] .story-text p { font-size: 1.25rem; }
:root[data-tv] .story-choice { min-height: 3.25rem; padding: 0.8rem 1.4rem; }

/* Human-made only (crate::made) leaves the story out: the beginning stays,
   with what the story is made from and the line saying what was left out. */
html[data-human-only] .story:has(.story-beat:target) .story-intro { display: block; }
