/* ==================================================================
   LECTEUR "AVANT-PREMIÈRE" (index.php)
   Toutes les classes commencent par .ap- pour ne rien casser ailleurs.
   ================================================================== */

.ap-section {
  --ap-orange: #E27904;
  --ap-rose: #f2546b;
  --ap-texte: #f5f1ec;
  --ap-texte-doux: rgba(245, 241, 236, 0.68);

  position: relative;
  padding: 70px 16px;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(226, 121, 4, 0.22), transparent 60%),
    radial-gradient(ellipse at 90% 100%, rgba(242, 84, 107, 0.14), transparent 55%),
    #0b0908;
  overflow: hidden;
}

.ap-card {
  position: relative;
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 44px;
  align-items: center;
  padding: 36px;
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015));
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
}

/* ---------- Pochette ---------- */

.ap-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
}

.ap-cover::before {               /* halo coloré derrière la pochette */
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--ap-orange), var(--ap-rose));
  filter: blur(34px);
  opacity: 0.55;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.ap-section.is-playing .ap-cover::before {
  opacity: 0.85;
  animation: ap-pulse 2.4s ease-in-out infinite;
}

.ap-cover img,
.ap-cover video {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
  display: block;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
}

/* Image OU vidéo : l'élément masqué ne doit pas s'afficher */
.ap-cover [hidden] {
  display: none !important;
}

/* annule le trait orange que styles.css ajoute sous les h2 */
.ap-section .ap-title::after,
.ap-section .ap-title::before {
  display: none !important;
  content: none !important;
}

@keyframes ap-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}

/* ---------- Textes ---------- */

.ap-info {
  color: var(--ap-texte);
  text-align: left;
  min-width: 0;
}

.ap-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  font-family: "Inter", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(90deg, var(--ap-orange), var(--ap-rose));
}

.ap-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  animation: ap-blink 1.6s ease-in-out infinite;
}

@keyframes ap-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.25; }
}

.ap-section .ap-title {
  text-align: inherit;            /* annule le centrage des h2 du site */
  padding: 0;
  letter-spacing: normal;
  text-transform: none;
  margin: 18px 0 6px;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 600;
  line-height: 1.05;
  color: #fff;
}

.ap-artist {
  margin: 0;
  font-family: "Inter", sans-serif;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ap-texte-doux);
}

.ap-date {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 0;
  font-family: "Inter", sans-serif;
  font-size: 15px;
  color: var(--ap-texte);
}

.ap-date[hidden] {
  display: none;
}

.ap-date .fa {
  color: var(--ap-orange);
}

/* ---------- Lecteur ---------- */

.ap-player {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 30px;
}

.ap-play {
  flex: 0 0 auto;
  width: 66px;
  height: 66px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 24px;
  background: linear-gradient(135deg, var(--ap-orange), var(--ap-rose));
  box-shadow: 0 10px 28px rgba(226, 121, 4, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ap-play:hover {
  transform: scale(1.06);
  box-shadow: 0 14px 34px rgba(226, 121, 4, 0.6);
}

.ap-play:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.ap-play .fa-play {
  margin-left: 4px;               /* centrage optique du triangle */
}

.ap-track {
  flex: 1 1 auto;
  min-width: 0;
}

.ap-times {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--ap-texte-doux);
}

/* Barre de progression (input range stylé) */
.ap-progress {
  --ap-pct: 0%;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  margin: 0;
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(90deg, var(--ap-orange), var(--ap-rose)) 0 0 / var(--ap-pct) 100% no-repeat,
              rgba(255, 255, 255, 0.14);
}

.ap-progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(226, 121, 4, 0.35);
  border: none;
}

.ap-progress::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(226, 121, 4, 0.35);
  border: none;
}

.ap-progress::-moz-range-track {
  background: transparent;
}

.ap-progress:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 6px;
}

/* Volume */
.ap-volume {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ap-mute {
  border: none;
  background: transparent;
  color: var(--ap-texte-doux);
  font-size: 18px;
  cursor: pointer;
  width: 28px;
  padding: 0;
}

.ap-mute:hover {
  color: #fff;
}

.ap-volume .ap-progress {
  width: 90px;
}

/* ---------- Liste des morceaux (dès qu'il y en a plusieurs) ---------- */

.ap-tracks {
  list-style: none;
  margin: 26px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ap-track-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--ap-texte-doux);
  font-family: "Inter", sans-serif;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.ap-track-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.ap-track-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.ap-track-btn.is-active {
  background: rgba(226, 121, 4, 0.12);
  border-color: rgba(226, 121, 4, 0.45);
  color: #fff;
}

.ap-track-num {
  flex: 0 0 22px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  opacity: 0.6;
}

.ap-track-name {
  flex: 1 1 auto;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ap-track-date {
  font-size: 13px;
  opacity: 0.7;
  white-space: nowrap;
}

/* Petit égaliseur animé sur le morceau en cours de lecture */
.ap-track-eq {
  display: none;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}

.ap-track-eq i {
  width: 3px;
  height: 100%;
  border-radius: 2px;
  background: var(--ap-orange);
  animation: ap-eq 0.9s ease-in-out infinite;
}

.ap-track-eq i:nth-child(2) { animation-delay: -0.3s; }
.ap-track-eq i:nth-child(3) { animation-delay: -0.6s; }

.ap-section.is-playing .ap-track-btn.is-active .ap-track-eq {
  display: inline-flex;
}

@keyframes ap-eq {
  0%, 100% { transform: scaleY(0.3); transform-origin: bottom; }
  50%      { transform: scaleY(1);   transform-origin: bottom; }
}

/* ---------- Responsive ---------- */

@media (max-width: 820px) {
  .ap-card {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 26px 20px;
    text-align: center;
  }

  .ap-cover {
    max-width: 260px;
    margin: 0 auto;
  }

  .ap-info {
    text-align: center;
  }

  .ap-volume {
    display: none;                /* sur mobile, on règle le volume au téléphone */
  }
}

@media (prefers-reduced-motion: reduce) {
  .ap-section.is-playing .ap-cover::before,
  .ap-badge-dot,
  .ap-track-eq i {
    animation: none;
  }
}
