/* 00_references_communes/site.css
   Site web public multi-pages genere par scripts/generate_site.py : copiee
   telle quelle dans chaque personnages/<Nom>/08_web/site.css a chaque run.
   Vulgarisation grand public -- distincte de cv.css (CV documentaire, une
   seule colonne dense) et du gabarit DOCX du livre. */

:root {
  --encre: #201d1a;
  --gris: #6b645c;
  --filet: #ded6c8;
  --fond: #faf7f1;
  --fond-carte: #ffffff;
  --accent: #7a1f1f;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 18px;
  line-height: 1.55;
}

header {
  max-width: 46rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 0;
}

header h1 {
  font-size: 2.1rem;
  margin: 0 0 .2rem;
  letter-spacing: -0.01em;
}

.tagline {
  margin: 0 0 1.4rem;
  color: var(--gris);
  font-style: italic;
}

/* Hors de <header> (et non a l'interieur) : un element sticky reste borne a
   la hauteur de son parent, et <header> est trop court pour laisser au menu
   la place de rester colle au-dela de sa propre hauteur. Ici, parent = body
   (toute la page), donc le menu reste visible sur tout le scroll. */
nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  max-width: 46rem;
  margin: 0 auto;
  padding: .7rem 1.5rem;
  border-top: 1px solid var(--filet);
  border-bottom: 1px solid var(--filet);
  font-family: -apple-system, "Segoe UI", sans-serif;
  font-size: .85rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  background: var(--fond);
  z-index: 10;
}

nav a { color: var(--gris); text-decoration: none; }
nav a:hover { color: var(--accent); }
nav a.actif { color: var(--accent); font-weight: 600; }

main {
  max-width: 46rem;
  margin: 0 auto;
  padding: 2.2rem 1.5rem 4rem;
}

/* Page dont le contenu profite de plus de largeur (carte des lieux) */
main.main-large { max-width: 68rem; }

.portrait { margin: 0 0 2rem; text-align: center; }

.portrait img {
  max-width: 100%;
  max-height: 26rem;
  border-radius: 2px;
}

.portrait figcaption {
  margin-top: .5rem;
  font-size: .8rem;
  color: var(--gris);
  font-family: -apple-system, "Segoe UI", sans-serif;
}

.accroche { font-size: 1.15rem; }

.biographie h2 {
  font-size: 1.3rem;
  color: var(--accent);
  margin: 2.6rem 0 .9rem;
  padding-bottom: .3rem;
  border-bottom: 1px solid var(--filet);
}

.biographie h2:first-child { margin-top: 0; }

p { margin: 0 0 1.1rem; }

a { color: var(--accent); }

/* Chronologie : frise verticale */
ol.chronologie {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--filet);
}

ol.chronologie li {
  position: relative;
  padding: 0 0 1.6rem 1.6rem;
}

ol.chronologie li::before {
  content: "";
  position: absolute;
  left: -6px;
  top: .35rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

ol.chronologie time {
  display: block;
  font-family: -apple-system, "Segoe UI", sans-serif;
  font-size: .8rem;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--gris);
  margin-bottom: .15rem;
}

/* Galerie : disposition en colonnes façon "mur de photos" -- chaque image
   garde sa hauteur naturelle (jamais rognée), portrait ou paysage. */
.galerie {
  columns: 3 17rem;
  column-gap: 1.6rem;
}

.galerie figure {
  margin: 0 0 1.6rem;
  break-inside: avoid;
  background: var(--fond-carte);
  border: 1px solid var(--filet);
  padding: .6rem;
}

.galerie img {
  width: 100%;
  height: auto;
  display: block;
  cursor: zoom-in;
}

.galerie figcaption {
  margin-top: .6rem;
  font-size: .85rem;
  font-family: -apple-system, "Segoe UI", sans-serif;
}

.galerie figcaption small { color: var(--gris); }

/* Loupe : agrandissement au clic (site.js) */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(16, 13, 11, .92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  z-index: 100;
}

/* Meme specificite que .lightbox { display:flex } ci-dessus : sans cette
   regle, l'attribut [hidden] pose par site.js est ignore et la lightbox
   reste affichee en permanence. */
.lightbox[hidden] { display: none; }

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, .5);
}

.lightbox-fermer {
  position: absolute;
  top: .8rem;
  right: 1rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
  padding: .3rem .7rem;
  font-family: -apple-system, "Segoe UI", sans-serif;
}

body.lightbox-ouvert { overflow: hidden; }

/* Carte des lieux : iframe vers 08_web/carte_lieux.html (annexe lieux_carte.py) */
.lieux-carte-frame {
  width: 100%;
  height: 78vh;
  min-height: 28rem;
  border: 1px solid var(--filet);
  display: block;
}

footer {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 3rem;
  border-top: 1px solid var(--filet);
  font-family: -apple-system, "Segoe UI", sans-serif;
  font-size: .78rem;
  color: var(--gris);
}

@media (max-width: 30rem) {
  body { font-size: 16.5px; }
  header, nav, main, footer { padding-left: 1.1rem; padding-right: 1.1rem; }
}
