/* Polices hébergées sur le site (plus de Google Fonts) : Archivo et Newsreader, licence SIL OFL 1.1 (fonts/LICENSE-*.txt) */
@font-face { font-family: "Archivo"; font-style: normal; font-display: swap; font-weight: 100 900; font-stretch: 62% 125%;
  src: url("../fonts/archivo-latin-standard-normal.woff2") format("woff2-variations"), url("../fonts/archivo-latin-standard-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Archivo"; font-style: normal; font-display: swap; font-weight: 100 900; font-stretch: 62% 125%;
  src: url("../fonts/archivo-latin-ext-standard-normal.woff2") format("woff2-variations"), url("../fonts/archivo-latin-ext-standard-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Newsreader"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url("../fonts/newsreader-latin-standard-normal.woff2") format("woff2-variations"), url("../fonts/newsreader-latin-standard-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Newsreader"; font-style: italic; font-display: swap; font-weight: 200 800;
  src: url("../fonts/newsreader-latin-standard-italic.woff2") format("woff2-variations"), url("../fonts/newsreader-latin-standard-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Newsreader"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url("../fonts/newsreader-latin-ext-standard-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Newsreader"; font-style: italic; font-display: swap; font-weight: 200 800;
  src: url("../fonts/newsreader-latin-ext-standard-italic.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ===== Ils ont existé =====
   Direction : les archives, version plateforme vidéo.
   Fond bordeaux très sombre (le tissu de la chaîne), sceaux de cire rouges, texte crème. */
:root {
  --fond: #170A09;
  --surface: #231210;
  --surface-2: #2E1715;
  --creme: #F4E7D3;
  --creme-vif: #FFF6EA;
  --sourdine: #C2AA9E;       /* texte secondaire, 9:1 sur le fond */
  --cire: #C9362C;           /* boutons principaux */
  --cire-vive: #D84A3E;
  --cire-fonce: #A8231C;
  --trait: rgba(244, 231, 211, 0.12);
  --verre: rgba(23, 10, 9, 0.78);

  --sceau: radial-gradient(circle at 38% 32%, #D84A3E, #A8231C 60%, #6E120D);
  --tissu: url("../images/marque/tissu.webp");
  --tissu-petit: url("../images/marque/tissu-petit.webp");

  --police-titre: "Archivo", "Arial Narrow", Arial, sans-serif;
  --police-texte: "Archivo", system-ui, sans-serif;
  --police-lecture: "Newsreader", Georgia, serif;
  --marge: clamp(20px, 4vw, 40px);
  --largeur: 1280px;
  --rayon: 20px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--fond);
  color: var(--creme);
  font-family: var(--police-texte);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--creme); text-underline-offset: 3px; }
a:hover { color: var(--creme-vif); }
:focus-visible { outline: 3px solid var(--cire-vive); outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--police-titre); }

.saut { position: absolute; left: -9999px; }
.saut:focus { left: 1rem; top: 1rem; z-index: 3000; background: var(--creme); color: var(--fond); padding: .5rem 1rem; border-radius: 8px; }
.visuellement-cache { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- En-tête flottant ---------- */
.entete {
  position: sticky; top: 0; z-index: 1500;
  background: rgba(23, 10, 9, 0.82);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--trait);
}
.entete-int {
  max-width: var(--largeur); margin: 0 auto; padding: 12px var(--marge);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.logo {
  display: inline-flex; align-items: center; gap: 12px; margin: 0;
  font-family: var(--police-titre); font-weight: 800; font-stretch: 125%;
  font-size: 16px; letter-spacing: .01em; text-transform: uppercase;
  text-decoration: none; white-space: nowrap; color: var(--creme);
}
.logo img { width: 40px; height: 40px; border-radius: 50%; }
.nav-pilule {
  display: flex; gap: 4px; padding: 5px; border-radius: 999px;
  background: rgba(244, 231, 211, 0.06); border: 1px solid var(--trait);
}
.nav-pilule a {
  padding: 8px 16px; border-radius: 999px; text-decoration: none;
  font-weight: 600; font-size: 15px; color: var(--sourdine);
}
.nav-pilule a:hover { color: var(--creme); background: rgba(244, 231, 211, 0.1); }

@media (max-width: 860px) {
  .entete-int { flex-wrap: wrap; row-gap: 10px; }
  .nav-pilule { order: 3; width: 100%; justify-content: space-between; }
  .nav-pilule a { flex: 1; text-align: center; padding: 8px 6px; }
  .hasard span { display: none; }
  .hasard { padding: 0; width: 44px; }
}
@media (max-width: 380px) { .logo span { font-size: 14px; } }

/* ---------- Boutons ---------- */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 24px; border-radius: 999px; border: 1px solid transparent;
  font: 700 16px/1.2 var(--police-texte); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.bouton svg { width: 18px; height: 18px; flex: none; }
.bouton-cire { background: var(--cire); color: var(--creme-vif); }
.bouton-cire:hover { background: var(--cire-vive); color: var(--creme-vif); }
.bouton-creme { background: var(--creme); color: var(--fond); min-height: 44px; font-size: 15px; padding: 0 18px; }
.bouton-creme:hover { background: var(--creme-vif); color: var(--fond); }
.bouton-contour { border-color: rgba(244, 231, 211, 0.3); color: var(--creme); background: transparent; }
.bouton-contour:hover { background: rgba(244, 231, 211, 0.08); }

/* ---------- La une ---------- */
.une { position: relative; overflow: hidden; background: var(--fond) var(--tissu) center / cover no-repeat; }
.une::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(23, 10, 9, .86) 0%, rgba(23, 10, 9, .93) 65%, var(--fond) 100%); }
.une-int {
  position: relative; max-width: var(--largeur); margin: 0 auto;
  padding: clamp(40px, 7vw, 88px) var(--marge) clamp(8px, 1.5vw, 24px);
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 48px; align-items: center;
}
.une-titre {
  margin: 0; font-weight: 900; font-stretch: 125%;
  font-size: clamp(56px, 8.4vw, 124px); line-height: .9; letter-spacing: -.035em;
}
.une-accroche { margin: 28px 0 0; max-width: 30ch; font-family: var(--police-lecture); font-style: italic; font-size: clamp(21px, 2.2vw, 28px); line-height: 1.3; }
.une-description { margin: 14px 0 0; max-width: 46ch; font-size: 18px; color: var(--sourdine); }
.une-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.une-actions .bouton { min-height: 52px; }
.une-reseaux { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 36px; font-size: 14px; color: var(--sourdine); }
.une-reseaux .reseaux { margin: 0; }

/* Trois shorts en éventail */
.eventail { position: relative; height: 540px; min-width: 0; }
.eventail-sceau { position: absolute; right: 0; top: -8px; z-index: 4; width: 140px; height: 140px; transform: rotate(-14deg); filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .55)); pointer-events: none; }
.short {
  position: absolute; top: 70px; width: 220px; aspect-ratio: 9 / 16;
  border-radius: 22px; overflow: hidden; text-decoration: none; color: var(--creme);
  box-shadow: 0 30px 60px rgba(0, 0, 0, .5); background: var(--surface);
  transition: transform .25s ease;
}
.short-gauche { left: 4%; transform: rotate(-8deg); }
.short-droite { right: 4%; transform: rotate(8deg); }
.short-centre { z-index: 3; top: 16px; left: 50%; width: 272px; margin-left: -136px; border: 1px solid rgba(244, 231, 211, .18); box-shadow: 0 40px 80px rgba(0, 0, 0, .6); }
.short:hover { color: var(--creme); }
.short-gauche:hover { transform: rotate(-8deg) translateY(-6px); }
.short-droite:hover { transform: rotate(8deg) translateY(-6px); }
.short-centre:hover { transform: translateY(-6px); }
.short .media { position: absolute; inset: 0; }
.short::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(23, 10, 9, .1) 35%, rgba(23, 10, 9, .92) 100%); }
.short-texte { position: absolute; z-index: 2; left: 18px; right: 18px; bottom: 20px; }
.short-texte .no { margin: 0; font-size: 13px; font-weight: 600; color: #E8B9A9; }
.short-titre { margin: 4px 0 0; font-family: var(--police-titre); font-weight: 800; font-size: 17px; line-height: 1.2; }
.short-centre .short-titre { font-size: 22px; letter-spacing: -.01em; }
.short-meta { margin: 8px 0 0; font-size: 14px; color: var(--sourdine); }
.short .badge { position: absolute; z-index: 2; top: 14px; left: 14px; }
.short-lecture {
  position: absolute; z-index: 2; left: 50%; top: 40%; width: 68px; height: 68px; margin: -34px 0 0 -34px;
  border-radius: 50%; display: grid; place-items: center; background: rgba(244, 231, 211, .92); color: var(--fond);
}
.short-lecture svg { width: 26px; height: 26px; margin-left: 3px; }

@media (max-width: 960px) {
  .une-int { grid-template-columns: 1fr; }
  .eventail { height: 460px; max-width: 520px; width: 100%; margin: 0 auto; }
  .short { width: 180px; }
  .short-centre { width: 230px; margin-left: -115px; }
  .eventail-sceau { width: 110px; height: 110px; }
}
@media (max-width: 480px) {
  .eventail { height: 400px; }
  .short { width: 150px; top: 60px; }
  .short-gauche { left: 0; } .short-droite { right: 0; }
  .short-centre { width: 200px; margin-left: -100px; }
  .eventail-sceau { width: 88px; height: 88px; right: -6px; }
  .une-actions .bouton { flex: 1 1 100%; }
}

/* ---------- Sections ---------- */
.section { max-width: var(--largeur); margin: 0 auto; padding: clamp(56px, 8vw, 96px) var(--marge) 0; }
.section-tete { margin-bottom: 32px; }
.section-tete-ligne { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
h2 { margin: 0; font-weight: 800; font-stretch: 115%; font-size: clamp(32px, 4vw, 44px); line-height: 1.02; letter-spacing: -.02em; }
.intro { margin: 12px 0 0; max-width: 62ch; font-size: 17px; color: var(--sourdine); }
.lien-fleche { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 700; text-decoration: none; }
.lien-fleche svg { width: 18px; height: 18px; }
.lien-fleche:hover svg { transform: translateX(3px); }

/* ---------- Pastilles et sceaux ---------- */
.badge { display: inline-flex; align-items: center; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--cire); color: var(--creme-vif); }
.pastille { display: inline-flex; align-items: center; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: rgba(244, 231, 211, .1); color: var(--creme); }
.sceau-no {
  display: grid; place-items: center; border-radius: 50%; background: var(--sceau);
  box-shadow: inset 0 0 0 5px rgba(0, 0, 0, .15), 0 8px 18px rgba(0, 0, 0, .5);
  font-family: var(--police-titre); font-weight: 900; font-stretch: 115%; color: var(--creme-vif);
}

/* Image d'une histoire : la miniature, ou le tissu avec le numéro dans un sceau */
.media { position: relative; overflow: hidden; background: var(--surface-2); }
.media img { width: 100%; height: 100%; object-fit: cover; }
.media.sans-image { display: grid; place-items: center; background: var(--surface-2) var(--tissu-petit) center / cover no-repeat; }
.media.sans-image::before { content: ""; position: absolute; inset: 0; background: rgba(23, 10, 9, .5); }
.media.sans-image::after {
  content: attr(data-no); position: relative;
  display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%;
  background: var(--sceau); box-shadow: inset 0 0 0 5px rgba(0, 0, 0, .15), 0 8px 18px rgba(0, 0, 0, .5);
  font-family: var(--police-titre); font-weight: 900; font-stretch: 115%; font-size: 22px; color: var(--creme-vif);
}

/* ---------- Grilles d'histoires ---------- */
.grille { display: grid; gap: 20px; }
.grille-v { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 28px 20px; }
.grille-l { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }

/* Carte verticale, format short */
.carte-v { display: block; text-decoration: none; color: var(--creme); }
.carte-v:hover { color: var(--creme); }
.carte-v-media { position: relative; aspect-ratio: 9 / 14; border-radius: 18px; overflow: hidden; }
.carte-v-media .media { position: absolute; inset: 0; transition: transform .35s ease; }
.carte-v:hover .carte-v-media .media { transform: scale(1.04); }
.carte-v-media .pastille { position: absolute; z-index: 2; left: 12px; bottom: 12px; max-width: calc(100% - 24px); background: rgba(23, 10, 9, .75); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.carte-v h3 { margin: 14px 0 0; font-family: var(--police-texte); font-weight: 700; font-size: 17px; line-height: 1.3; }
.carte-v:hover h3 { text-decoration: underline; text-decoration-thickness: 2px; }
.carte-v .meta { margin: 6px 0 0; font-size: 14px; color: var(--sourdine); }

/* Carte en ligne (sans adresse fixe) */
.carte-l {
  display: flex; align-items: center; gap: 18px; padding: 14px; border-radius: var(--rayon);
  background: var(--surface); border: 1px solid rgba(244, 231, 211, .08); text-decoration: none; color: var(--creme);
}
.carte-l:hover { background: var(--surface-2); color: var(--creme); }
.carte-l .media { flex: 0 0 96px; height: 120px; border-radius: 14px; }
.carte-l .media.sans-image::after { width: 48px; height: 48px; font-size: 17px; }
.carte-l h3 { margin: 0; font-family: var(--police-texte); font-weight: 700; font-size: 18px; line-height: 1.3; }
.carte-l .meta { margin: 6px 0 0; font-size: 14px; color: var(--sourdine); }

@media (max-width: 560px) {
  .grille-v { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; }
  .carte-v h3 { font-size: 15px; }
  .media.sans-image::after { width: 50px; height: 50px; font-size: 18px; }
}

/* ---------- Carte immersive ---------- */
.section-carte { max-width: 1360px; margin: 0 auto; padding: clamp(56px, 8vw, 96px) 20px 0; }
.carte-immersive { position: relative; height: min(78vh, 720px); min-height: 520px; border-radius: 32px; overflow: hidden; background: #1B2B1B; }
.map { position: absolute; inset: 0; z-index: 0; background: #1B2B1B; }
.panneau-regions {
  position: absolute; z-index: 600; left: 20px; top: 20px; bottom: 20px; width: 340px;
  display: flex; flex-direction: column; gap: 16px; padding: 26px;
  border-radius: 24px; background: var(--verre); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid var(--trait);
}
.panneau-regions h2 { font-size: 28px; line-height: 1.05; }
.champ-recherche-carte {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 16px;
  border-radius: 14px; background: rgba(244, 231, 211, .08); border: 1px solid rgba(244, 231, 211, .14);
}
.champ-recherche-carte svg { width: 18px; height: 18px; color: var(--sourdine); flex: none; }
.champ-recherche-carte input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--creme); font: inherit; font-size: 15px; }
.champ-recherche-carte:focus-within { border-color: var(--cire-vive); }
.pastilles-regions { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px; overflow-y: auto; min-height: 0; }
.pastilles-regions button {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px;
  border-radius: 999px; border: 1px solid rgba(244, 231, 211, .16); background: transparent;
  color: var(--creme); font: 600 14px var(--police-texte); cursor: pointer; text-align: left;
}
.pastilles-regions button:hover { background: rgba(244, 231, 211, .08); }
.pastilles-regions button[aria-pressed="true"] { background: var(--creme); color: var(--fond); border-color: var(--creme); }
.pastilles-regions .nb { opacity: .7; font-weight: 500; font-variant-numeric: tabular-nums; }

@media (max-width: 760px) {
  .section-carte { padding-left: 0; padding-right: 0; }
  .carte-immersive { height: auto; min-height: 0; border-radius: 0; overflow: visible; background: none; }
  .panneau-regions { position: static; width: auto; margin: 0 var(--marge) 16px; padding: 0; background: none; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .pastilles-regions { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(var(--marge) * -1); padding: 0 var(--marge) 4px; }
  .pastilles-regions button { flex: none; white-space: nowrap; }
  .map { position: relative; height: 66vh; min-height: 380px; margin: 0 12px; border-radius: 24px; overflow: hidden; }
}

/* Fonds : le mode « Carte » garde une teinte de vieux papier, le satellite ses couleurs */
.tuiles-papier { filter: sepia(.45) saturate(.9) brightness(.95); }

/* Contrôles Leaflet en verre sombre */
.leaflet-container { font-family: var(--police-texte); background: #1B2B1B; }
.leaflet-bar { border: 0 !important; box-shadow: none !important; }
.leaflet-bar a, .controle-bouton {
  display: grid !important; place-items: center; width: 46px !important; height: 46px !important; line-height: 46px !important;
  margin-bottom: 8px; border: 0 !important; border-radius: 50% !important;
  background: var(--verre) !important; color: var(--creme) !important; font-size: 22px;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); cursor: pointer; padding: 0;
}
.leaflet-bar a:hover, .controle-bouton:hover { background: rgba(46, 23, 21, .92) !important; }
.leaflet-bar a.leaflet-disabled { opacity: .45; }
.controle-bouton svg { width: 20px; height: 20px; }
.controle-bouton[aria-busy="true"] svg { animation: tourne 1s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .controle-bouton[aria-busy="true"] svg { animation: none; opacity: .5; } }
.leaflet-right .leaflet-control { margin-right: 20px; }
.leaflet-top .leaflet-control { margin-top: 20px; }
.leaflet-bottom .leaflet-control { margin-bottom: 20px; }
.fonds { display: flex !important; padding: 4px; border-radius: 999px !important; background: var(--verre) !important; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.fonds button {
  min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent;
  color: var(--sourdine); font: 600 14px var(--police-texte); cursor: pointer;
}
.fonds button[aria-pressed="true"] { background: var(--creme); color: var(--fond); font-weight: 700; }
.leaflet-control-attribution { background: rgba(23, 10, 9, .7) !important; color: var(--sourdine) !important; border-radius: 8px 0 0 0; }
.leaflet-control-attribution a { color: var(--creme) !important; }
.carte-message {
  max-width: 17rem; padding: .6rem .85rem; border-radius: 12px;
  background: var(--verre); color: var(--creme); font-size: .9rem; line-height: 1.4;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.carte-message:empty { display: none; }
.page-accueil .leaflet-left .leaflet-control { margin-left: 384px; }
@media (max-width: 760px) { .page-accueil .leaflet-left .leaflet-control { margin-left: 12px; } }

/* Épingles : des sceaux de cire numérotés */
.epingle-icone, .grappe-icone { background: none; border: 0; }
.epingle {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--sceau); box-shadow: inset 0 0 0 4px rgba(0, 0, 0, .15), 0 6px 14px rgba(0, 0, 0, .55);
  font: 800 14px/1 var(--police-texte); color: var(--creme-vif);
}
.grappe {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  background: var(--fond); border: 3px solid var(--cire-vive); box-shadow: 0 6px 14px rgba(0, 0, 0, .5);
  font: 800 16px/1 var(--police-texte); color: var(--creme);
}
.position-moi { width: 18px; height: 18px; border-radius: 50%; background: #3B82F6; border: 3px solid var(--creme-vif); box-shadow: 0 0 0 6px rgba(59, 130, 246, .3); }

/* Bulles : une carte crème, lisible sur le satellite */
.leaflet-popup-content-wrapper { padding: 0; overflow: hidden; border-radius: 20px; background: var(--creme); color: var(--fond); box-shadow: 0 24px 48px rgba(0, 0, 0, .5); }
.leaflet-popup-tip { background: var(--creme); }
.leaflet-popup-content { margin: 0; width: 290px !important; }
.leaflet-container a.leaflet-popup-close-button { color: var(--fond); }
.bulle { position: relative; }
.bulle-image { display: block; width: 100%; height: 132px; }
.bulle-image.sans-image::after { width: 54px; height: 54px; font-size: 19px; }
.bulle-fermer {
  position: absolute; top: 10px; right: 10px; z-index: 2; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; border: 0; background: rgba(244, 231, 211, .92); color: var(--fond); font-size: 16px; cursor: pointer;
}
.bulle-texte { padding: 16px 20px 20px; }
.bulle-texte p { margin: 0; }
.bulle-no { font-size: 13px; font-weight: 700; color: var(--cire-fonce); }
.bulle-titre { margin-top: 6px !important; font-family: var(--police-titre); font-weight: 800; font-size: 19px; line-height: 1.2; color: var(--fond); }
.bulle-meta { margin-top: 8px !important; font-size: 14px; color: #6B4E45; }
.bulle .bouton { width: 100%; margin-top: 16px; min-height: 46px; font-size: 15px; }
.leaflet-popup-content a.bouton-cire { color: var(--creme-vif); }
.bulle-moi { padding: 16px 18px; color: var(--fond); font-size: 15px; line-height: 1.45; }
.bulle-moi p { margin: 0; }
.bulle-moi p + p { margin-top: 6px; }
.bulle-moi a { color: var(--cire-fonce); font-weight: 700; }

/* ---------- Filtres ---------- */
.filtres { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; margin: 0 0 16px; }
.champ label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; color: var(--sourdine); }
.champ input, .champ select {
  width: 100%; min-height: 48px; padding: 0 16px; border-radius: 14px;
  border: 1px solid rgba(244, 231, 211, .16); background: var(--surface); color: var(--creme);
  font: inherit; font-size: 15px;
}
.champ select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--sourdine) 50%), linear-gradient(135deg, var(--sourdine) 50%, transparent 50%); background-position: calc(100% - 22px) 21px, calc(100% - 16px) 21px; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
.champ input:focus, .champ select:focus { border-color: var(--cire-vive); outline: none; }
@media (max-width: 700px) { .filtres { grid-template-columns: 1fr 1fr; } .champ-recherche { grid-column: 1 / -1; } }
#resultat { margin: 0 0 20px; font-size: 15px; color: var(--sourdine); }
.vide-message, .erreur { grid-column: 1 / -1; margin: 0; padding: 20px; border-radius: var(--rayon); background: var(--surface); border: 1px dashed rgba(244, 231, 211, .25); max-width: 62ch; }

/* ---------- À propos ---------- */
.a-propos {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: clamp(28px, 5vw, 72px); align-items: start;
  padding: clamp(28px, 5vw, 56px); border-radius: 32px; background: var(--surface); border: 1px solid rgba(244, 231, 211, .08);
}
.a-propos .citation { margin: 0; font-family: var(--police-lecture); font-style: italic; font-size: clamp(28px, 3.2vw, 40px); line-height: 1.2; }
.a-propos h2 { font-size: 26px; }
.a-propos p { color: var(--sourdine); }
.a-propos .citation { color: var(--creme); }

/* ---------- Réseaux et pied de page ---------- */
.reseaux { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.reseaux a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px;
  background: rgba(244, 231, 211, .08); text-decoration: none; font-weight: 600; font-size: 14px; color: var(--creme);
}
.reseaux a:hover { background: var(--cire); color: var(--creme-vif); }
.pied { margin-top: clamp(64px, 9vw, 104px); border-top: 1px solid var(--trait); }
.pied-int { max-width: var(--largeur); margin: 0 auto; padding: 32px var(--marge) 40px; display: flex; align-items: center; flex-wrap: wrap; gap: 16px 32px; font-size: 14px; color: var(--sourdine); }
.pied .logo { font-size: 14px; }
.pied .logo img { width: 32px; height: 32px; }
.pied .reseaux { margin: 0; }
.credit { margin: 0; flex: 1 1 260px; }

/* ===== Fiche d'une histoire ===== */
.fiche { max-width: var(--largeur); margin: 0 auto; padding: 0 var(--marge); }
.chargement { padding: 80px 0; color: var(--sourdine); }
.ariane { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 28px 0 32px; font-size: 14px; color: var(--sourdine); }
.ariane a { color: var(--sourdine); }
.ariane a:hover { color: var(--creme); }
.ariane [aria-current] { color: var(--creme); }

.fiche-grille { display: flex; flex-wrap: wrap; gap: clamp(32px, 5vw, 64px); align-items: flex-start; }
.video { flex: 0 1 380px; min-width: 280px; position: sticky; top: 96px; }
.video-cadre { position: relative; aspect-ratio: 9 / 16; border-radius: 28px; overflow: hidden; background: var(--surface); border: 1px solid rgba(244, 231, 211, .14); box-shadow: 0 40px 80px rgba(0, 0, 0, .55); }
.video-cadre iframe, .video-cadre img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
.video-cadre.sans-image::after { width: 110px; height: 110px; font-size: 40px; }
.plateformes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.plateforme {
  display: flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 8px; border-radius: 14px;
  background: var(--surface); border: 1px solid rgba(244, 231, 211, .1); text-decoration: none; font-weight: 600; font-size: 14px; color: var(--creme);
}
.plateforme:hover { background: var(--surface-2); color: var(--creme); }
.partager { width: 100%; margin-top: 8px; }
.partage-etat { margin: 8px 0 0; min-height: 1.4em; font-size: 14px; color: var(--sourdine); text-align: center; }

.video-bloquee {
  position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; justify-content: center; gap: 12px;
  padding: 24px; text-align: center; color: var(--creme);
  background: var(--surface-2) var(--tissu-petit) center / cover no-repeat;
}
.video-bloquee::before { content: ""; position: absolute; inset: 0; background: rgba(23, 10, 9, .86); }
.video-bloquee > * { position: relative; }
.video-bloquee p { margin: 0 0 6px; font-size: 15px; line-height: 1.5; }

.texte { flex: 999 1 560px; min-width: 0; max-width: 720px; }
.etiquettes { display: flex; flex-wrap: wrap; gap: 8px; }
.fiche-titre { margin: 22px 0 0; font-weight: 900; font-stretch: 118%; font-size: clamp(40px, 5.6vw, 68px); line-height: .98; letter-spacing: -.03em; }
.fiche-meta { display: flex; flex-wrap: wrap; gap: 16px 40px; margin: 32px 0 0; padding: 20px 0; border-top: 1px solid var(--trait); border-bottom: 1px solid var(--trait); }
.fiche-meta dt { font-size: 13px; color: var(--sourdine); }
.fiche-meta dd { margin: 4px 0 0; font-weight: 700; font-size: 16px; }
.chapeau { margin: 36px 0 0; font-family: var(--police-lecture); font-style: italic; font-size: clamp(22px, 2.3vw, 27px); line-height: 1.4; }
.texte h2 { margin: 52px 0 16px; font-size: 24px; }
.script { font-family: var(--police-lecture); font-size: 21px; line-height: 1.7; white-space: pre-line; }
.mini-carte-cadre { position: relative; height: 320px; border-radius: 24px; overflow: hidden; background: #1B2B1B; }
.mini-carte { position: absolute; inset: 0; z-index: 0; }
.mini-carte-lien { position: absolute; z-index: 600; left: 16px; bottom: 16px; min-height: 42px; padding: 0 16px; font-size: 14px; background: var(--verre); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.mini-carte-lien:hover { background: rgba(46, 23, 21, .92); }
.mini-carte .leaflet-right .leaflet-control, .mini-carte .leaflet-top .leaflet-control { margin-top: 14px; margin-right: 14px; }
.mini-carte .leaflet-left .leaflet-control { margin-left: 14px; }
.liens-region { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 14px 0 0; font-weight: 600; font-size: 15px; }
.source { margin: 0; overflow-wrap: anywhere; color: var(--sourdine); }
.source a { color: var(--creme); }

.encore { padding-top: clamp(64px, 9vw, 104px); }
.encore .section-tete-ligne { margin-bottom: 28px; }
.encore-nav { display: flex; flex-wrap: wrap; gap: 10px; }
.encore-nav .bouton { min-height: 44px; font-size: 14px; padding: 0 18px; }

.introuvable { padding: 64px 0; }
.introuvable .bouton { margin-top: 24px; }

@media (max-width: 860px) {
  .video { position: static; flex-basis: 100%; max-width: 380px; margin: 0 auto; }
  .texte { flex-basis: 100%; }
}

/* Page 404 */
.fiche > .fiche-titre:first-child { margin-top: 72px; }

/* Dans l'éventail, pas de numéro sur le tissu : le bouton de lecture et le titre suffisent */
.short .media.sans-image::after { display: none; }
.short-gauche .short-texte, .short-droite .short-texte { display: none; }
@media (max-width: 560px) { #grille-dernieres > :nth-child(n+5) { display: none; } }

/* Chiffres de la une */
.une-chiffres { display: flex; flex-wrap: wrap; gap: 20px 48px; margin: 28px 0 0; }
.une-chiffres div { display: flex; flex-direction: column-reverse; justify-content: flex-end; }
.une-chiffres dd { margin: 0; font-variant-numeric: tabular-nums; font-family: var(--police-titre); font-weight: 900; font-stretch: 118%; font-size: clamp(40px, 4.4vw, 56px); line-height: 1; letter-spacing: -.02em; color: var(--creme); }
.une-chiffres dt { margin-top: 6px; max-width: 22ch; font-size: 14px; line-height: 1.35; color: var(--sourdine); }
.une-chiffres div + div dd { color: #F08A7E; }
.une-chiffres + .une-description { margin-top: 18px; }

/* ---------- Statistiques ---------- */
.chiffre-bouton { all: unset; cursor: pointer; border-radius: 6px; }
.chiffre-bouton:disabled { cursor: default; }
.chiffre-bouton:not(:disabled):hover { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; }
.chiffre-bouton:focus-visible { outline: 3px solid var(--cire-vive); outline-offset: 4px; }
.lien-stats {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; margin-top: 14px; padding: 0 16px;
  border-radius: 999px; border: 1px solid rgba(244, 231, 211, .25); background: rgba(23, 10, 9, .4);
  color: var(--creme); font: 600 14px var(--police-texte); cursor: pointer;
}
.lien-stats:hover { background: rgba(244, 231, 211, .08); }
.lien-stats svg { width: 16px; height: 16px; }
.lien-stats + .une-description { margin-top: 16px; }

.stats {
  width: min(760px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 0; overflow: auto;
  border: 1px solid var(--trait); border-radius: 28px; background: var(--surface); color: var(--creme);
  box-shadow: 0 40px 100px rgba(0, 0, 0, .6);
}
.stats::backdrop { background: rgba(10, 4, 4, .72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.stats-int { padding: clamp(20px, 4vw, 36px); }
.stats-tete { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.stats h2 { font-size: clamp(26px, 3.4vw, 34px); }
.stats-maj { margin: 6px 0 0; font-size: 14px; color: var(--sourdine); }
.stats-maj:empty { display: none; }
.stats-fermer {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: rgba(244, 231, 211, .08); color: var(--creme); cursor: pointer;
}
.stats-fermer:hover { background: rgba(244, 231, 211, .16); }
.stats-fermer svg { width: 20px; height: 20px; }
.stats-total { margin: 20px 0 0; font-size: 16px; color: var(--sourdine); }
.stats-total span { display: block; font-family: var(--police-titre); font-weight: 900; font-stretch: 118%; font-size: clamp(40px, 6vw, 56px); line-height: 1; letter-spacing: -.02em; color: var(--creme); }
.stats-bloc { margin-top: 32px; }
.stats h3 { margin: 0 0 14px; font-family: var(--police-texte); font-size: 15px; font-weight: 700; color: var(--sourdine); }

.barres { display: flex; flex-direction: column; gap: 12px; }
.barre-ligne { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 12px; }
.barre-nom { font-weight: 600; font-size: 15px; }
.barre-piste { display: flex; align-items: center; gap: 10px; min-width: 0; }
.barre { height: 22px; border-radius: 0 4px 4px 0; background: #E36556; }
.barre-valeur { flex: none; font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.barre-valeur small { margin-left: 4px; font-weight: 500; font-size: 13px; color: var(--sourdine); }

.courbe { position: relative; }
.courbe svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.courbe .grille { stroke: rgba(244, 231, 211, .1); stroke-width: 1; }
.courbe .axe { fill: var(--sourdine); font: 12px var(--police-texte); }
.courbe .trace { fill: none; stroke: #E36556; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.courbe .aire { fill: #E36556; opacity: .1; }
.courbe .point { fill: #E36556; stroke: var(--surface); stroke-width: 2; }
.courbe .fin { fill: var(--creme); font: 700 13px var(--police-texte); }
.courbe .repere { stroke: rgba(244, 231, 211, .35); stroke-width: 1; }
.courbe .cible { fill: transparent; cursor: crosshair; }
.courbe-vide { margin: 0; padding: 20px; border-radius: 16px; border: 1px dashed rgba(244, 231, 211, .2); color: var(--sourdine); font-size: 15px; }
.infobulle {
  position: absolute; z-index: 2; transform: translateX(-50%); pointer-events: none;
  display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border-radius: 10px;
  background: var(--creme); color: var(--fond); font-size: 13px; white-space: nowrap; box-shadow: 0 8px 20px rgba(0, 0, 0, .4);
}
.infobulle strong { font-size: 14px; }

@media (max-width: 480px) {
  .barre-ligne { grid-template-columns: 1fr; gap: 4px; }
}

/* ---------- Précision des emplacements ---------- */
.epingle { position: relative; }
/* 2 : le secteur. Sceau plein entouré d'un anneau pointillé */
.epingle-p2::after {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  border: 2px dashed rgba(255, 246, 234, .9); pointer-events: none;
}
/* 3 : le village ou le quartier. Sceau « fantôme » : contour pointillé, centre presque vide */
.epingle-p3 {
  background: rgba(23, 10, 9, .55);
  border: 2px dashed #F08A7E; box-shadow: 0 4px 10px rgba(0, 0, 0, .45);
  color: var(--creme-vif);
}
.cercle-incertitude { fill: #E36556; fill-opacity: .14; stroke: #F08A7E; stroke-width: 2; stroke-dasharray: 6 5; }
.bulle-precision { margin-top: 8px !important; font-size: 13px; line-height: 1.4; color: #6B4E45; font-style: italic; }


.precision-lieu { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; font-size: 15px; color: var(--sourdine); }
.precision-icone { flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--sceau); }
.precision-p2 .precision-icone { box-shadow: 0 0 0 2px var(--fond), 0 0 0 3.5px rgba(255, 246, 234, .8); }
.precision-p3 .precision-icone { background: transparent; border: 2px dashed #F08A7E; }

/* ---------- Images : apparition en fondu sur le tissu ---------- */
.media { background: var(--surface-2) var(--tissu-petit) center / cover no-repeat; }
.media img { opacity: 0; transition: opacity .45s ease; }
.media img.chargee { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .media img { transition: none; } }

/* ---------- Avis « nouvelle histoire » ---------- */
.avis-nouveaute {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1200;
  display: flex; align-items: center; gap: 16px; max-width: calc(100% - 32px);
  padding: 10px 10px 10px 20px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--trait); color: var(--creme);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .45); font-size: 15px;
  animation: avis-entree .35s ease both;
}
.avis-nouveaute .bouton { padding: 8px 18px; min-height: 0; flex: none; }
@keyframes avis-entree { from { opacity: 0; transform: translate(-50%, 12px); } }
@media (prefers-reduced-motion: reduce) { .avis-nouveaute { animation: none; } }

/* ---------- À propos : lecture aérée ---------- */
.a-propos-tete h2 { margin: 0 0 20px; }
.a-propos .citation { font-size: clamp(22px, 2.2vw, 28px); line-height: 1.3; padding-left: 18px; border-left: 3px solid var(--cire); }
.a-propos-texte { max-width: 62ch; }
.a-propos-texte p { margin: 0 0 18px; font-size: 17px; line-height: 1.7; }
.a-propos-texte .a-propos-chapeau { font-family: var(--police-lecture); font-size: clamp(20px, 1.8vw, 23px); line-height: 1.5; color: var(--creme); }
.a-propos-contact { margin-top: 28px; padding-top: 24px; border-top: 1px solid rgba(244, 231, 211, .1); }
.a-propos-contact p { margin: 0; color: var(--creme); font-weight: 600; }
@media (max-width: 760px) { .a-propos { grid-template-columns: 1fr; } }

/* ---------- Fiche : l'ombre de la vidéo ne recouvre plus les boutons ---------- */
.video-cadre { box-shadow: 0 24px 48px -20px rgba(0, 0, 0, .6); }
.plateformes, .partager, .partage-etat { position: relative; z-index: 1; }

/* ---------- À propos : tout en pleine largeur ---------- */
.a-propos { grid-template-columns: 1fr; gap: 28px; }
.a-propos .citation { margin: 0; padding: 0 0 0 22px; font-size: clamp(26px, 3vw, 38px); line-height: 1.25; }
.a-propos-texte { max-width: none; }

/* ---------- Accordéon « Lieu inconnu » ---------- */
.accordeon summary {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 20px; border-radius: 999px;
  border: 1px solid rgba(244, 231, 211, .25); color: var(--creme); font-weight: 600; cursor: pointer; list-style: none;
}
.accordeon summary::-webkit-details-marker { display: none; }
.accordeon summary:hover { background: var(--surface); }
.accordeon summary:focus-visible { outline: 2px solid var(--cire-vive); outline-offset: 3px; }
.accordeon summary svg { width: 18px; height: 18px; transition: transform .2s ease; }
.accordeon[open] summary svg { transform: rotate(180deg); }
.accordeon[open] summary { margin-bottom: 24px; }

/* ---------- Territoires (précision 3) ---------- */
.zone-contour { fill: #E36556; fill-opacity: .07; stroke: #F08A7E; stroke-width: 2; stroke-dasharray: 6 5; stroke-opacity: .85; transition: fill-opacity .2s ease; }
.leaflet-interactive.zone-contour:hover, .zone-contour.zone-active { fill-opacity: .2; stroke-width: 2.5; stroke-opacity: 1; }
.bulle-zone .bulle-texte { padding-top: 22px; }
.bulle-zone .bulle-titre { padding-right: 24px; }
.bulle-zone .bulle-fermer { color: #6B4E45; background: rgba(23, 10, 9, .06); }
.bulle-liste { list-style: none; margin: 14px 0 0; padding: 0; max-height: 230px; overflow-y: auto; border-top: 1px solid rgba(23, 10, 9, .1); }
.bulle-liste li { border-bottom: 1px solid rgba(23, 10, 9, .1); }
.bulle-liste a { display: flex; align-items: flex-start; gap: 12px; padding: 10px 2px; text-decoration: none; color: #231210; }
.bulle-liste a:hover .bulle-liste-titre { text-decoration: underline; }
.bulle-liste-no { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--sceau, #C9362C); color: #FFF6EA; font-size: 12px; font-weight: 700; }
.bulle-liste-titre { display: block; font-weight: 700; font-size: 14px; line-height: 1.3; }
.bulle-liste-annee { display: block; margin-top: 2px; font-size: 12px; color: #6B4E45; }

/* Territoires emboîtés : les grands territoires restent discrets, les petits ressortent */
.zone-contour.zone-mrc, .zone-contour.zone-region { fill-opacity: .03; stroke-width: 1.5; stroke-dasharray: 2 6; }
.zone-contour.zone-municipalite { fill-opacity: .05; }
.zone-contour.zone-quartier, .zone-contour.zone-arrondissement { fill-opacity: .1; }
.leaflet-interactive.zone-contour:hover, .zone-contour.zone-active { fill-opacity: .22; stroke-width: 2.5; stroke-opacity: 1; stroke-dasharray: 6 5; }
.zone-infobulle { background: var(--creme); color: var(--fond); border: 0; border-radius: 10px; padding: 6px 10px; font-size: 13px; line-height: 1.35; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.zone-infobulle::before { border-top-color: var(--creme) !important; }
.bulle-exact { font-style: normal !important; }

/* ---------- La collection ---------- */
.collection-tete { padding: clamp(40px, 6vw, 72px) 0 8px; max-width: 760px; }
.surtitre { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--cire-vive); }
.collection-tete .fiche-titre { margin-top: 12px; }
.collection-intro { margin: 24px 0 0; font-family: var(--police-lecture); font-size: clamp(19px, 1.8vw, 22px); line-height: 1.55; color: var(--sourdine); }
.collection-outils { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px 32px; margin: 40px 0 28px; }
.collection-outils .pastilles-regions { overflow: visible; flex-wrap: wrap; max-height: none; max-width: 100%; }
.collection-tri { display: flex; align-items: flex-end; gap: 20px; margin-left: auto; }
.collection-tri p { margin: 0 0 14px; font-size: 14px; color: var(--sourdine); white-space: nowrap; }
.collection-tri .champ select { min-width: 220px; }

.grille-collection { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 32px 22px; }
.carte-piece { display: block; text-decoration: none; color: var(--creme); }
.carte-piece:hover { color: var(--creme); }
.carte-piece-media { position: relative; aspect-ratio: 4 / 5; border-radius: 18px; overflow: hidden; background: var(--surface); border: 1px solid rgba(244, 231, 211, .08); }
.carte-piece-media .media { position: absolute; inset: 0; transition: transform .35s ease; }
.carte-piece-media img { width: 100%; height: 100%; object-fit: cover; }
.carte-piece:hover .carte-piece-media .media { transform: scale(1.04); }
.carte-piece-media .pastille { position: absolute; z-index: 2; left: 12px; bottom: 12px; background: rgba(23, 10, 9, .78); }
.carte-piece h3 { margin: 14px 0 0; font-family: var(--police-texte); font-weight: 700; font-size: 17px; line-height: 1.3; }
.carte-piece:hover h3 { text-decoration: underline; text-decoration-thickness: 2px; }
.carte-piece .meta { margin: 6px 0 0; font-size: 14px; color: var(--sourdine); }

/* Fiche d'une pièce */
.piece-grille { display: flex; flex-wrap: wrap; gap: clamp(32px, 5vw, 64px); align-items: flex-start; }
.galerie { flex: 1 1 460px; min-width: 0; max-width: 620px; margin: 0; position: sticky; top: 96px; }
.galerie-principale { display: block; position: relative; width: 100%; aspect-ratio: 4 / 5; padding: 0; border: 1px solid rgba(244, 231, 211, .12); border-radius: 24px; overflow: hidden; background: var(--surface); cursor: zoom-in; }
.galerie-principale img { width: 100%; height: 100%; object-fit: contain; display: block; }
.galerie-principale:focus-visible { outline: 2px solid var(--cire-vive); outline-offset: 3px; }
.galerie-miniatures { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; padding-bottom: 4px; }
.galerie-miniatures button { flex: none; width: 76px; height: 76px; padding: 0; border-radius: 12px; overflow: hidden; border: 2px solid transparent; background: var(--surface); cursor: pointer; opacity: .65; }
.galerie-miniatures button[aria-pressed="true"] { border-color: var(--creme); opacity: 1; }
.galerie-miniatures img { width: 100%; height: 100%; object-fit: cover; display: block; }
.piece-titre { font-size: clamp(36px, 4.6vw, 58px); line-height: 1.02; }
.piece-description { margin-top: 28px; font-family: var(--police-lecture); font-size: 20px; line-height: 1.7; }
.piece-description p { margin: 0 0 18px; }
.piece-pdf { margin-top: 12px; gap: 10px; }
.piece-pdf svg { width: 20px; height: 20px; }
.piece-lecteur { padding-top: clamp(56px, 8vw, 88px); }
.piece-lecteur h2 { margin: 0 0 20px; font-size: 24px; }
.pdf-cadre { height: min(88vh, 1000px); border-radius: 20px; overflow: hidden; background: #fff; border: 1px solid rgba(244, 231, 211, .12); }
.pdf-cadre iframe { width: 100%; height: 100%; border: 0; display: block; }

.visionneuse { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(10, 4, 4, .94); }
.visionneuse::backdrop { background: rgba(10, 4, 4, .7); }
.visionneuse img { position: absolute; inset: 56px 64px; width: calc(100% - 128px); height: calc(100% - 112px); object-fit: contain; }
.visionneuse-fermer, .visionneuse-nav { position: absolute; z-index: 2; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(244, 231, 211, .14); color: var(--creme); font-size: 22px; cursor: pointer; }
.visionneuse-fermer { top: 16px; right: 16px; }
.visionneuse-nav { top: 50%; transform: translateY(-50%); font-size: 32px; line-height: 1; }
.visionneuse-nav.prec { left: 12px; }
.visionneuse-nav.suiv { right: 12px; }
.visionneuse-fermer:hover, .visionneuse-nav:hover { background: rgba(244, 231, 211, .26); }

@media (max-width: 860px) {
  .galerie { position: static; flex-basis: 100%; max-width: none; }
  .collection-tri { margin-left: 0; width: 100%; justify-content: space-between; }
  .collection-tri .champ select { min-width: 0; }
  .visionneuse img { inset: 64px 8px; width: calc(100% - 16px); height: calc(100% - 128px); }
}
@media (max-width: 420px) { .nav-pilule a { padding: 8px 2px; font-size: 13.5px; } }
@media (max-width: 560px) {
  .grille-collection { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 14px; }
  .carte-piece h3 { font-size: 15px; }
  .carte-piece-media .pastille { left: 8px; bottom: 8px; font-size: 12px; padding: 4px 9px; }
}

/* Bulles de la carte : bandeau plus haut, cadré sur le haut de la miniature, là où se trouve le titre incrusté */
.bulle-image { height: 196px; }
.bulle-image img { object-position: 50% 27%; }

/* Pile de sceaux : un territoire qui contient plusieurs histoires */
.pile-zone { position: relative; display: block; width: 58px; height: 52px; }
.pile-sceau {
  position: absolute; left: 0; bottom: 0; width: 34px; height: 34px; border-radius: 50%;
  background: var(--sceau); border: 2px solid var(--creme-vif);
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .15), 0 4px 10px rgba(0, 0, 0, .5);
}
.pile-sceau-1 { transform: translate(11px, -8px) rotate(10deg); filter: brightness(.85); }
.pile-sceau-2 { transform: translate(22px, -16px) rotate(20deg); filter: brightness(.7); }
.pile-avant {
  display: grid; place-items: center; background: var(--creme-vif); border-color: var(--cire);
  font: 800 15px/1 var(--police-texte); color: var(--cire-fonce, #8E1D16);
}
.pile-avant::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; border: 1.5px dashed rgba(168, 35, 28, .55); }
.epingle-icone:hover .pile-sceau-1, .epingle-icone:focus .pile-sceau-1 { transform: translate(13px, -10px) rotate(14deg); }
.epingle-icone:hover .pile-sceau-2, .epingle-icone:focus .pile-sceau-2 { transform: translate(26px, -20px) rotate(26deg); }
.pile-sceau-1, .pile-sceau-2 { transition: transform .2s ease; }

.piece-auteur { margin: 14px 0 0; font-family: var(--police-lecture); font-style: italic; font-size: 21px; color: var(--sourdine); }

/* Mini biographie de l'auteur, sous son nom */
.auteur-fiche { display: flex; gap: 18px; align-items: flex-start; margin-top: 18px; padding: 18px; border-radius: 18px; background: var(--surface); border: 1px solid rgba(244, 231, 211, .08); }
.auteur-portrait { flex: 0 0 96px; margin: 0; }
.auteur-portrait img { display: block; width: 96px; height: 120px; object-fit: cover; border-radius: 12px; filter: sepia(.15); }
.auteur-portrait figcaption { margin-top: 6px; font-size: 11.5px; line-height: 1.35; color: var(--sourdine); overflow-wrap: anywhere; }
.auteur-portrait figcaption a { color: inherit; }
.auteur-bio { flex: 1; min-width: 0; font-size: 15.5px; line-height: 1.6; }
.auteur-bio p { margin: 0 0 8px; }
.auteur-bio p:last-child { margin-bottom: 0; }
@media (max-width: 420px) { .auteur-fiche { padding: 14px; gap: 14px; } .auteur-portrait { flex-basis: 80px; } .auteur-portrait img { width: 80px; height: 100px; } }
.piece-source { margin: -4px 0 20px; font-size: 13.5px; line-height: 1.5; color: var(--sourdine); overflow-wrap: anywhere; }
.piece-source a { color: inherit; }
.auteur-bio p.auteur-source { margin: 10px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--sourdine); overflow-wrap: anywhere; }
.auteur-source a { color: inherit; }
.video-cadre.video-fb { background: #000; }

/* Fiche : la vidéo tient toujours dans la hauteur de l'écran (moins l'en-tête) */
.video-cadre { width: min(100%, calc((100svh - 190px) * 9 / 16)); margin-inline: auto; }
/* La colonne vidéo ne reste collée en haut que si elle tient entière à l'écran ; sinon elle défile normalement */
@media (max-height: 899px) { .video { position: static; } }
.piece-pdf { white-space: normal; text-align: left; max-width: 100%; }

/* Miniature sous le lecteur vidéo, visible pendant son chargement */
.video-cadre .video-affiche { position: absolute; inset: 0; }
.video-cadre .video-affiche img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.video-cadre iframe { z-index: 1; }
.video-cadre .video-bloquee { z-index: 2; }
.video-cadre .video-bloquee { background: transparent; }
.video-cadre .video-bloquee::before { background: rgba(23, 10, 9, .78); }

/* ---------- Page « Confidentialité, cookies et conditions » ---------- */
.texte-legal { max-width: 780px; }
.texte-legal section { padding-top: 40px; scroll-margin-top: 96px; }
.texte-legal h2 { margin: 0 0 14px; font-size: clamp(24px, 2.4vw, 30px); }
.texte-legal h3 { margin: 28px 0 8px; font-size: 19px; }
.texte-legal p, .texte-legal li { font-size: 17px; line-height: 1.65; }
.texte-legal p { margin: 0 0 14px; }
.texte-legal ul { margin: 0 0 14px; padding-left: 22px; }
.texte-legal li { margin-bottom: 8px; }
.texte-legal a { color: var(--creme); }
.texte-legal code { font-size: .88em; padding: 1px 6px; border-radius: 6px; background: var(--surface); }
.sommaire { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.sommaire a { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--trait); color: var(--creme); text-decoration: none; font-size: 14px; }
.sommaire a:hover { background: var(--surface); }
.pied-lien { color: var(--sourdine); }
.pied-lien:hover { color: var(--creme); }

/* ---------- Bandeau de cookies maison ---------- */
.bandeau-cookies {
  position: fixed; z-index: 3000; left: 50%; bottom: 20px; transform: translateX(-50%);
  width: min(760px, calc(100% - 32px)); display: flex; align-items: center; gap: 16px 24px; flex-wrap: wrap;
  padding: 18px 20px; border-radius: 20px; background: var(--surface); border: 1px solid var(--trait);
  color: var(--creme); box-shadow: 0 18px 48px rgba(0, 0, 0, .55); animation: avis-entree .35s ease both;
}
.bandeau-cookies p { flex: 1 1 380px; margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--sourdine); }
.bandeau-cookies p strong { display: block; margin-bottom: 4px; color: var(--creme); font-size: 15.5px; }
.bandeau-cookies a { color: var(--creme); }
.bandeau-cookies-boutons { display: flex; gap: 10px; flex: 0 0 auto; }
.bandeau-cookies-boutons .bouton { min-width: 120px; justify-content: center; }
@media (max-width: 560px) { .bandeau-cookies { bottom: 12px; padding: 16px; } .bandeau-cookies-boutons { width: 100%; } .bandeau-cookies-boutons .bouton { flex: 1; min-width: 0; } }
@media (prefers-reduced-motion: reduce) { .bandeau-cookies { animation: none; } }
button.pied-lien { padding: 0; border: 0; background: none; font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* Vidéo sans consentement : miniature + bouton « Lancer la vidéo » */
.video-lancer {
  position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  gap: 10px; padding: 24px 20px; text-align: center;
  background: linear-gradient(to bottom, rgba(23, 10, 9, 0) 30%, rgba(23, 10, 9, .9) 78%);
}
.video-lancer-bouton {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: grid; place-items: center;
  width: 78px; height: 78px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--creme-vif); color: var(--fond); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); transition: transform .2s ease;
}
.video-lancer-bouton svg { width: 34px; height: 34px; margin-left: 4px; }
.video-lancer-bouton:hover { transform: translate(-50%, -50%) scale(1.06); }
.video-lancer-bouton:focus-visible { outline: 3px solid var(--cire-vive); outline-offset: 4px; }
.video-lancer p { margin: 0; max-width: 30ch; font-size: 13px; line-height: 1.45; color: var(--creme); }
.video-lancer a { color: var(--creme); }
.video-lancer-externe { font-size: 13px; font-weight: 600; }
.lien-texte { padding: 0; border: 0; background: none; font: inherit; color: var(--creme); text-decoration: underline; cursor: pointer; }

/* Bouton « Lancer la vidéo » : dans le flux, au-dessus du texte, pour ne jamais le chevaucher */
.video-cadre .video-lancer { justify-content: flex-end; }
.video-cadre .video-lancer-bouton { position: static; transform: none; flex: none; margin: auto 0 18px; }
.video-cadre .video-lancer-bouton:hover { transform: scale(1.06); }
.video-cadre .video-lancer p { margin: 0; font-size: 13px; line-height: 1.45; }
.video-cadre .video-lancer-externe { font-size: 13px; }
@media (max-height: 640px), (max-width: 360px) { .video-cadre .video-lancer-bouton { width: 64px; height: 64px; margin-bottom: 12px; } }
