/* Page layout only: placement, columns, spacing in cells. Look and states live in components.css.
   Two outer widths: the hero (up to 1600px) and the content column (--screen). */
body { padding-bottom: 5lh; overflow-x: hidden; }
.screen { max-width: var(--screen); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: 1ch; top: -3lh; z-index: 10; }
.skip:focus { top: 0; }

/* header */
.top { padding-block: 1lh 0; }
.top-line { display: flex; align-items: center; gap: 1ch; }
.top-line a { text-decoration: none; }
.top-fill { flex: 1; min-width: 1ch; }
.top nav { margin-top: 1lh; }

/* keep scrolled-to panels clear of the pinned player */
[box-] { scroll-margin: 2lh 0 7lh; }

/* main stack: two rows between panels */
main { display: grid; gap: 2lh; padding-block: 2lh; }
main:focus { outline: none; }
.stack { display: grid; gap: 2lh; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2lh 2ch; align-items: start; }
.split-wide { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.shop { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 2lh 2ch; align-items: start; }
.irc { display: grid; grid-template-columns: minmax(0, 1fr) 26ch; gap: 2lh 2ch; align-items: start; }
.actions { display: flex; flex-wrap: wrap; gap: 0 1ch; align-items: center; margin-top: 1lh; }
.lead-row { display: flex; justify-content: space-between; gap: 2ch; align-items: center; padding-inline: 1ch; }
.total { margin-top: 1lh; }
.ev-title { font-size: 1em; }

/* route head: a double box sized to its banner */
.head { justify-self: start; width: fit-content; max-width: 100%; min-width: min(100%, 30ch); }

/* rows with their own columns */
.row.tier { grid-template-columns: minmax(0, 1fr) 5ch 12ch; }
.row.show { grid-template-columns: minmax(0, 1fr) 16ch 20ch; }
.row.past { grid-template-columns: 11ch minmax(0, 1fr) auto; }
.row.past > :nth-child(2) { white-space: normal; }
.row.cart-line { grid-template-columns: minmax(0, 1fr) auto 6ch auto; }
.row.post { grid-template-columns: 11ch minmax(0, 1fr) 5ch; }
.row.post > :nth-child(2) { white-space: normal; }
.row.file { grid-template-columns: 3ch minmax(0, 1fr); }
.row.file > :last-child { text-align: left; white-space: normal; }
.nicks .row { grid-template-columns: 1ch minmax(0, 1fr) auto; }

/* art panels */
.hero { padding-block: 1lh; margin-inline: calc((100% - min(100vw - 2 * var(--gutter) - 2ch, 1600px)) / 2); }
.viz { height: 7lh; }
.viz-idle { position: absolute; inset: auto 0 2lh; text-align: center; }
.fields { display: grid; gap: 1lh; }
.tabbed { display: grid; gap: 1lh; }
.cmd { display: flex; gap: 1ch; align-items: center; }
.cmd .in { flex: 1; width: auto; }

/* footer */
.foot { padding-block: 0 2lh; }
.foot-sub { margin-top: 1lh; max-width: none; }

/* player: a full-width black strip pinned to the bottom; the frame sits on the content column */
.player { position: fixed; inset: auto 0 0 0; z-index: 5; background: var(--background0); }
.pl { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(16ch, 1fr) auto 12ch; grid-template-areas: "now ctl meter time viz" "x x x x x"; gap: 0 2ch; align-items: center; }
.pl-now { grid-area: now; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: none; }
.pl-ctl { grid-area: ctl; display: flex; gap: 1ch; }
.pl-meter { grid-area: meter; display: flex; min-width: 0; }
.pl-time { grid-area: time; white-space: nowrap; text-align: right; }
.pl-viz { grid-area: viz; height: 1lh; }
.pl-vol { flex: none; width: 12ch; }
.pl-x { grid-area: x; }
.pl-meter:has(a) { grid-column: meter-start / time-end; } /* "listen on …" takes the hidden time's room too */
.pl-meter a { white-space: normal; }
/* room for the Mixcloud strip or the SoundCloud credit under the controls */
body:has(.pl-x:not([hidden])) { padding-bottom: calc(5lh + 60px); }

@media (max-width: 860px) {
  .split, .split-wide, .shop, .irc { grid-template-columns: minmax(0, 1fr); }
  .row.show { grid-template-columns: minmax(0, 1fr) auto; }
  .row.show > :last-child { grid-column: 1 / -1; text-align: left; }
}
@media (max-width: 640px) {
  body { padding-bottom: 7lh; }
  main { gap: 2lh; }
  .top .menu { flex-wrap: nowrap; justify-content: space-between; gap: 0; }
  .top .menu kbd { display: none; }
  .top .menu li:has([data-key=v], [data-key=s]) { display: none; } /* no room for 9; the home menu still lists them */
  .pl { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "now now viz" "ctl ctl time" "meter meter meter" "x x x"; gap: 0 1ch; }
  body:has(.pl-x:not([hidden])) { padding-bottom: calc(7lh + 60px); }
  .row.post { grid-template-columns: minmax(0, 1fr) auto; }
  .row.post > :nth-child(2) { grid-area: 2 / 1 / 3 / -1; }
  .pl-viz { width: 10ch; }
  .row.past { grid-template-columns: 7ch minmax(0, 1fr); }
  .row.past > :last-child { display: none; }
  /* mixes: artist, then title on its own line */
  .row.mix { align-items: start; }
  .row.mix > :nth-child(2) { white-space: normal; }
  .row.mix .ar, .row.mix .ti { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .row.mix .sep { display: none; }
}
