/* ======================= GLOBAL STYLES ======================= */
:root {
  /* Valeur de secours ; mise à jour automatiquement par le script ci-dessous. */
  --sticky-height: 170px;
  --anchor-gap: 12px;
}

html {
  scroll-behavior: auto;
  scroll-padding-top: calc(var(--sticky-height) + var(--anchor-gap));
}

/* Le scroll-padding s'applique aux navigations par fragment, y compris au chargement. */
[id] { scroll-margin-top: calc(var(--sticky-height) + var(--anchor-gap)); }

body {
  padding: 0;
  box-sizing: border-box;
  margin: auto;
  width: 100%;
  max-width: 800px;
  background-color: #ffffee;
  font-family: "Helvetica", "Comic Sans MS", 'Lato', sans-serif;
  text-align: center;
}

p.a { font-family: "Helvetica", "Comic Sans MS", "Times New Roman", Times, serif; font-size: 20px; }
pre { font-family: "Helvetica", "Times New Roman", "Comic Sans MS"; font-size: 1em; }
#conteneur { margin: auto; }

/* ======================= STICKY ELEMENTS ======================= */
div.sticky {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  background-color: yellow;
  padding: 50px;
  font-size: 20px;
}
#stickyPart {
  background-color: #ffffee;
  width: 95%;
  top: 0;
  position: -webkit-sticky;
  position: sticky;
  z-index: 1000;
  text-align: center;
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#Part2 { width: 85%; margin: auto; text-align: center; }

/* ======================= HEADER LINE 0 ======================= */
#ligne0 {
  font-family: "Helvetica";
  color: #000;
  text-align: center;
  padding: 12px 16px 8px;
  margin-top: 0;
  font-weight: bold;
  font-size: 1em;
}
#ligne0 a:link { color: #288; }
#ligne0 a:visited { color: #ff5555; }
#ligne0 a:hover { color: hotpink; }
#ligne0 a:active { color: blue; }
img.c { vertical-align: sub; color: #900; }

/* ======================= NAVIGATION BUTTONS ======================= */
.button, .abutton, .buttonbig {
  font-family: "Helvetica";
  border-radius: 7px;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}
.butmenu {
  background: #288;
  font-family: "Helvetica";
  color: #fff;
  font-size: 15px;
  padding: 5px 13px;
  text-decoration: none;
}
.button { background: #288; font-size: 17px; padding: 7px 15px; vertical-align: sup; }
.jules-scene { background: #288; font-family: "Helvetica"; color: #fff; font-size: 15px; padding: 5px 13px; text-decoration: none; }
.jules-scene-image { display: inline-block; background: none; padding: 0; margin-right: 10px; text-decoration: none; vertical-align: top; }
.jules-scene-image img { display: block; width: 300px; }

/* ======================= LIENS / BOUTONS INTERACTIFS ======================= */
[data-action], .js-nav {
  background: #288;
  color: #fff;
  font-size: 17px;
  display: inline-block;
  cursor: pointer;
  text-decoration: none;
  width: 30%;
}
[data-action] img { display: block; width: 100%; }
#gauche img { width: 100%; height: auto; }
#navScenes { margin-top: 10px; text-align: center; }
#navScenes button { margin: 0 5px; }
.abutton { font-size: 17px; padding: 7px 15px; text-decoration: underline; }
.buttonbig { background: #288; border-radius: 14px; font-size: 25px; padding: 14px 20px; }

/* ======================= ICON BUTTONS ======================= */
.format { width: 50px; margin: 0; border-radius: 0; display: inline-block; }
.suiv, .prec, .root, .jc, .pays, .trav, .pers, .haut, .bas, .grind {
  border: none;
  font-size: 18px;
  width: 50px;
  height: 50px;
  display: inline-block;
}
#home { background-image: url(../img/home.jpg); }
#suiv, .suiv { background-image: url(../img/suiv.jpg); }
#prec, .prec { background-image: url(../img/prec.jpg); }
.root { background-image: url(../img/root2.png); }
#jc, .jc { background-image: url(../img/jc.jpg); }
#pays, .pays { background-image: url(../img/pays.jpg); }
#trav, .trav { background-image: url(../img/trav.jpg); }
#pers, .pers { background-image: url(../img/perso.jpg); }
.haut, .bas, .grind { background-image: url(../img/bas.jpg); }

/* ======================= HEADER LINES ======================= */
#ligne1 {
  background-color: #288;
  float: left;
  width: 100%;
  line-height: 48px;
  font-weight: normal;
  font-size: 1em;
  text-align: center;
}
#ligne1 a:link, #ligne1 a:visited { color: white; }
#ligne1 a:hover { color: hotpink; }
#ligne1 a:active { color: blue; }
img.a { vertical-align: text-top; }

/* ======================= LIGNEBUTS / SECONDARY CONTENT ======================= */
#lignebuts { background-color: #ffffee; padding: 20px 1px; vertical-align: text-top; text-align: center; font-size: 1.2em; }
#lignemonde { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background-color: #ffffee; padding: 10px 7px; }
#lignemonde a, #lignemonde .nonclic { display: block; width: 100%; box-sizing: border-box; text-decoration: none; line-height: 0; }
#lignemonde .tile { display: block; width: 100%; box-sizing: border-box; border: 5px solid transparent; }
#lignemonde .tile img { display: block; width: 100%; height: auto; }
#lignemonde .tile.nonclic { border-color: red; }
#lignemonde .tile.cliquable { border-color: green; }
.image-pleine-largeur { display: block; width: 100%; }
.image-pleine-largeur img { display: block; width: 100%; max-width: none; height: auto; }
#secondary {
  background-color: #ffffee;
  color: #666;
  text-align: justify;
  vertical-align: text-top;
  padding: 10px 7px;
  line-height: 1.6;
  font-size: 1.2em;
}
#secondary img { max-width: 100%; height: auto; display: block; }
div#secondary table { table-layout: fixed; border-collapse: collapse; width: 100%; }
div#secondary th, div#secondary td { padding: 8px; border-bottom: 1px solid #ddd; }
#secondary .visages { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
#secondary .visages img { width: 28%; }

/* ======================= GUTTER COLUMNS ======================= */
#gauche, #droite, #image { background-color: #ffffee; vertical-align: text-top; margin: auto; font-size: 1.2em; }
#gauche { float: left; width: 30%; text-align: left; }
#droite { float: right; width: 70%; text-align: justify; }
#image { float: right; width: 60%; text-align: right; }

/* ======================= LIGNE PROTAS ======================= */
#ligneprotas { width: 100%; margin: auto; text-align: center; margin-top: 0; background-color: #ffffee; font-size: 1em; }
#ligneprotas h1, #ligneprotas h2, #ligneprotas h3 { text-align: center; }

/* ======================= MISC ======================= */
.center { display: block; margin-left: auto; margin-right: auto; width: 95%; }
.lire { font-family: "Helvetica"; font-size: 20px; text-align: center; }

/* ======================= CARROUSEL ======================= */
.carrousel-voyage { display: flex; align-items: flex-start; gap: 20px; width: 100%; box-sizing: border-box; }
#primary { background-color: #ffffee; text-align: center; }
#primary img { max-width: 100%; height: auto; }
#primaryB { flex: 1; max-width: 100%; overflow: hidden; }

/* ======================= CIMETIÈRE ======================= */
.prota-mort img, img.prota-mort { filter: grayscale(100%) brightness(0.8); opacity: 0.6; }
.prota-vivant img, img.prota-vivant { filter: none; opacity: 1; }
.disabled-link { pointer-events: none; cursor: default; }
.prota-case { display: block; width: 100%; box-sizing: border-box; }
.prota-case img { display: block; width: 100%; height: auto; }
.gris { filter: grayscale(100%) brightness(0.8); opacity: 0.6; }

/* ======================= SUSPECTS ======================= */
.grille-suspects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 10px; }
.grille-suspects a, .grille-suspects .tile { display: block; width: 100%; box-sizing: border-box; line-height: 0; }
.grille-suspects img { display: block; width: 100%; height: auto; }
.grille-suspects .prota-mort img { filter: grayscale(100%) brightness(0.8); opacity: 0.6; }

/* ======================= INDICE SUSPECT ======================= */
.prota-indice {
  outline: 4px solid rgba(255, 215, 0, 0.95);
  border-radius: 10px;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.9), 0 0 24px rgba(255, 215, 0, 0.6);
  transform: scale(1.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  animation: pulse-indice 2s infinite;
}
@keyframes pulse-indice {
  0% { box-shadow: 0 0 10px rgba(255, 215, 0, 0.7), 0 0 18px rgba(255, 215, 0, 0.4); }
  50% { box-shadow: 0 0 18px rgba(255, 215, 0, 1), 0 0 34px rgba(255, 215, 0, 0.8); }
  100% { box-shadow: 0 0 10px rgba(255, 215, 0, 0.7), 0 0 18px rgba(255, 215, 0, 0.4); }
}
.zombie-warning {
  margin-top: 12px;
  padding: 10px 14px;
  color: #992233;
  background: rgba(120, 0, 0, 0.18);
  border-left: 4px solid #ff3b3b;
  border-radius: 6px;
  font-style: italic;
  letter-spacing: 0.03em;
  animation: zombie-fade 1.8s ease-in-out infinite alternate;
}
@keyframes zombie-fade { from { opacity: 0.55; } to { opacity: 1; } }

/* ======================= GRILLE PROTAGONISTES ======================= */
.grille-protas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px; }
.grille-protas .prota-case { display: block; width: 100%; box-sizing: border-box; }
.grille-protas .prota-case img { display: block; width: 100%; height: auto; }

/* ======================= BOT ======================= */
.bot-interface { max-width: 600px; margin: 20px auto; text-align: center; }
.bot-interface label { display: block; margin-bottom: 8px; }
.bot-interface input { width: min(100%, 420px); box-sizing: border-box; padding: 10px; margin: 8px 0 14px; font-size: 17px; }
#botReponse { margin-top: 20px; padding: 14px; min-height: 30px; text-align: left; border: 1px solid #ccc; border-radius: 7px; background: #ffffee; }
.bot-erreur { color: #922; }
.suspect-jules { display: inline-block; opacity: 0.65; transition: opacity 0.2s, transform 0.2s, outline 0.2s; }
.suspect-jules:hover { opacity: 1; }
.suspect-selectionne { opacity: 1; transform: scale(1.05); outline: 3px solid currentColor; outline-offset: 4px; }

/* ======================= PORTRAITS SUSPECTS ======================= */
#primary.portraits-suspects { display: flex; justify-content: center; align-items: flex-start; gap: 3%; }
#primary.portraits-suspects > a { display: block; flex: 0 0 30%; min-width: 0; }
#primary.portraits-suspects > a > img { display: block; width: 100%; height: auto; }


html {
    scroll-padding-top: var(--hauteur-sticky, 170px);
}

#secondary [id] {
    scroll-margin-top: var(--hauteur-sticky, 170px);
}