/*
 * Beat expressive-dialogue: Moodroom, a casting rehearsal sheet with Mika in one large
 * portrait and eight takes of one line (web/landing/sections/expressive-dialogue.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 (expressive-dialogue-moodroom) is styled here and
 * nowhere else.
 *
 * Layout: the copy as a header over the window (the title and the line side by side
 * while there is room), the window the page's width. In the window the portrait on the
 * left and the sheet on the right; below 640 px of frame, the portrait above the sheet.
 * The sheet: the slate (take number and emotion, mono), the line (the serif, quoted),
 * the eight takes (mono ids, four by two, wrapped on a phone). Previous, Next and Hear
 * sit in the frame's toolbar, the line's time in its status.
 */

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

.use-case[data-beat="expressive-dialogue"] .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="expressive-dialogue"] .use-case-eyebrow { grid-area: eyebrow; }
.use-case[data-beat="expressive-dialogue"] .use-case-title { grid-area: title; margin: 0; }
.use-case[data-beat="expressive-dialogue"] .use-case-body { grid-area: body; padding-bottom: 6px; }

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

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

/* ── Inside the window: the portrait and the sheet ─────────────────────── */

[data-beat="expressive-dialogue"] .demo-frame-body {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "stage" "main";
}

@container demo-frame (min-width: 640px) {
  [data-beat="expressive-dialogue"] .demo-frame-body {
    grid-template-columns: minmax(260px, 1fr) minmax(0, 1fr);
    grid-template-areas: "stage main";
    align-items: center;
    gap: clamp(20px, 3.5cqi, 40px);
    padding: clamp(16px, 2.4cqi, 28px);
  }
}

[data-beat="expressive-dialogue"] .demo-frame-slot[data-slot="stage"] {
  display: flex;
  justify-content: center;
}

[data-beat="expressive-dialogue"] .expressive-dialogue-portrait { max-width: 520px; }

/* ── The sheet ─────────────────────────────────────────────────────────── */

[data-beat="expressive-dialogue"] .expressive-dialogue-sheet {
  display: grid;
  gap: clamp(16px, 2.6cqi, 26px);
  min-width: 0;
}

/* The slate: the take's number and its emotion, as a rehearsal sheet marks a take. */
[data-beat="expressive-dialogue"] .expressive-dialogue-slate {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  margin: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

[data-beat="expressive-dialogue"] .expressive-dialogue-slate-take {
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

[data-beat="expressive-dialogue"] .expressive-dialogue-slate-emotion {
  padding-left: 14px;
  border-left: 1px solid var(--line);
  color: var(--text);
}

/* The line, in the book voice: the serif, quoted, never bold. */
[data-beat="expressive-dialogue"] .expressive-dialogue-line {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(22px, 3.4cqi, 30px);
  line-height: 1.3;
  color: var(--text);
  text-wrap: pretty;
}

[data-beat="expressive-dialogue"] .expressive-dialogue-line q { quotes: "\201C" "\201D"; }

/* ── The eight takes ───────────────────────────────────────────────────── */

[data-beat="expressive-dialogue"] .expressive-dialogue-takes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

[data-beat="expressive-dialogue"] .expressive-dialogue-takes[hidden] { display: none; }

@container demo-frame (min-width: 640px) {
  [data-beat="expressive-dialogue"] .expressive-dialogue-takes {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* A take is a slate card: its number over its emotion. */
[data-beat="expressive-dialogue"] .expressive-dialogue-take {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
  min-height: 44px;
  padding: 8px 12px 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  transition: border-color .12s, background-color .12s;
}

[data-beat="expressive-dialogue"] .expressive-dialogue-take[hidden] { display: none; }
[data-beat="expressive-dialogue"] .expressive-dialogue-take:hover { border-color: var(--muted); }

[data-beat="expressive-dialogue"] .expressive-dialogue-take-number {
  font-size: 10.5px;
  letter-spacing: .08em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

[data-beat="expressive-dialogue"] .expressive-dialogue-take-name { min-width: 0; }

/* The take chosen: marked in the accent, which the frame keeps solid for Hear alone. */
[data-beat="expressive-dialogue"] .expressive-dialogue-take[aria-pressed="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--panel-2));
}

[data-beat="expressive-dialogue"] .expressive-dialogue-take[aria-pressed="true"] .expressive-dialogue-take-number { color: var(--accent); }

/* ── The toolbar: Previous, Next, Hear ─────────────────────────────────── */

[data-beat="expressive-dialogue"] .expressive-dialogue-icon {
  width: 12px;
  height: 12px;
  flex: none;
}

[data-beat="expressive-dialogue"] .expressive-dialogue-icon[hidden] { display: none; }

[data-beat="expressive-dialogue"] .expressive-dialogue-hear { margin-left: auto; }

@container demo-frame (max-width: 420px) {
  [data-beat="expressive-dialogue"] .expressive-dialogue-hear {
    order: -1;
    flex-basis: 100%;
    justify-content: center;
    margin-left: 0;
  }

  [data-beat="expressive-dialogue"] :is(.expressive-dialogue-prev, .expressive-dialogue-next) {
    flex: 1 1 0;
    justify-content: center;
  }
}
