/* =========================================================
   🎵 Style global - Current Song Display (fusion + boutons rétablis)
   ========================================================= */

/* Structure principale */
.current-song-container {
  color: #fff;
  font-weight: 600;
  font-size: 20px;
  text-align: left;
  line-height: 1.4;
}

/* Titre principal */
#song-title {
  font-weight: 600;
  margin-bottom: .5rem;
}

/* Image principale (Icecast ou émission standard) */
#album-cover {
  max-width: 250px;
  height: auto;
  display: block;
  margin-top: 10px;
  border-radius: 8px;
  border: 4px solid #fff;
  object-fit: cover;
}

/* Bouton "Voir l'émission" — rétabli et uniforme */
#song-link {
  margin-top: 10px;
  text-align: left;
}
#song-link a.song-link-btn,
.song-link-btn {
  display: inline-block;
  padding: 8px 14px;
  background-color: #1d70b8;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.2s ease, transform 0.2s ease;
  cursor: pointer;
  margin-top: 5px;
}
#song-link a.song-link-btn:hover,
.song-link-btn:hover {
  background-color: #0b3d91;
  transform: translateY(-2px);
}

/* ==========================================
   🧩 Styles pour le shortcode [chanson_actuelle_test]
   ========================================== */

/* 1️⃣ Cas standard : image centrée, bouton à gauche */
.current-song-container[data-endpoint*="current_song_display_endpoint.php"].current-song-with-cover.large-cover {
  text-align: left;
}
.current-song-container[data-endpoint*="current_song_display_endpoint.php"].current-song-with-cover.large-cover .emission-small-cover {
  display: block;
  margin: 10px auto;
  width: 100px;
  height: 100px;
  border-radius: 8px;
  box-shadow: 0 0 8px rgba(0,0,0,0.3);
}

/* 2️⃣ Cas sans_pochette="1" -> pas d’image émission ni Icecast */
.current-song-container[data-endpoint*="current_song_display_endpoint.php"].current-song-no-cover {
  text-align: left;
}
.current-song-container[data-endpoint*="current_song_display_endpoint.php"].current-song-no-cover .emission-small-cover,
.current-song-container[data-endpoint*="current_song_display_endpoint.php"].current-song-no-cover .icecast-cover {
  display: none !important;
}

/* 3️⃣ Cas cover_size="small" -> image émission à droite, texte à gauche */
.current-song-container[data-endpoint*="current_song_display_endpoint.php"].current-song-with-cover.small-cover {
  position: relative;
  text-align: left;
}
.current-song-container[data-endpoint*="current_song_display_endpoint.php"].current-song-with-cover.small-cover .emission-small-cover {
  width: 80px;
  height: 80px;
  position: absolute;
  right: 0;
  top: 0;
  border-radius: 8px;
  box-shadow: 0 0 8px rgba(0,0,0,0.3);
}

/* Icecast cover : taille standard */
.icecast-cover {
  width: 90px;
  height: 90px;
  display: block;
  margin: 10px auto;
  border-radius: 8px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.4);
}
/* =========================================================
   🎵 Style titres Icecast : séparation artiste / titre
   ========================================================= */
.icecast-title {
  display: block;
  font-size: 1.2rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 4px;
}

.icecast-artist {
  font-size: 0.95rem;
  font-weight: 400;
  color: #cccccc;
  margin-bottom: 10px;
}
/* =========================================================
   🎧 Ajustement de taille : émission petite / Icecast grande
   ========================================================= */

/* Pochette émission (CURRENT_EMISSION_IMAGE) — petite */
.current-song-container[data-endpoint*="current_song_display_endpoint.php"] .emission-small-cover,
.current-song-container[data-endpoint*="current_song_display_endpoint.php"] #album-cover {
  width: 100px !important;
  height: 100px !important;
  border-radius: 8px;
  margin: 8px 0;
  box-shadow: 0 0 6px rgba(0,0,0,0.3);
}

/* Pochette Icecast (flux en cours) — grande */
.current-song-container[data-endpoint*="current_song_display_endpoint.php"] .icecast-cover {
  width: 300px !important;
  height: 300px !important;
  border-radius: 12px;
  margin: 15px auto;
  display: block;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

/* 🎙️ Type d’émission (Live / Rediffusion) */
.emission-type {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
  margin-bottom: 10px;
}
/* 🎙️ Titre d’émission (Live / Rediffusion) */
.emission-title{
  display: block;
  font-size: 1.2rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 4px;
}


/* =========================================================
   🎵 Style de la grille des programmes
   ========================================================= */

/* ===============================
   🧩 GRILLE RADIO — RESPONSIVE FINAL
   =============================== */

.radio-grille {
  width: 100%;
  background: #f5f7f9;
  border-collapse: collapse;
  overflow: hidden;
  max-width: 100vw;
}

/* ====== Ligne des titres ====== */
.ligne-entete {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr); /* ✅ colonne "Heures" réduite */
  background: #354D93;
  color: white;
  font-weight: 600;
  text-align: center;
  border-bottom: 1px solid #ccc;
}

.cell-heure-titre,
.cell-jour-titre {
  padding: 6px;
  border-right: 1px solid #ccc;
  white-space: nowrap;
}

/* ====== Lignes horaires ====== */
.ligne-heure {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr); /* ✅ largeur ajustée */
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  align-items: stretch;
}

/* Alternance de fond */
.ligne-heure:nth-of-type(odd) { background: rgba(0, 0, 0, 0.02); }
.ligne-heure:nth-of-type(even) { background: rgba(255, 255, 255, 0.8); }


/* ====== Colonne des heures ====== */
.cell-heure-titre {
  background: #354D93; /* bleu principal */
  color: #fff;
  font-weight: 600;
  text-align: center;
  padding: 6px;
  border-right: 1px solid rgba(255,255,255,0.2);
}

/* ✅ Heures — alternance bleu foncé / bleu clair */
.cell-heure {
  text-align: center;
  font-weight: 600;
  color: #fff;
  line-height: 200px;
  border-right: 1px solid rgba(255,255,255,0.2);
  background: #354D93; /* bleu principal */
}

/* ✅ une ligne sur deux plus claire */
.ligne-heure:nth-of-type(even) .cell-heure {
  background: #4b61b0; /* bleu clair */
}


/* ====== Cellules des jours ====== */
.cell-jour {
  border-right: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  padding: 3px;
}

/* ====== Blocs émission ====== */
.emission-bloc {
  position: relative;
  background: #000;
  border: 1px solid #ccc;
  border-radius: 6px;
  height: 200px;
  margin-bottom: 3px;
  overflow: hidden;
  font-size: 0.8rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: box-shadow 0.3s ease, transform 0.25s ease;
  cursor: pointer;
}

/* ✅ Image plein cadre */
.emission-bloc img.emission-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  transition: transform 0.4s ease;
  z-index: 1;
}

/* ✅ Texte superposé */
.emission-bloc .emission-nom,
.emission-bloc .emission-horaire,
.emission-bloc .emission-freq,
.emission-bloc .emission-type {
  position: relative;
  z-index: 2;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  background: rgba(0,0,0,0.3);
  padding: 3px 6px;
  margin: 1px 0;
  width: fit-content;
  border-radius: 4px;
}

.emission-bloc .emission-nom {
  font-size: 0.9rem;
  font-weight: 600;
}

/* ✅ Effet zoom au survol (desktop uniquement) */
@media (hover: hover) and (pointer: fine) {
  .emission-bloc:hover img.emission-img {
    transform: scale(1.1);
  }

  .emission-bloc:hover {
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
    transform: scale(1.02);
  }
}

/* ===============================
   📱 RESPONSIVE MOBILE (≤900px)
   =============================== */
@media screen and (max-width: 900px) {

  /* ✅ structure de base mobile : heures + jour actif */
  .ligne-entete,
  .ligne-heure {
    grid-template-columns: 60px 1fr; /* ✅ conserve la même largeur de colonne */
  }

  /* ✅ Cache seulement les colonnes non actives */
  .cell-jour-titre,
  .cell-jour {
    display: none !important;
  }

  /* ✅ Affiche la colonne du jour actif dans toutes les lignes */
  .cell-jour-titre.active,
  .cell-jour.active {
    display: flex !important;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
  }

  /* ✅ Centrage texte entête du jour */
  .cell-jour-titre.active {
    display: block !important;
    text-align: center;
    background: #354D93;
    color: #fff;
    padding: 8px 0;
    font-weight: 600;
    border-bottom: 1px solid #ccc;
  }

  .cell-heure {
    line-height: 120px;
    font-size: 0.9rem;
    text-align: center;
    background: #354D93;
    color: #fff;
    border-right: 1px solid rgba(255,255,255,0.2);
  }

  /* ✅ Affichage complet des émissions */
  .cell-jour.active .emission-bloc {
    display: flex;
    height: 180px;
    margin: 5px 0;
  }

  .emission-bloc img.emission-img {
    transform: none !important;
  }

  .emission-bloc .emission-nom {
    font-size: 0.85rem;
    background: rgba(0, 0, 0, 0.4);
  }
}

/* ===============================
   🔗 Bloc émission cliquable
   =============================== */
.emission-bloc a.emission-link {
  position: absolute;
  inset: 0;
  z-index: 5;
  text-indent: -9999px;
  overflow: hidden;
}

.emission-bloc * {
  position: relative;
  z-index: 10;
}

/* ===============================
   📱 BARRE DE NAVIGATION DES JOURS (mobile)
   =============================== */

/* Cachée sur ordinateur */
.mobile-nav {
  display: none;
}

@media screen and (max-width: 900px) {
  .mobile-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 10px 0;
    background: #354D93;
    color: white;
    font-weight: 600;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    z-index: 50;
  }

  .mobile-nav .day-label {
    font-size: 1rem;
    text-transform: capitalize;
    letter-spacing: 0.5px;
  }

  .mobile-nav button {
    background: white;
    color: #354D93;
    border: none;
    border-radius: 6px;
    font-size: 1.3rem;
    width: 40px;
    height: 40px;
    line-height: 38px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  }

  .mobile-nav button:hover {
    background: #e7e9f6;
    transform: scale(1.05);
  }

  /* ✅ Animation de transition entre les jours */
  .radio-grille {
    position: relative;
    overflow: hidden;
  }

  .jour-transition {
    animation: slideIn 0.4s ease both;
  }

  @keyframes slideIn {
    from {
      opacity: 0;
      transform: translateX(40px);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }

  .jour-transition-prev {
    animation: slideOut 0.4s ease both;
  }

  @keyframes slideOut {
    from {
      opacity: 0;
      transform: translateX(-40px);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }

  /* ✅ Barre secondaire optionnelle en bas */
  .mobile-nav-bottom {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 10px 0;
    background: #354D93;
    color: white;
    font-weight: 600;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.1);
    position: sticky;
    bottom: 0;
    z-index: 40;
  }
}

/* =========================================
   🧪 Mode Debug Visuel (à désactiver en prod)
   ========================================= */
.debug-yes {
  outline: 3px solid rgba(0, 200, 0, 0.8); /* vert */
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}
.debug-no {
  outline: 3px solid rgba(255, 0, 0, 0.8); /* rouge */
  box-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
  opacity: 0.5; /* plus pâle */
}

/* ✅ Correction affichage mobile si aucune colonne .active n'est définie */
@media screen and (max-width: 900px) {
  .ligne-heure:not(:has(.cell-jour.active)) .cell-jour:nth-child(2),
  .ligne-entete:not(:has(.cell-jour-titre.active)) .cell-jour-titre:nth-child(2) {
    display: flex !important; /* Affiche la première colonne par défaut */
  }
}

/* Marges super serrées uniquement pour le shortcode sans_pochette="1" */
.current-song-container.current-song-no-cover .emission-title {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.current-song-container.current-song-no-cover .emission-type {
    margin-top: 0 !important;
    margin-bottom: 4px !important;
}

.current-song-container.current-song-no-cover .song-link-btn {
    margin-top: 4px !important;
}

/* Option : réduire l’espace entre les lignes internes si nécessaire */
.current-song-container.current-song-no-cover .icecast-title,
.current-song-container.current-song-no-cover .icecast-artist {
    margin-bottom: 2px !important;
}

