/* ==========================================================
   CODEX DU MONDE DU DESSUS
   Direction artistique : Cabinet de Taxonomie
   Typographie : IM Fell English · Courier Prime · Cinzel
   Palette : ivoire vieilli, encre, rouge correction, ocre
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=IM+Fell+English:ital@0;1&family=Courier+Prime:ital,wght@0,400;0,700;1,400&family=Cinzel:wght@400;500;600&display=swap');

/* --- Variables de système --------------------------------- */
:root {
  /* Palette Taxonomie */
  --ivoire:       #F7F3EC;       /* Papier de fond  */
  --ivoire-2:     #EDE8DC;       /* Papier usé      */
  --ivoire-3:     #DDD5C4;       /* Papier vieilli  */
  --brun:         #3D2B1A;       /* Encre de fond   */
  --brun-2:       #5C4030;       /* Encre secondaire*/
  --encre:        #1C1814;       /* Texte principal */
  --encre-2:      #2E231A;       /* Encre douce     */
  --rouge:        #8B2215;       /* Rouge correction */
  --rouge-pale:   #B54030;       /* Rouge annotat.  */
  --rouge-tres-pale: #D4604A;
  --ocre:         #B8943A;       /* Or d'index      */
  --ocre-pale:    #D4B060;
  --ocre-sombre:  #7A6020;
  --gris-spine:   #4A4540;       /* Dos de volume   */
  --gris-filet:   #C4B8A8;       /* Filets tabulaires*/
  --vert-bio:     #3A6040;       /* Annotations bio */
  --vert-bio-pale:#547854;

  /* Typographie */
  --font-corps:  'IM Fell English', 'Georgia', serif;
  --font-mono:   'Courier Prime', 'Courier New', monospace;
  --font-titre:  'Cinzel', 'Times New Roman', serif;

  /* Espacements système */
  --marge-spine: 88px;     /* Largeur de la gouttière gauche */
  --marge-corps: 3rem;
  --trans: 0.25s ease;

  /* Ombres papier */
  --ombre-page: 2px 3px 12px rgba(61,43,26,0.15);
  --ombre-fiche: 1px 2px 8px rgba(61,43,26,0.2);
}

/* --- Reset ------------------------------------------------ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 17px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--gris-filet) var(--ivoire-2);
}

body {
  background-color: var(--ivoire-2);
  color: var(--encre);
  font-family: var(--font-corps);
  font-weight: 400;
  line-height: 1.78;
  min-height: 100vh;
  overflow-x: hidden;
  /* Texture papier tramée */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--ivoire-2); }
::-webkit-scrollbar-thumb { background: var(--gris-filet); }

/* --- Typographie de base ---------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-corps);
  font-weight: 400;
  font-style: italic;
  line-height: 1.25;
  color: var(--encre);
}

h1 { font-size: 2.4rem;  letter-spacing: -0.01em; }
h2 { font-size: 1.55rem; margin: 2.5rem 0 0.8rem; }
h3 { font-size: 1.2rem;  margin: 1.8rem 0 0.5rem; }
h4 { font-size: 1rem; font-style: normal; font-family: var(--font-mono); font-size: 0.82rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brun-2); }

p { margin-bottom: 1.1em; }

strong, b {
  font-weight: 700;
  font-style: normal;
  color: var(--encre);
}

em, i { font-style: italic; }

a {
  color: var(--encre);
  text-decoration: none;
  border-bottom: 1px solid var(--gris-filet);
  transition: border-color var(--trans), color var(--trans);
}
a:hover {
  color: var(--rouge);
  border-bottom-color: var(--rouge);
}

/* Lien wiki interne — renvoi de catalogue */
a.lien-wiki {
  color: var(--brun-2);
  border-bottom: 1px dotted var(--brun-2);
  font-style: italic;
}
a.lien-wiki:hover {
  color: var(--rouge);
  border-bottom-color: var(--rouge);
}


ul, ol {
  margin: 1rem 0 1.4rem 1.8rem;
  color: var(--encre);
  line-height: 2;
}

li { margin-bottom: 0.2rem; }

/* --- Gouttière spine (marge gauche réservée) -------------- */
/* Cette colonne de gauche imite le dos d'un volume de catalogue.
   Elle porte : numéros de volume, codes, tampons, pagination. */

.page-wrapper {
  display: grid;
  grid-template-columns: var(--marge-spine) 1fr;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  grid-template-areas:
    "spine-nav nav"
    "spine-content content"
    "spine-footer footer";
}

/* ── COLONNE SPINE (fond plus sombre, réservée) ────────────── */
.spine-column {
  grid-area: spine-content;
  background: var(--ivoire-3);
  border-right: 1.5px solid var(--gris-filet);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 0;
  gap: 0;
  z-index: 10;
  box-shadow: var(--ombre-page);
}

/* Numéro de volume — grand, en impression typographique */
.spine-volume {
  font-family: var(--font-titre);
  font-size: 0.55rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--brun-2);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  margin-bottom: auto;
  padding-top: 1rem;
  white-space: nowrap;
}

.spine-num {
  font-family: var(--font-titre);
  font-size: 3.2rem;
  font-weight: 400;
  color: var(--gris-filet);
  line-height: 1;
  letter-spacing: -0.05em;
  margin: auto 0;
  user-select: none;
}

.spine-code {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  color: var(--gris-filet);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  margin-top: auto;
  padding-bottom: 1rem;
  letter-spacing: 0.1em;
}

/* Filet de séparation dans la spine */
.spine-filet {
  width: 60%;
  height: 1px;
  background: var(--gris-filet);
  margin: 0.75rem auto;
}

/* --- Navigation principale -------------------------------- */
.spine-nav-area {
  grid-area: spine-nav;
  background: var(--ivoire-3);
  border-right: 1.5px solid var(--gris-filet);
  border-bottom: 1.5px solid var(--gris-filet);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.nav-zone {
  grid-area: nav;
  background: var(--ivoire);
  border-bottom: 1.5px solid var(--gris-filet);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 54px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 var(--gris-filet);
}

/* Logo / titre du volume */
.nav-logo-taxo {
  font-family: var(--font-titre);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brun);
  text-decoration: none;
  border-bottom: none;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.nav-logo-taxo:hover { color: var(--rouge); border-bottom: none; }
.nav-logo-ligne1 { color: var(--encre); font-size: 0.72rem; }
.nav-logo-ligne2 { color: var(--gris-spine); font-size: 0.5rem; letter-spacing: 0.25em; }

/* Liens nav */
.nav-liens-taxo {
  display: flex;
  list-style: none;
  gap: 2rem;
  padding: 0;
  margin: 0;
}
.nav-liens-taxo a {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brun-2);
  border-bottom: none;
  transition: color var(--trans);
  position: relative;
}
.nav-liens-taxo a:hover,
.nav-liens-taxo a.active { color: var(--rouge); }
.nav-liens-taxo a.active::after {
  content: '';
  position: absolute;
  bottom: -18px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--rouge);
}

/* Zone recherche */
.nav-recherche-taxo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--gris-filet);
  padding: 0.25rem 0.75rem;
  background: var(--ivoire-2);
}
.nav-recherche-taxo input {
  background: none;
  border: none;
  outline: none;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--encre);
  width: 160px;
}
.nav-recherche-taxo input::placeholder { color: var(--gris-filet); }
.nav-loupe {
  font-size: 0.85rem;
  color: var(--gris-filet);
  font-family: var(--font-mono);
}

.nav-burger-taxo {
  display: none;
  background: none;
  border: 1px solid var(--gris-filet);
  color: var(--encre);
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

/* Marqueur de page spine header */
.spine-nav-mark {
  font-family: var(--font-mono);
  font-size: 0.45rem;
  color: var(--gris-filet);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

/* --- Zone de contenu principale --------------------------- */
.contenu-zone {
  grid-area: content;
  display: grid;
  grid-template-columns: 220px 1fr 200px;
  grid-template-areas: "sidebar-g main sidebar-d";
  align-items: start;
}

/* --- Sidebar gauche — Index de catalogue ----------------- */
.sidebar-index {
  grid-area: sidebar-g;
  border-right: 1px solid var(--gris-filet);
  padding: 2rem 0;
  position: sticky;
  top: 54px;
  max-height: calc(100vh - 54px);
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--ivoire);
  scrollbar-width: thin;
  scrollbar-color: var(--gris-filet) transparent;
  align-self: start;
}

.sidebar-rubrique {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gris-spine);
  padding: 1.2rem 1.2rem 0.4rem;
  border-bottom: 1px solid var(--gris-filet);
  margin-bottom: 0;
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav li {
  margin: 0;
  border-bottom: 1px solid rgba(196,184,168,0.4);
}

.sidebar-nav a {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.5rem 1.2rem;
  font-family: var(--font-corps);
  font-size: 0.85rem;
  color: var(--brun-2);
  border-bottom: none;
  transition: background var(--trans), color var(--trans);
  line-height: 1.35;
}

.sidebar-nav a:hover {
  background: var(--ivoire-2);
  color: var(--rouge);
  border-bottom: none;
}

.sidebar-nav a.active {
  background: var(--ivoire-2);
  color: var(--rouge);
  border-left: 2px solid var(--rouge);
  padding-left: calc(1.2rem - 2px);
}

/* Code de catalogue devant chaque entrée */
.sidebar-code {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  color: var(--gris-filet);
  min-width: 36px;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

/* Icône de statut */
.sidebar-statut {
  font-size: 0.7rem;
  margin-left: auto;
  flex-shrink: 0;
}
.statut-canon     { color: var(--vert-bio); }
.statut-revision  { color: var(--ocre); }
.statut-classe    { color: var(--rouge-pale); }
.statut-lacune    { color: var(--gris-filet); }

/* --- Main article ---------------------------------------- */
.main-article {
  grid-area: main;
  padding: 2.5rem var(--marge-corps);
  min-height: calc(100vh - 54px);
}

/* Breadcrumb style "chemin de renvoi" */
.renvoi-chemin {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gris-filet);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.renvoi-chemin a { color: var(--gris-filet); border-bottom: none; }
.renvoi-chemin a:hover { color: var(--rouge); }
.renvoi-sep { color: var(--gris-filet); }

/* --- En-tête d'article taxonomique ----------------------- */
.entete-taxo {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1.5px solid var(--gris-filet);
  position: relative;
}

/* Ligne de métadonnées du catalogue */
.entete-meta-catalogue {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.catalogue-code {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--rouge);
  background: rgba(139,34,21,0.06);
  padding: 0.2rem 0.5rem;
  border: 1px solid rgba(139,34,21,0.2);
}

.catalogue-classe {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brun-2);
}

.catalogue-volume {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--gris-filet);
  margin-left: auto;
}

/* Catégorie d'entrée — remplace catalogue-classe après nettoyage */
.entete-categorie {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brun-2);
  margin-bottom: 0.4rem;
}

/* Titre principal — nom scientifique en IM Fell */
.entete-genus {
  font-family: var(--font-corps);
  font-style: italic;
  font-size: 2.2rem;
  color: var(--encre);
  line-height: 1.15;
  margin-bottom: 0.2rem;
}

/* Nom commun sous le genre */
.entete-nom-commun {
  font-family: var(--font-titre);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brun-2);
  margin-bottom: 1rem;
}

/* Ligne de taxonomie — masquée (supprimée visuellement) */
.entete-taxonomie {
  display: none;
}
.taxo-cell {
  display: flex;
  flex-direction: column;
  padding: 0.4rem 1rem;
  border-right: 1px solid var(--gris-filet);
  flex: 1;
  min-width: 100px;
}
.taxo-cell:last-child { border-right: none; }
.taxo-label {
  font-family: var(--font-mono);
  font-size: 0.48rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gris-filet);
  margin-bottom: 0.15rem;
}
.taxo-val {
  font-family: var(--font-corps);
  font-style: italic;
  font-size: 0.88rem;
  color: var(--encre);
}

/* Ligne de statut catalogue */
.entete-statuts {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

/* Tampons de statut */
.tampon {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border: 1.5px solid;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.tampon::before { content: '◈'; font-size: 0.6em; }

.tampon-canon {
  color: var(--vert-bio);
  border-color: var(--vert-bio);
  background: rgba(58,96,64,0.05);
}
.tampon-revision {
  color: var(--ocre-sombre);
  border-color: var(--ocre);
  background: rgba(184,148,58,0.07);
  transform: rotate(-1deg);
}
.tampon-classe {
  color: var(--rouge);
  border-color: var(--rouge);
  background: rgba(139,34,21,0.06);
  transform: rotate(0.5deg);
}
.tampon-lacune {
  color: var(--gris-filet);
  border-color: var(--gris-filet);
  background: transparent;
  text-decoration: line-through;
}
.tampon-acces {
  color: var(--rouge);
  border-color: var(--rouge);
  background: rgba(139,34,21,0.06);
  transform: rotate(-2deg);
  border-width: 2px;
}

/* Annotation de révision (date, agent) */
.entete-revision {
  margin-top: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.52rem;
  color: var(--gris-filet);
  letter-spacing: 0.05em;
}

/* --- Encart Info (Fiche taxo, float right) --------------- */
.fiche-taxo {
  float: right;
  width: 240px;
  margin: 0 0 2rem 2rem;
  border: 1px solid var(--gris-filet);
  background: var(--ivoire);
  box-shadow: var(--ombre-fiche);
  position: relative;
}

/* Coin replié simulation papier */
.fiche-taxo::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, transparent 50%, var(--ivoire-2) 50%);
  border-top: 1px solid var(--gris-filet);
  border-left: 1px solid var(--gris-filet);
}

.fiche-taxo-titre {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ivoire);
  background: var(--brun);
  padding: 0.45rem 0.75rem;
  border-bottom: 2px solid var(--rouge);
}

.fiche-taxo-corps {
  padding: 0.75rem;
}

.fiche-taxo-ligne {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 0.3rem;
  padding: 0.32rem 0;
  border-bottom: 1px solid rgba(196,184,168,0.5);
  font-size: 0.8rem;
}
.fiche-taxo-ligne:last-child { border-bottom: none; }

.fiche-cle {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--brun-2);
  align-self: center;
}

.fiche-val {
  color: var(--encre);
  font-size: 0.82rem;
  line-height: 1.35;
}

/* Ligne de fiche barrée (révision) */
.fiche-taxo-ligne.obsolete {
  opacity: 0.55;
  text-decoration: line-through;
}
.fiche-taxo-ligne.obsolete .fiche-val { color: var(--gris-filet); }

/* Annotation manuscrite (recto de fiche) */
.fiche-annotation {
  background: rgba(184,148,58,0.08);
  border-left: 2px solid var(--ocre);
  padding: 0.5rem 0.75rem;
  font-family: var(--font-corps);
  font-style: italic;
  font-size: 0.78rem;
  color: var(--rouge-pale);
  line-height: 1.4;
  margin: 0.5rem 0 0;
}

.fiche-note-mono {
  font-family: var(--font-mono);
  font-size: 0.48rem;
  color: var(--gris-filet);
  letter-spacing: 0.05em;
  text-align: right;
  padding: 0.35rem 0.75rem;
  border-top: 1px solid var(--gris-filet);
  margin-top: 0;
}

/* --- Corps d'article ------------------------------------- */
.corps-article {
  position: relative;
}

/* Lettrine taxonomique — initiale ornée */
.corps-article > p:first-of-type::first-letter {
  font-family: var(--font-titre);
  font-size: 3.8em;
  float: left;
  line-height: 0.72;
  margin: 0.08em 0.1em 0 0;
  color: var(--rouge);
  font-weight: 400;
}

/* Titre de section — style "rubrique de catalogue" */
.corps-article h2 {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  font-style: italic;
  border-bottom: 1px solid var(--gris-filet);
  padding-bottom: 0.4rem;
  position: relative;
}

.corps-article h2::before {
  content: attr(data-num);
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 0.6rem;
  color: var(--gris-filet);
  letter-spacing: 0.05em;
  min-width: 24px;
  flex-shrink: 0;
}

.corps-article h3 {
  font-style: italic;
  color: var(--brun-2);
  position: relative;
  padding-left: 1.2rem;
}

.corps-article h3::before {
  content: '§';
  position: absolute;
  left: 0;
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 0.75rem;
  color: var(--gris-filet);
  top: 0.15em;
}

/* --- Annotation marginale externe (dans la marge droite) - */
.marge-note {
  position: absolute;
  right: -160px;
  width: 145px;
  font-family: var(--font-corps);
  font-style: italic;
  font-size: 0.72rem;
  color: var(--rouge-pale);
  line-height: 1.4;
  border-left: 1px solid rgba(181,64,48,0.3);
  padding-left: 0.6rem;
}

/* --- Citation de lore ------------------------------------ */
.citation-taxo {
  margin: 2rem 0;
  padding: 1rem 1.25rem 1rem 1.75rem;
  border-left: 3px solid var(--gris-filet);
  background: var(--ivoire-2);
  position: relative;
}
.citation-taxo::before {
  content: '"';
  font-family: var(--font-corps);
  font-size: 4rem;
  color: var(--gris-filet);
  position: absolute;
  top: -0.5rem;
  left: 0.75rem;
  line-height: 1;
}
.citation-taxo p {
  font-family: var(--font-corps);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--brun-2);
  margin: 0;
}
.citation-taxo cite {
  display: block;
  margin-top: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.08em;
  color: var(--gris-filet);
  font-style: normal;
}

/* --- Bloc de reclassification (entrée barrée/révisée) ----- */
.bloc-reclasse {
  margin: 2rem 0;
  border: 1px solid var(--ocre);
  background: rgba(184,148,58,0.05);
  padding: 1rem 1.25rem;
  position: relative;
}
.bloc-reclasse-header {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ocre-sombre);
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.bloc-reclasse-header::before {
  content: '◈';
  font-size: 0.7em;
}
.bloc-reclasse-ancien {
  text-decoration: line-through;
  color: var(--gris-filet);
  font-size: 0.88rem;
  margin-bottom: 0.4rem;
  font-family: var(--font-corps);
}
.bloc-reclasse-nouveau {
  color: var(--encre);
  font-size: 0.88rem;
  font-family: var(--font-corps);
}
.bloc-reclasse-date {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  color: var(--gris-filet);
  text-align: right;
  margin-top: 0.5rem;
}

/* --- Bloc accès restreint / lacune ----------------------- */
.bloc-acces {
  margin: 2rem 0;
  border: 1.5px solid var(--rouge);
  padding: 1rem 1.25rem;
  background: rgba(139,34,21,0.04);
  position: relative;
}
.bloc-acces-header {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--rouge);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.bloc-acces-header::before { content: '⚑ '; }
.bloc-acces p {
  font-size: 0.85rem;
  color: var(--brun-2);
}

/* Texte censuré (biffe) */
.biffe {
  background: var(--encre);
  color: transparent;
  user-select: none;
  padding: 0 2px;
  cursor: not-allowed;
}
.biffe:hover::after {
  content: ' [classifié]';
  color: var(--rouge);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.6em;
  vertical-align: super;
}

/* --- Note de bas de page --------------------------------- */
.notes-bas {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gris-filet);
}
.notes-bas-titre {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gris-filet);
  margin-bottom: 0.75rem;
}
.note-item {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.78rem;
  color: var(--brun-2);
  line-height: 1.5;
}
.note-num {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--rouge);
  min-width: 20px;
  padding-top: 0.1em;
}

/* Appel de note dans le texte */
sup.appel-note {
  font-family: var(--font-mono);
  font-size: 0.6em;
  color: var(--rouge);
  cursor: help;
}

/* --- Sommaire (TOC) --------------------------------------- */
.sommaire-taxo {
  border: 1px solid var(--gris-filet);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0 2rem;
  background: var(--ivoire);
  box-shadow: var(--ombre-fiche);
}
.sommaire-taxo-titre {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gris-spine);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.sommaire-taxo-titre::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gris-filet);
}
.toc-auto ol {
  list-style: none;
  counter-reset: toc-item;
  padding: 0;
  margin: 0;
}
.toc-auto li {
  counter-increment: toc-item;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.toc-auto li::before {
  content: counter(toc-item, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.52rem;
  color: var(--gris-filet);
  min-width: 22px;
}
.toc-auto a {
  font-size: 0.85rem;
  color: var(--brun);
  border-bottom: none;
  font-family: var(--font-corps);
  font-style: italic;
}
.toc-auto a:hover { color: var(--rouge); }

/* TOC sidebar droite */
.toc-sidebar-taxo {
  padding: 0;
  border: none;
  background: none;
  box-shadow: none;
  margin: 0;
}

/* --- Sidebar droite — Dans cet article ------------------- */
.sidebar-droite-taxo {
  grid-area: sidebar-d;
  border-left: 1px solid var(--gris-filet);
  padding: 2rem 1.25rem;
  position: sticky;
  top: 54px;
  max-height: calc(100vh - 54px);
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--ivoire);
  scrollbar-width: thin;
  align-self: start; /* empêche la sidebar de déborder sous le footer */
}

.sidebar-d-rubrique {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gris-spine);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--gris-filet);
}

.sidebar-d-rubrique + .sidebar-d-rubrique { margin-top: 1.5rem; }

/* Tags dans sidebar */
.tags-taxo {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.tag-taxo {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brun-2);
  border: 1px solid var(--gris-filet);
  padding: 0.2rem 0.5rem;
  background: var(--ivoire-2);
}

/* Pagination de volume */
.sidebar-pagination {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gris-filet);
}
.sidebar-page-num {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  color: var(--gris-filet);
  text-align: center;
  display: block;
}
.sidebar-page-grand {
  font-family: var(--font-titre);
  font-size: 2.5rem;
  color: var(--ivoire-3);
  text-align: center;
  display: block;
  line-height: 1;
  user-select: none;
}

/* --- Bloc relations (Articles liés) ---------------------- */
.bloc-renvois {
  margin: 3rem 0 1rem;
  padding: 1.25rem;
  border: 1px solid var(--gris-filet);
  background: var(--ivoire);
  box-shadow: var(--ombre-fiche);
}
.bloc-renvois-titre {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gris-filet);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.bloc-renvois-titre::before { content: '↗'; color: var(--rouge); font-size: 0.75em; }
.renvois-grille {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.4rem;
}
.renvoi-lien {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--gris-filet);
  text-decoration: none;
  border-bottom: 1px solid var(--gris-filet);
  transition: background var(--trans), border-color var(--trans);
  background: var(--ivoire-2);
}
.renvoi-lien:hover {
  background: var(--ivoire-3);
  border-color: var(--brun-2);
}
.renvoi-code {
  font-family: var(--font-mono);
  font-size: 0.48rem;
  color: var(--brun-2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.renvoi-nom {
  font-family: var(--font-corps);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--encre);
}

/* --- Cartes de catalogue (index / encyclopédie) ---------- */
.index-catalogue {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0;
  border: 1px solid var(--gris-filet);
  background: var(--gris-filet);
}

.carte-catalogue {
  display: flex;
  flex-direction: column;
  background: var(--ivoire);
  padding: 0;
  text-decoration: none;
  border-bottom: none;
  transition: background var(--trans);
  position: relative;
  overflow: hidden;
}
.carte-catalogue:hover { background: var(--ivoire-2); }
.carte-catalogue:hover .carte-cat-corps { border-left-color: var(--rouge); }

.carte-cat-header {
  background: var(--encre-2);
  padding: 0.4rem 0.75rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.carte-cat-code {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  color: var(--gris-filet);
  letter-spacing: 0.06em;
}
.carte-cat-statut {
  font-family: var(--font-mono);
  font-size: 0.48rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.stat-canon-txt   { color: var(--vert-bio); }
.stat-revision-txt { color: var(--ocre); }

.carte-cat-corps {
  padding: 0.9rem 1rem;
  flex: 1;
  border-left: 3px solid transparent;
  transition: border-color var(--trans);
}
.carte-cat-classe {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brun-2);
  margin-bottom: 0.3rem;
}
.carte-cat-titre {
  font-family: var(--font-corps);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--encre);
  margin-bottom: 0.4rem;
  line-height: 1.3;
}
.carte-cat-extrait {
  font-size: 0.8rem;
  color: var(--brun-2);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Entrée barrée dans l'index (reclassifiée/obsolète) */
.carte-catalogue.obsolete .carte-cat-titre {
  text-decoration: line-through;
  color: var(--gris-filet);
}
.carte-catalogue.obsolete { opacity: 0.65; }

/* --- Chronologie — journal de révisions ------------------- */
.journal-revisions {
  position: relative;
  padding-left: 3.5rem;
}
.journal-revisions::before {
  content: '';
  position: absolute;
  left: 1.5rem;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--gris-filet);
}

.journal-entree {
  position: relative;
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--gris-filet);
  background: var(--ivoire);
  box-shadow: var(--ombre-fiche);
}

.journal-entree::before {
  content: '';
  position: absolute;
  left: -2.05rem;
  top: 1.2rem;
  width: 8px;
  height: 8px;
  background: var(--ivoire);
  border: 1.5px solid var(--gris-filet);
}
.journal-entree.revision::before { border-color: var(--ocre); background: rgba(184,148,58,0.15); }
.journal-entree.majeur::before   { border-color: var(--rouge); background: rgba(139,34,21,0.1); width: 10px; height: 10px; left: -2.12rem; }

.journal-date {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  color: var(--brun-2);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
}
.journal-titre {
  font-family: var(--font-corps);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--encre);
  margin-bottom: 0.35rem;
}
.journal-desc {
  font-size: 0.82rem;
  color: var(--brun-2);
  line-height: 1.55;
}

/* --- Zone recherche résultats ----------------------------- */
#resultats-recherche {
  display: none;
  position: fixed;
  top: 54px;
  left: var(--marge-spine);
  right: 0;
  background: var(--ivoire);
  border-bottom: 1.5px solid var(--gris-filet);
  border-left: 1.5px solid var(--gris-filet);
  padding: 0.75rem 1.5rem;
  z-index: 99;
  max-height: 55vh;
  overflow-y: auto;
  box-shadow: 0 4px 16px rgba(61,43,26,0.12);
}

.resultat-item {
  padding: 0.6rem;
  border-bottom: 1px solid rgba(196,184,168,0.4);
  cursor: pointer;
  display: flex;
  gap: 1rem;
  align-items: baseline;
}
.resultat-item:hover { background: var(--ivoire-2); }
.resultat-code {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  color: var(--gris-filet);
  min-width: 60px;
}
.resultat-titre {
  font-family: var(--font-corps);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--encre);
}
.resultat-extrait {
  font-size: 0.72rem;
  color: var(--brun-2);
  margin-left: auto;
}

/* --- Hero page d'accueil --------------------------------- */
.hero-taxo {
  position: relative;
  min-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 4rem 3rem;
  overflow: hidden;
}
.hero-taxo-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-taxo-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(60%) contrast(1.05) brightness(0.45) saturate(0.6);
  mix-blend-mode: multiply;
}
.hero-taxo-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(247,243,236,0.92) 0%, rgba(247,243,236,0.3) 60%, transparent 100%);
}

/* Grille de fond hero — évoque papier millimétré */
.hero-taxo-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image:
    linear-gradient(rgba(196,184,168,0.25) 1px, transparent 1px),
    linear-gradient(90deg, rgba(196,184,168,0.25) 1px, transparent 1px);
  background-size: 32px 32px;
}

.hero-taxo-contenu {
  position: relative;
  z-index: 2;
  max-width: 680px;
}

.hero-code-volume {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--rouge);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.hero-code-volume::before {
  content: '';
  width: 40px;
  height: 1px;
  background: var(--rouge);
}

.hero-taxo-titre {
  font-family: var(--font-corps);
  font-style: italic;
  font-size: clamp(2.8rem, 6vw, 5rem);
  color: var(--encre);
  line-height: 1.05;
  margin-bottom: 0.4rem;
}

.hero-taxo-sous {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brun-2);
  margin-bottom: 2rem;
  max-width: 500px;
  line-height: 1.8;
}

.hero-taxo-actions {
  display: flex;
  gap: 1px;
  background: var(--gris-filet);
}

.btn-taxo {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.75rem 1.5rem;
  background: var(--ivoire);
  color: var(--encre);
  text-decoration: none;
  border: none;
  transition: background var(--trans), color var(--trans);
  border-bottom: none;
}
.btn-taxo:hover { background: var(--encre); color: var(--ivoire); border-bottom: none; }
.btn-taxo.primaire {
  background: var(--encre);
  color: var(--ivoire);
}
.btn-taxo.primaire:hover { background: var(--rouge); }

/* Ligne de statut en bas du hero */
.hero-taxo-status {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--ivoire-3);
  border-top: 1.5px solid var(--gris-filet);
  padding: 0.5rem 3rem;
  display: flex;
  align-items: center;
  gap: 3rem;
  z-index: 2;
}
.hero-status-item {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.hero-status-label {
  font-family: var(--font-mono);
  font-size: 0.48rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gris-filet);
}
.hero-status-val {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--encre);
  letter-spacing: 0.05em;
}

/* --- Filtres index --------------------------------------- */
.index-filtre {
  display: flex;
  gap: 1px;
  background: var(--gris-filet);
  margin-bottom: 1.5rem;
}
.filtre-btn {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.4rem 1rem;
  background: var(--ivoire);
  color: var(--brun-2);
  border: none;
  cursor: pointer;
  transition: background var(--trans), color var(--trans);
}
.filtre-btn:hover,
.filtre-btn.actif {
  background: var(--encre);
  color: var(--ivoire);
}

/* --- Pied de page --------------------------------------- */
.pied-taxo {
  background: var(--encre);
  color: var(--ivoire-3);
  border-top: 2px solid var(--brun-2);
  overflow: hidden;
}

/* Bandeau ornement haut du footer */
.pied-ornement {
  background: var(--encre-2);
  border-bottom: 1px solid var(--brun-2);
  padding: 1rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}
.pied-orn-trait {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--brun-2));
  max-width: 200px;
}
.pied-orn-trait.droite {
  background: linear-gradient(to left, transparent, var(--brun-2));
}
.pied-orn-glyph {
  font-family: var(--font-corps);
  font-style: italic;
  font-size: 1rem;
  color: var(--gris-filet);
  letter-spacing: 0.3em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  white-space: nowrap;
}
.pied-orn-point {
  width: 4px;
  height: 4px;
  background: var(--gris-filet);
  transform: rotate(45deg);
  flex-shrink: 0;
}

/* Corps du footer — 3 colonnes simples, pas de spine */
.pied-corps-simple {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  padding: 1.75rem 3rem;
  border-bottom: 1px solid var(--brun-2);
}

.pied-col {
  padding: 0 1.5rem;
  border-right: 1px solid var(--brun-2);
}
.pied-col:first-child { padding-left: 0; }
.pied-col:last-child  { border-right: none; }

.pied-col-titre {
  font-family: var(--font-mono);
  font-size: 0.48rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gris-filet);
  margin-bottom: 0.65rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--brun-2);
}

.pied-col-texte {
  font-family: var(--font-corps);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--brun-2);
  line-height: 1.7;
}

.pied-col-phrase {
  display: flex;
  align-items: center;
}

.pied-col-liens {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.pied-col-liens li a {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brun-2);
  text-decoration: none;
  border-bottom: none;
  transition: color var(--trans);
}
.pied-col-liens li a:hover { color: var(--ivoire-3); }

.pied-bas {
  padding: 0.65rem 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.pied-bas-logo {
  font-family: var(--font-titre);
  font-size: 0.6rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gris-spine);
}
.pied-bas-mention {
  font-family: var(--font-mono);
  font-size: 0.48rem;
  color: var(--gris-spine);
  letter-spacing: 0.04em;
}

@media (max-width: 960px) {
  .pied-corps-simple { grid-template-columns: 1fr 1fr; padding: 1.5rem; }
  .pied-col-phrase { display: none; }
  .pied-bas { padding: 0.65rem 1.5rem; }
}
@media (max-width: 640px) {
  .pied-corps-simple { grid-template-columns: 1fr; }
  .pied-col { border-right: none; border-bottom: 1px solid var(--brun-2); padding: 0.75rem 0; }
  .pied-col:last-child { border-bottom: none; }
}


/* --- Bouton haut de page -------------------------------- */
#btn-haut {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--encre);
  border: 1px solid var(--brun-2);
  color: var(--gris-filet);
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  opacity: 0;
  transition: opacity var(--trans), color var(--trans);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}
#btn-haut:hover { color: var(--ivoire); }

/* --- Menu mobile ---------------------------------------- */
.nav-mobile-taxo {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--ivoire);
  z-index: 200;
  flex-direction: column;
  padding: 4rem 2rem 2rem;
  overflow-y: auto;
}
.nav-mobile-taxo.ouvert { display: flex; }
.nav-mobile-fermer {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  background: none;
  border: 1px solid var(--gris-filet);
  color: var(--encre);
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  font-family: var(--font-mono);
}

.nav-mobile-rubrique {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gris-filet);
  padding: 1rem 0 0.4rem;
  border-bottom: 1px solid var(--gris-filet);
  margin-bottom: 0.25rem;
}

.nav-mobile-lien {
  display: block;
  font-family: var(--font-corps);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--encre);
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(196,184,168,0.4);
  text-decoration: none;
}

/* --- Utilitaires ---------------------------------------- */
.clearfix::after { content: ''; display: table; clear: both; }

/* --- Images & figures dans le corps d'article ----------- */
.corps-article img {
  max-width: 100%;
  height: auto;
  display: block;
}

.corps-article figure {
  margin: 2rem 0;
}

.figure-coupe {
  max-width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--gris-filet);
}

.figure-legende {
  margin-top: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.04em;
  color: var(--brun-2);
  line-height: 1.5;
}

/* --- Séparateur de section ornementé ------------------- */
/* Usage : <div class="sep-section" data-label="Géographie"></div> */
.sep-section {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin: 3rem 0 2.5rem;
  position: relative;
}
.sep-section::before,
.sep-section::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gris-filet);
}
.sep-section-inner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
  font-family: var(--font-corps);
  font-style: italic;
  font-size: 0.8rem;
  color: var(--gris-filet);
}
.sep-losange {
  width: 5px;
  height: 5px;
  background: var(--gris-filet);
  transform: rotate(45deg);
  flex-shrink: 0;
}
.sep-losange.accent {
  background: var(--rouge);
}

/* Version dans .corps-article — entre les h2 */
.corps-article .sep-article {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 2.5rem 0;
  color: var(--gris-filet);
}
.corps-article .sep-article::before,
.corps-article .sep-article::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gris-filet);
}
.corps-article .sep-article-glyph {
  font-family: var(--font-corps);
  font-style: italic;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

/* Filet tabulaire horizontal (ornement de section) — version héritée */
.filet-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 2.5rem 0 2rem;
}
.filet-section::before,
.filet-section::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gris-filet);
}
.filet-section::before { max-width: 0; flex: 0 0 0; }
.filet-section[data-label]::after { display: none; }
.filet-section {
  font-family: var(--font-mono);
  font-size: 0.48rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gris-filet);
  position: relative;
}
/* Réinitialisation pour utiliser le pseudo-element propre */
.filet-section {
  height: auto;
  background: none;
}

/* --- Animations ----------------------------------------- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.anim-entree  { animation: fadeIn 0.5s ease both; }
.anim-entree-2 { animation: fadeIn 0.5s ease 0.08s both; }
.anim-entree-3 { animation: fadeIn 0.5s ease 0.16s both; }

/* --- Responsive ----------------------------------------- */
@media (max-width: 1200px) {
  .contenu-zone {
    grid-template-columns: 200px 1fr;
    grid-template-areas: "sidebar-g main";
  }
  .sidebar-droite-taxo { display: none; }
}

@media (max-width: 960px) {
  .page-wrapper {
    grid-template-columns: 0 1fr;
  }
  .spine-column, .spine-nav-area { display: none; }
  .contenu-zone {
    grid-template-columns: 1fr;
    grid-template-areas: "main";
  }
  .sidebar-index { display: none; }
  .main-article { padding: 2rem 1.5rem; }
  .fiche-taxo { float: none; width: 100%; margin: 1.5rem 0; }
  .marge-note { display: none; }
}

@media (max-width: 640px) {
  .nav-liens-taxo { display: none; }
  .nav-recherche-taxo { display: none; }
  .nav-burger-taxo { display: flex; }
  html { font-size: 15px; }
}

/* --- Tooltip lien-wiki (extrait au survol) --------------- */
.lien-wiki {
  position: relative;
}

.lw-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: 260px;
  background: var(--encre);
  border: 1px solid var(--brun-2);
  border-top: 2px solid var(--rouge);
  padding: 0.75rem 0.9rem;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
  transform: translateX(-50%) translateY(4px);
  z-index: 500;
  box-shadow: 0 6px 20px rgba(28,24,20,0.4);
}

/* Flèche vers le bas */
.lw-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--brun-2);
}

.lw-tooltip-titre {
  font-family: var(--font-corps);
  font-style: italic;
  font-size: 0.92rem;
  color: var(--ivoire);
  margin-bottom: 0.35rem;
  line-height: 1.3;
}

.lw-tooltip-extrait {
  font-family: var(--font-corps);
  font-size: 0.75rem;
  color: var(--gris-filet);
  line-height: 1.55;
}

.lw-tooltip-cat {
  font-family: var(--font-mono);
  font-size: 0.42rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rouge-tres-pale);
  margin-bottom: 0.3rem;
}

/* Affichage */
.lien-wiki:hover .lw-tooltip,
.lien-wiki:focus .lw-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Ajuster si le tooltip sort à droite ou à gauche */
.lw-tooltip.gauche {
  left: 0;
  transform: translateX(0) translateY(4px);
}
.lw-tooltip.gauche::after { left: 20px; }
.lien-wiki:hover .lw-tooltip.gauche,
.lien-wiki:focus .lw-tooltip.gauche {
  transform: translateX(0) translateY(0);
}
.lw-tooltip.droite {
  left: auto;
  right: 0;
  transform: translateX(0) translateY(4px);
}
.lw-tooltip.droite::after { left: auto; right: 20px; transform: none; }
.lien-wiki:hover .lw-tooltip.droite,
.lien-wiki:focus .lw-tooltip.droite {
  transform: translateX(0) translateY(0);
}
