/* The Band drawer's rows (js/bandrows.js): Drums, Bass, Guitar and Keys in a line, each the switch on the left,
   then the name, then what it plays (dim), then the plus or the chevron. And the simple Play layer that Drums,
   Bass and Keys open for now (the guitar's is in guitar.css). Nick's side.
   Everything sits on Moon, in the drawer or in a Moon-toned sheet (drill.css), built from v2.css's --moon-*
   tokens and the Moon keys in chords.css (.mkey). No drop shadows: depth is Moon's bevels and hairlines.
   The switch is v2.css's Moon switch (.drawers .chip[data-part]); this file only makes it a small control. */

/* ---------- Glance: the rows ---------- */

.brows {
  margin: 0;
  padding: 0;
  list-style: none;
}

.brow {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  column-gap: 14px;
  align-items: center;
  transition: opacity 220ms var(--ease-out);
}

.brow + .brow {
  border-top: 1px solid var(--moon-line);
}

/* The switch: Moon's slide switch, on or off printed in its track (v2.css), a fixed 58px with no word on it now.
   Its thumb sits 35px from the right, so with no padding or border it rests 3px inside the track. */
.drawers .brow .brow-sw {
  grid-column: 1;
  justify-content: flex-start;
  gap: 0;
  width: 58px;
  min-height: 44px;
  padding: 0;
  border-width: 0;
}

.brow-h {
  grid-column: 2;
  min-width: 0;
  margin: 0;
  font: inherit;
}

/* The name and what it plays: one button, so the whole row opens the player. */
.brow-go {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 52px;
  padding: 6px 2px 6px 4px;
  border-radius: 10px;
  color: var(--moon-ink);
  text-align: left;
}

/* The names keep one width, so what they play starts in one line too. */
.brow-name {
  flex: none;
  min-width: 3.6em;
  font-size: 15px;
  font-weight: 500;
}

.brow-sum {
  flex: 1;
  min-width: 0;
  color: var(--moon-mtext);
  font-size: 14px;
  line-height: 1.35;
  /* On a phone a long one takes two even lines ("Hollowbody ·" over "Every beat"), not a word left alone. */
  text-wrap: balance;
}

.brow-go .pm {
  flex: none;
  color: var(--moon-mtext);
}

.brow-go[aria-expanded="true"] .pm-v {
  opacity: 0;
}

.brow-go:focus-visible {
  outline-offset: 0;
}

/* Off: the name goes quiet with what it plays; the switch says off. */
.brow.is-off .brow-name {
  color: var(--moon-mtext);
}

@media (hover: hover) {
  .brow-go:hover {
    background-color: color-mix(in srgb, var(--moon-ink) 4%, transparent);
  }
}

/* A plus in place on wide screens, a chevron where the layer slides up as a sheet (phones). */
.brow-chev {
  display: none;
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--moon-mtext);
}

@media (max-width: 639px) {
  .brow {
    column-gap: 12px;
  }

  .brow-go {
    gap: 12px;
  }

  .brow-go .pm {
    display: none;
  }

  .brow-chev {
    display: block;
  }
}

/* The layer grows here, the row's full width (js/drill.js). */
.brow-slot {
  grid-column: 1 / -1;
  min-width: 0;
}

.brow-slot[hidden] {
  display: none;
}

/* ---------- Play: the simple layer for Drums, Bass and Keys ---------- */

.brp {
  --b-raised: inset 0 1px 0 var(--moon-raised-hl), 0 2px 0 var(--moon-raised-edge), 0 7px 11px -7px rgba(0, 0, 0, .35), 0 0 0 1px var(--moon-raised-rim);
  --b-key: inset 0 1px 0 rgba(255, 255, 255, .16), 0 3px 0 var(--moon-key-edge), 0 9px 14px -6px rgba(0, 0, 0, .5), 0 0 0 1px var(--moon-key-rim);
  container: brp / inline-size;
  padding: 4px 0 16px;
  color: var(--moon-ink);
}

.drill .brp {
  padding-top: 0;
}

/* The band's Play (Moon's dark key) and a line on when a change is heard. */
.brp-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.brp-go {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 16px 0 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--moon-key-hi), var(--moon-key-lo));
  box-shadow: var(--b-key);
  color: var(--moon-key-ink);
  font-size: 14px;
  font-weight: 500;
  transition: scale var(--t) ease;
}

.brp-go .ic {
  width: 16px;
  height: 16px;
}

.brp-go:active {
  scale: .98;
}

.brp-status {
  flex: 1;
  min-width: 0;
  margin: 0;
  color: var(--moon-mtext);
  font-size: 13px;
  line-height: 1.4;
}

.brp-sec + .brp-sec {
  margin-top: 20px;
}

.brp-h {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
}

/* Drums: the groove families as Moon's raised keys, the picked one dark (chords.css .mkey). */
.brp-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 8px;
}

.brp-key {
  padding: 0 14px;
}

/* The choices: raised cards, the name above a line on what it does; picked is Moon's dark key. */
.brp-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

@container brp (min-width: 520px) {
  .brp-cards {
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  }
}

.brp-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  min-height: 68px;
  padding: 11px 13px 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--moon-raised), var(--moon-raised-lo));
  box-shadow: var(--b-raised);
  color: var(--moon-ink);
  text-align: left;
  transition: scale var(--t) ease;
}

.brp-card[aria-pressed="true"] {
  background: linear-gradient(180deg, var(--moon-key-hi), var(--moon-key-lo));
  box-shadow: var(--b-key);
  color: var(--moon-key-ink);
}

.brp-card:active {
  scale: .98;
}

.brp-card:focus-visible {
  outline-offset: 2px;
}

.brp-card-name {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.25;
}

.brp-card-line {
  color: var(--moon-mtext);
  font-size: 12.5px;
  line-height: 1.4;
}

.brp-card[aria-pressed="true"] .brp-card-line {
  color: color-mix(in srgb, var(--moon-key-ink) 72%, transparent);
}

@media (hover: hover) {
  .brp-go:hover {
    filter: brightness(1.08);
  }

  .brp-card:not([aria-pressed="true"]):hover {
    box-shadow: inset 0 1px 0 var(--moon-raised-hl), 0 2px 0 var(--moon-raised-edge), 0 7px 11px -7px rgba(0, 0, 0, .35), 0 0 0 1.5px var(--moon-ink);
  }
}

/* ---------- calm: reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .brow,
  .brp-go,
  .brp-card {
    transition: none;
  }

  .brp-go:active,
  .brp-card:active {
    scale: none;
  }
}
