/* =====================================================================
   RÉCIT AUDIO — boutons « Écouter » et « Lire le texte » + fenêtre du texte
   (module partagé par les pages projet ; voir assets/js/recit-audio.js)
   ===================================================================== */
.ra-listen,
.ra-read {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px 0 8px;
  overflow: hidden;
  border: 1px solid rgba(46, 230, 214, 0.45);
  border-radius: 12px;
  color: #fff;
  background: rgba(46, 230, 214, 0.07);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}
.ra-read { padding: 0 16px; gap: 8px; border-color: rgba(226, 230, 255, 0.24); background: rgba(255, 255, 255, 0.05); }
.ra-listen:hover,
.ra-read:hover { transform: translateY(-2px); border-color: #2ee6d6; }
.ra-listen::before {              /* progression de la lecture */
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--p, 0) * 1%);
  background: linear-gradient(90deg, rgba(46, 230, 214, 0.16), rgba(46, 230, 214, 0.32));
  pointer-events: none;
}
.ra-ico {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #061420;
  background: #2ee6d6;
}
.ra-ico svg { width: 14px; height: 14px; fill: currentColor; }
.ra-read svg { width: 18px; height: 18px; flex: none; }
.ra-listen > span:not(.ra-ico) { position: relative; }
.ra-time { font-variant-numeric: tabular-nums; opacity: 0.8; font-weight: 700; }
.ra-time::before { content: "· "; }
.ra-listen.is-playing .ra-label::after { content: " — en cours"; font-weight: 600; opacity: 0.85; }
.ra-listen.is-paused .ra-label::after { content: " — en pause"; font-weight: 600; opacity: 0.85; }
.ra-listen:focus-visible,
.ra-read:focus-visible,
.ra-close:focus-visible { outline: 3px solid #2ee6d6; outline-offset: 3px; }

.ra-dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: min(80vh, 760px);
  padding: 0;
  border: 1px solid rgba(46, 230, 214, 0.45);
  border-radius: 20px;
  color: #eaf3fb;
  background: linear-gradient(160deg, #13203f, #090f22);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.ra-dialog::backdrop { background: rgba(4, 6, 18, 0.74); backdrop-filter: blur(3px); }
.ra-dialog header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 14px;
  background: #131d3b;
  border-bottom: 1px solid rgba(46, 230, 214, 0.2);
}
.ra-kicker { margin: 0 0 4px; color: #2ee6d6; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; }
.ra-dialog h2 { margin: 0; font-size: 1.3rem; line-height: 1.25; }
.ra-close {
  flex: none;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(46, 230, 214, 0.4);
  border-radius: 50%;
  color: #fff;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
.ra-close:hover { background: rgba(46, 230, 214, 0.15); }
.ra-body { padding: 18px 24px 26px; overflow: auto; }
.ra-body p { margin: 0 0 14px; color: #d6e4f2; font-size: 1.02rem; line-height: 1.7; }
.ra-body p:last-child { margin-bottom: 0; }
@media (prefers-reduced-motion: reduce) { .ra-listen, .ra-read { transition: none; } }
@media print { .ra-listen, .ra-read { display: none !important; } }
