/* =========================================================
   HÖRPROBE — Audio-Player im Stil der Marke
   Ergänzt style.css + sales.css. Nutzt ausschließlich die
   globalen Farbtoken, funktioniert daher hell wie dunkel.
   Eingebunden auf: index.html (Abschnitt „Sarah")
   ========================================================= */

.hp {
  position: relative;
  margin: 64px auto 0;
  max-width: 940px;
}

/* Ohne JavaScript bleibt der native Player sichtbar (Rückfallebene). */
.hp-native { width: 100%; }
.hp-ui { display: none; }
.hp--js .hp-native { display: none; }
.hp--js .hp-ui { display: grid; }

/* ------------------ Karte ------------------ */
.hp-card {
  position: relative;
  overflow: hidden;
  padding: 40px 44px 34px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
/* Sehr leiser Lichtschimmer von oben links, kein sichtbarer Verlauf */
.hp-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 0% 0%, rgba(255, 255, 255, 0.5), transparent 62%);
  pointer-events: none;
}
html[data-theme="dark"] .hp-card::before {
  background: radial-gradient(120% 90% at 0% 0%, rgba(255, 255, 255, 0.05), transparent 62%);
}
.hp-card > * { position: relative; }

/* Auf der hellen Fläche der Sektion „alt" die Karte absetzen */
.sp-section.alt .hp-card { background: var(--bg-cream); }

/* ------------------ Kopf ------------------ */
.hp-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent-dark);
}
.hp-kicker svg { width: 15px; height: 15px; flex: none; }

.hp-title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 30px;
  line-height: 1.25;
  margin: 0 0 12px;
  color: var(--ink);
}
.hp-sub {
  margin: 0 0 30px;
  max-width: 62ch;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-muted);
}

/* ------------------ Player ------------------ */
.hp-ui {
  grid-template-columns: auto 1fr;
  gap: 28px;
  align-items: center;
}

/* Abspielknopf */
.hp-play {
  position: relative;
  width: 72px;
  height: 72px;
  flex: none;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--ink-fixed);
  border-radius: 50%;
  background: var(--ink-fixed);
  color: var(--bg-fixed);
  cursor: pointer;
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
  will-change: transform;
}
/* Im Dunkelmodus umgekehrt: heller Kreis auf dunkler Karte.
   Sonst stuende der Knopf fast unsichtbar dunkel auf dunkel. */
html[data-theme="dark"] .hp-play {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg-panel);
}
.hp-play:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.hp-play:active { transform: translateY(0); }
.hp-play svg { width: 22px; height: 22px; }
.hp-play .hp-i-pause { display: none; }
.hp--playing .hp-play .hp-i-play { display: none; }
.hp--playing .hp-play .hp-i-pause { display: block; }
/* Das Dreieck sitzt optisch erst mittig, wenn es leicht nach rechts rückt */
.hp-play .hp-i-play { margin-left: 3px; }

/* Ruhiger Ring, der während der Wiedergabe atmet */
.hp-play::after {
  content: "";
  position: absolute;
  inset: -7px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.6s var(--ease);
}
.hp--playing .hp-play::after { opacity: 0.55; animation: hp-breath 3.4s var(--ease) infinite; }
@keyframes hp-breath {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50%      { transform: scale(1.06); opacity: 0.18; }
}

/* Rechte Spalte */
.hp-stack { min-width: 0; display: grid; gap: 12px; }

.hp-topline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
}
.hp-track {
  font-size: 11.5px;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--text-muted);
}
.hp-time {
  font-size: 13px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.hp-cur { color: var(--ink); }
.hp-sep { opacity: 0.45; margin: 0 5px; }

/* ------------------ Wellenform ------------------ */
.hp-wave {
  position: relative;
  height: 58px;
  cursor: pointer;
  touch-action: none;
  border-radius: 4px;
}
.hp-bars {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  pointer-events: none;
}
.hp-bars i {
  flex: 1 1 0;
  min-width: 0;
  height: var(--h, 40%);
  border-radius: 2px;
  background: currentColor;
  transform: scaleY(var(--s, 1));
  transform-origin: center;
  transition: transform 0.5s var(--ease);
}
.hp-bars--base { color: var(--taupe); opacity: 0.42; }
.hp-bars--fill {
  color: var(--accent-dark);
  clip-path: inset(0 calc(100% - var(--p, 0%)) 0 0);
  transition: clip-path 0.12s linear;
}
.hp--seeking .hp-bars--fill { transition: none; }

/* Abspielmarke + Vorschaulinie beim Überfahren */
.hp-cursor,
.hp-hover {
  position: absolute;
  top: 2px;
  bottom: 2px;
  width: 1px;
  pointer-events: none;
}
.hp-cursor {
  left: var(--p, 0%);
  background: var(--ink);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.hp--started .hp-cursor { opacity: 0.6; }
.hp-hover { left: var(--hx, 0%); background: var(--ink); opacity: 0; }
.hp-wave:hover .hp-hover { opacity: 0.22; }

.hp-bubble {
  position: absolute;
  bottom: calc(100% + 8px);
  left: var(--hx, 0%);
  transform: translateX(-50%);
  padding: 4px 9px;
  border-radius: var(--pill);
  background: var(--ink-fixed);
  color: var(--bg-fixed);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
}
.hp-wave:hover .hp-bubble { opacity: 1; }

/* ------------------ Kleine Bedienelemente ------------------ */
.hp-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.hp-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: var(--pill);
  background: transparent;
  color: var(--text-muted);
  font-family: "Jost", sans-serif;
  font-size: 12.5px;
  letter-spacing: 0.6px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: color 0.35s var(--ease), border-color 0.35s var(--ease), background-color 0.35s var(--ease);
}
.hp-chip:hover { color: var(--ink); border-color: var(--accent-dark); }
.hp-chip svg { width: 14px; height: 14px; flex: none; }
.hp-chip--on { color: var(--ink); border-color: var(--accent-dark); }

.hp-note {
  margin: 22px 0 0;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-muted);
}
.hp-error {
  margin: 14px 0 0;
  font-size: 13.5px;
  color: var(--accent-dark);
}

/* ------------------ Schmalere Bildschirme ------------------ */
@media (max-width: 780px) {
  .hp { margin-top: 48px; }
  .hp-card { padding: 32px 26px 28px; border-radius: var(--radius); }
  .hp-title { font-size: 25px; }
  .hp-sub { margin-bottom: 26px; }
  /* Knopf und Wellenform bleiben nebeneinander: das ist die Anordnung,
     die man von Podcast-Apps kennt. Nur schmaler. */
  .hp-ui { gap: 18px; }
  .hp-play { width: 58px; height: 58px; }
  .hp-play svg { width: 19px; height: 19px; }
  .hp-wave { height: 46px; }
  /* Die Zahl der Balken bestimmt hoerprobe.js aus der Breite. */
  .hp-track { font-size: 10.5px; letter-spacing: 1.8px; }
  /* Etwas höher als am Desktop: bequem mit dem Daumen zu treffen */
  .hp-chip { padding: 10px 15px; font-size: 12px; }
}
@media (max-width: 560px) {
  /* Auf dem Handy bleibt nur die Zeit stehen. Die Beschriftung würde
     zweizeilig umbrechen und die Wellenform nach unten schieben,
     und was zu hören ist, sagt die Überschrift ohnehin. */
  .hp-track { display: none; }
  .hp-topline { justify-content: flex-end; }
}

/* ------------------ Weniger Bewegung ------------------ */
@media (prefers-reduced-motion: reduce) {
  .hp-play,
  .hp-bars i,
  .hp-bars--fill,
  .hp-cursor,
  .hp-bubble,
  .hp-chip { transition: none; }
  .hp--playing .hp-play::after { animation: none; }
}
