/*
 * Webplayer und oeffentliche Podcast-Seiten.
 *
 * Mobil zuerst: alle Breiten sind fluid, der einzige Media-Query oeffnet ab
 * 640px das zweispaltige Kopfbild. Die Akzentfarbe kommt als
 * CSS-Variable --akzent aus der Shell (Podcast.accentColor) — deshalb steht
 * hier nirgends eine feste Markenfarbe.
 *
 * Keine externe Bibliothek, kein Build. Die Datei wird von Caddy auf der
 * Podcast-Domain unter /assets/podcast/player.css ausgeliefert
 * (handle /assets/* -> backend:8000).
 */

:root {
  --akzent:      #1f2937;
  --text:        #12161f;
  --muted:       #6b7280;
  --border:      #e5e7eb;
  --flaeche:     #f8f9fb;
  --weiss:       #ffffff;
  --radius:      12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--weiss);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--akzent); }

.pk-huelle {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

/* ── Kopf ──────────────────────────────────────────────────────────── */

.pk-kopf {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 28px;
}

.pk-kopf__cover {
  width: 140px;
  height: 140px;
  border-radius: var(--radius);
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.pk-kopf__titel {
  margin: 0 0 4px;
  font-size: 26px;
  line-height: 1.25;
}

.pk-kopf__autor {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.pk-kopf__text {
  margin: 12px 0 0;
  color: var(--text);
}

@media (min-width: 640px) {
  .pk-kopf { flex-direction: row; align-items: flex-start; }
  .pk-kopf__cover { width: 180px; height: 180px; }
  .pk-kopf__titel { font-size: 32px; }
}

/* ── Plattform-Knoepfe ─────────────────────────────────────────────── */

.pk-plattformen {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.pk-plattform {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  background: var(--weiss);
}

.pk-plattform:hover { background: var(--flaeche); }

/* ── Player ────────────────────────────────────────────────────────── */

.pk-player {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--flaeche);
  padding: 16px;
  margin: 0 0 24px;
}

.pk-player__kopf {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.pk-player__titel {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  min-width: 0;
  overflow-wrap: anywhere;
}

.pk-player__abspielen {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border: none;
  border-radius: 50%;
  background: var(--akzent);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pk-player__abspielen:focus-visible {
  outline: 3px solid var(--akzent);
  outline-offset: 2px;
}

.pk-player__abspielen svg { width: 20px; height: 20px; fill: currentColor; }

/* Zeitleiste. Die Marken liegen absolut darin, deshalb position:relative. */
.pk-leiste {
  position: relative;
  height: 28px;
  display: flex;
  align-items: center;
  margin: 4px 0;
  touch-action: none;
}

.pk-leiste__spur {
  position: absolute;
  left: 0;
  right: 0;
  height: 6px;
  border-radius: 3px;
  background: #d9dce3;
  pointer-events: none;
}

.pk-leiste__gespielt {
  position: absolute;
  left: 0;
  height: 6px;
  border-radius: 3px;
  background: var(--akzent);
  width: 0;
  pointer-events: none;
}

.pk-leiste__marke {
  position: absolute;
  width: 2px;
  height: 14px;
  background: var(--weiss);
  opacity: .85;
  pointer-events: none;
}

/* Der echte Regler liegt unsichtbar darueber: so bleibt Tastatur- und
   Screenreader-Bedienung die des Browsers, und die Optik ist frei. */
.pk-leiste__regler {
  position: relative;
  width: 100%;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  height: 28px;
  cursor: pointer;
}

.pk-leiste__regler:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }
.pk-leiste__regler::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--akzent);
  border: 2px solid var(--weiss);
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.pk-leiste__regler::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--akzent);
  border: 2px solid var(--weiss);
}
.pk-leiste__regler::-webkit-slider-runnable-track { background: transparent; }
.pk-leiste__regler::-moz-range-track { background: transparent; }

.pk-zeiten {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.pk-knoepfe {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.pk-knopf {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--weiss);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pk-knopf:hover { background: var(--flaeche); }
.pk-knopf:focus-visible { outline: 2px solid var(--akzent); outline-offset: 1px; }
.pk-knopf[aria-pressed="true"] { background: var(--akzent); color: #fff; border-color: var(--akzent); }
.pk-knopf--abstand { margin-left: auto; }

.pk-meldung {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

/* ── Kapitel und Transkript ────────────────────────────────────────── */

.pk-block { margin: 0 0 24px; }

.pk-block__titel {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 8px;
}

.pk-kapitel { list-style: none; margin: 0; padding: 0; }

.pk-kapitel__eintrag {
  display: flex;
  gap: 10px;
  width: 100%;
  padding: 7px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  font: inherit;
  color: var(--text);
  cursor: pointer;
}

.pk-kapitel__eintrag:hover { background: var(--flaeche); }
.pk-kapitel__eintrag:focus-visible { outline: 2px solid var(--akzent); }
.pk-kapitel__eintrag[aria-current="true"] { background: var(--flaeche); font-weight: 600; }

.pk-kapitel__zeit {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  flex-shrink: 0;
  min-width: 56px;
}

.pk-transkript {
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--weiss);
}

.pk-transkript__satz {
  display: block;
  width: 100%;
  padding: 4px 6px;
  border: none;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  font: inherit;
  color: var(--text);
  cursor: pointer;
}

.pk-transkript__satz:hover { background: var(--flaeche); }
.pk-transkript__satz[aria-current="true"] {
  background: var(--flaeche);
  box-shadow: inset 3px 0 0 var(--akzent);
  font-weight: 600;
}

.pk-transkript__sprecher {
  color: var(--muted);
  font-size: 12px;
  margin-right: 6px;
}

.pk-falte { border: 1px solid var(--border); border-radius: var(--radius); }
.pk-falte > summary {
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
}
.pk-falte > div { padding: 0 14px 14px; }

/* ── Episodenliste ─────────────────────────────────────────────────── */

.pk-liste { list-style: none; margin: 0; padding: 0; }

.pk-liste__eintrag {
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.pk-liste__titel {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
}

.pk-liste__titel a { color: var(--text); text-decoration: none; }
.pk-liste__titel a:hover { text-decoration: underline; }

.pk-liste__meta {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.pk-liste__text { margin: 6px 0 0; font-size: 14px; color: var(--text); }

/* ── Shownotes ─────────────────────────────────────────────────────── */

.pk-shownotes { overflow-wrap: anywhere; }
.pk-shownotes h2 { font-size: 19px; margin-top: 22px; }
.pk-shownotes h3 { font-size: 17px; margin-top: 18px; }
.pk-shownotes h4 { font-size: 15px; margin-top: 16px; }
.pk-shownotes p  { margin: 0 0 12px; }
.pk-shownotes ul, .pk-shownotes ol { padding-left: 20px; }
.pk-shownotes blockquote {
  margin: 12px 0;
  padding: 2px 0 2px 14px;
  border-left: 3px solid var(--border);
  color: var(--muted);
}

/* ── Fuss ──────────────────────────────────────────────────────────── */

.pk-fuss {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}

.pk-fuss a { color: var(--muted); }

/* ── Embed ─────────────────────────────────────────────────────────── */

/* Im iframe gibt es keinen Seitenrand und keinen Fuss. Der Player soll
   die Flaeche ausfuellen, die der Einbettende vorgibt. */
body.pk-embed { background: var(--flaeche); }
body.pk-embed .pk-huelle { padding: 10px; max-width: none; }
body.pk-embed .pk-player { margin: 0; }

.pk-nur-screenreader {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
