/* ============================================================
   LECTEUR AUDIO PERSONNALISÉ — DA Emilie nature sacrée
   ============================================================ */

.audio-block {
  margin-top: 60px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.audio-temoin {
  position: relative;
  background:
    linear-gradient(180deg, rgba(245,240,232,0.6) 0%, rgba(245,240,232,0.95) 100%),
    radial-gradient(ellipse at top right, rgba(212,175,106,0.10) 0%, transparent 60%),
    radial-gradient(ellipse at bottom left, rgba(122,158,135,0.08) 0%, transparent 55%);
  border: 1px solid rgba(212,175,106,0.22);
  border-radius: 20px;
  padding: 36px 36px 30px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.85) inset,
    0 18px 38px -22px rgba(58,46,38,0.22),
    0 4px 12px -6px rgba(58,46,38,0.10);
  overflow: hidden;
}

/* Halo doré décoratif coin haut */
.audio-temoin::before {
  content: '❋';
  position: absolute;
  top: 14px;
  right: 18px;
  font-size: 14px;
  color: var(--lumiere-doree, #D4AF6A);
  opacity: 0.45;
  letter-spacing: .15em;
}

.audio-temoin-label {
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px;
  font-style: italic;
  color: var(--texte-doux, #6b5d52);
  text-align: center;
  margin: 0 0 26px;
  line-height: 1.6;
  text-wrap: balance;
}
.audio-temoin-label em {
  color: var(--terre-sacree, #C17A5A);
  font-style: italic;
}

/* Cache le lecteur natif (gardé pour fallback + moteur) */
.audio-temoin audio { display: none; }

/* === Le player custom === */
.audio-player {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 6px 0;
}

.audio-play-btn {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px solid rgba(122,158,135,0.45);
  background:
    radial-gradient(circle at 30% 28%, rgba(255,255,255,0.55) 0%, transparent 50%),
    linear-gradient(135deg, var(--foret-profonde, #7A9E87) 0%, #6b8e78 100%);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 0 6px rgba(212,175,106,0.08),
    0 8px 20px -8px rgba(122,158,135,0.55),
    inset 0 1px 0 rgba(255,255,255,0.3),
    inset 0 -2px 6px rgba(58,46,38,0.15);
  transition: all 320ms ease;
  position: relative;
}
.audio-play-btn:hover {
  transform: scale(1.06);
  box-shadow:
    0 0 0 8px rgba(212,175,106,0.14),
    0 12px 26px -10px rgba(122,158,135,0.65),
    inset 0 1px 0 rgba(255,255,255,0.35),
    inset 0 -2px 6px rgba(58,46,38,0.15);
}
.audio-play-btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 4px rgba(212,175,106,0.45),
    0 8px 20px -8px rgba(122,158,135,0.55);
}
.audio-play-btn svg {
  width: 22px;
  height: 22px;
  pointer-events: none;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.18));
}
/* Icônes show/hide selon état */
.audio-play-btn .ico-pause { display: none; }
.audio-temoin.is-playing .audio-play-btn .ico-play { display: none; }
.audio-temoin.is-playing .audio-play-btn .ico-pause { display: block; }

/* Halo respirant en lecture */
.audio-temoin.is-playing .audio-play-btn {
  animation: audio-breathe 2.6s ease-in-out infinite;
}
@keyframes audio-breathe {
  0%, 100% {
    box-shadow:
      0 0 0 6px rgba(212,175,106,0.12),
      0 8px 20px -8px rgba(122,158,135,0.55),
      inset 0 1px 0 rgba(255,255,255,0.3);
  }
  50% {
    box-shadow:
      0 0 0 12px rgba(212,175,106,0.04),
      0 10px 24px -8px rgba(122,158,135,0.65),
      inset 0 1px 0 rgba(255,255,255,0.35);
  }
}

/* === Visualisation onde === */
.audio-wave {
  flex: 1;
  height: 44px;
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.audio-wave-bars {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  position: relative;
}
.audio-wave-bar {
  flex: 1;
  background: rgba(122,158,135,0.22);
  border-radius: 2px;
  min-height: 4px;
  transition: background 300ms;
}
/* Animation barres en lecture */
.audio-temoin.is-playing .audio-wave-bar {
  animation: audio-bar 1.3s ease-in-out infinite;
}
.audio-temoin.is-playing .audio-wave-bar:nth-child(3n)   { animation-delay: .1s; }
.audio-temoin.is-playing .audio-wave-bar:nth-child(3n+1) { animation-delay: .25s; }
.audio-temoin.is-playing .audio-wave-bar:nth-child(3n+2) { animation-delay: .4s; }
.audio-temoin.is-playing .audio-wave-bar:nth-child(5n)   { animation-delay: .55s; }
.audio-temoin.is-playing .audio-wave-bar:nth-child(7n)   { animation-delay: .7s; }
@keyframes audio-bar {
  0%, 100% { transform: scaleY(1); }
  50%      { transform: scaleY(1.45); }
}

/* Overlay de progression (rempli gauche → droite, mix gold/terre) */
.audio-wave-progress {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: 0%;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  overflow: hidden;
}
.audio-wave-progress .audio-wave-bar {
  background: linear-gradient(180deg, var(--lumiere-doree, #D4AF6A) 0%, var(--terre-sacree, #C17A5A) 100%);
  box-shadow: 0 0 6px rgba(212,175,106,0.45);
}

/* Curseur poétique (point doré qui glisse) */
.audio-wave-handle {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fff 0%, var(--lumiere-doree, #D4AF6A) 50%, var(--terre-sacree, #C17A5A) 100%);
  transform: translate(-50%, -50%);
  box-shadow:
    0 0 0 4px rgba(245,240,232,0.92),
    0 2px 8px rgba(193,122,90,0.45);
  pointer-events: none;
  opacity: 0;
  transition: opacity 300ms;
  left: 0;
}
.audio-temoin.is-ready .audio-wave-handle { opacity: 1; }

/* === Temps === */
.audio-time {
  flex-shrink: 0;
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--texte-doux, #6b5d52);
  min-width: 78px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.audio-time .audio-time-current { color: var(--foret-profonde, #7A9E87); font-weight: 600; }
.audio-time .audio-time-sep { margin: 0 4px; opacity: 0.4; }

/* === Signature === */
.audio-signature {
  margin: 22px 0 0;
  text-align: center;
  font-family: 'Caveat', cursive;
  font-size: 22px;
  color: var(--terre-sacree, #C17A5A);
  letter-spacing: .02em;
}
.audio-signature small {
  display: block;
  font-family: 'Manrope', sans-serif;
  font-size: 10.5px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--texte-doux, #6b5d52);
  margin-top: 4px;
  opacity: 0.75;
}

/* État chargement */
.audio-temoin:not(.is-ready) .audio-time { opacity: 0.4; }
.audio-temoin.is-loading .audio-play-btn { opacity: 0.7; cursor: wait; }

/* Mobile */
@media (max-width: 600px) {
  .audio-temoin { padding: 26px 22px 22px; border-radius: 16px; }
  .audio-temoin-label { font-size: 15px; margin-bottom: 22px; }
  .audio-play-btn { width: 54px; height: 54px; }
  .audio-play-btn svg { width: 18px; height: 18px; }
  .audio-wave { height: 38px; }
  .audio-time { min-width: 68px; font-size: 11px; }
  .audio-player { gap: 14px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .audio-temoin.is-playing .audio-play-btn { animation: none; }
  .audio-temoin.is-playing .audio-wave-bar { animation: none; }
}
