/* ════════════════════════════════════════
   ANIMALIA — mythes_legendes.css
   Le Bestiaire fabuleux : manuscrit enluminé, vélin, pourpre et feuille d'or.
   Sert aussi à legende_fiche.php.
════════════════════════════════════════ */

.ml-body {
  --encre: #15121a;
  --encre-2: #1f1a24;
  --velin: #efe3c4;
  --velin-2: #e5d5ad;
  --pourpre: #7a1c1c;
  --or: #c9a14a;
  --or-clair: #e6cd8a;
  --brun: #4a3d2c;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(201, 161, 74, .1), transparent 70%),
    var(--encre);
  color: var(--velin);
  min-height: 100vh;
}

/* nav, footer, fil d'Ariane passés au sombre */
.ml-body nav { background: rgba(21, 18, 26, .94); border-bottom-color: rgba(201, 161, 74, .2); }
.ml-body .nav-logo { color: var(--velin); }
.ml-body .nav-logo em { color: var(--or); }
.ml-body .nav-links a { color: #c8bba0; }
.ml-body .nav-links a:hover, .ml-body .nav-links a[aria-current] { color: var(--or-clair); }
.ml-body .hamburger span { background: var(--velin); }
.ml-body footer { background: var(--encre-2); border-top-color: rgba(201, 161, 74, .15); color: #a8997c; }
.ml-body footer strong, .ml-body footer a { color: var(--or-clair); }
@media (max-width: 860px) { .ml-body .nav-links { background: rgba(21, 18, 26, .98); } }

/* ── en-tête enluminé ── */
.ml-tete { max-width: 860px; margin: 0 auto; padding: clamp(2.6rem, 6vw, 4.4rem) 1.4rem 2.4rem; text-align: center; }
.ml-sur { font-family: 'IM Fell English SC', var(--fd); font-size: .82rem; letter-spacing: .28em; color: var(--or); }
.ml-titre {
  display: inline-block;
  font-family: var(--fd); font-weight: 400;
  font-size: clamp(2.4rem, 6vw, 4rem); line-height: 1.05;
  margin: 1.1rem 0 1rem; color: var(--velin);
  text-align: left;
}
.ml-titre em { color: var(--or); }
/* la lettrine : un M d'or dans un carré pourpre, cadré d'or */
.ml-titre::first-letter {
  float: left;
  font-size: 1.7em; line-height: .9;
  padding: .12em .14em .02em;
  margin: .02em .14em 0 0;
  color: var(--or-clair);
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,.12), transparent 60%),
    var(--pourpre);
  border: 3px double var(--or);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .35);
}
.ml-chapeau { max-width: 60ch; margin: 0 auto; font-size: 1.1rem; line-height: 1.7; font-style: italic; color: #c8bba0; clear: both; }
.ml-compteurs { margin-top: 1.8rem; display: flex; justify-content: center; align-items: center; gap: 1.4rem; font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; color: #a8997c; }
.ml-compteurs b { display: block; font-family: var(--fd); font-weight: 400; font-size: 2.1rem; letter-spacing: 0; color: var(--or-clair); text-transform: none; }
.ml-fleuron { color: var(--or); font-size: 1.4rem; }

.ml-main { max-width: 1180px; margin: 0 auto; padding: 0 1.4rem 4rem; }

.ml-h2 { font-family: var(--fd); font-weight: 400; font-size: clamp(1.6rem, 3.4vw, 2.2rem); text-align: center; color: var(--velin); }
.ml-h2 span { color: var(--or); font-style: italic; margin-right: .3rem; }
.ml-h2::after { content: ""; display: block; width: 160px; height: 9px; margin: .8rem auto 0; background:
  radial-gradient(circle, var(--or) 2.5px, transparent 3px) center / 9px 9px no-repeat,
  linear-gradient(var(--or), var(--or)) left center / 70px 1px no-repeat,
  linear-gradient(var(--or), var(--or)) right center / 70px 1px no-repeat; opacity: .7; }
.ml-consigne { text-align: center; font-style: italic; color: #a8997c; margin: 1rem 0 2rem; }
.ml-vide { text-align: center; font-style: italic; color: #a8997c; padding: 2rem 0 3rem; }

/* ══════════ NIVEAU 1 : L'ARMORIAL ══════════ */
.ml-armorial { padding-top: 1rem; }
.ml-ecus { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2rem 1.2rem; }
.ml-ecu {
  background: none; border: 0; cursor: pointer; color: inherit; font: inherit;
  display: flex; flex-direction: column; align-items: center; gap: .3rem;
  padding: .6rem .3rem; border-radius: 8px;
  transition: transform .3s, background .3s;
}
.ml-ecu .ecu { width: 104px; height: 125px; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .5)); transition: transform .35s, filter .35s; }
.ecu-lettre { font-family: 'IM Fell English', Georgia, serif; font-size: 44px; fill: #f3e6c4; }
.ml-ecu-nom { font-family: var(--fd); font-size: 1.12rem; color: var(--velin); text-align: center; line-height: 1.2; margin-top: .3rem; }
.ml-ecu-nb { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: #a8997c; }
.ml-ecu:hover:not(:disabled) .ecu { transform: translateY(-5px) rotate(-3deg); }
.ml-ecu:focus-visible { outline: 2px solid var(--or); outline-offset: 2px; }
.ml-ecu[aria-pressed="true"] { background: rgba(201, 161, 74, .1); }
.ml-ecu[aria-pressed="true"] .ecu { transform: translateY(-5px) scale(1.06); filter: drop-shadow(0 0 14px rgba(230, 205, 138, .55)); }
.ml-ecu[aria-pressed="true"] .ml-ecu-nom { color: var(--or-clair); }
.ml-ecu:disabled { cursor: default; opacity: .45; }
.ml-ecu:disabled .ecu { filter: grayscale(.7); }

/* ══════════ NIVEAUX 2 & 3 : LA PAGE DE VÉLIN ══════════ */
.ml-livre { margin: 3rem auto 0; max-width: 900px; scroll-margin-top: 90px; }
.ml-livre:not([hidden]) { animation: ml-deplie .5s ease; }
@keyframes ml-deplie { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.ml-velin {
  position: relative;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(255, 250, 235, .7), transparent 55%),
    radial-gradient(ellipse at 90% 100%, rgba(150, 110, 50, .14), transparent 50%),
    var(--velin);
  color: var(--brun);
  padding: clamp(1.8rem, 4vw, 3rem) clamp(1.3rem, 4vw, 3.2rem);
  border: 3px double var(--or);
  box-shadow: 0 24px 40px rgba(0, 0, 0, .5);
}
.ml-velin::before { content: ""; position: absolute; inset: 8px; border: 1px solid rgba(122, 28, 28, .3); pointer-events: none; }
.ml-velin-tete { text-align: center; position: relative; padding: 0 2.4rem; }
.ml-velin-sur { font-family: 'IM Fell English SC', var(--fd); font-size: .8rem; letter-spacing: .26em; color: var(--pourpre); }
.ml-velin-titre { font-family: var(--fd); font-weight: 400; font-size: clamp(1.9rem, 4vw, 2.6rem); color: var(--civ, var(--pourpre)); margin: .2rem 0 .4rem; }
.ml-fermer {
  position: absolute; top: -.4rem; right: 0;
  width: 36px; height: 36px; border-radius: 50%;
  background: none; border: 1px solid rgba(122, 28, 28, .35); color: var(--pourpre);
  cursor: pointer; font-size: .95rem; transition: background .2s;
}
.ml-fermer:hover { background: rgba(122, 28, 28, .08); }
.ml-h3 { font-family: var(--fd); font-weight: 400; font-size: 1.25rem; color: var(--brun); text-align: center; margin: 1.4rem 0 1rem; }
.ml-h3 span { color: var(--pourpre); font-style: italic; }

/* les chapitres : des phylactères (banderoles) */
.ml-chapitres { display: flex; flex-wrap: wrap; justify-content: center; gap: .8rem .6rem; }
.ml-phyl {
  position: relative; cursor: pointer;
  border: 0; font: inherit;
  padding: .55rem 1.9rem .6rem;
  background: var(--civ, var(--pourpre));
  color: #f6ecd2;
  font-family: var(--fd); font-size: 1.02rem;
  clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 50%, 100% 100%, 0 100%, 12px 50%);
  transition: transform .2s, background .2s, color .2s;
}
.ml-phyl small { font-family: 'EB Garamond', serif; font-size: .78rem; opacity: .8; margin-left: .35rem; }
.ml-phyl:hover { transform: translateY(-2px); }
.ml-phyl:focus-visible { outline: 2px solid var(--brun); outline-offset: 3px; }
.ml-phyl[aria-pressed="true"] { background: var(--or); color: #2a1d16; }
.ml-attente { text-align: center; font-style: italic; color: #8a6d36; padding: .8rem 0; }

/* les récits */
.ml-recits { margin-top: 1.8rem; }
.ml-recits:empty { display: none; }
.ml-recits-tete { text-align: center; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: #8a6d36; padding-top: 1.2rem; border-top: 1px solid rgba(154, 122, 44, .4); margin-bottom: 1rem; }
.ml-recit {
  display: grid; grid-template-columns: 3.4rem 1fr; gap: .2rem 1rem;
  padding: 1rem .6rem; text-decoration: none; color: inherit;
  border-bottom: 1px dotted rgba(122, 28, 28, .3);
  transition: background .2s;
}
.ml-recit:last-child { border-bottom: 0; }
.ml-recit:hover { background: rgba(201, 161, 74, .14); }
.ml-recit-num { grid-row: span 2; font-family: var(--fd); font-size: 1.5rem; color: var(--pourpre); text-align: right; line-height: 1.1; }
.ml-recit b { font-family: var(--fd); font-weight: 400; font-style: italic; font-size: 1.2rem; color: #2a1d16; }
.ml-recit b small { font-style: normal; font-family: 'EB Garamond', serif; font-size: .78rem; letter-spacing: .08em; color: #8a6d36; margin-left: .4rem; }
.ml-recit span { font-size: .98rem; line-height: 1.55; color: var(--brun); }
.ml-recit:hover b { color: var(--pourpre); }

/* ══════════ DERNIERS RÉCITS ══════════ */
.ml-dernieres { margin-top: 4.5rem; }
.ml-cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.3rem; margin-top: 2rem; }
.ml-carte {
  position: relative; display: block; text-decoration: none;
  background: var(--velin); color: var(--brun);
  padding: 1.3rem 1.3rem 1.3rem 1.6rem;
  border-left: 6px solid var(--civ, var(--pourpre));
  box-shadow: 0 10px 22px rgba(0, 0, 0, .4);
  transition: transform .25s;
}
.ml-carte::after { content: ""; position: absolute; inset: 5px 5px 5px 0; border: 1px solid rgba(154, 122, 44, .35); pointer-events: none; }
.ml-carte:hover { transform: translateY(-4px); }
.ml-carte-civ { display: block; font-family: 'IM Fell English SC', var(--fd); font-size: .76rem; letter-spacing: .2em; color: var(--pourpre); }
.ml-carte b { display: block; font-family: var(--fd); font-weight: 400; font-size: 1.25rem; color: #2a1d16; margin: .35rem 0 .45rem; }
.ml-carte b::first-letter { color: var(--pourpre); font-size: 1.25em; }
.ml-carte-txt { font-size: .95rem; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.ml-avert { max-width: 68ch; margin: 4rem auto 0; text-align: center; font-size: .9rem; font-style: italic; color: #a8997c; line-height: 1.7; }
.ml-avert a { color: var(--or-clair); }

/* ══════════ FICHE D'UNE LÉGENDE (legende_fiche.php) ══════════ */
.ml-ariane { max-width: 880px; margin: 0 auto; padding: 1rem 1.4rem 0; font-size: .86rem; color: #a8997c; display: flex; flex-wrap: wrap; gap: .3rem .5rem; }
.ml-ariane a { color: #c8bba0; text-decoration: none; }
.ml-ariane a:hover { color: var(--or-clair); }
.ml-ariane .sep { opacity: .5; }
.ml-ariane .cur { font-style: italic; color: var(--velin); }

.lf-page { max-width: 880px; margin: 1.6rem auto 4rem; padding: 0 1.4rem; }
.lf-page .ml-velin { padding: clamp(2rem, 5vw, 3.6rem) clamp(1.4rem, 5vw, 4rem); }
.lf-entete { text-align: center; }
.lf-ecu { width: 74px; height: 89px; margin: 0 auto .6rem; display: block; filter: drop-shadow(0 5px 6px rgba(0, 0, 0, .3)); }
.lf-ecu .ecu-lettre { font-size: 44px; }
.lf-tag { font-family: 'IM Fell English SC', var(--fd); font-size: .82rem; letter-spacing: .2em; color: var(--pourpre); }
.lf-entete h1 { font-family: var(--fd); font-weight: 400; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.12; color: #2a1d16; margin: .5rem 0 .7rem; }
.lf-resume { font-style: italic; font-size: 1.12rem; line-height: 1.6; color: var(--brun); max-width: 52ch; margin: 0 auto; }
.lf-animal { margin-top: 1rem; font-size: .95rem; }
.lf-animal a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(36, 71, 95, .35); }
.lf-animal a:hover { border-color: var(--accent); }
.lf-animal i { font-style: italic; }
.lf-orn { display: block; text-align: center; color: var(--or); font-size: 1.4rem; margin: 1.6rem 0 1.4rem; letter-spacing: .6em; }
.lf-texte p { font-size: 1.12rem; line-height: 1.85; color: #3a2f22; margin-bottom: 1.2rem; text-align: justify; hyphens: auto; }
.lf-texte p:first-child::first-letter {
  float: left; font-family: var(--fd); font-size: 3.6em; line-height: .85;
  padding: .1em .12em 0; margin: .06em .16em 0 0;
  color: var(--or-clair); background: var(--civ, var(--pourpre));
  border: 3px double var(--or);
}
.lf-fin { text-align: center; color: var(--pourpre); font-family: var(--fd); font-style: italic; margin-top: 1.6rem; }
.lf-retour { display: inline-block; margin-top: 1.8rem; font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; color: var(--or-clair); text-decoration: none; border-bottom: 1px solid rgba(230, 205, 138, .35); }
.lf-retour:hover { border-color: var(--or-clair); }

}
@media (max-width: 600px) {
  .ml-ecus { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 1.4rem .6rem; }
  .ml-ecu .ecu { width: 84px; height: 101px; }
  .ml-ecu-nom { font-size: 1rem; }
  .ml-velin-tete { padding: 0 2.2rem 0 0; text-align: left; }
  .ml-recit { grid-template-columns: 2.4rem 1fr; gap: .2rem .6rem; }
  .lf-texte p { text-align: left; }
}
