/* Jolie Planète — feuille de style (2026) */
:root {
  --rouge: #d7141a;
  --rouge-fonce: #a50f14;
  --encre: #1d1b19;
  --texte: #2e2b28;
  --gris: #6c665f;
  --trait: #e4ded4;
  --papier: #faf7f1;
  --carte: #ffffff;
  --sable: #f2ece1;
  --titre: "Avenir Next Condensed", "Arial Narrow", "Roboto Condensed", "Helvetica Neue", Arial, sans-serif;
  --corps: Charter, "Bitstream Charter", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --large: 1180px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--papier); color: var(--texte);
  font-family: var(--corps); font-size: 1.125rem; line-height: 1.7;
}
img { max-width: 100%; height: auto; }
a { color: var(--rouge-fonce); text-underline-offset: .15em; }
a:hover { color: var(--rouge); }
:focus-visible { outline: 3px solid var(--rouge); outline-offset: 2px; }

.evitement { position: absolute; left: -9999px; top: 0; background: var(--encre); color: #fff; padding: .6rem 1rem; z-index: 100; }
.evitement:focus { left: 1rem; }

/* En-tête */
.entete { background: #fff; border-top: 6px solid var(--rouge); position: relative; }
.entete-int { max-width: var(--large); margin: 0 auto; padding: .75rem 1rem 0; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.marque { display: flex; align-items: center; gap: .9rem; text-decoration: none; color: var(--encre); margin-right: auto; }
.marque img { width: 72px; height: auto; }
.marque span { font-family: var(--titre); font-size: 1.05rem; letter-spacing: .02em; color: var(--gris); max-width: 14ch; line-height: 1.25; }
.menu ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem; }
.menu a {
  display: block; padding: .5rem .8rem; font-family: var(--titre); font-size: 1.05rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--encre); text-decoration: none; border-bottom: 3px solid transparent;
}
.menu a:hover { color: var(--rouge); }
.menu a[aria-current] { border-bottom-color: var(--rouge); }
.menu-bouton { display: none; }
.silhouette {
  height: 58px; margin-top: .25rem;
  background: url(/images/bandeau_haut.png) right bottom / auto 58px no-repeat, linear-gradient(#fff, #fff);
  border-bottom: 1px solid var(--trait);
}

@media (max-width: 860px) {
  .menu-bouton {
    display: inline-flex; align-items: center; gap: .5rem; font: 600 1rem var(--ui); background: var(--encre); color: #fff;
    border: 0; border-radius: 4px; padding: .55rem .9rem; cursor: pointer;
  }
  .menu-bouton::before { content: ""; width: 18px; height: 2px; background: currentColor; box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor; }
  .menu { display: none; width: 100%; }
  .menu.ouvert { display: block; }
  .menu ul { flex-direction: column; padding: .5rem 0; }
  .menu a { border-bottom: 1px solid var(--trait); border-left: 3px solid transparent; }
  .menu a[aria-current] { border-bottom-color: var(--trait); border-left-color: var(--rouge); }
  .marque img { width: 56px; }
  .silhouette { height: 40px; background-size: auto 40px, auto; }
}

/* Mise en page */
main { display: block; }
.mise-en-page { max-width: var(--large); margin: 0 auto; padding: 2rem 1rem 3rem; display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 3rem; align-items: start; }
@media (max-width: 960px) { .mise-en-page { grid-template-columns: minmax(0, 1fr); gap: 2rem; } }
.contenu { min-width: 0; max-width: 760px; }
.fil { font: .85rem var(--ui); color: var(--gris); margin: 0 0 1rem; }
.fil a { color: var(--gris); }
.surtitre { font-family: var(--titre); text-transform: uppercase; letter-spacing: .12em; color: var(--rouge); font-size: .95rem; margin: 0 0 .25rem; }
h1, h2, h3 { font-family: var(--titre); color: var(--encre); line-height: 1.15; font-weight: 700; }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); margin: 0 0 1.5rem; letter-spacing: -.01em; }
.contenu h2 { font-size: 1.6rem; margin: 2.5rem 0 .75rem; padding-top: .25rem; }
.contenu h3 { font-size: 1.25rem; margin: 2rem 0 .5rem; color: var(--rouge-fonce); }
.contenu .sous-titre { font: italic 1.15rem var(--corps); color: var(--gris); margin: -.4rem 0 1.25rem; }
.contenu b, .contenu strong { color: var(--encre); }
.contenu > :first-child { margin-top: 0; }
.bloc > :first-child, .cellule > :first-child, .bloc > div > :first-child { margin-top: 0; }
.contenu h1 + .bloc { margin-top: 0; }

/* Blocs issus des anciens tableaux */
.bloc { margin: 1rem 0; }
.rang { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: flex-start; margin: .75rem 0; }
.cellule { flex: 1 1 220px; min-width: 0; }
.cellule:has(> img:only-child), .cellule:has(> a:only-child > img) { flex: 0 1 auto; }

/* Bouton carte */
.btn-carte {
  display: inline-flex; align-items: center; gap: .4rem; font: 600 .85rem var(--ui); text-decoration: none;
  border: 1px solid var(--trait); background: #fff; padding: .35rem .75rem; border-radius: 999px; color: var(--encre);
}
.btn-carte::before { content: ""; width: 14px; height: 14px; background: var(--rouge); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 3 3 5v16l6-2 6 2 6-2V3l-6 2-6-2Zm0 2.2 6 2v13.6l-6-2V5.2Z'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 3 3 5v16l6-2 6 2 6-2V3l-6 2-6-2Zm0 2.2 6 2v13.6l-6-2V5.2Z'/%3E%3C/svg%3E") center/contain no-repeat; }
.btn-carte:hover { border-color: var(--rouge); }

/* Miniature de carte dans les blocs de date */
.carte-mini {
  display: block; width: 200px; max-width: 100%; text-decoration: none; color: var(--encre);
  background: #fff; border: 1px solid var(--trait); border-radius: 6px; overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,.05); transition: box-shadow .2s, transform .2s;
}
.carte-mini img { display: block; width: 100%; height: 150px; object-fit: cover; }
.carte-mini-label {
  display: flex; align-items: center; gap: .4rem; padding: .45rem .7rem; font: 600 .8rem var(--ui);
  border-top: 1px solid var(--trait);
}
.carte-mini-label::before { content: ""; width: 13px; height: 13px; flex: none; background: var(--rouge); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 3 3 5v16l6-2 6 2 6-2V3l-6 2-6-2Zm0 2.2 6 2v13.6l-6-2V5.2Z'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 3 3 5v16l6-2 6 2 6-2V3l-6 2-6-2Zm0 2.2 6 2v13.6l-6-2V5.2Z'/%3E%3C/svg%3E") center/contain no-repeat; }
.carte-mini:hover { box-shadow: 0 8px 24px rgba(0,0,0,.12); transform: translateY(-2px); }
.carte-mini:hover .carte-mini-label { color: var(--rouge); }
.cellule:has(> .carte-mini) { flex: 0 0 200px; }
@media (max-width: 560px) {
  .cellule:has(> .carte-mini) { flex: 1 1 100%; order: -1; }
  .carte-mini { width: 100%; }
  .carte-mini img { height: 170px; }
}

/* Galeries */
.galerie { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; margin: 1.25rem 0 2rem; }
.galerie a { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 3px; background: var(--sable); }
.galerie img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.galerie a:hover img { transform: scale(1.06); }
@media (max-width: 480px) { .galerie { grid-template-columns: repeat(3, 1fr); gap: 4px; } }
.contenu a > img { vertical-align: middle; }

/* Diaporama */
.diaporama { position: relative; margin: 2rem 0; background: var(--encre); border-radius: 6px; overflow: hidden; }
.diapo-piste { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; scroll-behavior: smooth; }
.diapo-piste::-webkit-scrollbar { display: none; }
.diapo { flex: 0 0 100%; margin: 0; scroll-snap-align: start; position: relative; }
.diapo img { display: block; width: 100%; height: auto; aspect-ratio: auto; max-height: 520px; object-fit: cover; }
.diapo figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 2.5rem 1rem .8rem; color: #fff; font: .95rem/1.4 var(--ui); background: linear-gradient(transparent, rgba(0,0,0,.75)); }
.diapo-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); color: var(--encre); font-size: 1.4rem; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.diapo-nav.prec { left: .6rem; } .diapo-nav.suiv { right: .6rem; }
.diapo-points { position: absolute; top: .6rem; right: .8rem; display: flex; gap: 6px; }
.diapo-points span { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.45); }
.diapo-points span.actif { background: #fff; }

/* Vidéos, cartes, audio */
.video, .carte-embed { position: relative; aspect-ratio: 16 / 9; margin: 1.5rem 0; background: #000; border-radius: 6px; overflow: hidden; }
.carte-embed { aspect-ratio: 16 / 7; background: var(--sable); }
.video iframe, .carte-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
audio { width: 100%; max-width: 420px; margin: .5rem 0; }
.musique { margin: 0 0 2rem; padding: .9rem 1.1rem; background: #fff; border: 1px solid var(--trait); border-left: 4px solid var(--rouge); border-radius: 6px; font-family: var(--ui); }
.musique figcaption { font-size: .95rem; color: var(--texte); }
.musique-label { display: inline-block; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--rouge); margin-right: .4rem; }
.musique audio { display: block; margin-top: .5rem; max-width: 100%; }
.lien-video { display: inline-block; position: relative; }
.lien-video:has(img)::after { content: "▶"; position: absolute; inset: 0; margin: auto; width: 46px; height: 46px; border-radius: 50%; background: rgba(215,20,26,.9); color: #fff; display: grid; place-items: center; font-size: 1.1rem; }
.note { font: italic .95rem var(--ui); color: var(--gris); background: var(--sable); padding: .6rem .9rem; border-radius: 4px; }
img.carte-cliquable { display: block; margin: 1rem 0; }

/* Navigation latérale */
.sous-nav { position: sticky; top: 1rem; font-family: var(--ui); font-size: .95rem; background: #fff; border: 1px solid var(--trait); border-radius: 6px; padding: 1rem 1.1rem; max-height: calc(100vh - 2rem); overflow: auto; }
@media (max-width: 960px) { .sous-nav { position: static; max-height: none; } }
.sous-nav-titre { font-family: var(--titre); text-transform: uppercase; letter-spacing: .08em; font-size: 1.05rem; margin: 0 0 .5rem; color: var(--encre); }
.sous-nav ul { list-style: none; margin: 0 0 .5rem; padding: 0; }
.sous-nav li a { display: block; padding: .3rem .5rem; color: var(--texte); text-decoration: none; border-left: 2px solid transparent; line-height: 1.35; }
.sous-nav li a:hover { color: var(--rouge); }
.sous-nav li a[aria-current] { border-left-color: var(--rouge); color: var(--rouge-fonce); font-weight: 600; background: var(--papier); }
.sous-nav details { border-top: 1px solid var(--trait); padding: .35rem 0; }
.sous-nav summary { cursor: pointer; font-weight: 600; color: var(--encre); padding: .3rem 0; }

/* Précédent / suivant */
.suite { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--trait); font-family: var(--ui); }
.suite a { display: block; padding: .8rem 1rem; border: 1px solid var(--trait); border-radius: 6px; text-decoration: none; color: var(--encre); background: #fff; font-weight: 600; line-height: 1.3; }
.suite a:hover { border-color: var(--rouge); }
.suite span { display: block; font-size: .78rem; font-weight: 400; text-transform: uppercase; letter-spacing: .08em; color: var(--gris); margin-bottom: .2rem; }
.suite .suiv { text-align: right; grid-column: 2; }

/* Accueil */
.accueil-haut { max-width: var(--large); margin: 0 auto; padding: 3rem 1rem 2rem; display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
@media (max-width: 860px) { .accueil-haut { grid-template-columns: 1fr; padding-top: 1.5rem; gap: 1.5rem; } }
.accueil-haut h1 { font-size: clamp(2.3rem, 5.5vw, 3.8rem); margin-bottom: 1rem; }
.chapo { font-size: 1.2rem; color: var(--texte); max-width: 34ch; }
.accueil-diapo { margin: 0; }
.accueil-diapo .diapo img { aspect-ratio: 387 / 336; max-height: none; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.bouton { display: inline-block; font: 600 1rem var(--ui); background: var(--rouge); color: #fff; padding: .75rem 1.2rem; border-radius: 4px; text-decoration: none; }
.bouton:hover { background: var(--rouge-fonce); color: #fff; }
.bouton.secondaire { background: transparent; color: var(--encre); box-shadow: inset 0 0 0 2px var(--encre); }
.bouton.secondaire:hover { color: var(--rouge); box-shadow: inset 0 0 0 2px var(--rouge); }
.bande { max-width: var(--large); margin: 0 auto; padding: 2rem 1rem; }
.bande h2 { font-size: 1.8rem; margin: 0 0 1.25rem; padding-bottom: .5rem; border-bottom: 3px solid var(--rouge); display: inline-block; }
.cartes-regions { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
.cartes-regions a { display: block; background: #fff; border: 1px solid var(--trait); border-radius: 6px; overflow: hidden; text-decoration: none; color: var(--encre); transition: transform .2s, box-shadow .2s; }
.cartes-regions a:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.cartes-regions img { display: block; width: 100%; aspect-ratio: 180 / 186; object-fit: cover; }
.region { display: block; font: 700 1.15rem var(--titre); padding: .7rem .9rem 0; }
.periode { display: block; font: .85rem var(--ui); color: var(--gris); padding: 0 .9rem .8rem; }
.famille { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 1.5rem; }
.famille a { display: flex; flex-direction: column; align-items: center; gap: .5rem; text-decoration: none; color: var(--encre); font: 600 1rem var(--ui); }
.famille img { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--trait); }
.famille a:hover img { box-shadow: 0 0 0 3px var(--rouge); }
.lien-suite { font-family: var(--ui); margin-top: 1.5rem; }
.erreur { max-width: 700px; margin: 0 auto; padding: 5rem 1rem; text-align: center; }

/* Pied de page */
.pied { background: var(--encre); color: #d9d4cc; margin-top: 3rem; font: .95rem/1.6 var(--ui); }
.pied::before { content: ""; display: block; height: 58px; background: var(--papier) url(/images/bandeau_haut.png) left bottom / auto 58px no-repeat; transform: scaleX(-1); }
.pied-int { max-width: var(--large); margin: 0 auto; padding: 1.5rem 1rem 2rem; }
.pied a { color: #fff; }
.pied .petit { font-size: .82rem; color: #a49e95; }

/* Visionneuse */
.visio { position: fixed; inset: 0; z-index: 1000; background: rgba(12,11,10,.94); display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 3.5rem .5rem 1rem; }
.visio[hidden] { display: none; }
.visio-media { max-width: 100%; max-height: calc(100vh - 7rem); display: flex; align-items: center; justify-content: center; }
.visio-media img { max-width: 100%; max-height: calc(100vh - 7rem); width: auto; height: auto; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.visio-media .video { width: min(92vw, 1100px); margin: 0; }
.visio-legende { color: #e8e3da; font: .95rem var(--ui); margin-top: .75rem; text-align: center; min-height: 1.4em; }
.visio button { position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0; width: 48px; height: 48px; border-radius: 50%; font-size: 1.5rem; cursor: pointer; display: grid; place-items: center; }
.visio button:hover { background: rgba(255,255,255,.25); }
.visio .fermer { top: .6rem; right: .6rem; }
.visio .prec { left: .6rem; top: 50%; transform: translateY(-50%); }
.visio .suiv { right: .6rem; top: 50%; transform: translateY(-50%); }
.visio .compteur { position: absolute; top: 1.1rem; left: 1rem; color: #bdb6ab; font: .85rem var(--ui); }
@media (max-width: 600px) { .visio .prec, .visio .suiv { top: auto; bottom: .6rem; transform: none; } }
body.visio-ouverte { overflow: hidden; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
@media print { .entete, .pied, .sous-nav, .suite, .diapo-nav { display: none !important; } body { background: #fff; } }

/* Sélecteur de langue */
.langue {
  font: 700 .8rem var(--ui); letter-spacing: .08em; text-decoration: none; color: var(--encre);
  border: 2px solid var(--encre); border-radius: 4px; padding: .3rem .55rem; line-height: 1;
}
.langue:hover { color: #fff; background: var(--rouge); border-color: var(--rouge); }
@media (max-width: 860px) { .langue { order: 2; } .menu-bouton { order: 3; } .menu { order: 4; } }
@media (max-width: 480px) {
  .marque span { display: none; }
  .entete-int { flex-wrap: nowrap; }
}
