/* ==========================================================================
   MUSIC - THE RISE UP TRACK DIRECTORY (music.html, Sept 28 2026)
   A flat, scannable list of all 28, for reading: what each track is about,
   its running time and a 20-second preview. The home carousel is the
   immersive version; this is the index. See the note at the top of
   music.html for why the page exists and what it must not carry.

   Palette, per css/transmissions.css's reading of the brand audit: no
   crimson here at all (it is a "rare interruption" and this page has
   nothing to interrupt), and moonlight only as --text-secondary copy.
   The one colour that varies is each track's own accentColor from
   data/tracks.json, arriving as --track-accent on the <li>; it only ever
   marks the playing/targeted row and the preview's progress fill.
   ========================================================================== */

.music-page {
  padding-top: calc(var(--space-24) + 3rem);
  padding-bottom: var(--space-24);
}

/* ---- Intro ---- */
.music-intro { max-width: 68ch; margin-bottom: var(--space-12); }
.music-intro h1 {
  font-size: calc(var(--fs-h1) * 1.35);
  line-height: var(--lh-tight);
  margin: var(--space-2) 0 var(--space-3);
}
.music-intro__meta {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-6);
}
.music-intro p:not(.music-intro__meta):not(.music-intro__actions) { color: var(--text-secondary); }
.music-intro__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-8);
}

/* ---- The list ----
   Each row sits on a translucent scrim rather than a solid panel, the same
   reasoning as the edition cards in css/purchase.css: the sky behind the
   page is the page, and a solid panel would delete it for the full height of
   the list. The two stops are purchase.css's own card gradient (0.42 -> 0.66
   of --color-black), so body copy here reads against the sky exactly as the
   purchase cards' copy already does. */
.tracklist {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: var(--border-hairline);
}
.tracklist__item {
  position: relative;
  display: grid;
  grid-template-columns: 3ch 80px minmax(0, 1fr) auto;
  gap: var(--space-6);
  align-items: start;
  padding: var(--space-6) var(--space-6) var(--space-6) var(--space-4);
  border-bottom: var(--border-hairline);
  background: linear-gradient(180deg, rgba(3, 4, 15, 0.42) 0%, rgba(3, 4, 15, 0.66) 100%);
  /* Deep links (/music#spine-glow, and the MusicRecording urls in the
     JSON-LD) land the row below the fixed nav rather than under it. */
  scroll-margin-top: calc(var(--nav-h) + var(--space-6));
}
/* The accent edge: shown on the row a deep link targets and on the row whose
   preview is playing. Inset shadow, not a border, so the grid does not move. */
.tracklist__item:target,
.tracklist__item.is-playing {
  box-shadow: inset 3px 0 0 var(--track-accent);
}

.tracklist__num {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: var(--tracking-mono);
  color: var(--text-muted);
  padding-top: 0.35em;
}
.tracklist__art {
  display: block;
  width: 80px;
  height: 80px;
  object-fit: cover;
  border: var(--border-hairline);
  background: var(--bg-secondary);
}
.tracklist__title {
  font-family: var(--font-display);
  font-weight: var(--display-wght);
  font-stretch: var(--display-stretch);
  font-variation-settings: "wdth" var(--display-wdth), "wght" var(--display-wght);
  font-size: var(--fs-h3);
  line-height: var(--lh-heading);
  letter-spacing: var(--tracking-heading);
  text-transform: uppercase;
  margin: 0 0 var(--space-2);
}
.tracklist__oneliner { color: var(--text-primary); margin-bottom: var(--space-2); }
.tracklist__desc {
  color: var(--text-secondary);
  font-size: var(--fs-caption);
  line-height: var(--lh-body);
}
/* One line of lyric, when data/tracks.json's visualTheme.lyricFragment is
   filled. Never a verse - see music.html. */
.tracklist__lyric {
  margin: var(--space-4) 0 0;
  padding-left: var(--space-4);
  border-left: 2px solid var(--track-accent);
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  color: var(--text-primary);
}

.tracklist__side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-3);
}
.tracklist__time {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: var(--tracking-mono);
  color: var(--text-muted);
  padding-top: 0.35em;
}

/* ---- The preview button ----
   Interface type like every button (Rajdhani), 44px minimum like .btn in
   css/components.css. --p (0..1) is written by js/music-previews.js ON THIS
   BUTTON, never on <html>: a per-frame custom-property write on the root
   restyles the whole document in Firefox (measured 2026-09-08, see memory
   and css notes), a write on one button restyles one button. */
.tracklist__play {
  --p: 0;
  position: relative;
  overflow: hidden;
  min-height: 44px;
  min-width: 7.5rem;
  padding: 0 var(--space-4);
  font-family: var(--font-label);
  font-weight: 600;
  font-size: var(--fs-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-primary);
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sharp);
  cursor: pointer;
  transition: border-color var(--motion-fast) var(--ease-standard),
              background var(--motion-fast) var(--ease-standard);
}
.tracklist__play::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--track-accent);
  opacity: 0.55;
  transform: scaleX(var(--p));
  transform-origin: left center;
}
.tracklist__play-label { position: relative; }
.tracklist__play:hover { border-color: var(--color-white); }
.tracklist__play[aria-pressed="true"] { border-color: var(--color-white); }
.tracklist__play.is-unavailable { opacity: 0.4; cursor: not-allowed; }

/* ---- Outro ---- */
.music-outro {
  max-width: 68ch;
  margin-top: var(--space-16);
}
.music-outro .label { display: block; margin-bottom: var(--space-2); }
.music-outro p { color: var(--text-secondary); }

/* ---- Phones ----
   Four columns do not fit at 320-412px. The art keeps the left edge and
   spans two rows; the number becomes an eyebrow above the title (kept, not
   hidden - it is how someone finds "track 14"); time and preview become one
   row across the bottom. */
@media (max-width: 600px) {
  .tracklist__item {
    grid-template-columns: 56px minmax(0, 1fr);
    grid-template-areas:
      "art  num"
      "art  body"
      "side side";
    gap: var(--space-1) var(--space-4);
    padding: var(--space-4) var(--space-4) var(--space-4) var(--space-3);
  }
  .tracklist__num  { grid-area: num; padding-top: 0; }
  .tracklist__art  { grid-area: art; width: 56px; height: 56px; }
  .tracklist__body { grid-area: body; }
  .tracklist__side {
    grid-area: side;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--space-3);
  }
  .tracklist__time { padding-top: 0; }
}
