/* ═══════════════════════════════════════════════════
   LOOPS – playlist-block.css
   Playlist-Karussell für Content-Seiten (includes/playlist-block.php).
   Baut nur auf base.css auf (Tokens, section, .card, .btn-*,
   .section-label/-lead). Alles unter .pb gekapselt, damit es
   keine bestehende Seite beeinflusst. Kartenoptik = media-card.
   Desktop 3 Karten · Tablet 2 · Phone 1 + Anschnitt der nächsten.
═══════════════════════════════════════════════════ */

.pb { --pb-cols: 3; --pb-gap: 22px; }
.pb [hidden] { display: none !important; }

/* ── Kopf: Text links, Pfeile rechts ── */
.pb-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px 32px; }
.pb-head-text { flex: 1 1 420px; min-width: 0; }
.pb-controls { display: flex; gap: 10px; flex: 0 0 auto; }
.pb-nav {
  width: 44px; height: 44px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border); background: var(--white); color: var(--black);
  font: 400 24px/1 'DM Sans', sans-serif; padding: 0 0 3px; cursor: pointer;
  transition: border-color 0.18s, background 0.18s, opacity 0.18s;
}
.pb-nav:hover:not(:disabled) { border-color: var(--black); background: var(--off2); }
.pb-nav:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pb-nav:disabled { opacity: 0.35; cursor: default; }

/* ── Track: native scroll-snap (Wischen/Trackpad), Pfeile per JS ── */
.pb-track {
  display: flex; gap: var(--pb-gap);
  margin: 30px -4px -14px; padding: 6px 4px 22px;   /* Platz für Hover-Lift + Schatten */
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding-inline: 4px;
  scrollbar-width: none;
}
.pb-track::-webkit-scrollbar { display: none; }
.pb-track:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-lg); }

/* ── Karte ── */
.pb-card {
  flex: 0 0 calc((100% - (var(--pb-cols) - 1) * var(--pb-gap)) / var(--pb-cols));
  scroll-snap-align: start;
  position: relative; display: flex; flex-direction: column;
  min-width: 0; padding: 0; overflow: hidden;
}
.pb-thumb { position: relative; width: 100%; aspect-ratio: 16 / 9; background: var(--off2); overflow: hidden; }
.pb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pb-pill {
  position: absolute; top: 10px; left: 10px; max-width: calc(100% - 20px);
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 100px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: rgba(17,17,16,0.75); color: #fff; backdrop-filter: blur(4px);
}
.pb-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.pb-title { font-size: 16px; font-weight: 700; color: var(--black); line-height: 1.35; overflow-wrap: break-word; }
.pb-meta  { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 4px; }
.pb-tag {
  font-size: 10.5px; font-weight: 600; color: var(--mid);
  background: var(--off); border: 1px solid var(--border); padding: 3px 9px; border-radius: 100px;
}
.pb-desc {
  font-size: 13.5px; color: var(--mid); line-height: 1.65; flex: 1;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden;
}
.pb-cta { margin-top: 10px; padding: 12px 22px; font-size: 14px; justify-content: center; }
/* Ganze Karte klickbar, Markup bleibt <article> + Button */
.pb-cta::before { content: ''; position: absolute; inset: 0; z-index: 1; }
.pb-card:has(.pb-cta:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.pb-cta:focus-visible { outline: none; }

.pb-more { margin-top: 28px; text-align: center; }

/* ═══════════════ RESPONSIVE ═══════════════ */
@media (max-width: 960px) {
  .pb { --pb-cols: 2; --pb-gap: 18px; }
}
@media (max-width: 640px) {
  .pb { --pb-cols: 1.12; --pb-gap: 14px; }   /* nächste Karte angeschnitten = Wisch-Hinweis */
  .pb-head { align-items: flex-start; }
  .pb-controls { display: none; }            /* Touch: wischen statt klicken */
  .pb-track { margin-top: 24px; }
  .pb-more .btn-ghost { width: 100%; justify-content: center; }
}
@media (hover: none) {
  .pb-card:hover { transform: none; box-shadow: 0 2px 10px rgba(0,0,0,0.04); }
}
@media (prefers-reduced-motion: reduce) {
  .pb-card { transition: none; }
}
