/* ════════════════════════════════════════
   ANIMALIA — histoire_legendes.css
   Le grand livre ouvert, posé sur la table du cabinet.
   Page gauche : manuscrit enluminé (bestiaire)
   Page droite : carnet de terrain (traditions)
════════════════════════════════════════ */

.hl-body {
  --nuit: #0e1620;
  --nuit-2: #141f2b;
  --velin: #efe3c4;
  --pourpre: #7a1c1c;
  --or: #c9a14a;
  --or-clair: #e6cd8a;
  --papier: #f6f1de;
  background: var(--nuit);
}

/* nav et footer passés au sombre sur cette page */
.hl-body nav { background: rgba(14, 22, 32, .94); border-bottom-color: rgba(201, 161, 74, .18); }
.hl-body .nav-logo { color: #eef2f5; }
.hl-body .nav-logo em { color: var(--or); }
.hl-body .nav-links a { color: #b9c4cf; }
.hl-body .nav-links a:hover, .hl-body .nav-links a[aria-current] { color: var(--or-clair); }
.hl-body .hamburger span { background: #eef2f5; }
.hl-body footer { background: var(--nuit-2); border-top-color: rgba(201, 161, 74, .15); color: #93a6b8; }
.hl-body footer strong, .hl-body footer a { color: #e4d6a8; }
@media (max-width: 860px) {
  .hl-body .nav-links { background: rgba(14, 22, 32, .98); }
}

/* ── titre ── */
.hl-tete { text-align: center; padding: clamp(2.6rem, 6vw, 4.2rem) 1.2rem 2rem; color: #eef2f5; position: relative; }
.hl-sur { font-family: 'IM Fell English SC', var(--fd); font-size: .82rem; letter-spacing: .3em; text-transform: uppercase; color: var(--or); }
.hl-tete h1 { font-family: var(--fd); font-weight: 400; font-size: clamp(2.3rem, 5.4vw, 3.8rem); margin: .5rem 0 .6rem; }
.hl-tete h1 em { color: var(--or); }
.hl-chapeau { max-width: 52ch; margin: 0 auto; font-style: italic; color: #93a6b8; font-size: 1.08rem; }

/* ── la table : hachures discrètes, lumière de lampe ── */
.hl-table {
  position: relative;
  padding: 1rem clamp(.8rem, 3vw, 2.5rem) clamp(3rem, 7vw, 5rem);
  background:
    radial-gradient(ellipse 70% 55% at 50% 45%, rgba(228, 196, 120, .13), transparent 70%),
    repeating-linear-gradient(115deg, rgba(255,255,255,.018) 0 2px, transparent 2px 9px);
}

/* ── le livre ── */
.hl-livre {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 34px 1fr;
  perspective: 2200px;
  filter: drop-shadow(0 28px 34px rgba(0, 0, 0, .55));
}

.hl-page {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(560px, 74vh, 720px);
  padding: 3.4rem 3rem;
  text-decoration: none;
  color: var(--ink);
  transition: transform .6s cubic-bezier(.3, .7, .2, 1), box-shadow .6s;
  overflow: hidden;
}
.hl-page--bestiaire { transform-origin: right center; border-radius: 6px 0 0 6px; }
.hl-page--carnets   { transform-origin: left center;  border-radius: 0 6px 6px 0; }

/* au survol, la page se soulève légèrement vers le lecteur */
.hl-page--bestiaire:hover { transform: rotateY(7deg) translateZ(6px); }
.hl-page--carnets:hover   { transform: rotateY(-7deg) translateZ(6px); }
.hl-page:focus-visible { outline: 3px solid var(--or); outline-offset: 4px; }

/* ── PAGE GAUCHE : vélin enluminé ── */
.hl-page--bestiaire {
  background:
    linear-gradient(90deg, transparent 82%, rgba(60, 38, 14, .2) 100%),
    radial-gradient(ellipse at 30% 25%, rgba(255, 250, 235, .7), transparent 60%),
    var(--velin);
}
.hl-cadre {
  position: absolute; inset: 22px;
  border: 3px double var(--or);
  pointer-events: none;
}
.hl-cadre::before {
  content: ""; position: absolute; inset: 7px;
  border: 1px solid rgba(122, 28, 28, .35);
}
.hl-rinceau--h { position: absolute; left: 34px; top: 46px; bottom: 46px; width: 26px; height: calc(100% - 92px); }

.hl-contenu { position: relative; z-index: 2; max-width: 430px; text-align: center; }
.hl-rubrique {
  font-family: 'IM Fell English SC', var(--fd);
  font-size: .9rem; letter-spacing: .24em; color: var(--pourpre);
}
.hl-ouroboros { width: 132px; height: 132px; margin: 1rem auto .6rem; display: block; transition: transform 1.4s ease; }
.hl-page--bestiaire:hover .hl-ouroboros { transform: rotate(-30deg); }
.hl-ouro-lettre { font-family: var(--fd); font-size: 30px; fill: var(--pourpre); }
.hl-page h2 { font-family: var(--fd); font-weight: 400; font-size: clamp(2rem, 3.6vw, 2.8rem); line-height: 1.1; margin: .4rem 0 1rem; }
.hl-page h2 span { font-style: italic; }
.hl-page--bestiaire h2 { color: var(--pourpre); }
.hl-page--bestiaire h2 span { color: var(--gold); }
.hl-desc { font-size: 1.08rem; line-height: 1.7; color: #4a3d2c; margin-bottom: 1.1rem; }
.hl-compte { font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; color: #8a6d36; margin-bottom: 1rem; }
.hl-go {
  display: inline-block; font-size: .82rem; letter-spacing: .16em; text-transform: uppercase;
  padding-bottom: .2rem; border-bottom: 1px solid currentColor; transition: letter-spacing .3s;
}
.hl-page:hover .hl-go { letter-spacing: .22em; }
.hl-page--bestiaire .hl-go { color: var(--pourpre); }
.hl-folio { position: absolute; bottom: 30px; font-family: var(--fd); font-style: italic; font-size: .9rem; color: #8a6d36; }
.hl-page--bestiaire .hl-folio { left: 50%; transform: translateX(-50%); }
.hl-page--carnets .hl-folio { right: 34px; }

/* ── RELIURE ── */
.hl-reliure {
  position: relative;
  background: linear-gradient(90deg, #1b120a, #4a3220 30%, #6b4a2c 50%, #4a3220 70%, #1b120a);
  box-shadow: inset 0 0 12px rgba(0, 0, 0, .6);
}
.hl-reliure::before, .hl-reliure::after {
  content: ""; position: absolute; left: 4px; right: 4px; height: 2px; background: var(--or); opacity: .6;
}
.hl-reliure::before { top: 14%; } .hl-reliure::after { bottom: 14%; }
.hl-signet {
  position: absolute; left: 50%; top: -14px; width: 16px; height: 120px; margin-left: -8px;
  background: linear-gradient(90deg, #5c1515, #9c2a2a 50%, #5c1515);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 86%, 0 100%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .4);
  z-index: 4;
}

/* ── PAGE DROITE : carnet de terrain ligné ── */
.hl-page--carnets {
  background:
    linear-gradient(270deg, transparent 82%, rgba(60, 38, 14, .2) 100%),
    repeating-linear-gradient(180deg, transparent 0 31px, rgba(36, 71, 95, .16) 31px 32px),
    var(--papier);
  background-position: 0 0, 0 18px, 0 0;
}
.hl-marge { position: absolute; top: 0; bottom: 0; left: 64px; width: 1px; background: rgba(179, 38, 30, .45); }
.hl-marge::after { content: ""; position: absolute; top: 0; bottom: 0; left: 4px; width: 1px; background: rgba(179, 38, 30, .25); }

.hl-timbre {
  position: absolute; top: 36px; right: 40px; width: 92px; height: 110px;
  background: #fbf7ea;
  transform: rotate(5deg);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .18);
  padding: 5px;
  /* bords dentelés (seulement le pourtour) */
  -webkit-mask: linear-gradient(#000 0 0) content-box, radial-gradient(circle 4px, #0000 96%, #000) -5.5px -5.5px / 11px 11px round;
          mask: linear-gradient(#000 0 0) content-box, radial-gradient(circle 4px, #0000 96%, #000) -5.5px -5.5px / 11px 11px round;
  transition: transform .5s;
}
.hl-timbre svg { width: 100%; height: 100%; display: block; }
.hl-timbre-txt { font-family: 'IM Fell English SC', var(--fd); font-size: 8.5px; letter-spacing: 1.5px; fill: #e4d6a8; }
.hl-page--carnets:hover .hl-timbre { transform: rotate(-2deg) scale(1.05); }
.hl-cachet { position: absolute; top: 92px; right: 86px; width: 104px; height: 104px; opacity: .55; transform: rotate(-14deg); pointer-events: none; }
.hl-cachet-txt { font-family: 'IM Fell English SC', var(--fd); font-size: 9.5px; letter-spacing: 2px; fill: #7a1c1c; }
.hl-cachet-date { font-family: var(--fd); font-size: 12px; fill: #7a1c1c; }

.hl-rubrique--carnet { color: var(--accent); font-family: var(--fd); font-style: italic; letter-spacing: .08em; font-size: 1.05rem; text-transform: none; }
.hl-page--carnets .hl-contenu { margin-left: 30px; }
.hl-page--carnets h2 { color: var(--ink); }
.hl-page--carnets h2 span { color: var(--accent); }
.hl-page--carnets .hl-desc { color: var(--ink-light); }
.hl-page--carnets .hl-compte { color: var(--ink-muted); }
.hl-page--carnets .hl-go { color: var(--accent); }

/* ── écrans très larges : les deux pages respirent plus ── */
@media (min-width: 1500px) {
  .hl-page { padding: 3.6rem 4.4rem; }
}

/* ── tablette / mobile : le livre se referme en pile ── */
@media (max-width: 860px) {
  .hl-livre { grid-template-columns: 1fr; perspective: none; }
  .hl-reliure { height: 22px; background: linear-gradient(180deg, #1b120a, #6b4a2c 50%, #1b120a); }
  .hl-reliure::before, .hl-reliure::after { top: 4px; bottom: 4px; height: auto; width: 2px; left: auto; right: auto; }
  .hl-reliure::before { left: 18%; } .hl-reliure::after { right: 18%; }
  .hl-signet { top: -6px; left: 14%; height: 70px; }
  .hl-folio { display: none; }
  .hl-page { min-height: 480px; padding: 3rem 1.8rem; border-radius: 6px; }
  .hl-page--bestiaire, .hl-page--carnets { background-image: none; }
  .hl-page--bestiaire { background: var(--velin); border-radius: 6px 6px 0 0; }
  .hl-page--carnets {
    background: repeating-linear-gradient(180deg, transparent 0 31px, rgba(36, 71, 95, .16) 31px 32px), var(--papier);
    border-radius: 0 0 6px 6px;
  }
  .hl-page--bestiaire:hover, .hl-page--carnets:hover { transform: none; }
  .hl-rinceau--h { display: none; }
  .hl-marge { left: 26px; }
  .hl-page--carnets .hl-contenu { margin-left: 12px; padding-top: 4.5rem; }
  .hl-timbre { top: 22px; right: 22px; width: 70px; height: 84px; }
  .hl-cachet { top: 54px; right: 64px; width: 80px; height: 80px; }
}
@media (max-width: 480px) {
  .hl-cadre { inset: 12px; }
  .hl-page { padding: 2.6rem 1.3rem; }
}
@media (prefers-reduced-motion: reduce) {
  .hl-page, .hl-ouroboros, .hl-timbre { transition: none; }
}
