/*
 * Beat offline-guide: Waypoint, a museum placard with its guide on the running stage and
 * three numbered exhibit topics (web/landing/sections/offline-guide.html). Linked in the
 * page head by lib/landing.ts while the beat is enabled; the shells' sheets it builds on
 * are linked by the page itself, once each and before every section sheet. Every class
 * here starts with the beat id, and every rule is scoped by [data-beat]: the frame's
 * variant (offline-guide-waypoint) is styled here and nowhere else.
 *
 * Layout: the copy as a header, then the Waypoint window: Liris standing on the left, the
 * placard on the right (the gallery in mono, the exhibit in the serif, the object line in
 * the sans, then the three topics as large numbered buttons and the chosen topic's line),
 * and under the placard the local-assets list in mono, every file dim until it is in hand.
 * On a phone: the portrait, then the topics stacked full width, then the list.
 *
 * Type: the serif for the exhibit's name alone, mono for the gallery line, the topic
 * numbers and the asset list, the system sans for the object line, the topics and the line.
 */

/* ── The copy, as a header ─────────────────────────────────────────────── */

.use-case[data-beat="offline-guide"] .use-case-copy {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  grid-template-areas:
    "eyebrow eyebrow"
    "title body";
  align-items: end;
  gap: 0 clamp(28px, 5vw, 72px);
  margin: 0 0 clamp(24px, 4vh, 36px);
}

.use-case[data-beat="offline-guide"] .use-case-eyebrow { grid-area: eyebrow; }
.use-case[data-beat="offline-guide"] .use-case-title { grid-area: title; margin: 0; }
.use-case[data-beat="offline-guide"] .use-case-body { grid-area: body; padding-bottom: 6px; }

@media (max-width: 860px) {
  .use-case[data-beat="offline-guide"] .use-case-copy {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "eyebrow" "title" "body";
  }

  .use-case[data-beat="offline-guide"] .use-case-title { margin: 0 0 16px; }
}

/* ── The window: the guide standing, the placard beside her ───────────── */

[data-beat="offline-guide"] .offline-guide-stage {
  max-width: 280px;
  margin: 0 auto;
}

@container demo-frame (min-width: 640px) {
  [data-beat="offline-guide"] .demo-frame-body {
    grid-template-columns: clamp(220px, 32cqw, 320px) minmax(0, 1fr);
    grid-template-areas: "stage main" "stage aside";
    align-items: start;
    gap: 18px 28px;
    padding: 20px;
  }

  [data-beat="offline-guide"] .offline-guide-stage { max-width: none; }
}

/* The foot holds Pause, Replay and the status: nothing to show until the load starts. */
[data-beat="offline-guide"] .demo-frame:not([data-guide]) .demo-frame-foot,
[data-beat="offline-guide"] .demo-frame[data-guide="idle"] .demo-frame-foot { display: none; }

/* ── The placard ──────────────────────────────────────────────────────── */

[data-beat="offline-guide"] .offline-guide-placard {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 16px 18px 18px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--muted);
  border-radius: 4px 12px 12px 4px;
  background: var(--panel-2);
}

[data-beat="offline-guide"] .offline-guide-room {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

[data-beat="offline-guide"] .offline-guide-exhibit {
  margin: 2px 0 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(22px, 3cqw, 28px);
  line-height: 1.2;
}

[data-beat="offline-guide"] .offline-guide-object {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted);
}

/* Load guide assets: the placard's one primary control, above what it unlocks. */
[data-beat="offline-guide"] .offline-guide-load {
  justify-self: start;
  min-height: 40px;
  margin: 2px 0 4px;
  padding: 8px 18px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: filter .12s;
}

[data-beat="offline-guide"] .offline-guide-load:hover { filter: brightness(1.08); }
[data-beat="offline-guide"] .offline-guide-load:disabled { opacity: .6; cursor: default; filter: none; }
[data-beat="offline-guide"] .offline-guide-load[hidden] { display: none; }

/* The topics: large numbered buttons, one per line she says. */
[data-beat="offline-guide"] .offline-guide-topics {
  display: grid;
  gap: 8px;
  margin: 4px 0 6px;
  padding: 0;
  list-style: none;
}

[data-beat="offline-guide"] .offline-guide-topic {
  display: flex;
  align-items: baseline;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--ink);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: border-color .12s, opacity .15s;
}

[data-beat="offline-guide"] .offline-guide-topic:not(:disabled):hover { border-color: var(--muted); }
[data-beat="offline-guide"] .offline-guide-topic:disabled { opacity: .5; cursor: default; }
[data-beat="offline-guide"] .offline-guide-topic[aria-pressed="true"] { border-color: var(--accent); }

[data-beat="offline-guide"] .offline-guide-topic-n {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

[data-beat="offline-guide"] .offline-guide-topic[aria-pressed="true"] .offline-guide-topic-n { color: var(--accent); }

/* Her line: the topic's own button names it, so the line's label goes with a script. */
[data-beat="offline-guide"] .offline-guide-flow[data-reader-js] [data-segment-label] { display: none; }
[data-beat="offline-guide"] .offline-guide-flow .reader-flow-text { font-size: 15px; line-height: 1.55; }

/* ── The local assets ─────────────────────────────────────────────────── */

[data-beat="offline-guide"] .offline-guide-assets {
  display: grid;
  gap: 8px;
  min-width: 0;
}

[data-beat="offline-guide"] .offline-guide-assets-title {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

[data-beat="offline-guide"] .offline-guide-files {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.5;
}

[data-beat="offline-guide"] .offline-guide-file {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 10px;
  min-width: 0;
}

[data-beat="offline-guide"] .offline-guide-path {
  flex: 0 0 auto;
  min-width: 13.5em;
  color: var(--muted);
  overflow-wrap: anywhere;
}

[data-beat="offline-guide"] .offline-guide-marks {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0 10px;
  min-width: 0;
}

/* A file is dim until it is in hand; then it is lit with a dot. */
[data-beat="offline-guide"] .offline-guide-marks i {
  font-style: normal;
  color: var(--muted);
  opacity: .5;
  transition: opacity .15s, color .15s;
}

[data-beat="offline-guide"] .offline-guide-marks i[data-in] { color: var(--text); opacity: 1; }

[data-beat="offline-guide"] .offline-guide-marks i[data-in]::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin: 0 5px 1px 0;
  border-radius: 50%;
  background: var(--accent);
}

[data-beat="offline-guide"] .offline-guide-prepared {
  margin: 4px 0 0;
  font-size: 13.5px;
  font-weight: 600;
}

[data-beat="offline-guide"] .offline-guide-prepared[hidden] { display: none; }

[data-beat="offline-guide"] .offline-guide-prepared::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin: 0 8px 1px 0;
  border-radius: 50%;
  background: var(--accent);
}

/* ── A phone: the topics as big as a thumb ────────────────────────────── */

@container demo-frame (max-width: 639px) {
  [data-beat="offline-guide"] .offline-guide-topic { min-height: 54px; font-size: 16px; }
  [data-beat="offline-guide"] .offline-guide-load { justify-self: stretch; min-height: 48px; }
  [data-beat="offline-guide"] .offline-guide-path { min-width: 0; flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  [data-beat="offline-guide"] :is(.offline-guide-topic, .offline-guide-marks i) { transition: none; }
}
