/* Design system EDIPO Archéo — les valeurs de base. FIGÉ : ne se modifie que sur demande explicite.

   Palette tirée du logo : bordeaux #5B0F1A et or #C9A25A (docs/charte/logo-planche-originale.png).

   Règles de contraste, mesurées :
   - bordeaux sur ivoire : environ 13:1, à utiliser pour les titres, liens et boutons ;
   - or sur bordeaux : 5,8:1, à utiliser pour les boutons et accents sur fond bordeaux ;
   - l'or sur fond clair ne fait que 2,1:1 : il ne porte donc JAMAIS de texte sur fond clair,
     seulement des filets, des bordures et des décors. Pour un texte d'accent sur fond clair
     (dates, fonctions), on prend --or-texte, une variante sombre de l'or (5,4:1). */
:root {
  --bordeaux: #5B0F1A;
  --bordeaux-clair: #7A1B29;   /* survol des boutons */
  --or: #C9A25A;
  --or-texte: #7A5C1E;
  --ivoire: #F8F4EC;
  --sable: #EDE5D3;
  --anthracite: #2A2323;
  --blanc: #FFFFFF;

  /* Polices du système : aucune requête vers un service extérieur, donc rien à déclarer sur la vie privée. */
  --police-titre: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --police-texte: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --e1: .5rem;
  --e2: 1rem;
  --e3: 1.5rem;
  --e4: 2.5rem;
  --e5: 4rem;
  --largeur: 1120px;
  --largeur-texte: 44rem;
  --rayon: 4px;
}

/* Design system EDIPO Archéo — socle commun : typographie, mise en page, en-tête, pied, boutons. FIGÉ. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--ivoire); color: var(--anthracite); font: 1.0625rem/1.65 var(--police-texte); }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--police-titre); font-weight: 600; line-height: 1.2; color: var(--bordeaux); margin: 0 0 var(--e2); }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.25rem); }
h3 { font-size: 1.25rem; }
p, ul { margin: 0 0 var(--e2); }
a { color: var(--bordeaux); text-underline-offset: .15em; }
a:hover { color: var(--or-texte); }
:focus-visible { outline: 3px solid var(--or); outline-offset: 3px; }
.container { width: min(100% - 2rem, var(--largeur)); margin-inline: auto; }

.lien-evitement { position: absolute; left: -999px; top: 0; background: var(--blanc); padding: var(--e1) var(--e2); z-index: 10; }
.lien-evitement:focus { left: var(--e2); top: var(--e1); }

/* en-tête et navigation (menu repliable sur mobile, sans JavaScript) */
/* fond blanc : le logo est livré sur fond blanc, pas transparent */
.entete-site { background: var(--blanc); border-bottom: 3px solid var(--or); position: sticky; top: 0; z-index: 5; }
.logo { height: 60px; width: auto; }
.barre { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--e1) var(--e3); padding-block: var(--e2); }
.nom-site { font-family: var(--police-titre); font-size: 1.4rem; font-weight: 700; color: var(--bordeaux); text-decoration: none; }
.nav ul { display: flex; flex-wrap: wrap; gap: var(--e1) var(--e3); list-style: none; margin: 0; padding: 0; }
.nav a { color: var(--anthracite); text-decoration: none; padding-block: .25rem; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--or); color: var(--bordeaux); }
/* page mise en avant dans le menu : même bouton que les appels à l'action */
.nav a.nav-cta { background: var(--bordeaux); color: var(--ivoire); font-weight: 600; padding: .5rem 1.2rem; border: 2px solid var(--bordeaux); border-radius: var(--rayon); }
.nav a.nav-cta:hover, .nav a.nav-cta[aria-current="page"] { background: var(--bordeaux-clair); border-color: var(--bordeaux-clair); color: var(--blanc); }
.menu-case { position: absolute; opacity: 0; pointer-events: none; }
.menu-bouton { display: none; cursor: pointer; border: 1px solid var(--bordeaux); border-radius: var(--rayon); padding: .35rem .9rem; color: var(--bordeaux); }
.menu-case:focus-visible + .menu-bouton { outline: 3px solid var(--or); outline-offset: 3px; }
@media (max-width: 760px) {
  .menu-bouton { display: block; }
  .nav { display: none; width: 100%; }
  .menu-case:checked ~ .nav { display: block; }
  /* menu ouvert : les entrées sont alignées à droite, plus espacées (cibles de toucher plus grandes) */
  .nav ul { flex-direction: column; align-items: flex-end; gap: 1.1rem; padding-block: var(--e2) var(--e1); }
  .nav a { display: inline-block; padding-block: .45rem; text-align: right; font-size: 1.1rem; }
}

/* boutons */
.boutons { display: flex; flex-wrap: wrap; gap: var(--e2); margin-top: var(--e3); }
.bouton { display: inline-block; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; border: 2px solid var(--bordeaux); border-radius: var(--rayon); padding: .7rem 1.4rem; }
.bouton-principal { background: var(--bordeaux); color: var(--ivoire); }
.bouton-principal:hover { background: var(--bordeaux-clair); border-color: var(--bordeaux-clair); color: var(--blanc); }
.bouton-secondaire { background: transparent; border-color: currentColor; color: var(--bordeaux); }
.bouton-secondaire:hover { background: var(--bordeaux); border-color: var(--bordeaux); color: var(--ivoire); }

/* CTA secondaire en lien souligné : pour les choix de second plan (ancres d'une page, « en savoir plus ») */
.bouton-lien { background: none; border: 0; border-radius: 0; padding: .25rem 0; color: var(--bordeaux); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .25em; }
.bouton-lien:hover { background: none; color: var(--or-texte); }
.boutons:has(.bouton-lien) { gap: var(--e1) var(--e4); }

/* sur la photo du bandeau : le bouton principal passe à l'or (5,8:1 sur bordeaux), le secondaire en clair */
.m-bandeau .bouton-principal { background: var(--or); border-color: var(--or); color: var(--bordeaux); }
.m-bandeau .bouton-principal:hover { background: var(--ivoire); border-color: var(--ivoire); color: var(--bordeaux); }
.m-bandeau .bouton-secondaire { color: var(--ivoire); }
.m-bandeau .bouton-secondaire:hover { background: var(--ivoire); border-color: var(--ivoire); color: var(--bordeaux); }

/* pied de page */
.pied-site { background: var(--bordeaux); color: var(--ivoire); padding-block: var(--e4) var(--e2); font-size: .95rem; }
.pied-site a { color: var(--ivoire); }
.pied-grille { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--e3); }
.pied-grille ul { list-style: none; padding: 0; margin: 0; }
.pied-nom { font-family: var(--police-titre); font-size: 1.3rem; margin-bottom: .25rem; }
.pied-copy { margin-top: var(--e3); padding-top: var(--e2); border-top: 1px solid rgba(248, 244, 236, .25); }
@media (max-width: 760px) { .pied-grille { grid-template-columns: 1fr; } }

/* ce qui reste à compléter : volontairement criard, pour ne pas partir en ligne */
mark.a-completer { background: #FFE08A; color: #4a3300; padding: 0 .25em; border-radius: 2px; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.lien-bouton { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }

/* bandeau de consentement : en bas de l'écran, « Autoriser » et « Refuser » ont le même poids visuel */
.consentement { position: fixed; left: var(--e2); right: var(--e2); bottom: var(--e2); z-index: 20; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--e2) var(--e3); max-width: 60rem; margin-inline: auto; padding: var(--e2) var(--e3); background: var(--blanc); border-top: 4px solid var(--or); border-radius: var(--rayon); box-shadow: 0 10px 40px rgba(42, 20, 22, .3); }
.consentement[hidden] { display: none; }
.consentement p { margin: 0; flex: 1 1 24rem; font-size: .95rem; }
.consentement .boutons { margin: 0; flex: 0 0 auto; }

/* Design system EDIPO Archéo — le style de chaque module. FIGÉ. Un bloc par module de modules.py. */
.module { padding-block: var(--e5); }
/* Alternance de fond FIGÉE : par son rang dans la page, un module est sable (rang impair) ou ivoire (rang pair).
   Le contenu ne choisit jamais la couleur : deux modules voisins ne peuvent donc pas avoir le même fond.
   Seuls deux modules échappent à la règle, et ils sont uniques dans leur genre : le bandeau d'ouverture
   (photo sur bordeaux) et l'appel à l'action (or). Un appel ne peut pas en suivre un autre (voir modules.py). */
main > .module:nth-child(odd) { background: var(--sable); }
main > .module:nth-child(even) { background: var(--ivoire); }
main > .module.m-bandeau { background: var(--bordeaux); }
main > .module.m-appel { background: var(--or); }
.prose { max-width: var(--largeur-texte); }
.prose.intro { margin-bottom: var(--e3); }
.prose ul { padding-left: 1.2rem; }

/* images */
.img-vide { display: grid; place-items: center; aspect-ratio: 4 / 3; width: 100%; background: var(--sable); border: 2px dashed var(--or); color: var(--or-texte); font-size: .95rem; }
.credit, figcaption { font-size: .85rem; color: inherit; opacity: .8; }
figure { margin: 0; }
figcaption { margin-top: .4rem; }

/* entete_page */
.m-entete { padding-block: var(--e4); border-bottom: 3px solid var(--or); }
.m-entete .chapo { max-width: var(--largeur-texte); font-size: 1.2rem; }
.m-entete h1 { margin-bottom: var(--e1); }

/* bandeau_photo */
.m-bandeau { position: relative; display: flex; align-items: flex-end; min-height: min(78vh, 640px); padding: 0; background: var(--bordeaux); color: var(--blanc); overflow: hidden; }
.bandeau-image { position: absolute; inset: 0; }
.bandeau-image img, .bandeau-image .img-vide { width: 100%; height: 100%; object-fit: cover; aspect-ratio: auto; border: 0; background: var(--bordeaux); color: rgba(248, 244, 236, .6); }
.m-bandeau::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(42, 20, 22, .82) 0%, rgba(42, 20, 22, .5) 50%, rgba(42, 20, 22, .08) 100%); }
.bandeau-texte { position: relative; z-index: 1; padding-block: var(--e4); }
/* le texte reste dans la moitié gauche du bandeau : il ne part pas vers la droite sur grand écran */
.m-bandeau .bandeau-texte > * { max-width: 38rem; }
.m-bandeau h1 { color: var(--blanc); margin-bottom: var(--e2); }
/* Sur photo, tout le texte est blanc ou ivoire, jamais or : l'or (2,1:1 sur clair) se perd dans une photo. */
.m-bandeau .accroche { font-family: var(--police-titre); font-size: clamp(1.5rem, 5vw, 2.5rem); line-height: 1.25; color: var(--blanc); margin-bottom: var(--e2); }
.m-bandeau h1, .m-bandeau .accroche, .m-bandeau .chapo { text-shadow: 0 1px 8px rgba(42, 20, 22, .65); }
.m-bandeau .chapo { font-size: 1.15rem; }
.m-bandeau .credit { display: block; margin-top: var(--e2); }

/* texte_image et bloc_contact */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: var(--e4); align-items: center; }
.duo-droite .duo-image { order: 2; }
.duo-image img, .duo-image .img-vide { border-radius: var(--rayon); aspect-ratio: 16 / 9; width: 100%; object-fit: cover; }
@media (max-width: 760px) { .duo { grid-template-columns: 1fr; gap: var(--e3); } .duo-droite .duo-image { order: 0; } }

/* deux/trois/quatre_colonnes, cartes_evenements, cartes_actualites */
.grille { display: grid; gap: var(--e3); }
.grille-2 { grid-template-columns: repeat(2, 1fr); }
.grille-3 { grid-template-columns: repeat(3, 1fr); }
.grille-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .grille-3, .grille-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grille-2, .grille-3, .grille-4 { grid-template-columns: 1fr; } }
.carte { background: var(--blanc); border: 1px solid var(--sable); border-radius: var(--rayon); overflow: hidden; display: flex; flex-direction: column; }
main > .module:nth-child(odd) .carte { border-color: transparent; }
.carte-image img, .carte-image .img-vide { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.carte-corps { padding: var(--e3); }
.carte .date { color: var(--or-texte); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: .85rem; margin-bottom: .4rem; }
.carte .meta { font-size: .95rem; opacity: .85; }
.lien-suite { font-weight: 600; }
.lien-suite::after { content: " →"; }

/* image_pleine, galerie */
.m-image-pleine { padding-block: var(--e4); }
.m-image-pleine img, .m-image-pleine .img-vide { width: 100%; max-height: 560px; object-fit: cover; border-radius: var(--rayon); }
.grille-galerie { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: var(--e2); }
.grille-galerie img, .grille-galerie .img-vide { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--rayon); }

/* appel_action */
/* appel_action : bordeaux sur or, 5,8:1 */
.m-appel { color: var(--bordeaux); text-align: center; }
.m-appel .prose { margin-inline: auto; }
.m-appel .boutons { justify-content: center; }

/* encadre */
.m-encadre { padding-block: var(--e3); }
.encadre { max-width: var(--largeur-texte); padding: var(--e3); border-left: 5px solid var(--bordeaux); background: var(--blanc); border-radius: var(--rayon); }
.encadre-prudence { border-left-color: var(--or); }
.encadre :last-child { margin-bottom: 0; }

/* fiche_chantier */
.chantier { display: grid; grid-template-columns: 3fr 2fr; gap: var(--e4); align-items: start; }
.chantier-faits { display: grid; gap: var(--e2); }
.chantier-faits dl { margin: 0; padding: var(--e3); background: var(--blanc); border-radius: var(--rayon); }
.chantier-faits dl div + div { margin-top: .75rem; }
.chantier-faits dt { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--or-texte); }
.chantier-faits dd { margin: 0; }
.chantier-faits img, .chantier-faits .img-vide { width: 100%; border-radius: var(--rayon); }
@media (max-width: 860px) { .chantier { grid-template-columns: 1fr; } }

/* liste_personnes : médaillons, en grille ou en carrousel */
.m-personnes h2, .m-logos h2 { text-align: center; }
/* centré : une rangée incomplète reste au milieu au lieu de coller à gauche */
.grille-personnes { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--e4) var(--e3); }
.grille-personnes .personne { width: 14rem; }
.personne { text-align: center; }
.personne-photo { width: min(9rem, 70%); margin: 0 auto var(--e2); }
.personne-photo img, .personne-photo .img-vide { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 50%; border: 3px solid var(--or); padding: 4px; background: var(--blanc); }
.personne h3 { margin-bottom: 0; }
.personne .role { color: var(--or-texte); font-weight: 600; margin-bottom: .4rem; }
.carrousel { position: relative; }
.carrousel-piste { list-style: none; margin: 0; display: flex; gap: var(--e3); overflow-x: auto; scroll-snap-type: x mandatory; padding: var(--e1) var(--e1) var(--e2); }
.carrousel-piste .personne { flex: 0 0 min(14rem, 72%); scroll-snap-align: center; }
/* marges automatiques aux deux bouts : le carrousel est centré s'il tient dans la largeur, et défile normalement sinon (un simple « justify-content: center » couperait le premier élément) */
.carrousel-piste .personne:first-child { margin-left: auto; }
.carrousel-piste .personne:last-child { margin-right: auto; }
.carrousel-fleche { position: absolute; top: 4.5rem; z-index: 1; width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 0; background: var(--bordeaux); color: var(--ivoire); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.carrousel-fleche:hover { background: var(--bordeaux-clair); }
.carrousel-prec { left: -.5rem; }
.carrousel-suiv { right: -.5rem; }
.carrousel[data-sans-debordement] .carrousel-fleche { display: none; }
@media (max-width: 760px) { .carrousel-prec { left: 0; } .carrousel-suiv { right: 0; } }

/* logos : le logo, avec le nom du partenaire dessous */
.rangee-logos { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--e3) var(--e4); }
.rangee-logos li { width: 11rem; }
.logo-bloc { display: flex; flex-direction: column; align-items: center; gap: var(--e1); text-align: center; text-decoration: none; color: var(--anthracite); }
/* hauteur fixe : les logos (PNG ou SVG) ont des proportions très différentes ; « contain » ne déforme jamais */
.logo-bloc img { height: 64px; width: auto; max-width: 100%; object-fit: contain; }
.logo-bloc .img-vide { width: 100%; aspect-ratio: 2 / 1; }
.logo-nom { font-size: .9rem; font-weight: 600; line-height: 1.3; }
a.logo-bloc:hover .logo-nom { text-decoration: underline; }

/* fiche_campagne : l'année en grand, au-dessus du titre ; la mise en page est celle de fiche_chantier */
.campagne-annee { font-family: var(--police-titre); font-size: clamp(2.5rem, 7vw, 4rem); line-height: 1; color: var(--or-texte); margin: 0 0 var(--e1); }

/* liste_documents */
.liste-documents { list-style: none; padding: 0; max-width: var(--largeur-texte); }
.liste-documents li { padding-block: .75rem; border-bottom: 1px solid rgba(91, 15, 26, .18); }
.doc-taille { opacity: .7; font-size: .9rem; }
.doc-desc { display: block; font-size: .95rem; opacity: .85; }

/* bloc_contact et formulaire */
.coordonnees { list-style: none; padding: 0; }
.coordonnees li { margin-bottom: .4rem; }
.formulaire { display: grid; gap: var(--e2); }
.formulaire label { display: grid; gap: .3rem; font-weight: 600; }
.formulaire input:not([type="checkbox"]), .formulaire textarea { font: inherit; padding: .7rem .8rem; border: 1px solid #8b867a; border-radius: var(--rayon); background: var(--blanc); width: 100%; }
.formulaire .case { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; font-size: .95rem; }
.formulaire .case input { margin-top: .3rem; }
.formulaire .piege { position: absolute; left: -9999px; }
.formulaire .bouton { justify-self: start; }
.retour-formulaire { padding: var(--e2); background: var(--blanc); border-left: 5px solid var(--or); border-radius: var(--rayon); margin: 0; }


/* revue_de_presse */
.revue { list-style: none; padding: 0; display: grid; gap: var(--e3); max-width: 60rem; }
.revue-item { background: var(--blanc); border-left: 5px solid var(--or); border-radius: var(--rayon); padding: var(--e3); }
.revue-meta { font-size: .9rem; font-weight: 600; color: var(--or-texte); margin-bottom: .4rem; }
.revue-nature { text-transform: uppercase; letter-spacing: .05em; margin-right: .6rem; }
.revue-item h3 { margin-bottom: var(--e1); }

/* widget_helloasso : le formulaire d'un service extérieur, dans une carte qui ressort (ombre, filet or) */
.widget-duo { display: grid; grid-template-columns: 1fr 1.25fr; gap: var(--e4); align-items: start; }
.widget-carte { background: var(--blanc); border-top: 4px solid var(--or); border-radius: var(--rayon); box-shadow: 0 8px 28px rgba(91, 15, 26, .14); padding: var(--e2); }
.widget-helloasso { display: block; width: 100%; height: 750px; border: 0; }
.widget-vide { margin: 0; padding: var(--e4) var(--e3); text-align: center; border: 2px dashed var(--or); border-radius: var(--rayon); }
.widget-seul { max-width: 52rem; margin-inline: auto; }
.widget-attente { padding: var(--e4) var(--e2); text-align: center; }
.widget-attente p { max-width: 28rem; margin-inline: auto; }
/* selon le choix du visiteur : le message qui lui correspond (« indécis » sans JavaScript) */
.widget-attente [data-si] { display: none; }
.widget-zone[data-etat="indecis"] [data-si="indecis"], .widget-zone[data-etat="refuse"] [data-si="refuse"] { display: block; }
/* la case à cocher du formulaire de contact : la phrase reste d'un seul bloc */
.formulaire .case span { flex: 1; }
.widget-seul h2 { text-align: center; }
@media (max-width: 860px) { .widget-duo { grid-template-columns: 1fr; gap: var(--e3); } }

/* un lien « page#ancre » ne doit pas arriver sous l'en-tête fixe */
.module[id] { scroll-margin-top: 6.5rem; }

/* bloc_contact sans coordonnées : le formulaire seul, à la largeur du texte */
.formulaire-seul { max-width: 40rem; margin-inline: auto; }
