/* Mystères à voix haute : feuille de style commune du site */

:root {
  --fond: #F5EEDC;
  --carte: #FBF7EE;
  --encre: #1E1B16;
  --doux: #4A443B;
  --titre: #1F4A3A;
  --or: #9A7333;
  --or-texte: #7D5C24;
  --filet: #D2C3A0;
  --cadre2: #1F4A3A;
  --bouton: #1F4A3A;
  --bouton-texte: #F5EEDC;
  --actif: #EEE4CB;
  --barre: #1F4A3A;
  --barre-texte: #F5EEDC;
  --barre-doux: #CFC6B0;
  --barre-piste: rgba(245, 238, 220, .25);
  --barre-plein: #C9A45C;
  --barre-bouton-texte: #10241C;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fond: #0E211A;
    --carte: #132A22;
    --encre: #EEE5D0;
    --doux: #B9AE98;
    --titre: #EADFC2;
    --or: #C9A45C;
    --or-texte: #D1B06F;
    --filet: #2E463C;
    --cadre2: #3D6B58;
    --bouton: #C9A45C;
    --bouton-texte: #10241C;
    --actif: #183429;
    --barre: #07130F;
    --barre-texte: #EEE5D0;
    --barre-doux: #A89F8B;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--fond);
  color: var(--encre);
  font-family: 'EB Garamond', Garamond, Georgia, serif;
  font-size: 18px;
  line-height: 1.5;
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--or); outline-offset: 3px; }

.page { max-width: 620px; margin: 0 auto; padding: 16px 16px 40px; }
body.avec-lecteur .page { padding-bottom: 140px; }

/* Double cadre, comme sur les pages du kit */
.cadre { position: relative; padding: 34px 22px 30px; border: 1.5px solid var(--or); }
.cadre::before { content: ""; position: absolute; inset: 6px; border: 1px solid var(--cadre2); pointer-events: none; }
.cadre > * { position: relative; }

.marque { display: flex; justify-content: center; }
.marque a {
  display: inline-flex; align-items: center; gap: 9px;
  text-decoration: none;
  font-size: 12.5px; letter-spacing: .2em; text-transform: uppercase; font-weight: 500;
  color: var(--or-texte);
}
.marque svg { width: 26px; height: 26px; flex: none; color: var(--titre); }

.titre {
  margin: 18px 0 0;
  text-align: center;
  font-family: 'Cormorant Garamond', Garamond, Georgia, serif;
  font-weight: 600;
  font-size: clamp(38px, 11vw, 54px);
  line-height: 1;
  color: var(--titre);
  text-wrap: balance;
}
.orn { display: block; width: 150px; height: 13px; margin: 12px auto 0; color: var(--or); }
.lieu { margin-top: 10px; text-align: center; font-style: italic; font-size: 17.5px; color: var(--doux); }
.accroche {
  margin-top: 26px;
  text-align: center;
  font-family: 'Cormorant Garamond', Garamond, Georgia, serif;
  font-style: italic; font-weight: 500;
  font-size: 30px; line-height: 1.2;
  color: var(--titre);
}

.h2 {
  margin: 32px 0 12px;
  display: flex; align-items: center; gap: 10px;
  font-size: 13.5px; letter-spacing: .22em; text-transform: uppercase; font-weight: 600;
  color: var(--titre);
}
.h2::before { content: "◆"; color: var(--or); letter-spacing: 0; }
.h2::after { content: ""; flex: 1; height: 1px; background: var(--filet); }

.txt { margin-top: 10px; text-wrap: pretty; }
.txt strong, .encadre strong { font-weight: 600; }
.petit { margin-top: 10px; font-size: 15.5px; line-height: 1.45; color: var(--doux); text-wrap: pretty; }

.encadre { margin-top: 26px; padding: 16px 18px 18px; border: 1px solid var(--or); background: var(--carte); }
.encadre p + p { margin-top: 8px; }
.lien { font-size: 16px; font-weight: 500; color: var(--or-texte); overflow-wrap: anywhere; }
.sans-coupure { white-space: nowrap; }
.partage-ok { min-height: 1.4em; font-size: 15px; font-style: italic; color: var(--or-texte); }

.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 46px; padding: 10px 20px;
  border: 0; border-radius: 999px;
  background: var(--bouton); color: var(--bouton-texte);
  font: inherit; font-size: 16.5px; font-weight: 500; line-height: 1.2;
  text-decoration: none; cursor: pointer;
}
.bouton.contour { background: transparent; color: var(--titre); border: 1.5px solid var(--or); }
.zips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

/* « bientôt » : visible seulement quand le fichier n'est pas encore en ligne */
.bientot { display: none; font-style: italic; }
.indispo .bientot { display: inline; }
a.indispo { opacity: .55; pointer-events: none; }

/* Liste des pistes */
.pistes { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--filet); }
.piste {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 52px;
  align-items: center;
  column-gap: 10px;
  padding: 13px 6px;
  border-bottom: 1px solid var(--filet);
  transition: background-color .2s;
}
.piste[data-etat="lecture"], .piste[data-etat="pause"], .piste[data-etat="charge"] { background: var(--actif); }
.num {
  font-family: 'Cormorant Garamond', Garamond, Georgia, serif;
  font-weight: 700; font-size: 26px; line-height: 1;
  color: var(--or); text-align: center;
}
.nom { font-weight: 500; font-size: 18.5px; line-height: 1.25; }
.quand { margin-top: 3px; font-size: 15.5px; line-height: 1.38; color: var(--doux); text-wrap: pretty; }
.meta { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 14.5px; color: var(--or-texte); }
.meta a { text-decoration: underline; text-underline-offset: 2px; }
.etat { font-style: italic; }
.etat:empty { display: none; }
.indispo .tele { display: none; }

.lire {
  position: relative;
  justify-self: end;
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  padding: 0; border: 0; border-radius: 50%;
  background: var(--bouton); color: var(--bouton-texte);
  cursor: pointer;
}
.lire svg { width: 20px; height: 20px; }
.i-pause { display: none; }
[data-etat="lecture"] .lire .i-lire { display: none; }
[data-etat="lecture"] .lire .i-pause { display: block; }
[data-etat="charge"] .lire svg { opacity: .35; }
[data-etat="charge"] .lire::after {
  content: ""; position: absolute; inset: -4px;
  border-radius: 50%; border: 2px solid transparent; border-top-color: var(--or);
  animation: tour .9s linear infinite;
}
@keyframes tour { to { transform: rotate(360deg); } }
.indispo .lire { background: transparent; border: 1.5px dashed var(--filet); color: var(--doux); cursor: default; }

/* Une seule piste (page de l'invitation) : grand bouton centré */
.pistes.seule { margin-top: 26px; border: 0; }
.seule .piste { grid-template-columns: 1fr; justify-items: center; row-gap: 12px; text-align: center; padding: 0; border: 0; background: transparent; }
.seule .num { display: none; }
.seule .lire { order: -1; justify-self: center; width: 78px; height: 78px; }
.seule .lire svg { width: 30px; height: 30px; }
.seule .meta { justify-content: center; }

.conseil { margin-top: 22px; text-align: center; font-style: italic; color: var(--doux); }
.fin { margin-top: 26px; text-align: right; font-style: italic; font-size: 19px; color: var(--titre); }

.kit { margin-top: 28px; padding: 18px 18px 20px; border: 1px solid var(--or); background: var(--carte); text-align: center; }
.kit-sur { font-size: 12.5px; letter-spacing: .2em; text-transform: uppercase; font-weight: 600; color: var(--or-texte); }
.kit h2 { margin: 6px 0 0; font-family: 'Cormorant Garamond', Garamond, Georgia, serif; font-weight: 600; font-size: 32px; line-height: 1.1; color: var(--titre); }
.kit p + p { margin-top: 8px; }
.logo-grand { display: block; width: 74px; height: 74px; margin: 0 auto; color: var(--titre); }
.centre { text-align: center; }

.pied { margin-top: 18px; text-align: center; font-size: 14.5px; font-style: italic; color: var(--doux); }
.pied p + p { margin-top: 4px; }
.pied a { color: var(--or-texte); }

/* Lecteur fixé en bas de l'écran */
.lecteur {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--barre); color: var(--barre-texte);
  box-shadow: 0 -6px 18px rgba(0, 0, 0, .18);
}
.lecteur[hidden] { display: none; }
.l-in { max-width: 620px; margin: 0 auto; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; align-items: center; }
.l-lire {
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  padding: 0; border: 0; border-radius: 50%;
  background: var(--barre-plein); color: var(--barre-bouton-texte);
  cursor: pointer;
}
.l-lire svg { width: 22px; height: 22px; }
.lecteur[data-lecture="1"] .l-lire .i-lire { display: none; }
.lecteur[data-lecture="1"] .l-lire .i-pause { display: block; }
.l-nom { font-size: 16.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.l-ligne { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.l-recul {
  flex: none; padding: 6px 2px; border: 0; background: transparent;
  color: var(--barre-texte); font: inherit; font-size: 14px; cursor: pointer; white-space: nowrap;
}
.l-prog {
  flex: 1; min-width: 0; height: 22px; margin: 0;
  background: transparent; cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
.l-prog::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(var(--barre-plein), var(--barre-plein)) 0 0 / var(--p, 0%) 100% no-repeat, var(--barre-piste);
}
.l-prog::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%; background: var(--barre-plein); }
.l-prog::-moz-range-track { height: 4px; border-radius: 2px; background: var(--barre-piste); }
.l-prog::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--barre-plein); }
.l-prog::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: var(--barre-plein); }
.l-temps { flex: none; font-size: 14px; color: var(--barre-doux); white-space: nowrap; font-variant-numeric: tabular-nums lining-nums; }

@media (prefers-reduced-motion: reduce) {
  [data-etat="charge"] .lire::after { animation-duration: 3s; }
  .piste { transition: none; }
}
