/* Episode pages (v3) — episodes/<slug>/index.html, generated by
   scripts/sync-episodes.mjs from templates/episode.html (docs/episode-sync.md).
   Linked after css/main.css. Tokens only. Everything sits on the shared grid
   (docs §13): cover 5 | copy 7 of 12 → 3 | 5 of 8 → stacked on the 4-column
   phone tier. The "Listen On" row, the section head and the prev/next cards
   reuse the home page / archive components unchanged. */

/* ---- Hero: cover | eyebrow, artist + song, chips, player ---- */
.episode-hero {
  --grid-row-gap: var(--space-5);
  align-items: center;
  padding-block: var(--space-7) var(--space-5);
}
.episode-hero__art { --span: 5; --span-md: 3; }
/* Cover art: square, never below the 200px brand floor (5 of 12 ≈ 413px at
   1069px, 3 of 8 ≈ 246px at 735px, full width on phones) */
.episode-hero__art img {
  width: 100%;
  height: auto;
  aspect-ratio: var(--ratio-square);
  object-fit: cover;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
}
/* Copy stack: h1 rhythm (24px), padded on the cover side like the home "Why"
   split so the gutter reads as --grid-split-gap */
.episode-hero__copy {
  --span: 7;
  --span-md: 5;
  --stack-gap: var(--stack-gap-h1);
  display: grid;
  gap: var(--stack-gap);
  justify-items: start;
  align-content: center;
  min-width: 0;
  padding-inline-start: var(--grid-split-pad);
}

/* Title: the card format — artist (TrashHand h1 scale), then “Song” in accent */
.episode-title { display: grid; gap: var(--space-2); }
.episode-title__artist { display: block; overflow-wrap: anywhere; }
.episode-title__song {
  display: block;
  font-family: var(--family-body);
  font-size: var(--fs-subhead);
  font-weight: 600;
  line-height: var(--leading-snug);
  color: var(--text-accent);
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.episode-hero__chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* Native player: full copy width, dark UA controls */
.episode-player { justify-self: stretch; }
.episode-player__audio { display: block; width: 100%; color-scheme: dark; }

/* ---- Show notes (sanitised feed HTML: p, br, a, strong, em, ul, ol, li) ---- */
.episode-notes { padding-block-start: var(--space-5); }
.episode-notes__inner { --span: 8; --span-md: 8; display: grid; gap: var(--stack-gap-h2); min-width: 0; }
.episode-notes__body {
  display: grid;
  gap: var(--space-3);
  max-width: var(--measure-body);
  color: var(--text-lead);
  overflow-wrap: anywhere;
}
.episode-notes__body strong { font-weight: 700; color: var(--text-primary); }
.episode-notes__body :is(ul, ol) { display: grid; gap: var(--space-2); padding-inline-start: var(--space-5); }
/* Links in running text are underlined, not colour-only (WCAG 1.4.1) */
.episode-notes__body a {
  text-decoration: underline;
  text-decoration-thickness: from-font;
  text-underline-offset: var(--space-1);
}

/* ---- Watch on YouTube (client 2026-11-20): beside the show notes on the 12-column
   tier (notes 7 | video 5), stacked under them on the 8- and 4-column tiers. The
   video column sticks under the nav while long show notes scroll past. ---- */
.episode-notes .grid { --grid-row-gap: var(--space-6); }
.episode-video { --span: 5; --span-md: 8; display: grid; gap: var(--stack-gap-h2); align-content: start; align-self: start; min-width: 0; }
.episode-notes .grid:has(> .episode-video) > .episode-notes__inner { --span: 7; }
.episode-video__frame {
  position: relative;
  display: block;
  aspect-ratio: var(--ratio-cinema);
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
}
.episode-video__frame > :is(iframe, img) { display: block; width: 100%; height: 100%; border: 0; object-fit: cover; }
/* Embedding turned off by the video's owner: thumbnail + YouTube play badge, linking out */
.episode-video__play { position: absolute; inset: 50% auto auto 50%; width: var(--size-video-play); height: auto; translate: -50% -50%; }
.episode-video__play-bg { fill: var(--text-primary); fill-opacity: 0.8; transition: fill var(--dur-quick) var(--ease), fill-opacity var(--dur-quick) var(--ease); }
.episode-video__play-icon { fill: var(--ink-950); }
.episode-video__frame--link:is(:hover, :focus-visible) .episode-video__play-bg { fill: var(--hue-youtube); fill-opacity: 1; }
.episode-video__frame--link:is(:hover, :focus-visible) .episode-video__play-icon { fill: var(--ssq-white); }
@media (width > 1068px) {
  .episode-video { position: sticky; top: var(--scroll-offset); }
}

/* ---- Nav: EPISODES is the current section (aria-current="true", set by the sync),
   coloured like main.css's current page ---- */
.site-nav a[aria-current="true"]:not(.btn) { color: var(--text-accent); }

/* ---- Keep listening: previous / next as text-only episode cards ---- */
.episode-card--nav .episode-card__meta { flex-wrap: wrap; }

/* Phone tier: everything stacks full width (grid default), cover first */
@media (max-width: 734px) {
  .episode-hero { padding-block-start: var(--space-6); }
  .episode-hero__copy { padding-inline-start: 0; }
}
