/* Orpheus · css/components.css
   States of the shared lesson components (crates/orpheus-web/src/components:
   question bar, stage strip, prompt, drawings, piano, result card, level
   intro, checklist) that the Ma previews do not show. Everything the
   previews need is in css/ma.css. No literal colour: every colour is a
   token from style.css. Each block says why it exists. */

/* ---------- SYSTEM.md section 11: two gaps of the design CSS ---------- */
/* 11.2 A disabled quiet button (Undo before an entry) reads as unavailable. */
.btn--quiet:disabled { color: var(--muted); }
.btn--quiet:disabled .kbd { color: var(--faint); }
/* 11.3 A pressed piano key, and a key shown as a lit item. */
.piano .pk.is-down .kw, .piano .pk.is-played .kw { fill: var(--key-down); }
.piano .pk.is-down .kb, .piano .pk.is-played .kb { fill: var(--muted); }
/* The asked key carries a ring (a shape, read without colour), not the
   pressed fill: ink on a white key, light on a black key. */
.piano .kq { fill: none; stroke: currentColor; stroke-width: 2; color: var(--key-line); }
.piano .pk.is-black .kq { color: var(--key-white); }

/* ---------- Piano: other ranges, marks, labels ---------- */
/* The previews fix the keyboard at 15 white keys. The app also draws one
   octave (the intro picture) and custom ranges: --nk is the white key count. */
.piano { width: calc(var(--nk, 15) * 42px); }
.piano.is-live .pk { cursor: pointer; }
/* Right and wrong keys carry a tick or a cross at the top of the key. The
   tick takes the key-line colour, dark on the light key in both themes. On a
   black key (the group says is-black) both marks take the key-white colour:
   the shape tells them apart. */
.piano .km { color: var(--key-line); overflow: visible; }
.piano .pk.is-wrong .km { color: var(--bad); }
.piano .pk.is-black .km, .piano .pk.is-black.is-wrong .km { color: var(--key-white); }
/* A label on a black key. */
.piano .kl--b { fill: var(--key-white); }
/* Hotkey letters are for a computer keyboard: a phone has none. */
@media (max-width: 599px) {
  .piano .hk { display: none; }
}
.piano .pk.is-ghost .kl { fill: var(--muted); }
/* A page that wraps the component in its own .piano-wrap. */
.piano-wrap > .piano-wrap { margin-top: 0; width: 100%; }
/* A drawn keyboard inside the staff frame shrinks to the frame. */
.stage .piano { max-width: 100%; height: auto; }
@media (max-width: 599px) {
  .piano { width: calc(var(--nk, 15) * 44px); }
  .stage .piano { width: 100%; }
}

/* ---------- Staff: roles the previews do not show ---------- */
/* A played note that is neither right nor wrong (a reference tone, a
   comparison) is ink. A context note (the chord a tone belongs to) is muted. */
.staff .is-played { fill: var(--fg); }
.staff .is-ghost { fill: var(--muted); }
/* AnswerDrawing wraps the SVG string in a box that takes no space, so the
   svg.staff itself is the grid item of .stage--liss. */
.drawing { display: contents; }
/* With display: contents the svg is not a direct child of .stage--liss, so the
   grid area is given here. Without it the staff is auto-placed into the first
   cell and the phone row of figures overflows the page. */
.stage--liss .drawing > .staff { grid-area: staff; }

/* ---------- Status row: the stage strip placed as a sibling ---------- */
/* QuestionBar renders .lesson__status and takes the stage strip as its
   children. When a page puts StageChips after it instead, the strip is
   pulled up to the right end of the row. */
.lesson__status + .lesson__stages { height: 0; margin-top: calc(-1 * var(--s-5)); justify-content: flex-end; }
.lesson__status + .lesson__stages > * { position: relative; top: calc(var(--s-5) / 2); }
.lesson__status + .lesson__stages > .stage-name { top: calc(var(--s-5) / 2 - 10px); }
.lesson__status + .lesson__stages > .stations { top: calc(var(--s-5) / 2 - 6px); }
/* A page that wraps QuestionBar in its own .lesson__status. */
.lesson__status > .lesson__status { display: contents; }

/* ---------- Prompt (TaskPanel) ---------- */
/* The verdict and the Listen pass put a few words in ink and a control glyph before them. */
.prompt b { color: var(--fg); font-weight: var(--w-label); }
.prompt__mark { color: var(--fg); }
.prompt__mark.is-wrong { color: var(--bad); }
.prompt__note { color: var(--muted); }
.prompt__steps { display: inline-flex; align-items: center; gap: var(--s-1); color: var(--fg); }
.prompt__steps svg { width: var(--pic); height: var(--pic); }
/* The hint pictogram. */
.hint-mark { color: var(--fg); overflow: visible; }
.step-glyph { color: var(--fg); }

/* ---------- Checklist ---------- */
/* A condition that is not measured yet: a dashed faint ring. */
.cond.is-none { border-style: dashed; border-color: var(--faint); }
.checks__caption { margin-bottom: var(--s-3); }

/* ---------- Result card ---------- */
/* The Details fold spans the card. */
.result .fold { grid-column: 1 / -1; margin-top: 0; }
.result__unmet > span:first-child { flex: none; }
/* SYSTEM.md 11.10: the card on a phone stacks its parts. */
@media (max-width: 599px) {
  .result__score, .result__bar, .result__unmet { grid-column: 1 / -1; }
  .result__actions { flex-wrap: wrap; }
}

/* ---------- Level intro ---------- */
/* The card before a drill: the lesson head, the task, the goal, the
   picture in a staff frame, the item play buttons, the stage line, Begin. */
.intro { display: block; padding-top: var(--s-5); padding-bottom: var(--s-7); }
/* The card takes focus when it opens, so that Enter begins. The ring stays on the buttons. */
.intro:focus { outline: none; }
.intro__task { margin-top: var(--s-6); font-size: var(--fs-h2); line-height: var(--lh-h2); font-weight: var(--w-text); }
.intro__goal { margin-top: var(--s-2); max-width: 60ch; font-size: var(--fs-body); line-height: var(--lh-body); color: var(--muted); }
.intro__goal b { color: var(--fg); font-weight: var(--w-label); }
.intro__picture { margin-top: var(--s-5); }
.intro__items { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-2); margin-top: var(--s-5); margin-left: calc(-1 * var(--s-2)); }
.intro__items .fold { flex-basis: 100%; margin-top: 0; }
.intro__more { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-2); padding-left: 0; max-width: none; }
.intro__facts { margin-top: var(--s-4); height: auto; min-height: 20px; flex-wrap: wrap; row-gap: var(--s-1); white-space: normal; }
.intro__actions { display: flex; justify-content: flex-end; margin-top: var(--s-6); padding-top: var(--s-4); border-top: var(--hair) solid var(--rule); }
.intro .lesson__tools:empty { display: none; }
@media (max-width: 599px) {
  .intro { padding-top: var(--s-3); padding-bottom: var(--s-5); }
  .intro__task { margin-top: var(--s-5); }
  .intro__actions .btn--primary { width: 100%; }
}

/* ---------- Drawings of the notation crate ---------- */
/* Some view helpers still render with orpheus-notation (comparisons, chord
   members, progressions, dictation phrases). Until they move to the Ma
   staff they take its colours: ink, right in ink, wrong in red, context muted. */
.orpheus-notation { display: block; max-width: 100%; max-height: var(--stage-h); height: auto; color: var(--fg); }
.orpheus-notation .correct { color: var(--ok); }
.orpheus-notation .wrong { color: var(--bad); }
.orpheus-notation .ghost { color: var(--muted); }
.orpheus-notation text { font-family: var(--font-text); }
