/* ============================================================
   PLAYLISTS — 91 FM
   ============================================================ */

.playlists-page,
.playlist-detail {
  --pl-brand:  #d91319;
  --pl-ink:    #0f172a;
  --pl-muted:  #4b5a78;
  --pl-panel:  #ffffff;
  --pl-border: rgba(220, 228, 240, 0.96);
  --pl-radius: 18px;
  --pl-wrap:   min(1200px, calc(100% - 32px));
  background: #f3f6fb;
  min-height: 60vh;
}

/* ============================================================
   HERO
   ============================================================ */

.playlists-hero,
.playlist-detail-header {
  position: relative;
  overflow: hidden; /* repli pour les navigateurs sans `clip` */
  overflow: clip;
  padding: 72px 0 64px;
}

.playlists-hero::before,
.playlist-detail-header::before {
  content: '';
  position: absolute;
  inset: -30px;
  background: url('https://media.webradio91fm.fr/assets/content/backgrounds/BandeauNews.png') center / cover no-repeat;
  filter: blur(6px);
  transform: scale(1.08);
  opacity: 0.6;
  z-index: 0;
}

.playlists-hero::after,
.playlist-detail-header::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(8, 14, 30, 0.58);
  z-index: 1;
}

.playlists-hero-inner,
.playlist-detail-header-inner {
  position: relative;
  z-index: 2;
  width: var(--pl-wrap);
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.playlists-hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
}

.playlists-hero-kicker::before, .playlists-hero-kicker::after {
  content: '';
  display: block;
  width: 24px;
  height: 2px;
  background: var(--pl-brand);
  border-radius: 99px;
}

.playlists-hero h1,
.playlist-detail-name {
  margin: 0 0 18px;
  font-size: clamp(3.8rem, 10vw, 7.5rem);
  font-weight: 900;
  font-style: italic;
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 2px rgba(255,255,255,.82);
}

.playlist-detail-name { margin-bottom: 0; }

.playlists-hero-sub {
  margin: 0;
  font-size: clamp(14px, 2vw, 17px);
  font-weight: 400;
  color: rgba(255,255,255,.68);
  line-height: 1.5;
  max-width: 44ch;
}

/* ============================================================
   CORPS
   ============================================================ */

.playlists-body {
  padding: 44px 0 88px;
  display: flex;
  flex-direction: column;
  gap: 44px;
}

.pl-section {
  width: var(--pl-wrap);
  margin: 0 auto;
}

.pl-section-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #94a3b8;
  margin: 0 0 18px;
}

.playlists-empty {
  color: var(--pl-muted);
  text-align: center;
  padding: 80px 0;
  font-size: 15px;
}

/* ─── Badge date ─────────────────────────────────────────── */
.pl-date-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
}

.pl-date-badge svg { width: 12px; height: 12px; flex-shrink: 0; }

/* ============================================================
   BLOC COUP DE CŒUR
   ============================================================ */

.pl-cdc {
  background: linear-gradient(135deg, #0c0f1e 0%, #161b35 50%, #0c0f1e 100%);
  border-radius: 22px;
  padding: 36px 40px;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(280px, 360px);
  gap: 40px;
  align-items: center;
  position: relative;
  overflow: hidden;
}

/* Halo Spotify vert */
.pl-cdc::before {
  content: '';
  position: absolute;
  bottom: -60px;
  right: 60px;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(29,185,84,.14) 0%, transparent 65%);
  pointer-events: none;
}

.pl-cdc-left { position: relative; z-index: 1; }

.pl-cdc-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.65);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.pl-cdc-badge svg { width: 11px; height: 11px; }

.pl-cdc-title {
  font-size: clamp(20px, 2.5vw, 28px);
  font-weight: 800;
  color: #fff;
  margin: 0 0 22px;
  line-height: 1.2;
  max-width: 480px;
}

.pl-cdc-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.pl-cdc-footer .pl-date-badge { color: rgba(255,255,255,.3); }
.pl-cdc-footer .pl-date-badge svg { color: rgba(255,255,255,.3); }

/* Illustration musicale (droite) */
.pl-cdc-art {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 50%;
  color: rgba(255,255,255,.08);
}

.pl-cdc-art svg { width: 64px; height: 64px; }

/* Repli : lecteur Spotify intégré (si les pochettes iTunes échouent) */
.pl-cdc-embed {
  position: relative;
  z-index: 1;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0,0,0,.35);
}

.pl-cdc-embed iframe { display: block; border-radius: 14px; }

/* Pochettes des morceaux Coup de Cœur (via iTunes, voir spotify_playlist_covers.php) */
.pl-cdc-tracks-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.pl-cdc-track-tile { min-width: 0; }

.pl-cdc-track-cover {
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255,255,255,.06);
  box-shadow: 0 6px 20px rgba(0,0,0,.3);
  margin-bottom: 8px;
}

.pl-cdc-track-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.pl-cdc-track-cover-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.15);
}

.pl-cdc-track-cover-placeholder svg { width: 32px; height: 32px; }

.pl-cdc-track-tile-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pl-cdc-track-tile-artist {
  margin: 2px 0 0;
  font-size: 12px;
  color: rgba(255,255,255,.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   SECTION ÉMISSIONS — cartes poster (même langage visuel que
   la grille /emissions : cover pleine carte + overlay dégradé)
   ============================================================ */

.pl-emissions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px;
}

.pl-em-card {
  position: relative;
  display: block;
  aspect-ratio: 1;
  border-radius: var(--pl-radius);
  overflow: hidden;
  text-decoration: none;
  background: #12131e;
  box-shadow: 0 2px 10px rgba(15,23,42,.08);
  transition: box-shadow .22s, transform .22s;
}

.pl-em-card:hover {
  box-shadow: 0 16px 40px rgba(15,23,42,.22);
  transform: translateY(-4px);
}

.pl-em-cover {
  position: absolute;
  inset: 0;
  background: #e8eef6;
}

.pl-em-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s;
}

.pl-em-card:hover .pl-em-cover img { transform: scale(1.06); }

.pl-em-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pl-em-cover-placeholder svg { width: 44px; height: 44px; color: #b0bccc; }

/* Badge nombre de titres — haut gauche, façon badge catégorie /emissions */
.pl-em-count {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(6px) saturate(1.1);
  -webkit-backdrop-filter: blur(6px) saturate(1.1);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 4px 10px;
  border-radius: 999px;
}

/* Titre + date en overlay dégradé bas */
.pl-em-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1;
  padding: 30px 14px 14px;
  background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,.82) 100%);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pl-em-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pl-em-date {
  color: rgba(255,255,255,.6);
}

.pl-em-date svg { color: rgba(255,255,255,.6); }

/* ============================================================
   BLOC LA PLAYLIST D'ARNAUD
   ============================================================ */

.pl-arnaud {
  background: var(--pl-panel);
  border: 1px solid var(--pl-border);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 2px 14px rgba(15,23,42,.06);
}

.pl-arnaud-header {
  padding: 28px 28px 24px;
  border-bottom: 1px solid var(--pl-border);
}

.pl-arnaud-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--pl-brand);
  display: block;
  margin-bottom: 6px;
}

.pl-arnaud-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--pl-ink);
  margin: 0 0 8px;
  line-height: 1.2;
}

.pl-arnaud-desc {
  font-size: 14px;
  color: var(--pl-muted);
  line-height: 1.5;
  margin: 0;
  max-width: 56ch;
}

.pl-arnaud-children {
  padding: 24px 28px 28px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

/* Carte enfant */
.pl-child-card {
  display: block;
  text-decoration: none;
  background: #f8fafc;
  border: 1px solid var(--pl-border);
  border-radius: 14px;
  overflow: hidden;
  transition: box-shadow .2s, transform .2s, background .15s;
}

.pl-child-card:hover {
  background: #fff;
  box-shadow: 0 8px 24px rgba(15,23,42,.1);
  transform: translateY(-3px);
}

.pl-child-cover {
  aspect-ratio: 1;
  background: #e8eef6;
  overflow: hidden;
}

.pl-child-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s;
}

.pl-child-card:hover .pl-child-cover img { transform: scale(1.04); }

.pl-child-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pl-child-cover-placeholder svg { width: 32px; height: 32px; color: #b0bccc; }

.pl-child-body { padding: 12px 14px 14px; }

.pl-child-name {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--pl-ink);
  line-height: 1.3;
  margin-bottom: 4px;
}

.pl-child-count { display: block; font-size: 12px; color: #94a3b8; }

/* ============================================================
   BOUTON SPOTIFY
   ============================================================ */

.pl-spotify-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #1DB954;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 999px;
  text-decoration: none;
  transition: opacity .15s, transform .15s;
}

.pl-spotify-btn:hover { opacity: .88; transform: scale(1.03); }
.pl-spotify-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ============================================================
   PAGE DÉTAIL
   ============================================================ */

.playlist-detail-meta-bar {
  background: #fff;
  border-bottom: 1px solid var(--pl-border);
}

.playlist-detail-meta-inner {
  width: var(--pl-wrap);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 22px 0;
  flex-wrap: wrap;
}

.playlist-detail-cover {
  width: 72px; height: 72px;
  flex-shrink: 0;
  border-radius: 10px; overflow: hidden;
  background: #e8eef6;
  border: 1px solid var(--pl-border);
}

.playlist-detail-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.playlist-detail-cover-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}

.playlist-detail-cover-placeholder svg { width: 32px; height: 32px; color: #b0bccc; }

.playlist-detail-info { flex: 1; min-width: 0; }

.playlist-detail-info-name {
  font-size: 18px; font-weight: 800;
  color: var(--pl-ink); margin: 0 0 6px; line-height: 1.2;
}

.playlist-detail-count { font-size: 13px; color: #94a3b8; font-weight: 500; }

.playlist-detail-platforms {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-left: auto;
}

.playlist-platform-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--pl-ink); color: #fff;
  font-size: 13px; font-weight: 700;
  padding: 10px 18px; border-radius: 999px;
  text-decoration: none; white-space: nowrap;
  transition: opacity .15s, transform .15s;
}

.playlist-platform-btn:hover { opacity: .88; transform: scale(1.03); }
.playlist-platform-btn img { width: 20px; height: 20px; border-radius: 5px; flex-shrink: 0; }

.playlist-detail-back {
  display: inline-flex; align-items: center; gap: 5px;
  color: #94a3b8; font-size: 13px; text-decoration: none;
  font-weight: 500; transition: color .15s; white-space: nowrap;
}

.playlist-detail-back:hover { color: var(--pl-ink); }
.playlist-detail-back svg { width: 14px; height: 14px; flex-shrink: 0; }

.playlist-detail-children-body {
  width: var(--pl-wrap); margin: 0 auto; padding: 36px 0 64px;
}

.playlist-detail-section-label {
  font-size: 12px; font-weight: 800; color: #94a3b8;
  letter-spacing: .1em; text-transform: uppercase; margin: 0 0 16px;
}

.playlist-detail-body {
  width: var(--pl-wrap); margin: 0 auto; padding: 36px 0 64px;
}

/* Réutiliser la grille cartes dans le détail */
.playlists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.playlist-card {
  background: var(--pl-panel); border: 1px solid var(--pl-border);
  border-radius: var(--pl-radius); overflow: hidden;
  box-shadow: 0 2px 10px rgba(15,23,42,.05);
  transition: box-shadow .22s, transform .22s;
}

.playlist-card:hover { box-shadow: 0 10px 30px rgba(15,23,42,.12); transform: translateY(-4px); }
.playlist-card-link { display: block; text-decoration: none; color: inherit; }

.playlist-card-cover {
  position: relative; aspect-ratio: 1; background: #e8eef6; overflow: hidden;
}

.playlist-card-cover img {
  width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s;
}

.playlist-card:hover .playlist-card-cover img { transform: scale(1.04); }

.playlist-card-cover-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
}

.playlist-card-cover-placeholder svg { width: 44px; height: 44px; color: #b0bccc; }

.playlist-card-body { padding: 16px 18px 18px; }

.playlist-card-name {
  font-size: 15px; font-weight: 700; color: var(--pl-ink); margin: 0 0 8px; line-height: 1.3;
}

.playlist-card-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.playlist-meta-tracks { font-size: 12px; color: #94a3b8; font-weight: 500; }

/* Tracks */
.playlist-loading {
  display: flex; align-items: center; gap: 12px;
  color: var(--pl-muted); font-size: 14px; padding: 40px 0;
}

.playlist-spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(15,23,42,.1); border-top-color: var(--pl-brand);
  border-radius: 50%; animation: spinTrack .7s linear infinite; flex-shrink: 0;
}

@keyframes spinTrack { to { transform: rotate(360deg); } }

.playlist-error { color: var(--pl-muted); font-size: 14px; padding: 40px 0; }

/* Liste des titres — rangées 2 colonnes, pochette + numéro + pastilles
   d'icônes réelles des plateformes (voir /assets/img/spotify.svg etc.). */
.tracks-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.track-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #f0f2f5;
  border-radius: 12px;
  padding: 10px 14px 10px 10px;
  transition: background .15s;
}

.track-row:hover { background: #e8ebf0; }

.track-row-cover {
  position: relative;
  flex-shrink: 0;
  width: 68px; height: 68px;
  border-radius: 8px;
  background: #d8dee6 center / cover no-repeat;
  overflow: visible;
}

.track-row-num {
  position: absolute;
  bottom: -6px; left: -6px;
  background: var(--pl-brand);
  color: #fff;
  font-size: 11px; font-weight: 800;
  min-width: 24px; text-align: center;
  padding: 2px 5px;
  border-radius: 4px;
  line-height: 1.3;
}

/* Extrait 30s (iTunes) — bouton play centré, visible au survol de la pochette */
.track-row-play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 8px;
  background: rgba(15,23,42,.45);
  color: #fff;
  opacity: 0;
  cursor: pointer;
  transition: opacity .15s, background .15s;
}

.track-row-cover:hover .track-row-play,
.track-row-play:focus-visible,
.track-row-play-active { opacity: 1; }

.track-row-play:hover { background: rgba(15,23,42,.65); }
.track-row-play svg { width: 22px; height: 22px; }

.track-row-info { flex: 1; min-width: 0; }

.track-row-title {
  margin: 0 0 3px; font-size: 16px; font-weight: 700; color: var(--pl-ink); line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.track-row-manual {
  display: inline-block; margin-left: 8px; vertical-align: middle;
  background: #dbe1ea; color: #64748b;
  font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px;
}

.track-row-artist {
  margin: 0; font-size: 13px; color: var(--pl-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.track-row-actions {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 6px;
}

.track-row-action {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border-radius: 9px;
  background: #fff;
  border: 1px solid var(--pl-border);
  transition: transform .15s, box-shadow .15s;
}

.track-row-action:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(15,23,42,.15); }
.track-row-action img { width: 22px; height: 22px; border-radius: 5px; display: block; }

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

.tracks-show-more-btn {
  background: #fff; border: 1px solid var(--pl-border); color: var(--pl-muted);
  font-size: 14px; font-weight: 600; font-family: inherit;
  padding: 12px 32px; border-radius: 999px; cursor: pointer;
  box-shadow: 0 2px 8px rgba(15,23,42,.06);
  transition: background .15s, box-shadow .15s, color .15s;
}

.tracks-show-more-btn:hover {
  background: #f3f6fb; box-shadow: 0 4px 16px rgba(15,23,42,.1); color: var(--pl-ink);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 780px) {
  .pl-cdc { grid-template-columns: 1fr; padding: 28px 24px; }
  .pl-cdc-art { display: none; }
  .pl-arnaud-header { padding: 22px 20px 20px; }
  .pl-arnaud-children { padding: 20px 20px 24px; }
}

@media (max-width: 640px) {
  .pl-emissions-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .pl-arnaud-children { grid-template-columns: 1fr 1fr; }
  .tracks-grid { grid-template-columns: 1fr; }
  .track-row-cover { width: 52px; height: 52px; }
  .track-row-action { width: 30px; height: 30px; }
  .track-row-action img { width: 18px; height: 18px; }
  .playlist-detail-cover { width: 56px; height: 56px; }
}

@media (max-width: 400px) {
  .pl-emissions-grid { grid-template-columns: 1fr; }
}
