/* =====================================================================
   The album page (#/album/<id>) -- see js/album-page.js. Everything is prefixed ap-.
   ===================================================================== */
.ap { --ap-label: .74rem; max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; gap: 28px; }
.ap a { color: inherit; }
.ap-noart { display: grid; place-items: center; background: linear-gradient(135deg, var(--surface-3), var(--accent-wash)); color: var(--accent-soft); font-weight: 600; text-transform: uppercase; }

/* ---- hero: cover + who/what + the stat boxes ---- */
.ap-hero { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 32px; align-items: center; }
.ap-cover { width: 260px; height: 260px; object-fit: cover; display: block; box-shadow: var(--shadow); font-size: 5rem; }
.ap-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ap-info .hud { font-size: .8rem; }
.ap-title { margin: 0; font-size: 2.6rem; line-height: 1.1; letter-spacing: .01em; overflow-wrap: anywhere; }
.ap-artist { font-size: 1.15rem; color: var(--silver); }
.ap-artist a:hover { color: var(--accent-soft); }
.ap-info .genre-row { margin: 4px 0 6px; }
.ap-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 6px; }
.ap-kpi { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 12px 10px; background: var(--surface); border: 1px solid var(--edge); min-width: 0; }
.ap-kpi b { font-size: 1.55rem; font-weight: 600; line-height: 1.1; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ap-kpi.accent b { color: var(--accent-scrobble); }
.ap-kpi span { margin-top: 4px; font-family: var(--font-mono); font-size: var(--ap-label); letter-spacing: .07em; text-transform: uppercase; color: var(--text-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ap-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ap-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--edge); border-radius: 999px; font-family: var(--font-mono);
  font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--silver); }
.ap-chip:hover { border-color: var(--accent); color: var(--text); }
.ap-chip.vinyl { color: var(--accent-vinyl); border-color: color-mix(in srgb, var(--accent-vinyl) 50%, transparent); }
.ap-chip.muted { color: var(--text-dim); }

/* ---- body: tracklist beside the side cards ---- */
.ap-body { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 24px; align-items: start; }
.ap-main, .ap-side { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.ap-card { padding: 20px 22px; background: var(--surface); border: 1px solid var(--edge); box-shadow: var(--shadow); min-width: 0; }
.ap-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.ap-head h2 { margin: 0; font-size: 1.15rem; font-weight: 500; letter-spacing: .03em; text-transform: uppercase; color: var(--silver); }
.ap-head .subtle { font-size: .82rem; }
.ap-head a.subtle:hover { color: var(--accent-soft); }

/* the tracklist: position, title, plays, length -- and a bar for how much it's played */
.ap-tracks { list-style: none; margin: 0; padding: 0; }
.ap-tracks li { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto 46px; align-items: center; gap: 10px; padding: 9px 4px 11px;
  border-bottom: 1px solid var(--edge); cursor: pointer; }
.ap-tracks li:hover { background: var(--accent-wash); }
.ap-pos { font-family: var(--font-mono); font-size: .76rem; color: var(--text-dim); }
.ap-tt { font-weight: 600; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-plays { font-family: var(--font-mono); font-size: .86rem; color: var(--silver); font-variant-numeric: tabular-nums; }
.ap-dur { font-family: var(--font-mono); font-size: .76rem; color: var(--text-dim); text-align: right; }
.ap-bar { position: absolute; left: 48px; bottom: 3px; height: 2px; width: calc((100% - 48px) * var(--w)); background: color-mix(in srgb, var(--accent) 70%, transparent); }
.ap-tracks li.ap-unplayed .ap-tt { font-weight: 400; color: var(--text-dim); }
.ap-tracks li.ap-unplayed .ap-plays { color: var(--text-muted); }
.ap-tracks li.ap-short .ap-tt { font-weight: 400; color: var(--text-dim); }
.ap-tooshort { font-family: var(--font-mono); font-size: .62rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); white-space: nowrap; }
.ap-group-label { margin: 16px 0 4px; font-family: var(--font-mono); font-size: var(--ap-label); letter-spacing: .12em; text-transform: uppercase; color: var(--accent-soft); }
.ap-group-label:first-of-type { margin-top: 0; }
.ap-quiet { margin-top: 14px; }
.ap-quiet summary { cursor: pointer; font-family: var(--font-mono); font-size: var(--ap-label); letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); }

/* your listening: plays a year */
.ap-years { display: flex; align-items: flex-end; gap: 3px; height: 70px; }
.ap-years i { flex: 1; min-width: 0; height: var(--h); background: color-mix(in srgb, var(--accent-scrobble) 45%, transparent); border-radius: 1px 1px 0 0; }
.ap-years i.pk { background: var(--accent-scrobble); }
.ap-years-cap { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font-family: var(--font-mono); font-size: .7rem; color: var(--text-dim); text-transform: uppercase; }
.ap-years-cap .pk { color: var(--accent-soft); }

/* your copies (the Vinyl page's pressing card, compact) */
.ap-copy { display: block; padding: 12px 14px; margin-bottom: 10px; border: 1px solid var(--edge); border-left: 3px solid var(--accent-vinyl); background: var(--surface-2); }
.ap-copy:last-child { margin-bottom: 0; }
.ap-copy:hover { border-color: var(--accent-vinyl); }
.ap-copy-top { display: flex; gap: 12px; align-items: flex-start; }
.ap-copy-art { width: 52px; height: 52px; object-fit: cover; flex: none; }
.ap-copy .pbadges { margin: 6px 0; }
.ap-copy .pbadge.og { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }

/* heard live: songs x shows */
.ap-livegrid { display: grid; grid-template-columns: minmax(120px, 1fr) repeat(var(--cols), minmax(26px, 34px)) 36px; align-items: center; gap: 0; margin-bottom: 12px; overflow-x: auto; }
.ap-lg-col { font-family: var(--font-mono); font-size: .7rem; color: var(--text-dim); text-align: center; padding: 0 0 6px; }
a.ap-lg-col:hover { color: var(--accent-live); }
.ap-lg-song { padding: 7px 8px 7px 0; border-top: 1px solid var(--edge); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; font-weight: 600; font-size: .95rem; }
.ap-lg-song:hover { color: var(--accent-soft); }
.ap-lg-cell { align-self: stretch; display: grid; place-items: center; border-top: 1px solid var(--edge); font-size: .7rem; color: var(--accent-live); }
.ap-lg-cell:not(.on)::before { content: "·"; color: var(--text-muted); }
.ap-lg-n { align-self: stretch; display: grid; place-items: center end; border-top: 1px solid var(--edge); font-family: var(--font-mono); font-size: .78rem; color: var(--silver); }
.ap-lastshow { font-size: .86rem; color: var(--accent-live); }

/* more by the artist: a grid in the side column */
.ap-more { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.ap-more a { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ap-more b { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-more .subtle { font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-more a:hover b { color: var(--accent-soft); }

/* a row of album covers across the page: similar albums */
.ap-shelf { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 16px; }
.ap-shelf a { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ap-more-art { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; font-size: 2rem; }
.ap-shelf b { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-shelf .subtle { font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-shelf a:hover b { color: var(--accent-soft); }
.ap-extras { margin-top: 16px; }
.vinyl-dot { color: var(--accent-vinyl); }


@media (max-width: 1000px) {
  .ap-body { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .ap { --ap-label: .64rem; gap: 18px; }
  .ap-hero { grid-template-columns: 1fr; gap: 16px; justify-items: center; text-align: center; }
  .ap-cover { width: min(62vw, 240px); height: min(62vw, 240px); }
  .ap-info { align-items: center; width: 100%; }
  .ap-info .genre-row { justify-content: center; }
  .ap-title { font-size: 1.8rem; }
  .ap-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: 8px; }
  .ap-kpi b { font-size: 1.25rem; }
  .ap-links { justify-content: center; }
  .ap-card { padding: 14px; }
  .ap-tracks li { grid-template-columns: 28px minmax(0, 1fr) auto 40px; gap: 8px; }
  .ap-bar { left: 40px; width: calc((100% - 40px) * var(--w)); }
  .ap-tt { font-size: .92rem; }
  /* the shelves scroll sideways on a phone */
  .ap-shelf { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; padding-bottom: 4px; }
  .ap-shelf a { flex: 0 0 34%; scroll-snap-align: start; }
}
