/* Mamou : lecteur de note vocale (.mm-audio) et prévisualiseur de fichiers (.mm-viewer). Voir mamou-media.js. */
:root { --mm-accent: #c91417; --mm-accent-soft: rgba(201, 20, 23, .1); --mm-bg: #fff; --mm-line: #e5e7eb; --mm-text: #1f2937; --mm-muted: #6b7280; }

/* ---------- Lecteur audio ---------- */
.mm-audio { display: flex; align-items: center; gap: .75rem; padding: .6rem .8rem; background: var(--mm-bg); border: 1px solid var(--mm-line); border-radius: 14px; max-width: 520px; width: 100%; box-sizing: border-box; }
.mm-audio__play { flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--mm-accent); color: #fff; font-size: 1.15rem; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: transform .15s; }
.mm-audio__play:hover { transform: scale(1.06); }
.mm-audio__play:focus-visible, .mm-audio__btn:focus-visible { outline: 3px solid var(--mm-accent-soft); outline-offset: 2px; }
.mm-audio__body { flex: 1 1 auto; min-width: 0; }
.mm-audio__seek { width: 100%; height: 6px; margin: 8px 0 4px; accent-color: var(--mm-accent); cursor: pointer; touch-action: none; }
.mm-audio__time { display: flex; justify-content: space-between; font-size: .75rem; color: var(--mm-muted); font-variant-numeric: tabular-nums; }
.mm-audio__btn { flex: none; min-width: 40px; height: 36px; padding: 0 .5rem; border: 1px solid var(--mm-line); border-radius: 10px; background: transparent; color: var(--mm-text); font-size: .8rem; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none; }
.mm-audio__btn:hover { background: var(--mm-accent-soft); color: var(--mm-accent); }
.mm-audio__erreur { display: none; font-size: .78rem; color: #b91c1c; margin-top: .25rem; }
.mm-audio.is-error .mm-audio__erreur { display: block; }
.mm-audio.is-loading .mm-audio__play i { animation: mm-pulse 1s infinite; }
@keyframes mm-pulse { 50% { opacity: .35; } }
@media (max-width: 480px) { .mm-audio { gap: .5rem; padding: .5rem; } .mm-audio__dl { display: none; } }

.mm-nv { display: flex; align-items: flex-start; gap: .75rem; flex-direction: column; }
.mm-nv__titre { font-size: .8rem; font-weight: 600; color: var(--mm-muted); display: flex; align-items: center; gap: .4rem; }

/* ---------- Prévisualiseur ---------- */
.mm-viewer { position: fixed; inset: 0; z-index: 2000; display: none; flex-direction: column; background: rgba(15, 23, 42, .92); color: #fff; height: 100vh; height: 100dvh; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.mm-viewer.is-open { display: flex; animation: mm-fade .18s ease-out; }
@keyframes mm-fade { from { opacity: 0; } }
.mm-viewer__bar { display: flex; align-items: center; gap: .5rem; padding: .6rem .8rem; background: rgba(0, 0, 0, .35); flex: none; }
.mm-viewer__titre { flex: 1 1 auto; min-width: 0; font-size: .95rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-viewer__compteur { font-size: .8rem; opacity: .7; flex: none; }
.mm-viewer__btn { flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; font-size: 1.1rem; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none; }
.mm-viewer__btn:hover { background: rgba(255, 255, 255, .25); color: #fff; }
.mm-viewer__btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.mm-viewer__btn[hidden] { display: none; }
.mm-viewer__scene { position: relative; flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; }
.mm-viewer__contenu { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; overflow: auto; -webkit-overflow-scrolling: touch; }
.mm-viewer__img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; transition: transform .15s; user-select: none; }
.mm-viewer__img.is-zoom { max-width: none; max-height: none; width: 180%; cursor: zoom-out; }
.mm-viewer__frame { width: 100%; height: 100%; border: 0; background: #fff; }
.mm-viewer__carte { background: var(--mm-bg); color: var(--mm-text); border-radius: 16px; padding: 1.5rem; width: min(92vw, 460px); text-align: center; }
.mm-viewer__carte .mm-audio { margin: 1rem auto 0; }
.mm-viewer__carte a.mm-viewer__lien { display: inline-block; margin-top: 1rem; padding: .6rem 1.2rem; border-radius: 10px; background: var(--mm-accent); color: #fff; text-decoration: none; font-weight: 600; }
.mm-viewer__nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; }
.mm-viewer__nav--prec { left: .6rem; }
.mm-viewer__nav--suiv { right: .6rem; }
.mm-viewer__spinner { position: absolute; width: 38px; height: 38px; border: 4px solid rgba(255, 255, 255, .25); border-top-color: #fff; border-radius: 50%; animation: mm-spin .8s linear infinite; pointer-events: none; }
@keyframes mm-spin { to { transform: rotate(360deg); } }
html.mm-viewer-ouvert, html.mm-viewer-ouvert body { overflow: hidden; }
@media (max-width: 576px) {
  .mm-viewer__bar { padding: .45rem .5rem; }
  .mm-viewer__btn { width: 38px; height: 38px; }
  .mm-viewer__nav { width: 38px; height: 38px; background: rgba(0, 0, 0, .45); }
  .mm-viewer__nav--prec { left: .3rem; } .mm-viewer__nav--suiv { right: .3rem; }
  .mm-viewer__zoom { display: none; }
}
@media (prefers-reduced-motion: reduce) { .mm-viewer.is-open, .mm-viewer__spinner, .mm-audio.is-loading .mm-audio__play i { animation: none; } }

/* ---- Enregistreur de note vocale (formulaires publics) ---- */
.mm-rec { margin-top: .75rem; }
.mm-rec__ou { display: flex; align-items: center; gap: .75rem; color: var(--mm-muted); font-size: .8rem; margin: .5rem 0; }
.mm-rec__ou::before, .mm-rec__ou::after { content: ""; flex: 1; height: 1px; background: var(--mm-line); }
.mm-rec__carte { border: 1px solid var(--mm-line); border-radius: 16px; padding: .75rem; background: var(--mm-bg); }
.mm-rec__carte[hidden], .mm-rec [hidden] { display: none !important; }
.mm-rec__micro { width: 100%; display: flex; align-items: center; justify-content: center; gap: .6rem; min-height: 48px; border: 1px dashed var(--mm-accent); border-radius: 14px; background: var(--mm-accent-soft); color: var(--mm-accent); font-weight: 600; cursor: pointer; }
.mm-rec__micro:disabled { opacity: .5; cursor: not-allowed; }
.mm-rec__micro:focus-visible, .mm-rec__stop:focus-visible { outline: 3px solid var(--mm-accent-soft); outline-offset: 2px; }
.mm-rec__ligne { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.mm-rec__point { width: 12px; height: 12px; border-radius: 50%; background: var(--mm-accent); animation: mm-pulse 1s ease-in-out infinite; }
@keyframes mm-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .mm-rec__point { animation: none; } }
.mm-rec__chrono { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--mm-text); flex: 1; min-width: 7rem; }
.mm-rec__piste { height: 4px; border-radius: 2px; background: var(--mm-line); margin: .6rem 0; overflow: hidden; }
.mm-rec__piste > span { display: block; height: 100%; width: 0; background: var(--mm-accent); transition: width .2s linear; }
.mm-rec__stop { border: 0; border-radius: 999px; padding: .55rem 1rem; font-weight: 600; cursor: pointer; background: var(--mm-accent); color: #fff; }
.mm-rec__stop--discret { background: transparent; color: var(--mm-muted); border: 1px solid var(--mm-line); }
.mm-rec__actions { display: flex; gap: .5rem; margin-top: .6rem; flex-wrap: wrap; }
.mm-rec__msg { margin-top: .5rem; font-size: .85rem; color: #b4790b; }
.mm-rec__aide { margin-top: .4rem; font-size: .75rem; color: var(--mm-muted); }
