/* Writesides of History podcast app
   Canonical visual contract: docs/blueprint/podcast-app-visual-system.md
   Keep every rule scoped to .listen-app-shell so the reading site remains independent. */

.listen-app-shell {
  --listen-bg: #031016;
  --listen-bg-raised: #071a22;
  --listen-surface: #0d2a35;
  --listen-ink: #f4ecdc;
  --listen-muted: #b9ad94;
  --listen-accent: #d0a24d;
  --listen-accent-soft: #e8c77f;
  --listen-line: rgb(208 162 77 / 0.42);
  --listen-serif: var(--serif, Georgia, serif);
  --listen-sans: var(--sans, system-ui, sans-serif);
  min-height: 100vh;
  padding-bottom: calc(5.25rem + env(safe-area-inset-bottom));
  color: var(--listen-ink);
  background:
    radial-gradient(circle at 85% 8%, rgb(208 162 77 / 0.1), transparent 28rem),
    var(--listen-bg);
}

.listen-app-shell a:focus-visible,
.listen-app-shell button:focus-visible,
.listen-app-shell input:focus-visible {
  outline: 2px solid var(--listen-accent-soft);
  outline-offset: 3px;
}

.listen-app-shell .listen-app-header {
  position: sticky;
  z-index: 40;
  top: 0;
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) 4.75rem;
  align-items: center;
  gap: 0.75rem;
  padding: calc(0.75rem + env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) 0.75rem max(1rem, env(safe-area-inset-left));
  background: rgb(3 16 22 / 0.9);
  border-bottom: 1px solid var(--listen-line);
  box-shadow: 0 0.6rem 2rem rgb(0 0 0 / 0.16);
  backdrop-filter: blur(18px);
}

.listen-app-shell .listen-app-header a { color: var(--listen-ink); text-decoration: none; }

.listen-app-shell .listen-app-mark {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  color: var(--listen-accent-soft);
  border: 1px solid var(--listen-accent);
  border-radius: 50%;
  font: italic 400 1.1rem/1 var(--listen-serif);
}

.listen-app-shell .listen-app-brand {
  min-width: 0;
  color: var(--listen-ink);
  font: 400 clamp(0.78rem, 3.4vw, 1rem)/1 var(--listen-serif);
  letter-spacing: 0.14em;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}

.listen-app-shell .listen-app-brand span {
  color: var(--listen-accent-soft);
  font-style: italic;
  letter-spacing: 0;
  text-transform: lowercase;
}

.listen-app-shell .listen-app-brand small {
  display: block;
  margin-top: 0.28rem;
  color: var(--listen-muted);
  font: 500 0.65rem/1 var(--listen-sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.listen-app-shell .listen-install {
  min-height: 2.75rem;
  padding: 0.55rem 0.7rem;
  color: var(--listen-accent-soft);
  background: transparent;
  border: 1px solid var(--listen-line);
  border-radius: 999px;
  cursor: pointer;
  font: 500 0.72rem/1 var(--listen-sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.listen-app-shell .listen-install[hidden] { display: block; visibility: hidden; }
.listen-app-shell .listen-install:not([hidden]):hover { color: var(--listen-bg); background: var(--listen-accent-soft); }

.listen-app-shell .listen-app-main {
  width: min(100%, 58rem);
  margin: 0 auto;
  padding: 0 1rem 3rem;
}

.listen-app-shell .listen-app-intro {
  max-width: 46rem;
  margin: 0;
  padding: clamp(3rem, 10vw, 6.5rem) 0 clamp(2rem, 7vw, 4rem);
}

.listen-app-shell .story-kicker {
  color: var(--listen-accent-soft);
  font: 500 0.72rem/1.4 var(--listen-sans);
  letter-spacing: 0.18em;
}

.listen-app-shell .listen-app-intro h1 {
  max-width: 11ch;
  margin: 0.5rem 0 1rem;
  color: var(--listen-ink);
  font: 400 clamp(3rem, 11vw, 6.5rem)/0.92 var(--listen-serif);
  letter-spacing: -0.045em;
}

.listen-app-shell .listen-app-intro p:last-child {
  max-width: 38rem;
  margin: 0;
  color: var(--listen-muted);
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  line-height: 1.65;
}

.listen-app-shell .listen-app-main > section > h2 {
  margin: 0 0 1rem;
  color: var(--listen-ink);
  font: 400 clamp(1.65rem, 5vw, 2.35rem)/1.1 var(--listen-serif);
}

.listen-app-shell .listen-card-grid { display: grid; gap: 1.25rem; }

.listen-app-shell .listen-card {
  overflow: hidden;
  padding: 0;
  color: var(--listen-muted);
  background: var(--listen-surface);
  border: 1px solid rgb(232 199 127 / 0.2);
  border-radius: 1.4rem;
  box-shadow: 0 1.2rem 3rem rgb(0 0 0 / 0.22);
}

.listen-app-shell .listen-card-image {
  position: relative;
  display: block;
  min-height: clamp(25rem, 95vw, 38rem);
  overflow: hidden;
  color: var(--listen-ink);
  text-decoration: none;
}

.listen-app-shell .listen-card-image::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, transparent 32%, rgb(3 16 22 / 0.95) 96%);
}

.listen-app-shell .listen-card-image img {
  width: 100%;
  height: 100%;
  margin: 0;
  position: absolute;
  inset: 0;
  object-fit: cover;
  transition: transform 500ms ease;
}

.listen-app-shell .listen-card-image:hover img { transform: scale(1.025); }

.listen-app-shell .listen-card-image-copy {
  position: absolute;
  z-index: 1;
  right: 0;
  bottom: 0;
  left: 0;
  display: block;
  padding: clamp(1.4rem, 5vw, 2.25rem);
}

.listen-app-shell .listen-card-image-copy .story-kicker { display: block; margin-bottom: 0.75rem; }

.listen-app-shell .listen-card-image-copy strong {
  display: block;
  max-width: 15ch;
  color: var(--listen-ink);
  font: 400 clamp(2.35rem, 8vw, 4.2rem)/0.96 var(--listen-serif);
  letter-spacing: -0.035em;
}

.listen-app-shell .listen-card-copy { padding: 1.35rem clamp(1.4rem, 5vw, 2.25rem) 1.7rem; }
.listen-app-shell .listen-card-copy > p:first-child { max-width: 42rem; margin-top: 0; line-height: 1.65; }

.listen-app-shell .listen-card-meta {
  color: var(--listen-muted);
  font: 400 0.78rem/1.5 var(--listen-sans);
}

.listen-app-shell .listen-card-action {
  display: inline-flex;
  gap: 0.7rem;
  align-items: center;
  min-height: 2.75rem;
  margin-top: 0.35rem;
  color: var(--listen-accent-soft);
  font: 500 0.82rem/1 var(--listen-sans);
  letter-spacing: 0.05em;
  text-decoration: none;
}

.listen-app-shell .story-listen {
  margin: 0;
  padding: 0;
  color: var(--listen-ink);
  background: transparent;
  border: 0;
}

.listen-app-shell .story-episode-hero {
  position: relative;
  min-height: min(78rem, 132vw);
  overflow: hidden;
  margin: 0 -1rem;
  display: flex;
  align-items: end;
  background: var(--listen-bg-raised);
}

.listen-app-shell .story-episode-hero::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(180deg, rgb(3 16 22 / 0.02) 28%, rgb(3 16 22 / 0.28) 54%, rgb(3 16 22 / 0.98) 96%),
    linear-gradient(90deg, rgb(3 16 22 / 0.24), transparent 55%);
}

.listen-app-shell .story-episode-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: cover;
}

.listen-app-shell .story-episode-hero-copy {
  position: relative;
  z-index: 1;
  width: min(100%, 52rem);
  padding: clamp(2rem, 7vw, 4.5rem) 1.5rem;
}

.listen-app-shell .story-episode-hero h1 {
  max-width: 16ch;
  margin: 0.65rem 0 0;
  color: var(--listen-ink);
  font: 400 clamp(2.75rem, 10vw, 6rem)/0.93 var(--listen-serif);
  letter-spacing: -0.045em;
}

.listen-app-shell .story-episode-meta {
  margin: 1.15rem 0 0;
  color: var(--listen-muted);
  font: 400 0.86rem/1.5 var(--listen-sans);
}

.listen-app-shell .story-evidence-label {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1rem;
  padding: 0.48rem 0.8rem;
  color: #c5dec7;
  background: rgb(36 79 55 / 0.74);
  border-radius: 999px;
  font: 500 0.78rem/1 var(--listen-sans);
}

.listen-app-shell .story-evidence-label::before {
  width: 0.45rem;
  height: 0.45rem;
  content: "";
  background: #8fbd95;
  border-radius: 50%;
}

.listen-app-shell .story-episode-dek {
  padding: clamp(1.8rem, 6vw, 3.2rem) clamp(0.5rem, 4vw, 2.5rem);
  background: linear-gradient(180deg, var(--listen-bg-raised), var(--listen-bg));
}

.listen-app-shell .story-episode-dek p {
  max-width: 37rem;
  margin: 0;
  color: #ded3bf;
  font: 400 clamp(1.2rem, 3.6vw, 1.65rem)/1.55 var(--listen-serif);
}

.listen-app-shell .story-player-panel {
  margin: 0 0.25rem 2rem;
  padding: clamp(1.15rem, 4vw, 1.6rem);
  background: var(--listen-surface);
  border: 1px solid rgb(232 199 127 / 0.18);
  border-radius: 1.25rem;
  box-shadow: 0 1rem 3rem rgb(0 0 0 / 0.18);
}

.listen-app-shell .story-listen-heading { max-width: none; }

.listen-app-shell .story-listen-heading h2 {
  margin: 0.35rem 0 0;
  color: var(--listen-ink);
  font: 400 clamp(1.35rem, 4.5vw, 1.85rem)/1.1 var(--listen-serif);
}

.listen-app-shell .story-player-panel > audio { width: 100%; margin-top: 1.25rem; }
.listen-app-shell .story-listen[data-story-enhanced] .story-player-panel > audio { display: none; }

.listen-app-shell .story-controls { margin-top: 1.15rem; }

.listen-app-shell .story-round-button,
.listen-app-shell .story-speed {
  min-width: 2.75rem;
  min-height: 2.75rem;
  color: var(--listen-ink);
  border-color: var(--listen-line);
}

.listen-app-shell .story-play {
  color: var(--listen-bg);
  background: var(--listen-accent);
  border-color: var(--listen-accent);
  border-radius: 50%;
}

.listen-app-shell .story-timeline input[type="range"] {
  background: linear-gradient(to right, var(--listen-accent-soft) var(--story-progress), rgb(185 173 148 / 0.23) var(--story-progress));
}

.listen-app-shell .story-timeline input[type="range"]::-webkit-slider-thumb { background: var(--listen-ink); }
.listen-app-shell .story-timeline input[type="range"]::-moz-range-thumb { background: var(--listen-ink); }

.listen-app-shell .story-now { color: var(--listen-muted); }
.listen-app-shell .story-now strong { color: var(--listen-ink); }

.listen-app-shell .story-chapter-section { padding: 0 0.5rem 1rem; }

.listen-app-shell .story-chapter-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.listen-app-shell .story-chapter-heading h2 {
  margin: 0;
  color: var(--listen-ink);
  font: 400 clamp(1.8rem, 5vw, 2.45rem)/1.1 var(--listen-serif);
}

.listen-app-shell .story-chapter-heading p {
  margin: 0;
  color: var(--listen-accent-soft);
  font: 500 0.7rem/1 var(--listen-sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.listen-app-shell .story-chapters {
  margin-top: 0.75rem;
  border-color: var(--listen-line);
}

.listen-app-shell .story-chapters li { border-color: rgb(208 162 77 / 0.16); }

.listen-app-shell .story-chapters button {
  min-height: 3.5rem;
  padding: 0.95rem 0;
  color: var(--listen-muted);
}

.listen-app-shell .story-chapters button > span,
.listen-app-shell .story-chapters time { color: var(--listen-muted); }

.listen-app-shell .story-chapters button strong {
  color: var(--listen-ink);
  font-weight: 400;
}

.listen-app-shell .story-chapters button.is-active strong,
.listen-app-shell .story-chapters button:hover strong { color: var(--listen-accent-soft); }

.listen-app-shell .story-noscript { padding: 0 0.5rem; }
.listen-app-shell .story-noscript a { color: var(--listen-accent-soft); }

.listen-app-shell .story-dock {
  bottom: calc(4.3rem + env(safe-area-inset-bottom));
  color: var(--listen-ink);
  background: rgb(3 16 22 / 0.94);
  border-color: var(--listen-line);
}

.listen-app-shell .listen-source-link {
  margin: 2rem 0.5rem;
  color: var(--listen-ink);
  background: var(--listen-surface);
  border-color: rgb(232 199 127 / 0.18);
  border-left-color: var(--listen-accent);
  border-radius: 0 1rem 1rem 0;
}

.listen-app-shell .listen-source-link h2 { color: var(--listen-ink); }
.listen-app-shell .listen-source-link p { color: var(--listen-muted); }
.listen-app-shell .listen-image-credit { margin-top: 1.25rem; font-size: 0.8125rem; line-height: 1.5; }
.listen-app-shell .listen-image-credit a { color: var(--listen-accent-soft); }
.listen-app-shell .listen-source-link .btn {
  color: var(--listen-bg);
  background: var(--listen-accent);
  border-color: var(--listen-accent);
}

.listen-app-shell .listen-empty {
  color: var(--listen-muted);
  border-color: var(--listen-line);
}

.listen-app-shell .listen-app-nav {
  position: fixed;
  z-index: 50;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0.65rem max(1rem, env(safe-area-inset-right)) calc(0.65rem + env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  background: rgb(3 16 22 / 0.96);
  border-top: 1px solid var(--listen-line);
  box-shadow: 0 -0.5rem 2rem rgb(0 0 0 / 0.2);
  backdrop-filter: blur(18px);
}

.listen-app-shell .listen-app-nav a {
  min-height: 2.75rem;
  display: grid;
  place-items: center;
  color: var(--listen-muted);
  font: 500 0.7rem/1 var(--listen-sans);
  letter-spacing: 0.09em;
  text-decoration: none;
  text-transform: uppercase;
}

.listen-app-shell .listen-app-nav a[aria-current="page"],
.listen-app-shell .listen-app-nav a:hover { color: var(--listen-accent-soft); }

@media (min-width: 46rem) {
  .listen-app-shell .listen-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .listen-app-shell .listen-card-image { min-height: 34rem; }
  .listen-app-shell .story-episode-hero {
    min-height: 46rem;
    margin-right: 0;
    margin-left: 0;
    border-radius: 0 0 1.5rem 1.5rem;
  }
}

@media (max-width: 30rem) {
  .listen-app-shell .listen-app-header { grid-template-columns: 2.75rem minmax(0, 1fr) 4.15rem; gap: 0.45rem; }
  .listen-app-shell .listen-app-brand { font-size: 0.72rem; letter-spacing: 0.09em; }
  .listen-app-shell .listen-install { padding-right: 0.45rem; padding-left: 0.45rem; font-size: 0.66rem; }
  .listen-app-shell .story-episode-hero { min-height: 148vw; }
  .listen-app-shell .story-episode-hero-copy { padding-right: 1.15rem; padding-left: 1.15rem; }
  .listen-app-shell .story-player-panel { margin-right: 0; margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .listen-app-shell .listen-card-image img { transition: none; }
}


/* Distribution and collection surfaces share the approved app visual system. */
.listen-app-shell .listen-feature,
.listen-app-shell .listen-everywhere {
  margin: 0 0 clamp(2.5rem, 8vw, 4.5rem);
  padding: clamp(1.4rem, 5vw, 2.25rem);
  background: linear-gradient(145deg, rgb(13 42 53 / 0.96), rgb(7 26 34 / 0.96));
  border: 1px solid rgb(232 199 127 / 0.24);
  border-radius: 1.4rem;
  box-shadow: 0 1.2rem 3rem rgb(0 0 0 / 0.2);
}
.listen-app-shell .listen-feature h2,
.listen-app-shell .listen-everywhere h2 {
  margin: 0.45rem 0 0.75rem;
  color: var(--listen-ink);
  font: 400 clamp(1.8rem, 6vw, 3rem)/1.02 var(--listen-serif);
}
.listen-app-shell .listen-feature > p:not(.story-kicker),
.listen-app-shell .listen-everywhere p { max-width: 40rem; color: var(--listen-muted); line-height: 1.65; }
.listen-app-shell .listen-everywhere { display: grid; gap: 1.25rem; }
.listen-app-shell .listen-distribution-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.listen-app-shell .listen-pill {
  display: inline-flex;
  min-height: 2.85rem;
  align-items: center;
  padding: 0.7rem 1rem;
  color: var(--listen-accent-soft);
  border: 1px solid var(--listen-line);
  border-radius: 999px;
  font: 600 0.78rem/1 var(--listen-sans);
  letter-spacing: 0.05em;
  text-decoration: none;
}
.listen-app-shell .listen-pill-primary { color: var(--listen-bg); background: var(--listen-accent); border-color: var(--listen-accent); }
.listen-app-shell .listen-section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.listen-app-shell .listen-section-heading a { color: var(--listen-accent-soft); font: 600 0.78rem/1 var(--listen-sans); }
.listen-app-shell .listen-app-intro-compact { padding-bottom: clamp(1.5rem, 5vw, 2.5rem); }
.listen-app-shell .listen-app-intro-compact h1 { max-width: none; }
.listen-app-shell .listen-episode-list { display: grid; gap: 0.8rem; margin: 0; padding: 0; list-style: none; }
.listen-app-shell .listen-episode-row {
  display: grid;
  grid-template-columns: 5.25rem minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 0.8rem;
  color: var(--listen-ink);
  background: var(--listen-surface);
  border: 1px solid rgb(232 199 127 / 0.18);
  border-radius: 1rem;
  text-decoration: none;
}
.listen-app-shell .listen-episode-row img { width: 5.25rem; height: 6.55rem; margin: 0; border-radius: 0.65rem; object-fit: cover; }
.listen-app-shell .listen-episode-row-copy { display: grid; gap: 0.35rem; min-width: 0; }
.listen-app-shell .listen-episode-row-copy strong { font: 400 clamp(1.05rem, 3.8vw, 1.45rem)/1.15 var(--listen-serif); }
.listen-app-shell .listen-episode-row-copy > span:last-child { color: var(--listen-muted); font: 400 0.75rem/1.4 var(--listen-sans); }
.listen-app-shell .listen-episode-distribution { margin-top: 2rem; }
@media (min-width: 48rem) {
  .listen-app-shell .listen-everywhere { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
}

/* Zie podcast-components.css: hetzelfde teken, hier in een pil die al inline-flex is. */
.listen-app-shell .listen-pill .platform-mark { margin-right: 0.4rem; vertical-align: 0; }
