/* EMCEE4D — www.mc4d.com | Catalogue, singles & collection pages.
   Loaded after site.css (and album-page.css) on the Discography (/music/), the Albums and Singles indexes and each single
   page (scripts/generate-single-page.js, generate-collection-pages.js, generate-music-page.js).
   Scoped classes: .cat-*, .sp-*, .collection-*. Same dark tokens as the rest of the site (var(--bg), --surface, --line,
   --accent...). No inline styles: the site CSP forbids them.

   CTA hierarchy used everywhere: ONE solid crimson primary per decision (.btn-primary: play / listen / explore),
   outlined secondary (.btn: view all, read the story, back), text links for breadcrumbs. */

/* ============================================================ catalogue grid + cards ==== */
/* 3-up desktop, 2-up tablet, 1-up phone. minmax(0,1fr) lets long titles wrap instead of widening a column. */
.cat-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; margin: 8px 0 0; }
@media (min-width: 640px) { .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; } }
@media (min-width: 1000px) { .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px; } }

/* One card anatomy for albums AND singles (the album card's markup is unchanged; this only restyles it inside a grid). */
.cat-grid .album-feature {
  position: relative;
  height: 100%;
  padding: 16px 16px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color 200ms ease, transform 200ms ease;
}
.cat-grid .album-feature:focus-within { border-color: var(--accent); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .cat-grid .album-feature:hover { border-color: var(--accent); transform: translateY(-3px); }
}
/* Album artwork inside a card: same frame as a single's, no blurred glow or offset hairline (those need room the grid does not have). */
.cat-grid .album-feature .release-art { max-width: none; width: 100%; margin: 0 0 18px; }
.cat-grid .album-feature .release-art::before,
.cat-grid .album-feature .release-art::after { display: none; }
.cat-grid .album-feature .release-art-frame { box-shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.9); }

.cat-grid .album-feature-label { margin-bottom: 6px; }
.cat-grid .album-feature-title { font-size: clamp(1.6rem, 3vw, 2rem); letter-spacing: 0.07em; margin-bottom: 8px; overflow-wrap: anywhere; }
.cat-grid .album-feature-headline { font-size: 1.05rem; max-width: none; margin: 2px 0 10px; }
.cat-grid .release-meta { margin-bottom: 10px; }
/* Album descriptions are approved copy and are shown in full. A single's discovery copy is short by design (<= 240 characters);
   the clamp is only a safety net so a long fallback description can never make one card tower over its neighbours. */
.cat-grid .album-feature-desc { max-width: none; margin-bottom: 22px; }
.cat-grid .album-feature--single .album-feature-desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  line-clamp: 5;
  overflow: hidden;
}
/* One CTA height across a row, whatever the title length. */
.cat-grid .album-feature-cta { display: flex; align-items: center; justify-content: center; max-width: none; width: 100%; min-height: 58px; margin-top: auto; }

/* Single card artwork: framed like an album cover, whole image shown (never cropped), optional status badge overlaid. */
.cat-art {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  margin: 0 0 18px;
  background: #0a0a0c;
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.9);
}
.cat-art img { display: block; width: 100%; height: 100%; object-fit: contain; }
.cat-art--empty { display: flex; align-items: center; justify-content: center; }
.cat-art-mark { font-family: var(--display); font-size: 2.4rem; letter-spacing: 0.16em; color: var(--muted); }
.cat-title-link { color: inherit; }
.cat-title-link:hover { color: var(--accent-soft); }
/* Type label and optional status badge share one row under the artwork (never over it: cover art carries its own lettering). */
.cat-label-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 6px; }
.cat-label-row .album-feature-label { margin: 0; }

/* Lone item in a grid (e.g. the first single): a wider two-column feature card instead of one lonely column. */
@media (min-width: 720px) {
  .cat-grid--featured { grid-template-columns: minmax(0, 1fr); }
  .cat-grid--featured .album-feature {
    display: grid;
    grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
    grid-auto-rows: min-content;
    column-gap: 40px;
    align-content: start;
    padding: 24px;
  }
  .cat-grid--featured .album-feature > :first-child { grid-column: 1; grid-row: 1 / span 8; align-self: start; margin-bottom: 0; }
  .cat-grid--featured .album-feature > :not(:first-child) { grid-column: 2; }
  .cat-grid--featured .album-feature-title { margin-top: 6px; font-size: clamp(2rem, 4vw, 2.8rem); }
  .cat-grid--featured .album-feature-desc { -webkit-line-clamp: 8; line-clamp: 8; font-size: 1.02rem; max-width: 52ch; }
  .cat-grid--featured .album-feature-cta { max-width: 320px; }
}

/* Compact variant ("More from EMCEE4D"): artwork, label, title, meta and the button only. */
.cat-grid .album-feature[hidden] { display: none; }
.cat-more { display: flex; flex-direction: column; align-items: center; gap: 14px; margin: 44px 0 4px; text-align: center; }
.cat-more[hidden] { display: none; }
.cat-more-status { margin: 0; color: var(--muted, #b9b3c4); font-size: 0.92rem; letter-spacing: 0.04em; }
.cat-more-btn { min-height: 52px; min-width: min(100%, 280px); }
.cat-grid--compact .album-feature-headline,
.cat-grid--compact .album-feature-desc { display: none; }
.cat-grid--compact .album-feature-title { margin-bottom: 10px; }
.cat-grid--compact .release-meta { margin-bottom: 16px; }

/* ============================================================ badges + metadata ==== */
.cat-badge, .sp-badge {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid var(--line);
  background: rgba(11, 11, 13, 0.82);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
  white-space: nowrap;
}
.cat-badge--new { background: var(--accent); border-color: var(--accent); color: #fff; }
.cat-badge--soon { border-color: var(--accent); color: var(--accent-soft); }
.cat-badge--draft { border: 1px dashed var(--accent); color: var(--accent-soft); }
.sp-badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.sp-badge--type { color: var(--text); }

/* ============================================================ collection pages (Music / Albums / Singles) ==== */
.collection-crumb {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.collection-crumb:hover { color: var(--accent-soft); }
.collection-links { display: flex; flex-wrap: wrap; gap: 14px; margin: 4px 0 0; }
.collection-links .btn { min-height: 44px; }
.collection-count { color: var(--muted); font-size: 0.85rem; letter-spacing: 0.04em; margin: -22px 0 28px; }

/* A catalogue section on /music/: kicker + heading on the left, "View all" on the right. */
.cat-section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 24px; margin: 0 0 28px; }
.cat-section-head h2 { margin: 0; }
.cat-section-head .kicker { margin-bottom: 8px; }
.cat-section-head .btn { min-height: 44px; }
.cat-section + .cat-section { border-top: 1px solid var(--line); }

/* Section jump chips (Music header; single page "On this page"). */
.cat-chips, .sp-jump ul { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.cat-chips a, .sp-jump a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}
.cat-chips a:hover, .sp-jump a:hover { border-color: var(--accent); color: var(--text); }

/* Index pages with no entries yet: an honest, quiet empty state (never a placeholder card). */
.collection-empty { max-width: 56ch; padding: 24px 0 8px; color: var(--muted); }
.collection-empty p { margin-bottom: 18px; }

/* ============================================================ single page: hero ==== */
.sp-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.sp-breadcrumb li + li::before { content: "/"; margin-right: 10px; color: #4a4a52; }
.sp-breadcrumb a { color: var(--muted); }
.sp-breadcrumb a:hover { color: var(--accent-soft); }
.sp-breadcrumb [aria-current="page"] { color: var(--text); overflow-wrap: anywhere; }

.release--solo { grid-template-columns: 1fr; }
.release--solo .release-title { max-width: 20ch; }
.sp-hero-cover { max-width: 420px; }
/* The base .release-art blurs The Introduction's cover behind the art. A single must never borrow an album's artwork, so no
   glow image here: a soft shadow instead. */
.sp-hero-cover::before { background-image: none; opacity: 0; }
.sp-hero-cover .release-art-frame { box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.95); }
.sp-cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin: 0 0 4px; }
.sp-cta-row .btn { min-height: 48px; }
.ap-preview-notice { margin-top: 18px; max-width: 560px; }

/* ============================================================ single page: jump navigation ==== */
.sp-jump { padding: 0 20px; background: var(--bg); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sp-jump .wrap { padding: 14px 0; overflow-x: auto; scrollbar-width: thin; }
.sp-jump ul { flex-wrap: nowrap; }
.sp-jump-label { display: block; margin-bottom: 10px; }
section[id], .sp-anchor { scroll-margin-top: 84px; }

/* ============================================================ single page: player ==== */
.sp-player .ap-now { grid-template-columns: 1fr; }
.sp-player.sp-player--art .ap-now { grid-template-columns: 120px 1fr; }
@media (min-width: 720px) {
  .sp-player.sp-player--art .ap-now { grid-template-columns: 200px 1fr; }
}
.sp-player .ap-tracks { margin-top: 18px; }
/* album-page.css gives .ap-controls display:flex, which would override the [hidden] attribute. A single has no previous/next. */
.sp-player .ap-controls[hidden] { display: none; }

/* ============================================================ single page: story + essay ==== */
.sp-section-tight { padding-top: 56px; padding-bottom: 56px; }
.sp-prose { max-width: 66ch; }
.sp-prose p { color: var(--muted); margin-bottom: 1.3em; line-height: 1.8; }
/* The first paragraph of the short story is the standfirst. */
.sp-prose .sp-standfirst {
  color: var(--text);
  font-family: var(--display);
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  letter-spacing: 0.04em;
  line-height: 1.2;
  max-width: 28ch;
  margin-bottom: 0.9em;
}

/* Extended editorial: a reading column (66ch), generous rhythm, real hierarchy. */
.sp-essay { max-width: 66ch; }
.sp-essay-title { font-size: clamp(2rem, 5.5vw, 3.2rem); line-height: 1.08; margin: 0 0 36px; text-transform: none; letter-spacing: 0.04em; }
.sp-essay p { margin: 0 0 1.5em; color: #bdbab3; font-size: 1.05rem; line-height: 1.85; }
.sp-essay p em { color: var(--text); font-style: italic; }
.sp-essay .sp-essay-lede { color: var(--text); font-size: 1.22rem; line-height: 1.7; }
.sp-essay-figure { margin: 2.2em 0; padding: 0; border: 1px solid var(--line); background: #0e0e12; line-height: 0; }
.sp-essay-figure img { display: block; width: 100%; height: auto; }
.sp-essay-h {
  margin: 64px 0 20px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-family: var(--display);
  font-size: clamp(1.4rem, 3.4vw, 1.9rem);
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1.2;
  color: var(--accent-soft);
}
.sp-pullquote {
  margin: 56px 0;
  padding: 6px 0 6px 24px;
  border-left: 3px solid var(--accent);
  max-width: 34ch;
}
.sp-pullquote p {
  margin: 0;
  color: var(--text);
  font-family: var(--display);
  font-size: clamp(1.6rem, 4.2vw, 2.4rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.2;
}
.sp-toc { margin: 0 0 44px; padding: 18px 20px; border: 1px solid var(--line); background: var(--surface); }
.sp-toc-label { display: block; margin-bottom: 10px; }
.sp-toc ol { margin: 0; padding: 0; list-style: none; color: var(--muted); }   /* headings carry their own numbering: no automatic numbers */
.sp-toc li { margin: 6px 0; }
.sp-toc .sp-toc-introduction { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.sp-toc .sp-toc-epilogue { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.sp-toc-tag, .sp-essay-tag { display: inline-block; margin-right: 0.6em; color: var(--accent-soft); font-family: var(--body, inherit); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; vertical-align: 0.12em; }
.sp-essay-h--introduction, .sp-essay-h--epilogue { border-top-color: var(--accent); }
.sp-essay-h--introduction .sp-essay-tag { display: block; margin: 0 0 8px; }
.sp-toc a { color: var(--text); }
.sp-toc a:hover { color: var(--accent-soft); }

/* ============================================================ single page: supporting visuals (0-3) ==== */
/* The section is simply absent with zero visuals; the page never reserves space for them. */
.sp-visuals { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; margin: 0; }
.sp-visual { margin: 0; min-width: 0; }
.sp-visual .vg-open { display: block; width: 100%; aspect-ratio: auto; padding: 0; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.9); }
.sp-visual img { display: block; width: 100%; height: auto; }
.sp-visual figcaption { margin-top: 12px; color: var(--muted); font-size: 0.85rem; line-height: 1.6; max-width: 68ch; }
@media (min-width: 720px) {
  .sp-visuals--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sp-visuals--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sp-visuals--3 .sp-visual:first-child { grid-column: 1 / -1; }   /* one lead image, two supporting */
}
@media (min-width: 1000px) {
  .sp-visuals--1 { max-width: 760px; }
  .sp-visuals--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sp-visuals--3 .sp-visual:first-child { grid-column: auto; }
}

/* ============================================================ single page: lyrics, credits, links ==== */
/* The single page carries only a discreet link to the lyrics; the lyrics themselves live on /singles/<slug>/lyrics/ (below). */
.sp-lyrics-link-row { margin: 0; }
.sp-lyrics-btn { min-height: 48px; }

.sp-credits { max-width: 560px; margin: 0; padding: 0; border: 1px solid var(--line); }
.sp-credits div { display: flex; justify-content: space-between; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.sp-credits div:last-child { border-bottom: 0; }
.sp-credits dt { color: var(--muted); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.sp-credits dd { margin: 0; color: var(--text); text-align: right; }
.sp-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 14px; }
.sp-links .btn { min-height: 44px; }

/* ============================================================ single page: related music ==== */
.sp-more .cat-grid { margin-bottom: 36px; }
.sp-more-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.sp-more-actions .btn { min-height: 48px; }
.sp-crumbs { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-bottom: 18px; }
.sp-crumbs .ap-crumb { margin-bottom: 0; }

@media (max-width: 600px) {
  .sp-pullquote { margin: 40px 0; padding-left: 18px; }
  .sp-essay-h { margin-top: 48px; }
}

/* ============================================================ lyrics page (/singles/<slug>/lyrics/) ==== */
/* A reading page: one comfortable column, generous leading, section names as headings (production instructions are not displayed). */
.sp-lyrics-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: center; }
.sp-lyrics-thumb { width: 132px; margin: 0; padding: 8px; background: #0e0e12; border: 1px solid var(--line); box-shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.9); }
.sp-lyrics-thumb img { display: block; width: 100%; height: auto; }
@media (min-width: 720px) {
  .sp-lyrics-head { grid-template-columns: 176px minmax(0, 1fr); gap: 40px; }
  .sp-lyrics-thumb { width: 176px; }
}
.sp-lyrics-hero .release-title { margin-bottom: 10px; }
.sp-lyrics-page .wrap { padding-top: 8px; }
.sp-lyrics-text { max-width: 36rem; color: #d6d3cc; font-size: 1.14rem; line-height: 1.9; overflow-wrap: anywhere; }
.sp-lyrics-text .sp-stanza { margin: 0 0 1.5em; }
.sp-lyric-sec { margin: 0 0 3.2rem; padding-top: 2.2rem; border-top: 1px solid var(--line); }
.sp-lyric-sec:first-child { padding-top: 0; border-top: 0; }
.sp-lyric-label { margin: 0 0 4px; color: var(--accent-soft); font-family: var(--display); font-size: 1.5rem; font-weight: 400; letter-spacing: 0.14em; line-height: 1.2; text-transform: uppercase; }
.sp-lyrics-end { display: flex; flex-wrap: wrap; gap: 14px; margin: 1rem 0 0; padding-top: 2rem; border-top: 1px solid var(--line); }
.sp-lyrics-end .btn { min-height: 48px; }
