/* ============================================================
   LECTEURS MÉDIA RÉUTILISABLES
   Spotify, YouTube, Apple Music, Vidéos, Audio
   ============================================================ */

/* ---- BASE — Conteneur média générique ---- */
.media-embed {
  margin-top: var(--spacing-md);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid #e6edf5;
  box-shadow: var(--shadow-sm);
  background: #000;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.media-embed:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Ratio responsive 16:9 (YouTube, Vimeo, etc.) */
.media-embed .ratio {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
}

.media-embed .ratio iframe,
.media-embed .ratio video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ============================================================
   LECTEURS AUDIO (hauteur fixe selon plateforme)
   ============================================================ */

/* Spotify - Hauteur optimale pour l'album */
.media-embed.media-embed--spotify .ratio {
  padding-bottom: 0;
  height: 380px;
}

/* Apple Music - Hauteur optimale pour le widget album */
.media-embed.media-embed--apple-music .ratio {
  padding-bottom: 0;
  height: 450px;
}

/* Deezer - Hauteur optimale pour le widget */
.media-embed.media-embed--deezer .ratio {
  padding-bottom: 0;
  height: 300px;
}

/* Responsive pour mobile */
@media screen and (max-width: 768px) {
  .media-embed.media-embed--spotify .ratio {
    height: 360px;
  }
  
  .media-embed.media-embed--apple-music .ratio {
    height: 420px;
  }
  
  .media-embed.media-embed--deezer .ratio {
    height: 280px;
  }
}

/* ============================================================
   SPOTIFY (vertical)
   ============================================================ */

.spotify-embed {
  width: 100%;
  max-width: 400px;
  border-radius: 12px;
  margin: 15px 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.spotify-embed:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(29, 185, 84, 0.15);
}

.spotify-info {
  font-size: 0.9em;
  color: #666;
  margin-top: 10px;
  text-align: center;
}

.spotify-tracklist {
  margin-top: 15px;
  padding-left: 20px;
  list-style: none;
}

.spotify-tracklist li {
  margin-bottom: 8px;
}

.spotify-tracklist a {
  color: #1db954;
  font-weight: bold;
  text-decoration: none;
  transition: color 0.2s ease;
}

.spotify-tracklist a:hover {
  color: #169c46;
}

@media screen and (max-width: 950px) {
  .spotify-embed {
    height: 400px !important;
  }
}

/* ============================================================
   APPLE MUSIC
   ============================================================ */

.apple-music-embed {
  width: 100%;
  max-width: 450px;
  border-radius: 12px;
  margin: 15px 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.apple-music-embed:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(168, 85, 247, 0.15);
}

.apple-music-tracklist {
  margin-top: 15px;
  padding-left: 20px;
  list-style: none;
}

.apple-music-tracklist li {
  margin-bottom: 8px;
}

.apple-music-tracklist a {
  color: #a855f7;
  font-weight: bold;
  text-decoration: none;
  transition: color 0.2s ease;
}

.apple-music-tracklist a:hover {
  color: #9333ea;
}

/* ============================================================
   YOUTUBE / VIDÉO
   ============================================================ */

.youtube-embed,
.video-embed {
  width: 100%;
  border-radius: 12px;
  margin: 20px 0;
  overflow: hidden;
}

.youtube-embed .ratio,
.video-embed .ratio {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
}

.youtube-embed .ratio iframe,
.youtube-embed .ratio video,
.video-embed .ratio iframe,
.video-embed .ratio video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ============================================================
   DEEZER
   ============================================================ */

.deezer-embed {
  width: 100%;
  max-width: 400px;
  border-radius: 12px;
  margin: 15px 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.deezer-embed:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(240, 99, 97, 0.15);
}

.deezer-tracklist {
  margin-top: 15px;
  padding-left: 20px;
  list-style: none;
}

.deezer-tracklist li {
  margin-bottom: 8px;
}

.deezer-tracklist a {
  color: #f06361;
  font-weight: bold;
  text-decoration: none;
  transition: color 0.2s ease;
}

.deezer-tracklist a:hover {
  color: #d63c39;
}

/* ============================================================
   SOUNDCLOUD
   ============================================================ */

.soundcloud-embed {
  width: 100%;
  border-radius: 12px;
  margin: 15px 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.soundcloud-embed:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 153, 0, 0.15);
}

/* ============================================================
   AUDIO GÉNÉRIQUE (HTML5)
   ============================================================ */

.audio-player {
  width: 100%;
  max-width: 600px;
  margin: 15px 0;
  padding: 12px;
  background: #fff;
  border: 1px solid #e6edf5;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.audio-player audio {
  width: 100%;
  outline: none;
}

.audio-player audio::-webkit-media-controls-container {
  background: transparent;
}

/* ============================================================
   CALLOUT / CONSEIL
   ============================================================ */

.media-callout {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 15px 0;
  padding: 12px 14px;
  border-left: 4px solid #fbbf24;
  background: #fef3c7;
  border-radius: 8px;
  font-size: 0.95rem;
  color: #78350f;
}

.media-callout .icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.media-callout .label {
  font-weight: 600;
  color: #d97706;
}

.media-callout a {
  color: #0ea5e9;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px dashed rgba(14, 165, 233, 0.3);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.media-callout a:hover {
  color: #0284c7;
  border-bottom-color: rgba(2, 132, 199, 0.6);
}

/* Variantes de couleur */
.media-callout.spotify {
  border-left-color: #1db954;
  background: #ecfdf5;
  color: #065f46;
}

.media-callout.spotify .label {
  color: #059669;
}

.media-callout.apple {
  border-left-color: #a855f7;
  background: #f3e8ff;
  color: #581c87;
}

.media-callout.apple .label {
  color: #9333ea;
}

.media-callout.deezer {
  border-left-color: #f06361;
  background: #fef2f2;
  color: #7c2d12;
}

.media-callout.deezer .label {
  color: #dc2626;
}

.media-callout.youtube {
  border-left-color: #ef4444;
  background: #fef2f2;
  color: #7c2d12;
}

.media-callout.youtube .label {
  color: #dc2626;
}

/* ============================================================
   SECTION TITRE MÉDIA
   ============================================================ */

.media-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: var(--spacing-lg) 0 var(--spacing-md);
  font-size: 1.3rem;
  font-weight: 700;
  color: #0f172a;
}

.media-section-title .icon {
  display: inline-block;
  font-size: 1.4rem;
}

.media-section-title .brand {
  font-size: 0.85em;
  opacity: 0.8;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
  .media-embed {
    margin-top: var(--spacing-sm);
    border-radius: 10px;
  }

  .spotify-embed,
  .apple-music-embed,
  .deezer-embed {
    max-width: 100%;
  }

  .media-callout {
    padding: 10px 12px;
    font-size: 0.9rem;
  }

  .media-callout .icon {
    font-size: 1rem;
  }

  .media-section-title {
    font-size: 1.15rem;
  }
}

@media (max-width: 480px) {
  .media-embed .ratio {
    padding-bottom: 56.25%;
  }

  .audio-player {
    max-width: 100%;
    padding: 10px;
  }
}