/* Rituel Magie — styles.css
   Classes en camelCase préfixées rmg, états en classes séparées (estSombre,
   estCreuse, estTrois). Titres : Playfair Display. Texte : Spectral.
   Le site alterne deux fonds : parchemin clair et nuit verte très sombre. */

:root{
  --parchemin:#F7F2E7;
  --parchemin-creux:#EFE7D6;
  --papier:#FFFDF8;
  --nuit:#10262A;
  --nuit-clair:#1A3A3F;
  --encre:#1B1A17;
  --encre-douce:#3B3932;
  --gris:#6B665B;
  --trait:#DED3BC;
  --cuivre:#AF6428;
  --cuivre-clair:#F3E0CD;
  --laiton:#C79A3E;
  --vert:#3F6B55;
  --titre:"Playfair Display","Iowan Old Style",Georgia,serif;
  --texte:"Spectral",Georgia,"Times New Roman",serif;
  --arrondi:4px;
  --rail:1160px;
  --releve:0 1px 2px rgba(27,26,23,.05),0 10px 26px -16px rgba(27,26,23,.35);
}

*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;scroll-behavior:smooth;scroll-padding-top:5rem}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*{transition:none!important}}
body{margin:0;background:var(--parchemin);color:var(--encre);font-family:var(--texte);font-size:1.08rem;line-height:1.72;font-weight:400}
img{max-width:100%;height:auto;display:block}
a{color:var(--cuivre);text-decoration-thickness:1px;text-underline-offset:3px}
a:hover{color:#8C4C18}
:focus-visible{outline:3px solid var(--laiton);outline-offset:2px}
h1,h2,h3,h4{font-family:var(--titre);font-weight:500;line-height:1.16;color:var(--encre);margin:0 0 .5em}
h1{font-size:clamp(2rem,4.3vw,3.05rem)}
h2{font-size:clamp(1.55rem,2.7vw,2.1rem)}
h3{font-size:1.24rem}
p{margin:0 0 1.15em}
b,strong{font-weight:600}
sup{font-size:.68em}
.screen-reader-text{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(1px,1px,1px,1px);white-space:nowrap}

.rmgEvitement{position:absolute;left:-999px;top:0;z-index:99;background:var(--nuit);color:#fff;padding:.6rem 1.1rem}
.rmgEvitement:focus{left:0;color:#fff}

/* ───── Rails et sections ───── */
.rmgRail{width:min(100% - 2.5rem,var(--rail));margin-inline:auto}
.rmgEtroit{max-width:748px}
.rmgCorps{display:block}
.rmgSection{padding:4rem 0}
.rmgSection.estSombre{background:var(--nuit);color:#E9E2D2}
.rmgSection.estSombre h1,.rmgSection.estSombre h2,.rmgSection.estSombre h3{color:#F6EFDE}
.rmgSection.estSombre a{color:var(--laiton)}
.rmgTitreSection{margin-bottom:1.5rem}
.rmgChapeau{max-width:70ch;color:var(--gris);margin-bottom:2rem}
.rmgSection.estSombre .rmgChapeau{color:#BFB6A2}

/* ───── En-tête ───── */
.rmgEntete{position:sticky;top:0;z-index:40;background:var(--papier)}
.rmgEnteteRang{display:flex;align-items:center;gap:1.3rem;padding:.7rem 0;flex-wrap:wrap}
.rmgFilet{height:3px;background:
  linear-gradient(90deg,transparent 0 6px,var(--cuivre) 6px 7px,transparent 7px 13px) repeat-x,
  linear-gradient(90deg,var(--trait),var(--trait));
  background-size:13px 3px,100% 1px;background-position:0 0,0 2px}
.rmgEnseigne{margin:0;flex:1 1 auto}
.rmgEnseigne a{display:inline-flex;align-items:center;gap:.65rem;text-decoration:none;color:var(--encre)}
.rmgEnseigneSceau{color:var(--cuivre);flex:0 0 auto;display:block}
.rmgEnseigneMots{display:block;min-width:0}
.rmgEnseigneNom{display:block;font-family:var(--titre);font-size:1.38rem;line-height:1.05;color:var(--nuit)}
.rmgEnseigneDit{display:block;font-size:.74rem;letter-spacing:.14em;text-transform:uppercase;color:var(--gris)}

.rmgBouton{display:none;align-items:center;gap:.5rem;background:var(--nuit);color:#fff;border:0;border-radius:var(--arrondi);padding:.5rem 1rem;font-family:var(--texte);font-size:.92rem;cursor:pointer}
.rmgBoutonTraits{display:inline-grid;gap:3px}
.rmgBoutonTraits i{display:block;width:15px;height:2px;background:currentColor}
.rmgBoutonMot{white-space:nowrap}

.rmgNav{display:flex;align-items:center;gap:1.3rem;flex:0 1 auto}
.rmgMenu{display:flex;align-items:center;gap:1.2rem;list-style:none;margin:0;padding:0;flex-wrap:wrap}
.rmgMenu a{display:block;padding:.26rem 0;font-size:.88rem;letter-spacing:.09em;text-transform:uppercase;text-decoration:none;color:var(--encre-douce);border-bottom:2px solid transparent}
.rmgMenu a:hover,.rmgMenu li.estCourant>a,.rmgMenu li.current-cat>a{color:var(--cuivre);border-bottom-color:var(--cuivre)}

.rmgChercher{display:flex;align-items:center;gap:.4rem}
.rmgChercher input{width:10.5rem;border:1px solid var(--trait);background:var(--parchemin);border-radius:var(--arrondi);padding:.42rem .8rem;font:inherit;font-size:.92rem;color:var(--encre)}
.rmgChercher input::placeholder{color:#A49D8E}
.rmgChercher button{border:1px solid var(--cuivre);background:var(--cuivre-clair);color:#7E4312;border-radius:var(--arrondi);padding:.42rem .9rem;font:inherit;font-size:.88rem;cursor:pointer}
.rmgChercher button:hover{background:var(--cuivre);color:#fff}

@media(max-width:920px){
  .rmgBouton{display:inline-flex}
  .rmgNav{display:none;flex-basis:100%;flex-direction:column;align-items:stretch;gap:.9rem;padding:.3rem 0 1rem;max-height:calc(100dvh - 5rem);overflow-y:auto;overscroll-behavior:contain}
  body.rmgNavOuverte .rmgNav{display:flex}
  .rmgMenu{flex-direction:column;align-items:stretch;gap:0}
  .rmgMenu a{padding:.7rem .15rem;border-bottom:1px solid var(--trait)}
  .rmgChercher input{width:100%}
}

/* ───── Appels ───── */
.rmgCta{display:inline-block;background:var(--cuivre);color:#fff;border:1px solid var(--cuivre);border-radius:var(--arrondi);padding:.68rem 1.4rem;font-size:.98rem;letter-spacing:.02em;text-decoration:none}
.rmgCta:hover{background:#8C4C18;border-color:#8C4C18;color:#fff}
.rmgCta.estCreuse{background:transparent;color:var(--cuivre)}
.rmgCta.estCreuse:hover{background:var(--cuivre);color:#fff}
.rmgSection.estSombre .rmgCta.estCreuse{color:var(--laiton);border-color:var(--laiton)}
.rmgSection.estSombre .rmgCta.estCreuse:hover{background:var(--laiton);color:var(--nuit)}

/* ───── Hero ───── */
.rmgHero{background:var(--nuit);color:#E9E2D2;padding:3.2rem 0 3.6rem}
.rmgHeroRang{display:grid;grid-template-columns:.92fr 1.08fr;gap:3rem;align-items:center}
.rmgHeroPlanche{margin:0}
.rmgHeroPlanche img{border:5px solid #E9E2D2;box-shadow:0 20px 48px -24px #000}
.rmgHeroMot h1{color:#F6EFDE;margin-bottom:.45em}
.rmgHeroPlume{font-size:.9rem;font-style:italic;color:var(--laiton);margin:0 0 .9rem}
.rmgHeroDit{font-size:1.1rem;color:#CFC7B4;max-width:58ch}
.rmgHeroActions{display:flex;gap:.8rem;flex-wrap:wrap;margin:1.7rem 0 0}
.rmgHero .rmgCredit{color:#9A9281}
.rmgHero .rmgCredit a{color:#9A9281}
@media(max-width:940px){.rmgHeroRang{grid-template-columns:1fr;gap:2rem}.rmgHero{padding:2.2rem 0 2.6rem}}

.rmgCredit{margin:.55rem 0 0;font-size:.76rem;color:var(--gris)}
.rmgCredit a{color:inherit}

/* ───── Tableau des provenances ───── */
.rmgTableau{overflow-x:auto;border:1px solid var(--trait);background:var(--papier);box-shadow:var(--releve)}
.rmgTableau table{width:100%;border-collapse:collapse;font-size:1rem;min-width:620px}
.rmgTableau th,.rmgTableau td{padding:.9rem 1.1rem;text-align:left;vertical-align:top;border-bottom:1px solid var(--trait)}
.rmgTableau thead th{background:var(--nuit);color:#F0E8D6;font-family:var(--titre);font-weight:500;font-size:.98rem;letter-spacing:.04em;border-bottom:0}
.rmgTableau tbody th{font-family:var(--titre);font-weight:500;color:var(--cuivre);white-space:nowrap;width:12rem}
.rmgTableau tbody tr:last-child th,.rmgTableau tbody tr:last-child td{border-bottom:0}
.rmgTableau tbody tr:nth-child(even){background:#FBF7EE}
.rmgTableau td:nth-child(2){white-space:nowrap;color:var(--encre-douce);width:9rem}

/* ───── Entrées (rubriques) ───── */
.rmgRubriques{display:grid;grid-template-columns:repeat(3,1fr);gap:1.3rem}
.rmgRubrique{position:relative;display:block;min-height:216px;overflow:hidden;text-decoration:none;color:#F3EDDF;background:var(--nuit-clair);border:1px solid rgba(233,226,210,.22)}
.rmgRubriqueFond{position:absolute;inset:0;z-index:0}
.rmgRubriqueFond img{width:100%;height:100%;object-fit:cover;opacity:.72}
.rmgRubrique::after{content:"";position:absolute;inset:0;z-index:1;background:linear-gradient(180deg,rgba(16,38,42,.12) 0%,rgba(16,38,42,.46) 42%,rgba(16,38,42,.80) 68%,rgba(16,38,42,.96) 100%)}
.rmgRubriqueTexte{position:relative;z-index:2;display:flex;flex-direction:column;justify-content:flex-end;min-height:216px;padding:1.4rem 1.45rem}
.rmgRubriqueNom{display:block;font-family:var(--titre);font-size:1.4rem;line-height:1.15;margin-bottom:.35rem;text-shadow:0 1px 6px rgba(0,0,0,.55)}
.rmgRubriqueDit{display:block;font-size:.93rem;color:rgba(243,237,223,.94);text-shadow:0 1px 5px rgba(0,0,0,.6)}
.rmgRubrique:hover{color:#fff;border-color:var(--laiton)}
.rmgRubrique:hover .rmgRubriqueFond img{opacity:.88}
@media(max-width:940px){.rmgRubriques{grid-template-columns:repeat(2,1fr)}}
@media(max-width:600px){.rmgRubriques{grid-template-columns:1fr}}

/* ───── Tuiles d'article ───── */
.rmgGrille{display:grid;gap:1.4rem}
.rmgGrille.estTrois{grid-template-columns:repeat(3,1fr)}
.rmgGrille.estQuatre{grid-template-columns:repeat(4,1fr)}
@media(max-width:1000px){.rmgGrille.estQuatre{grid-template-columns:repeat(2,1fr)}}
@media(max-width:860px){.rmgGrille.estTrois{grid-template-columns:repeat(2,1fr)}}
@media(max-width:620px){.rmgGrille.estTrois,.rmgGrille.estQuatre{grid-template-columns:1fr}}

.rmgTuile{background:var(--papier);border:1px solid var(--trait);box-shadow:var(--releve);transition:border-color .15s,transform .15s}
.rmgTuile:hover{border-color:var(--cuivre);transform:translateY(-2px)}
.rmgTuile.estNue{border-top:4px solid var(--cuivre)}
.rmgTuileLien{display:flex;flex-direction:column;height:100%;text-decoration:none;color:inherit}
.rmgTuileImage{display:block;aspect-ratio:3/2;overflow:hidden;background:var(--parchemin-creux)}
.rmgTuileImage img{width:100%;height:100%;object-fit:cover}
.rmgTuileTexte{display:block;padding:1.05rem 1.2rem 1.25rem}
.rmgTuileTitre{display:block;font-family:var(--titre);font-size:1.16rem;line-height:1.22;color:var(--encre);margin:.5rem 0 .4rem}
.rmgTuile.estNue .rmgTuileTitre{font-size:1.24rem}
.rmgTuile:hover .rmgTuileTitre{color:var(--cuivre)}
.rmgTuileChapo{display:block;font-size:.93rem;color:var(--gris)}

.rmgEtiquette{display:inline-block;border:1px solid var(--cuivre);color:var(--cuivre);padding:.1rem .6rem;font-size:.7rem;letter-spacing:.12em;text-transform:uppercase;font-family:var(--texte)}
.rmgEtiquette.estLien{text-decoration:none}
.rmgEtiquette.estLien:hover{background:var(--cuivre);color:#fff}

/* ───── Fil d'Ariane ───── */
.rmgFil{margin:1.3rem 0 1rem;font-size:.84rem;color:var(--gris)}
.rmgFil ol{list-style:none;display:flex;flex-wrap:wrap;gap:.25rem .5rem;margin:0;padding:0}
.rmgFil li+li::before{content:"·";margin-right:.5rem;color:#B6AE9C}
.rmgFil a{color:var(--gris)}
.rmgFil a:hover{color:var(--cuivre)}

/* ───── Article ───── */
.rmgArticleTete{position:relative;background:var(--nuit);color:#E9E2D2;padding:.8rem 0 2.6rem;overflow:hidden}
.rmgArticleFond{position:absolute;inset:0;z-index:0}
.rmgArticleFond img{width:100%;height:100%;object-fit:cover;opacity:.26}
.rmgArticleTete .rmgRail{position:relative;z-index:1}
.rmgArticleTete h1{color:#F6EFDE;margin:.7rem 0 .5rem}
.rmgArticleTete .rmgFil,.rmgArticleTete .rmgFil a{color:rgba(233,226,210,.74)}
.rmgArticleTete .rmgFil a:hover{color:var(--laiton)}
.rmgArticleTete .rmgEtiquette{border-color:var(--laiton);color:var(--laiton)}
.rmgArticleTete .rmgEtiquette.estLien:hover{background:var(--laiton);color:var(--nuit)}
.rmgArticleTete .rmgCredit,.rmgArticleTete .rmgCredit a{color:rgba(233,226,210,.52)}
.rmgArticleDate{font-size:.86rem;color:rgba(233,226,210,.72);margin:0}
.rmgArticleRevu{color:var(--laiton)}
.rmgArticleCorps{padding-top:2.4rem;padding-bottom:3.4rem}

.rmgSommaire{background:var(--papier);border:1px solid var(--trait);border-left:3px solid var(--cuivre);padding:1.05rem 1.25rem;margin:0 0 2rem}
.rmgSommaireTitre{font-family:var(--titre);font-size:1.02rem;color:var(--nuit);margin:0 0 .45rem}
.rmgSommaire ol{margin:0;padding-left:1.15rem;font-size:.96rem}
.rmgSommaire li{margin-bottom:.28rem}
.rmgSommaire a{color:var(--encre-douce);text-decoration:none;border-bottom:1px solid var(--trait)}
.rmgSommaire a:hover{color:var(--cuivre);border-bottom-color:var(--cuivre)}

.rmgProse h2{margin:2.4rem 0 .65rem}
.rmgProse h3{margin:1.8rem 0 .45rem;color:var(--vert)}
.rmgProse ul,.rmgProse ol{padding-left:1.3rem;margin:0 0 1.2em}
.rmgProse li{margin-bottom:.42rem}
.rmgProse blockquote{margin:1.6rem 0;padding:.15rem 0 .15rem 1.25rem;border-left:3px solid var(--laiton);color:var(--encre-douce);font-style:italic}
.rmgProse img{margin:1.6rem 0}
.rmgProse table{width:100%;border-collapse:collapse;margin:1.6rem 0;font-size:.98rem}
.rmgProse th,.rmgProse td{border:1px solid var(--trait);padding:.6rem .8rem;text-align:left;vertical-align:top}
.rmgProse th{background:var(--parchemin-creux);font-family:var(--titre);font-weight:500}
.rmgLienInterne{text-decoration-color:var(--laiton)}

.rmgQuestions{margin:2.4rem 0 0;border-top:2px solid var(--cuivre);padding-top:1.3rem}
.rmgQuestions h3{font-family:var(--titre);font-size:1.14rem;color:var(--nuit);margin:1.35rem 0 .3rem}
.rmgQuestions h3:first-child{margin-top:0}
.rmgQuestions p{color:var(--encre-douce);margin-bottom:.8rem}

.rmgSignature{display:flex;gap:1rem;align-items:flex-start;background:var(--parchemin-creux);border:1px solid var(--trait);padding:1.2rem 1.3rem;margin:2.6rem 0 0}
.rmgSceau{flex:0 0 auto;color:var(--cuivre);display:block}
.rmgSignatureNom{font-family:var(--titre);font-size:1.18rem;margin:0 0 .12rem;color:var(--nuit)}
.rmgSignatureDit{margin:0;font-size:.94rem;color:var(--encre-douce)}

/* ───── Têtes de rubrique et de liste ───── */
.rmgRubriqueTete{position:relative;background:var(--nuit);color:#E9E2D2;padding:.8rem 0 2.6rem;overflow:hidden}
.rmgRubriqueTeteFond{position:absolute;inset:0;z-index:0}
.rmgRubriqueTeteFond img{width:100%;height:100%;object-fit:cover;opacity:.3}
.rmgRubriqueTete .rmgRail{position:relative;z-index:1}
.rmgRubriqueTete h1{color:#F6EFDE;margin-bottom:.3em}
.rmgRubriqueTeteDit{max-width:62ch;color:rgba(233,226,210,.88);margin:0}
.rmgRubriqueTete .rmgFil,.rmgRubriqueTete .rmgFil a{color:rgba(233,226,210,.74)}
.rmgRubriqueTete .rmgFil a:hover{color:var(--laiton)}
.rmgRubriqueTete .rmgCredit,.rmgRubriqueTete .rmgCredit a{color:rgba(233,226,210,.52)}
.rmgListeTete{padding:.5rem 0 1.9rem;border-bottom:1px solid var(--trait)}
.rmgListeDit{color:var(--gris);max-width:62ch;margin:0}
.rmgPageTitre{margin:.6rem 0 1.2rem}
.rmgPageVisuel{margin:0 0 1.8rem}
.rmgRien{color:var(--gris);margin-bottom:2rem}

/* ───── Accueil : les principes ───── */
.rmgPrincipes{list-style:none;counter-reset:principe;margin:0;padding:0}
.rmgPrincipes li{counter-increment:principe;position:relative;padding:0 0 1.5rem 3.4rem}
.rmgPrincipes li::before{content:counter(principe,upper-roman);position:absolute;left:0;top:.08rem;width:2.3rem;text-align:center;font-family:var(--titre);font-size:1.15rem;color:var(--cuivre);border-bottom:1px solid var(--cuivre);padding-bottom:.1rem}
.rmgPrincipes li:last-child{padding-bottom:0}
.rmgPrincipes h3{margin:0 0 .3rem;color:var(--nuit)}
.rmgPrincipes p{margin:0;color:var(--encre-douce)}
.rmgEncore{margin:1.8rem 0 0}

/* ───── Pagination ───── */
.rmgPages{margin-top:2.3rem}
.rmgPages .nav-links{display:flex;flex-wrap:wrap;gap:.4rem;align-items:center;justify-content:center}
.rmgPages .page-numbers{display:inline-block;min-width:2.4rem;text-align:center;padding:.42rem .8rem;border:1px solid var(--trait);background:var(--papier);text-decoration:none;color:var(--encre-douce);font-size:.94rem}
.rmgPages .page-numbers:hover{border-color:var(--cuivre);color:var(--cuivre)}
.rmgPages .page-numbers.current{background:var(--nuit);border-color:var(--nuit);color:#F0E8D6}
.rmgPages .screen-reader-text{display:none}

/* ───── Bas de page ───── */
.rmgBas{background:var(--nuit);color:rgba(233,226,210,.82)}
.rmgBasRang{display:grid;grid-template-columns:2fr 1fr 1fr;gap:2.3rem;padding:3.1rem 0 2.3rem}
.rmgBasMot{min-width:0}
.rmgBasColonne{min-width:0}
.rmgBasNom{font-family:var(--titre);font-size:1.45rem;color:#F6EFDE;margin:0 0 .5rem}
.rmgBasMot p{max-width:46ch}
.rmgBasCourriel a{color:var(--laiton)}
.rmgBasTitre{font-family:var(--titre);font-size:1.08rem;color:#F6EFDE;margin:0 0 .65rem}
.rmgListeBas{list-style:none;margin:0;padding:0}
.rmgListeBas li{margin-bottom:.42rem}
.rmgListeBas a{color:rgba(233,226,210,.82);text-decoration:none;border-bottom:1px solid transparent}
.rmgListeBas a:hover{color:#fff;border-bottom-color:var(--laiton)}
.rmgBasPied{border-top:1px solid rgba(233,226,210,.16);padding:1rem 0 1.5rem;font-size:.85rem}
.rmgBasPied p{margin:0;color:rgba(233,226,210,.6)}
@media(max-width:860px){.rmgBasRang{grid-template-columns:1fr;gap:1.8rem;padding:2.3rem 0 1.7rem}}

/* Ligne de rattachement, ajoutée aux articles trop courts pour que le
   tissage contextuel opère. */
.rmgVoirAussi{margin:2rem 0 0;padding:.85rem 1.1rem;background:var(--parchemin-creux);border-left:3px solid var(--laiton);font-size:.95rem}
.rmgVoirAussi span{display:block;font-family:var(--titre);color:var(--nuit);margin-bottom:.25rem}
.rmgArticleVisuel{margin:0 0 1.9rem}
.rmgArticle{display:block}
.rmgPage{display:block;padding:.4rem 0 3.4rem}
