
  @font-face {
  font-family: 'police';
  font-style: normal;
  font-weight: 400;
  src: url('/police.woff2') format('woff2');
  font-display: swap;
}

:root {
  --color-ivory: #f5f5dc;
  --color-menu: #7A2E27;
  --color-text:  #f5f5dc;
  --font-primary: 'police', cursive;
  --font-alt: 'Great Vibes', cursive;
  --menu-w: clamp(180px, 28vw, 220px);
  --burger-w: 30px;   /* largeur mini-codex fermé */
  --burger-gap: 4px; /* marge au bord droit */
  --lang-gap: 2px;    /* respiration langue ↔ burger */
  --header-h: clamp(65px, 12vh, 110px); /* hauteur totale du header (visuel, translucide inclus) */
  --headerH:  50px;                     /* hauteur “cadre” : zone exclue du fond (opaque) */
  --headerH-safe: min(var(--headerH), var(--header-h));
  --footerH:  50px;                     /* hauteur “cadre” : zone exclue du fond (opaque) */
  --opaque: 50px;    /* largeur opaque des bandes */
  --fade: 30px;      /* largeur max du fondu */
  --maxBand: calc(var(--opaque) + var(--fade));
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
  font-family: var(--font-primary); 
  color: var(--color-text);
  overflow-x: hidden;
  position: relative;
  background: black;

  /* Sticky footer */
  min-height: 100vh;       
  display: flex;           
  flex-direction: column;  
}

header {
  position: fixed;
  top: 0; width: 100%;
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  background: linear-gradient(to bottom,
  rgba(0,0,0,1) 0px,     /* noir dès le bord haut */
  rgba(0,0,0,1) 50px,       /* noir opaque en haut */
  rgba(0,0,0,0.6) 60px,      /* petit palier noir */
  rgba(0,0,0,0.4) 70px,    /* fondu vers translucide */
  rgba(0,0,0,0.25) 80px,   /* translucide léger */
  rgba(0,0,0,0.25) 100%    /* reste du header translucide */
);
  z-index: 10;
  height: var(--header-h);
}
.logo-container{
  display: grid;
  grid-template-columns: auto 1fr auto; /* logo | texte | actions */
  align-items: center;
  width: 100%;
  position: relative;
}
.logo-container img {
  height: clamp(60px, 12vh, 100px);
  width: auto;
  image-rendering: crisp-edges;
  -webkit-image-rendering: crisp-edges;
  -moz-image-rendering: crisp-edges;
  max-height: 100px;
  object-fit: contain;
}
#animatedText{
  grid-column: 2;       /* colonne centrale */
  position: relative;   /* référentiel des <span> en absolute */
  text-align: center;
  pointer-events: none; /* pas de capture de clics */
  font-size: clamp(20px, 3vw, 42px);  /* adaptatif : mini 20px, max 42px */
  font-weight: 600;                   /* optionnel : un peu plus gras */
  line-height: 1.2;                   /* lisibilité sur 2 lignes */
}
#animatedText > span{
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;                /* pour centrer le texte et limiter à 38ch via la classe */
  text-align: center;
  opacity: 0;
  transition: opacity var(--header-fade, 2s) ease;
  pointer-events: none;        /* ne capte pas les clics */
}
#animatedText > span.active{ opacity:1; }

.header-actions{
  grid-column: 3;                /* colonne droite */
  display: inline-flex;
  align-items: center;
  gap: var(--lang-gap);
  justify-self: end;             /* colle à droite */
}
/* espace “fantôme” = empreinte visuelle du burger fixe à droite */
.header-burger-spacer{
  width: calc(var(--burger-w) + var(--burger-gap));
  height: 1px;                   /* invisible */
}

/* Bouton X : aligné au BAS du header, côté droit */
.close-btn{
  position: fixed;
  top: var(--header-h, 80px);        /* bord bas du header */
  right: 12px;                       /* bord droit */
  transform: translateY(calc(-100% - 2px)); /* ↑ place le X juste DEDANS le header (2 px au-dessus du bord bas) */
  z-index: 4000;
  font-size: 2rem;
  line-height: 1;
  color: var(--color-ivory);
  text-shadow: 0 0 4px rgba(0,0,0,.8), 0 0 8px rgba(0,0,0,.6);
  cursor: pointer;
}

.menu-item img {
  display: block;                   /* ← pas flex sur une image */
  /* borne haute pilotée par JS pour que les 6 pages tiennent sans scroll */
  height: min(max(14vh, 80px), var(--menu-item-maxH, 140px));
  aspect-ratio: 2 / 3;
  object-fit: contain;
  margin-top: -20px;
  margin-bottom: -20px; /* marge négative légère, rapproche le texte */ 
  margin-left: auto;
  margin-right: auto;
}
.menu-item .tooltip {
  margin-top: 0; /* neutralise si défini ailleurs */
  line-height: 1.05;     /* resserre un peu, évite l’effet “flottant” */
}
.menu-item:hover img {
  transform: scale(1.1);
  filter: drop-shadow(0 0 12px var(--color-menu))
          drop-shadow(0 0 24px rgba(139, 26, 26, 0.6));
  transition: transform 0.3s ease, filter 0.3s ease;
}
.tooltip {
  margin-top: 0;
  font-size: 1.52rem;
  color: var(--color-menu);
  text-shadow: none;
  transition: opacity 0.3s, text-shadow 0.3s;
  white-space: normal;
}

.menu-item:hover .tooltip {
  text-shadow: 
    0 0 6px var(--color-menu),
    0 0 12px rgba(139, 26, 26, 0.6);
  transition: text-shadow 0.3s ease;
  color: var(--color-text);
}

main {
  padding-top: 150px;  /* compense le header fixed */
  flex: 1;             /* pousse le footer en bas si contenu court */
}

.background-overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  pointer-events: none;
 /* Taille unique, continue (pas de “saut” de breakpoint) */
 width: clamp(350px, 70vmin, 900px);
 /* Empêche qu'il dépasse la fenêtre utile (sans rogner header/footer) */
 max-width: min(92vw, calc(100dvh - var(--headerH-safe) - var(--footerH) - 16px));
}

.background-logo {
  width: 100%;
  height: auto;
  opacity: 0;
  transition: opacity 2s ease, transform 2s ease;
}
#background-logo {
  opacity: 1;
  transform: scale(1);
  z-index : 5;
}
#background-logo.hidden {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 2s ease, transform 2s ease;
}
@keyframes fadeZoomIn {
  0% { opacity: 0; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1); }
}
.fade-in-logo {
  animation: fadeZoomIn 3s ease-out forwards;
}
@keyframes disappearLogo {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.8); }
}
.fade-out-logo {
  animation: disappearLogo 3s ease forwards;
  transition: opacity 1.5s ease, transform 1.5s ease;
  opacity: 0;
  transform: scale(0.8);
}

#footer a#legalBtn {
  color: var(--color-ivory);
  cursor: pointer;
  text-decoration: underline;
  margin-left: 0.3rem;
  font-size: 0.9rem;
  transition: color 0.2s, filter 0.2s;
}

#footer a#legalBtn:hover,
#footer a#legalBtn:focus {
  color: #fff;
  filter: drop-shadow(0 0 6px var(--color-ivory));
}

#footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.6rem; /* espace entre les éléments */
}

#footer .footer-link {
  font-weight: bold;
  text-decoration: underline;
}

#legalFormWrapper strong {
  color: #7A2E27;
}

.side-menu a {
  text-decoration: none;
  color: inherit;
}
.side-menu a:visited {
  color: inherit;
}
.side-menu a:hover,
.side-menu a:focus {
  text-decoration: none;
  outline: none;
}
/* Liens inactifs quand le menu n’est pas ouvert */
.side-menu:not(.active) a,
.side-menu.opening a,
.side-menu.priming a,
.side-menu:not(.active) a * {
  pointer-events: none;  /* empêche les clics souris/tactile */
}
/* Lien de la page active dans le menu (sous-pages) */
.side-menu a.active-page{
  pointer-events: none;
  cursor: default;
  opacity: .6;
  font-style: italic;
}

:focus-visible {
  outline: 2px solid var(--color-ivory, #f5f5dc);
  outline-offset: 2px;
}
.close-btn:focus-visible, .side-menu a:focus-visible, #muteBtn:focus-visible {
  outline: 2px solid var(--color-ivory, #f5f5dc);
  outline-offset: 3px;
}

.side-menu{
  --spine-gap: 3px;
  --spine-line: 1px;
  --spine-color: var(--color-ivory, #eee);
  --spine-h: 0px;

  position: fixed;
  top: var(--header-h, 80px);
  right: 0;
  transform: translateX(100%);
  transition: transform .3s ease;
  z-index: 3700;

  /* largeur + hauteur + scroll (reprend ton second bloc) */
  width: var(--menu-w);
  height: calc(100dvh - var(--header-h, 80px) - env(safe-area-inset-bottom, 0px) - 6px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: max(env(safe-area-inset-bottom, 0px) - 4px, 0px);
  background: transparent !important;
  box-shadow: none !important;
}

.side-menu.active { padding-top: 0 !important; }
.side-menu .accordion-page:first-child { margin-top: 0 !important; }
/* Fermé (après oracle-ready) : #sideMenu = mini-codex sous le header, cliquable */
body.oracle-ready .side-menu:not(.active):not(.priming):not(.opening){
  position: fixed;
  top: 0;                          /* commence en haut de la page */
  height: var(--header-h, 80px);   /* exactement la hauteur du header */
  right: 12px;
  width: 30px;

  display: flex;
  flex-direction: column;
  justify-content: center;         /* centre verticalement dans le header */
  gap: var(--spine-gap);

  transform: translateX(0);
  pointer-events: auto;
  opacity: 1;
}

/* lames fermées, même rendu que le codex gauche */
body.oracle-ready .side-menu:not(.active):not(.priming):not(.opening) .accordion-page{
  max-height: 0;
  margin: 0;
  overflow: hidden;
  transition-delay: 0s !important;          /* pas de cascade en "bouton" */
}
body.oracle-ready .side-menu:not(.active):not(.priming):not(.opening) .accordion-page::after{
  content:"";
  display:block;
  height: var(--spine-line);
  background: var(--spine-color);
}
/* Phase 1 : descendre visuellement sous le header, lames fermées (look “gauche”) */
.side-menu.opening{
  gap: var(--spine-gap);
  transform: translateX(0) translateY(0);
  right: 12px;
  width: 30px;                 
  display: flex; 
  flex-direction: column; 
}
.side-menu.opening .accordion-page{
  max-height: 0 !important;
  margin: 0;   
  overflow: hidden;
  transition-delay: 0s !important;
  display: flex;
  flex-direction: column;
}


/* Phase 2 : élargir depuis le bouton (toujours lames fermées) */
.side-menu.priming{
  transform: translateX(0);
  right: 12px;
  width: 30px;
  overflow: hidden;
  animation: side-grow 280ms ease-out forwards;
  gap: var(--spine-gap);
  display: flex;
  flex-direction: column;
}
/* La pile (menu plié / en descente / en élargissement) est cliquable => curseur main */
.side-menu:not(.active):not(.opening):not(.priming),
.side-menu.opening,
.side-menu.priming {
  cursor: pointer;
}

.side-menu.priming .accordion-page{
  max-height: 0 !important;
  margin: 0;                  /* ← pas de marge ici non plus */
  transition-delay: 0s !important;
}
/* Traits des lames pendant .opening/.priming → border-bottom, pas ::after */
.side-menu.opening .accordion-page,
.side-menu.priming .accordion-page{
  border-bottom: var(--spine-line) solid var(--spine-color);
}
@keyframes side-grow{
  from{ width: 30px; right: 12px; }
  to  { width: var(--menu-w); right: 0; }
}
/* Phase 3 : .active — tes règles actuelles gèrent déjà la cascade */
.side-menu.active {
  transform: none;              /* ← plus de référentiel local pour le fixed */
  right: 0;                     /* bord droit, inchangé visuellement */
  cursor: auto; /* ou 'default' si tu préfères */
}
.side-menu.active .accordion-page {
  max-height: var(--panel-max, 420px);
  transition-delay: 0s; /* valeur par défaut, remplacée plus bas */
}
.side-menu.active .accordion-page:nth-of-type(1) { transition-delay: .10s; }
.side-menu.active .accordion-page:nth-of-type(2) { transition-delay: .50s; }
.side-menu.active .accordion-page:nth-of-type(3) { transition-delay: .90s; }
.side-menu.active .accordion-page:nth-of-type(4) { transition-delay: 1.30s; }
.side-menu.active .accordion-page:nth-of-type(5) { transition-delay: 1.70s; }
.side-menu.active .accordion-page:nth-of-type(6) { transition-delay: 2.10s; }

.barre-verticale {
  width: 1px;
  height: 24px;
  background-color: #f1e9d2;
  margin: 0 0.01rem;
}

html, body {
  height: 100%;
}

footer {
  position: relative;
  z-index: 100;
  background-color: rgba(0, 0, 0, 0.95);
  color: var(--color-ivory);
  text-align: center;
  height: 50px;          /* hauteur fixe */
  line-height: 50px;     /* centre verticalement le texte */
  padding: 0;
  box-sizing: border-box;
}
  
#muteBtn {
  padding: 0;
  background: transparent;
  border: none;
  outline: 1.6px solid #f1e9d2;
  outline-offset: 1.8px;
  border-radius: 3px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-sizing: border-box;
  transition: transform 0.15s, filter 0.15s;
}

#muteBtn:hover,
#muteBtn:focus-visible {
  filter: drop-shadow(0 0 10px #f1e9d2);
  transform: scale(1.05);
  outline-color: #fff;
}

/* Au clavier : focus visible */
#muteBtn:focus-visible {
  outline: 2px solid var(--color-ivory);
  outline-offset: 3px;
}

.page-transition {
  pointer-events: none;
  position: fixed;
  z-index: 3000;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: black;
  opacity: 0;
  transition: opacity 0.8s cubic-bezier(0.6,0.3,0.2,1);
}
.page-transition.active {
  opacity: 1;
  pointer-events: auto;
}
.reseaux-sociaux-bar {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-left: 2.3vw;
  margin-bottom: 0.5rem;
  margin-top: 2.2rem;
  position: relative;   /* nécessaire pour que z-index s’applique */
  z-index: 500;         /* plus que header (10) et background (20) */
}

.reseaux-sociaux-bar img {
  width: 28px;
  height: 28px;
  opacity: 1;
  filter: none;
  outline: 1.6px solid #f1e9d2;
  outline-offset: 1.8px;
  background: transparent;
  border-radius: 3px;
  padding: 2px;
  transition: opacity 0.15s, transform 0.15s;
  cursor: pointer;
}

.reseaux-sociaux-bar img:hover,
.reseaux-sociaux-bar a:focus img {
  opacity: 1;
  filter: drop-shadow(0 0 10px #f1e9d2);
  transform: scale(1.12) rotate(-1.7deg);
  outline-color: #fff;
}

.lang-select ul li a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.84rem;
}

/* Base (desktop et par défaut) */
.logo-text {
  font-size: clamp(1rem, 4vw, 1.7rem);
  padding-left: 1rem;
  padding-right: 1rem;
  white-space: normal;
  word-break: break-word;
  text-align: center;
  pointer-events: none;
}

@media screen and (max-width: 600px) {
  .lang-select button img {
    width: 18px;
  }
}
/* Uniformise largeur + centrage pour toutes les phrases multilignes */
/* Base: pas de limite stricte */
#animatedText span.multiline-centered{
  display: inline-block;
  max-width: 38ch;
  margin: 0 auto;          /* centre le bloc, pas juste la 1re ligne */
  line-height: 1.05;
  text-align: center;
  white-space: normal;
  word-break: normal;
}

/* === Déplacé depuis le header === */
/* Langue à droite du header, juste à gauche du burger */
.lang-select{
  position: static;  /* plus d’absolu */
  transform: none;
  top: auto; right: auto;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin: 0;
  z-index: 11;
}
.lang-select button { background: transparent; border: none; cursor: pointer; padding: 0; }
.lang-select ul {
  list-style: none; margin: 0; padding: 0.5rem;
  background: rgba(0,0,0,0.7); border-radius: 4px; display: none;
  position: absolute; top: 75%; right:0; left: auto; z-index: 3500;
}
.lang-select.open ul { display: block; }
.lang-select li { margin: 0.25rem 0; }
.lang-select img { vertical-align: middle; width: 24px; height: auto; }
.lang-select span { color: var(--color-ivory); margin-left: 0.5rem; font-family: var(--font-primary); }
.icon-langue {
  width: 28px; height: 28px; outline: 1.6px solid #f1e9d2; outline-offset: 1.8px;
  background: transparent; border-radius: 3px; padding: 2px;
  transition: opacity 0.15s, transform 0.15s; cursor: pointer; box-sizing: border-box;
}
.icon-langue:hover { opacity: 1; filter: drop-shadow(0 0 10px #f1e9d2); transform: scale(1.12) rotate(-1.7deg); outline-color: #fff; }
.lang-select li.disabled a { pointer-events: none; opacity: 0.45; filter: grayscale(100%); cursor: not-allowed; }
.lang-select li.disabled a:hover { transform: none; text-decoration: none; }

/* Mobile : overrides complémentaires */
@media (max-width: 600px) {
   #animatedText span.multiline-centered{
    max-width: 100%;
    width: 100%;
  }
  
  .logo-text {
  padding-left: 0.4rem;
  padding-right: 0.4rem;
  }
}

/* Délais inversés pendant la fermeture (3 -> 2 -> 1) */
.side-menu.menu-closing .accordion-page:nth-of-type(1){ transition-delay: 2.0s; }
.side-menu.menu-closing .accordion-page:nth-of-type(2){ transition-delay: 1.6s; }
.side-menu.menu-closing .accordion-page:nth-of-type(3){ transition-delay: 1.20s; }
.side-menu.menu-closing .accordion-page:nth-of-type(4){ transition-delay: .80s; }
.side-menu.menu-closing .accordion-page:nth-of-type(5){ transition-delay: .40s; }
.side-menu.menu-closing .accordion-page:nth-of-type(6){ transition-delay: .00s; }
.side-menu.menu-closing .accordion-page{
  max-height: var(--spine-h);     /* referme vers la tranche */
}

/* Ombre douce sous le bas */
.accordion-page::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 4px;
  background: linear-gradient(180deg, rgba(0,0,0,.18), rgba(0,0,0,0));
  opacity: .5;
  pointer-events: none;
}
/* Plis : ombre haute sur chaque panneau sauf le premier */
.accordion-page:not(:first-of-type)::before{
  content:"";
  position:absolute;
  left: 10px; right: 10px;  /* léger retrait pour ne pas toucher les bords arrondis */
  top: -6px;                /* chevauchement pour créer le creux du pli */
  height: 14px;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(0,0,0,.5),
    rgba(0,0,0,0)
  );
  opacity: .9;
  filter: blur(.2px);
  border-radius: 10px;
}
/* ====== MENU: responsive & accessibilité ====== */

/* 0) Largeur + hauteur calculée = zone visible sous le header */
.side-menu {
  width: var(--menu-w);
  height: calc(100dvh - var(--header-h, 80px) - env(safe-area-inset-bottom, 0px) - 6px); /* viewport - hauteur du header */
  overflow-y: auto;           /* ascenseur vertical dans le menu */
  overflow-x: hidden;         /* pas d’horizontal */
  -webkit-overflow-scrolling: touch; /* inertie iOS */
  overscroll-behavior: contain;
  padding-bottom: max(env(safe-area-inset-bottom, 0px) - 4px, 0px);
}

/* 1) On fige le fond quand le menu est ouvert (évite le scroll de fond) */
body.menu-open {
  overflow: hidden;
}

/* 2) Harmonisation des breakpoints : on retient 600px comme pivot mobile */
@media (max-width: 600px) {
   #backgroundLayer,
  .background-wrapper { 
    top: 50px; 
    bottom: 50px; 
    position: fixed;
    inset: 0;

  /* 1) Hauteur utile = écran - header - footer */
  --H: calc(100dvh - var(--headerH-safe) - var(--footerH));

  /* 2) Calcul des bandes (inchangé) */
  --sideRaw: calc((100vw - (var(--H) * 1.5)) / 2);
  --side: clamp(0px, var(--sideRaw), var(--maxBand));

  /* 3) NE PEINDRE L’IMAGE QUE DANS LE CADRE UTILE */
  /* Le padding crée le “cadre” (haut/bas/latéraux) */
  padding: var(--headerH-safe) var(--side) var(--footerH);

  /* L’image de fond est peinte dans la zone de contenu uniquement */
  background-origin: content-box;
  background-clip: content-box;

  /* Choisis UNE des deux lignes suivantes selon le rendu désiré : */
  background-size: cover;   /* remplit le cadre, peut rogner (recommandé) */
  /* background-size: contain; */  /* 100% visible, peut letterbox */

  background-position: center center;
  background-repeat: no-repeat;
  }

  .background { 
    height: calc(100vh - 100px);      /* fallback */
    height: calc(100dvh - 100px);     /* valeur moderne */
    width: auto; 
    aspect-ratio: 3/2; 
    object-fit: cover; 
  }
  
  .side-menu.opening,
  .side-menu.priming,
  .side-menu.active{
    top: var(--header-h, 80px) !important; /* bord bas du header */
    padding-top: 0 !important;             /* neutralise le padding mobile */
  }
  .menu-item img {
    display: block;
    margin: -6px auto -10px auto;   /* auto = centrage horizontal sûr */
    max-width: 56px;
    height: auto;
  }
  .tooltip {
    font-size: 1.05rem;
    white-space: normal;            /* retour à la ligne autorisé */
    text-align: center;
  }
  .side-menu {
    /* pousse le contenu sous la zone sûre + un coussin visuel */
    padding-top: calc( env(safe-area-inset-top, 0px) + 72px );
  }
    #animatedText {
    font-size: clamp(20px, 8vw, 50px);
  }
  /* Burger fermé (menu replié) : place-le DANS le header et supprime le padding parasite */
  body.oracle-ready .side-menu:not(.active):not(.priming):not(.opening){
    top: 0;
    height: var(--header-h, 80px);  /* occupe tout le header */
    display: flex;
    flex-direction: column;
    justify-content: center;       /* centre vertical */
    right: 12px;
    width: 30px;
    transform: translateX(0);
    padding-top: 0 !important;
  }
}

/* 5) Accessibilité : effets au focus, et "pas de hover" en pointeur grossier */
.menu-item:focus-within img,
.menu-item a:focus-visible img {
  transform: scale(1.1);
  filter:
    drop-shadow(0 0 12px var(--color-menu))
    drop-shadow(0 0 24px rgba(139, 26, 26, 0.6));
}
.menu-item:focus-within .tooltip,
.menu-item a:focus-visible .tooltip {
  text-shadow:
    0 0 6px var(--color-menu),
    0 0 12px rgba(139, 26, 26, 0.6);
  color: var(--color-text);
}

/* 6) Désactiver les animations de survol si pas de hover (mobile/tactile) */
@media (hover: none) and (pointer: coarse) {
  .menu-item:hover img,
  .menu-item:hover .tooltip {
    /* pas d’effet forcé sur tactile ; garder l’état "repos" */
    transform: none;
    filter: none;
    text-shadow: 0 0 1px #000;
  }
}

/* 7) Respecte les préférences utilisateur (réduit les animations) */
@media (prefers-reduced-motion: reduce) {
  .side-menu,
  .accordion-page,
  .menu-item img,
  .tooltip {
    transition: none !important;
    animation: none !important;
  }
}
.side-menu .accordion-page,
#accordion-intro-left .accordion-page {
  position: relative;
  overflow: hidden;
  margin-bottom: var(--spine-gap);
  padding: 1px;
  text-align: center;
  display: block;
  will-change: max-height;
  max-height: var(--spine-h, 0px);
  transition: max-height .35s ease;

  background: url("/Icones/amatl.webp") repeat;
  background-size: cover;
  border: 2px solid rgba(60, 47, 34, 0.25);
  color: #6E6E6E;
  border-radius: 12px;
  box-shadow:
    0 2px 6px rgba(0,0,0,0.25),
    inset 0 0 40px rgba(0,0,0,0.15);
}
#accordion-intro-left{
  z-index: 3600 !important;
}


.side-menu .accordion-page:last-child {
  margin-bottom: 0 !important; /* colle le dernier item au bord bas */
}

.side-menu .accordion-page a { 
  display: block; 
}

.side-menu .menu-item {
  display: inline-flex;            
  flex-direction: column;
  align-items: center;             
  justify-content: center;
  width: fit-content;
  margin: 0.25rem auto;            
  text-align: center;
  position: relative;
}

.side-menu .accordion-page .menu-item { 
  position: relative; 
}

/* N’affiche l’effet que sur vrais pointeurs (souris/stylet), pas sur tactile */
@media (hover: hover) and (pointer: fine) {
  .side-menu .menu-item::after {
    content: "";
    position: absolute;
    right: 104px;
    bottom: 12px;
    width: 40px; height: 40px;
    background: url("/Icones/sello_rojo.webp") center/contain no-repeat;
    opacity: 0;                                /* caché par défaut */
    transform: rotate(-8deg) scale(0.95);
    transition: opacity .2s ease, transform .2s ease;
    pointer-events: none;                       /* ne bloque aucun clic */
  }
  .side-menu .menu-item:is(:hover, :focus-visible)::after {
    opacity: .85;                               /* visible sur l’item ciblé */
    transform: rotate(-8deg) scale(1);
  }
}
/* X caché tant que le menu n'est pas prêt ; visible seulement quand .ready est posée */
.side-menu:not(.active) .close-btn,
.side-menu.opening .close-btn,
.side-menu.priming .close-btn,
.side-menu.active:not(.ready) .close-btn {display: none !important;}
.side-menu.active.ready .close-btn {display: block !important;}
/* Quand le menu langue est ouvert, on hisse le header au-dessus du volet */
header:has(.lang-select.open) {
  z-index: 3002; /* > 2000 du side-menu */
}
/* Accueil : cacher le menu langue tant que l'utilisateur n'a pas cliqué */
body[data-logo-state="never"] .lang-select {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Quand l'expérience démarre, on l’affiche (en même temps que le burger) */
body.oracle-ready .lang-select {
  opacity: 1;
  visibility: visible;
  transition: opacity .2s ease;
}
body:not(.oracle-ready) #accordion-intro-left { display: none !important; }

@keyframes glowPage {
  0%, 100% {
    box-shadow: 0 0 0 rgba(255, 255, 180, 0);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 12px 4px rgba(255, 255, 180, 0.7);
    transform: scale(1.07);
  }
}

.accordion-page.attention {
  animation: glowPage 2.2s ease-in-out infinite;
  border-radius: 6px;
}

.visually-hidden {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

/* Fenêtre utile : entre bas du header opaque et haut du footer */
#backgroundLayer,
.background-wrapper{
  position: fixed;
  bottom: var(--footerH, 50px);
  left: 0; 
  right: 0;
  overflow: hidden;
  z-index: -1;
  top: var(--headerH-safe);
  --H: calc(100dvh - var(--headerH-safe) - var(--footerH, 50px));
}

/* L’image (ou <picture>) remplit la fenêtre utile, pincée par les bandes */
#backgroundLayer > picture,
#backgroundLayer > img {
  position: absolute;
  top: 0;
  bottom: 0;

  /* On commence à l'extérieur de la bande opaque uniquement */
  left: 0;
  right: 0;
}

/* Respecte le ratio sans déformation ; remplit la zone (peut rogner) */
#backgroundLayer img.background{
  width: 100%; 
  height: 100%;
  object-fit: cover;     /* Mets 'contain' si tu veux tout voir sans rognage */
  object-position: center;
}


/* === Bandes latérales dynamiques (overlay par-dessus l’image) === */
.background-wrapper::before,
.background-wrapper::after {
  --sideRaw: calc((100vw - (var(--H) * 1.5)) / 2);
  --side: clamp(0px, var(--sideRaw), var(--maxBand));
  --fadePart: min(var(--side), var(--fade));
  --opaquePart: clamp(0px, calc(var(--side) - var(--fade)), var(--opaque));

  content: "";
  position: fixed;
  top: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 2;
}

/* Bande gauche : noir plein puis fondu vers l’image */
/* Bande gauche : miroir de la droite, version explicite/robuste */
.background-wrapper::before{
  left: 0;
  width: calc(var(--opaquePart) + var(--fadePart));
  background:
    /* aplat noir collé au bord gauche */
    linear-gradient(to right, black 0, black 100%)
      left 0 top 0 / var(--opaquePart) 100% no-repeat,
    /* fondu noir→transparent juste après l’aplat (depuis la gauche) */
    linear-gradient(to right, black, transparent)
      left var(--opaquePart) top 0 / var(--fadePart) 100% no-repeat;
}

/* Bande droite : miroir parfait de la gauche */
.background-wrapper::after{
  right: 0;
  width: calc(var(--opaquePart) + var(--fadePart));
  background:
    /* aplat noir collé au bord droit */
    linear-gradient(to left, black 0, black 100%)
      right 0 top 0 / var(--opaquePart) 100% no-repeat,
    /* fondu noir→transparent juste après l’aplat (depuis la droite) */
    linear-gradient(to left, black, transparent)
      right var(--opaquePart) top 0 / var(--fadePart) 100% no-repeat;
}

/* Sécurité : le <picture> passe bien sous les overlays */
.background-wrapper picture{ position: relative; z-index: 0; }

.footer-icons,
#contactFormWrapper {
  max-width: clamp(220px, 45vw, 320px);
  margin: 0;
}

.contact-form-wrapper {
  position: fixed;
  bottom: -2px;
  left: 0;
  right: 0;
  transform: translateY(100%);
  transition: transform 0.4s ease-in-out;
  z-index: 3602;
  display: flex;
  justify-content: flex-start;
  pointer-events: none;
}

.contact-form-wrapper.visible {
  transform: translateY(0%);
  pointer-events: auto;
}

.contact-form {
  background: #FAF8F3;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  padding: 1.2rem;
  width: clamp(260px, 45vw, 360px);
  position: relative;
}

.contact-form-title {
  color: #7A2E27;
  font-weight: bold;
  font-size: clamp(1rem, 1.6vw, 1.5rem); 
  font-family: var(--font-primary);
  margin-bottom: 0.6rem;
}

.contact-form input,
.contact-form textarea {
  display: block;
  width: 100%;
  margin-bottom: 0.8rem;
  padding: 0.6rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #F0ECE3;
  font-size: clamp(1rem, 1.6vw, 1.5rem); 
  font-family: inherit;
  color: #333;
}

.contact-form-submit {
  background-color: #7A2E27;
  color: #FAF8F3;
  border: none;
  border-radius: 6px;
  padding: 0.8rem 1.2rem;
  font-weight: bold;
  font-size: clamp(1rem, 1.6vw, 1.5rem); 
  font-family: var(--font-primary);
  cursor: pointer;
  transition: background-color 0.2s;
  display: block; 
  margin: 0 auto;
  font-family: var(--font-primary);
}

.contact-form-submit:hover {
  background-color: #7A2E27;
}

.close-contact-btn {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #7A2E27;
  cursor: pointer;
}

/* Cadre parchemin visible autour du formulaire */
.form-codex-wrapper {
  background-image:
    linear-gradient(rgba(255,255,255,0.42), rgba(255,255,255,0.42)),
    url("/Icones/amatl.webp"),
    repeating-linear-gradient(90deg, rgba(60,47,34,0.06) 0 1px, rgba(255,255,255,0) 1px 3px),
    radial-gradient(120% 100% at 50% 0%,  rgba(255,255,255,0.25), rgba(255,255,255,0) 60%),
    radial-gradient(120% 120% at 50% 100%, rgba(0,0,0,0.10),  rgba(0,0,0,0) 60%);
  background-size:
    auto,
    512px 512px,
    auto,
    auto,
    auto;
  background-repeat:
    no-repeat,
    repeat,
    repeat,
    no-repeat,
    no-repeat;
  background-color: #EFE2C6;
  border-radius: 12px;
  box-shadow:
    inset 0 0 0 2px rgba(60,47,34,0.18),
    inset 0 0 28px rgba(0,0,0,0.12);
  padding: 10px;
  position: relative;
  z-index: 0;
}

/* === Panneau NL (slide-in) : calqué sur le contact === */
.nl-form-wrapper {
  position: fixed;
  bottom: -2px;                  /* anti-liseré noir */
  left: 0;
  right: 0;
  transform: translateY(100%);   /* caché par défaut */
  transition: transform 0.4s ease-in-out;
  z-index: 3603;
  display: flex;
  justify-content: flex-start;   /* comme le contact à gauche */
  pointer-events: none;
}
.nl-form-wrapper.visible {
  transform: translateY(0%);
  pointer-events: auto;
}

/* Harmonisation des contenus du panneau NL (hors iframe) */
#nlFormWrapper .contact-form-title {
  color: #7A2E27;
  font-weight: bold;
  font-size: clamp(1rem, 1.6vw, 1.5rem);
  font-family: var(--font-primary);
  margin-bottom: 0.6rem;
}

/* L’iframe est contenue dans le bloc “contact-form” : on ne peut pas styler son intérieur */
#nlFormWrapper .beehiiv-embed {
  width: 100% !important;
  max-width: 100% !important;
  border-radius: 6px !important;
  background: transparent !important;
}
.contact-form-rgpd {
  margin: 0.2rem 0 0.8rem;
  font-family: var(--font-primary);
  font-size: clamp(0.8rem, 1.4vw, 0.95rem);
  line-height: 1.25;
  color: #6E6E6E; /* gris clair */
}

/* GOOG Texte de présentation pour référencement */
#main .intro {
  margin-top: 0;
  text-align: center;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* ================= Tonalpedia layout ================= */

/* Le panel = la plaque obsidienne */
.tonalpedia-panel{
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: min(980px, 92vw);
  box-sizing: border-box;
  top: var(--tp-top, calc(var(--header-h) + 45px));
  bottom: calc(var(--footerH) + 45px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 3601;
  /* Plaque obsidienne */
  background: rgba(8, 10, 12, 0.78);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  box-shadow: 0 16px 60px rgba(0,0,0,0.55);
  padding: 18px 18px 22px;
}

/* L’article ne pousse plus la mise en page (le panel gère tout) */
.tonalpedia-article{
  margin: 0;
  padding: 0;
  color: var(--color-ivory);
}

/* Grille */
.tonalpedia-grid{
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 22px;
  align-items: start; /* image alignée en haut */
}

/* Image */
.tonalpedia-figure{
  margin: 0;
}
.tonalpedia-figure img{
  width: 100%;
  max-width: 300px;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
}

/* Titres / texte (harmonisés) */
.tonalpedia-title{
  margin: 0 0 8px 0;
  font-size: clamp(2.1rem, 3vw, 3rem);
  line-height: 1.05;
  font-weight: 600;
}
.tonalpedia-subtitle{
  margin: 0 0 14px 0;
  opacity: 0.88;
  font-size: 1.05rem;
  line-height: 1.35;
}

.tonalpedia-body h2{
  margin: 18px 0 8px;
  font-size: clamp(1.25rem, 1.6vw, 1.6rem);
  line-height: 1.15;
  font-weight: 600;
  opacity: 0.95;
}

.tonalpedia-body p,
.tonalpedia-body li,
.tonalpedia-body a{
  font-size: clamp(1.15rem, 1.4vw, 1.25rem);
  line-height: 1.6;
}

/* Mobile */
@media (max-width: 900px){
  .tonalpedia-grid{
    grid-template-columns: 1fr;
  }
  .tonalpedia-figure img{
    max-width: 240px;
  }
}

/* Tonalpedia - liste discrète des autres signes */
.tonalpedia-sep{
  border: 0;
  height: 1px;
  background: rgba(255,255,255,0.10);
  margin: 18px 0 14px;
}

.tonalpedia-all-title{
  font-size: clamp(1.25rem, 1.6vw, 1.6rem);
  margin: 0 0 12px 0;
  opacity: 0.95;
  font-weight: 600;
}

.tonalpedia-all-list{
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px 12px;
  /* responsive auto : plus l’écran est large, plus il y a de “colonnes” */
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.tonalpedia-all-list a{
  display: inline-block;
  font-size: 0.92rem;
  text-decoration: none;
  color: rgba(255, 244, 220, 0.85); /* ivoire doux */
  transition: opacity 0.2s ease, color 0.2s ease;
}

.tonalpedia-all-list a:hover{
  color: var(--color-menu); /* cuivre du menu */
  opacity: 1;
}
/* Liens dans le corps de l'article (affinités, etc.) */
.tonalpedia-body a{
  color: rgba(255, 244, 220, 0.85); /* ivoire doux */
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.tonalpedia-body a:hover{
  color: var(--color-menu); /* cuivre */
}
