/* ==================================================================
   nhoso.com — feuille de style commune à toutes les pages
   ------------------------------------------------------------------
   1. Réglages (couleurs, tailles)      7. Pages galerie / projet
   2. Base                              8. Listes (portfolio, projets)
   3. En-tête et menu                   9. À propos
   4. Onglet vertical et pied de page  10. Contact et formulaire
   5. Éléments communs (titres…)       11. Visionneuse (plein écran)
   6. Accueil (diaporama)              12. Mobile
   ================================================================== */

/* ---------- 1. Réglages ---------- */
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url(../polices/jost-latin.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: 'Jost';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url(../polices/jost-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --encre: #1f1f1f;          /* texte principal */
  --texte: #5c5c5c;          /* texte courant */
  --discret: #9a9a9a;        /* légendes, infos */
  --sombre: #292929;         /* panneaux foncés, onglet */
  --fond: #f9f9f9;           /* fond de page */
  --blanc: #ffffff;
  --trait: #ececec;          /* filets, bordures */
  --accent: #f44336;         /* rouge du logo */

  --police: 'Jost', 'Helvetica Neue', Arial, sans-serif;
  --police-italique: Georgia, 'Times New Roman', Times, serif;

  --entete: 70px;            /* hauteur de l'en-tête */
  --pied: 50px;              /* hauteur du pied de page */
  --marge: 50px;             /* marges gauche/droite du cadre */
  --hauteur-cadre: calc(100vh - var(--entete) - var(--pied));
  --fiche: 350px;            /* largeur du panneau de texte des galeries */
  --ecart: 10px;             /* espace entre les photos */
}
@supports (height: 100dvh) {
  :root { --hauteur-cadre: calc(100dvh - var(--entete) - var(--pied)); }
}

/* ---------- 2. Base ---------- */
/* Langues : les textes lang="en" / lang="fr" ne s'affichent que dans leur langue */
html:not([data-langue="fr"]) body [lang="fr"]:not(.langues button),
html[data-langue="fr"] body [lang="en"]:not(.langues button) { display: none !important; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font: 400 15px/1.75 var(--police);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1.1em; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; line-height: 1.2; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: #fff; }

.visuellement-cache {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.lien-evitement {
  position: fixed; top: 8px; left: 8px; z-index: 2000;
  padding: 10px 16px; background: var(--sombre); color: #fff;
  font-size: 12px; text-transform: uppercase; letter-spacing: 1px;
  transform: translateY(-200%); transition: transform .2s;
}
.lien-evitement:focus { transform: none; }

/* Le cadre : l'espace entre l'en-tête, le pied de page et les marges */
main.cadre {
  min-height: 100vh;
  padding: var(--entete) var(--marge) var(--pied);
  animation: apparition .6s ease both;
}
main.cadre > * + * { margin-top: 30px; }
main.cadre > .visuellement-cache + * { margin-top: 0; }
.plein { height: var(--hauteur-cadre); min-height: 420px; }

@keyframes apparition { from { opacity: 0; } to { opacity: 1; } }

/* ---------- 3. En-tête et menu ---------- */
.entete {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--entete);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--marge);
  background: var(--blanc);
}
.entete .logo img { height: 44px; width: auto; }
.entete { justify-content: flex-start; }
.menu { margin-left: auto; }
.menu ul { display: flex; margin: 0; padding: 0; list-style: none; }
.menu a {
  position: relative; z-index: 0; display: block; padding: 10px 22px;
  font-size: 11px; line-height: 1; letter-spacing: 1px; text-transform: uppercase; color: #666;
  transition: color .1s linear;
}
.menu a:hover { color: #ccc; }
.menu a.actif { color: #fff; }
.menu a.actif::before {
  content: ''; position: absolute; left: 0; bottom: 0; z-index: -1;
  width: 100%; height: 100%; background: var(--sombre); transition: height .2s linear;
}
.menu a.actif:hover { color: #000; }
.menu a.actif:hover::before { height: 0; }

.langues { display: flex; align-items: center; margin-left: 18px; padding-left: 14px; border-left: 1px solid var(--trait); }
.langues button {
  padding: 6px 6px; border: 0; background: none;
  font-size: 11px; letter-spacing: 1.2px; color: var(--discret);
  transition: color .25s;
}
.langues button + button::before { content: '/'; margin-right: 6px; color: var(--trait); }
.langues button:hover { color: var(--encre); }
.langues button[aria-pressed="true"] { color: var(--encre); font-weight: 500; }

.burger {
  display: none;
  width: 44px; height: 44px; margin-right: -10px;
  border: 0; background: none; position: relative;
}
.burger span, .burger::before, .burger::after {
  content: ''; position: absolute; left: 11px; width: 22px; height: 1.5px;
  background: var(--encre); transition: transform .3s, opacity .3s;
}
.burger::before { top: 15px; }
.burger span { top: 21px; }
.burger::after { top: 27px; }
.menu-ouvert .burger::before { transform: translateY(6px) rotate(45deg); }
.menu-ouvert .burger span { opacity: 0; }
.menu-ouvert .burger::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- 4. Onglet vertical et pied de page ---------- */
.onglet {
  position: fixed; left: 0; top: 50%; z-index: 90; isolation: isolate;
  width: var(--marge); height: 220px; margin-top: -110px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; cursor: default;
}
.onglet::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: var(--sombre); transform-origin: top; transition: transform .2s linear;
}
.onglet:hover::before { transform: scaleY(0); }
.onglet > span {
  transform: rotate(-90deg); white-space: nowrap;
  font-size: 12px; letter-spacing: .17em; text-transform: uppercase;
  transition: color .2s linear;
}
.onglet:hover > span { color: #000; }

.pied {
  position: fixed; inset: auto 0 0 0; z-index: 100;
  height: var(--pied);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 0 var(--marge);
  background: var(--blanc);
  font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--texte);
}
.pied-infos { display: flex; align-items: center; min-width: 0; color: #666; }
.pied-infos ul { position: relative; display: flex; margin: 0 0 0 10px; padding: 0 0 0 20px; list-style: none; }
.pied-infos ul::before { content: ''; position: absolute; top: 50%; left: -2px; width: 2px; height: 20px; margin-top: -10px; background: #eee; }
.pied-infos li { position: relative; padding-left: 40px; }
.pied-infos li::before {
  content: ''; position: absolute; top: 50%; left: 0; width: 30px; height: 3px; margin-top: -2px;
  background: #000; transition: width .3s linear;
}
.pied-infos li:hover::before { width: 100%; }
.pied-infos li > * { padding: 0 10px; }
.pied-infos li a:hover { text-decoration: line-through; }
.pied-infos * { white-space: nowrap; }
/* Écran moyen : on retire la ville du pied de page pour tout garder sur une ligne */
@media (min-width: 1024px) and (max-width: 1279px) { .pied .pied-lieu { display: none; } }
.pied-liens a:hover { color: var(--accent); }
.pied-liens { display: flex; align-items: center; gap: 10px; }
.reseau, .haut-de-page {
  width: 26px; height: 26px; border-radius: 50%; border: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--sombre); color: #fff; transition: background-color .25s;
}
.reseau:hover, .haut-de-page:hover { background: var(--accent); }
.reseau svg, .haut-de-page svg { width: 12px; height: 12px; }

/* ---------- 5. Éléments communs ---------- */
.sous-titre {
  font-family: var(--police-italique); font-style: italic;
  font-size: 16px; line-height: 1.5;
}
.trait { display: block; width: 70px; height: 4px; margin: 18px 0 26px; background: var(--accent); }
.centre .trait, .trait.centre { margin-left: auto; margin-right: auto; }
.vague {
  display: block; width: 26px; height: 7px; margin: 14px auto;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 7'%3E%3Cpath d='M1 5.5 4 1.5l3 4 3-4 3 4 3-4 3 4 3-4 3 4' fill='none' stroke='%23000' stroke-width='1.4'/%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 26 7'%3E%3Cpath d='M1 5.5 4 1.5l3 4 3-4 3 4 3-4 3 4 3-4 3 4' fill='none' stroke='%23000' stroke-width='1.4'/%3E%3C/svg%3E") center / contain no-repeat;
}
.titre-section { text-align: center; padding: 80px 20px 50px; }
.titre-section h1, .titre-section h2 { font-size: 44px; font-weight: 300; }
.titre-section .sous-titre { color: var(--texte); max-width: 560px; margin: 0 auto; }

.bouton {
  display: inline-block; padding: 14px 35px 13px; line-height: 1;
  border: 2px solid currentColor; background: transparent;
  font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
  transition: background-color .3s, color .3s, border-color .3s;
}
.bouton:hover { background: var(--sombre); border-color: var(--sombre); color: #fff; }
.bouton-clair { color: #fff; border-color: rgba(255,255,255,.55); }
.bouton-clair:hover { background: #fff; border-color: #fff; color: var(--encre); }
.bouton-plein { background: var(--sombre); border-color: var(--sombre); color: #fff; }
.bouton-plein:hover { background: var(--accent); border-color: var(--accent); }

/* ---------- 6. Accueil : diaporama ---------- */
.diaporama { position: relative; color: #fff; }
.diapos { position: absolute; inset: 0; overflow: hidden; background: var(--sombre); }
.diapo {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 0 40px;
  opacity: 0; visibility: hidden; transition: opacity 1.2s ease, visibility 0s 1.2s;
}
.diapo.actif { opacity: 1; visibility: visible; transition: opacity 1.2s ease; z-index: 1; }
.diapo > img {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; max-width: none; object-fit: cover;
}
.diapo.actif > img { animation: zoom-lent 9s ease-out both; }
.diapo::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: rgba(0,0,0,.3);
}
.diapo .sous-titre, .diapo h2, .diapo .vague, .diapo .bouton {
  opacity: 0; transform: translateY(18px); transition: opacity .8s, transform .8s;
}
.diapo.actif .sous-titre, .diapo.actif h2, .diapo.actif .vague, .diapo.actif .bouton { opacity: 1; transform: none; }
.diapo.actif .vague { transition-delay: .35s; }
.diapo.actif h2 { transition-delay: .5s; }
.diapo.actif .bouton { transition-delay: .7s; }
.diapo .sous-titre { position: relative; padding-top: 12px; margin-top: 30px; font-size: 16px; }
.diapo .sous-titre::before {
  content: ''; position: absolute; top: -30px; left: 50%; margin-left: -25px;
  width: 50px; height: 25px; border: 2px solid #fff; border-bottom: 0; border-radius: 90px 90px 0 0;
}
.diapo .sous-titre > span { opacity: .8; }
.diapo h2 {
  display: flex; align-items: center; gap: 20px;
  margin: 0 0 10px;
  font-size: clamp(28px, 3vw, 40px); letter-spacing: 2px; text-transform: uppercase;
}
.diapo h2::before, .diapo h2::after { content: ''; width: 50px; height: 1px; background: #fff; opacity: .6; transition: width .4s ease-in-out; }
.diapo h2:hover::before, .diapo h2:hover::after { width: 90px; }
.diapo .bouton {
  margin-top: 6px; padding: 10px 40px; border: 1px solid rgba(255,255,255,.31); background: rgba(255,255,255,.11);
  font-size: 13px; font-weight: 300; letter-spacing: 2px;
}
.diapo .bouton:hover { background: rgba(255,255,255,.11); border-color: rgba(255,255,255,.31); color: #fff; text-decoration: line-through; }
@keyframes zoom-lent { from { transform: scale(1.12); } to { transform: scale(1); } }

.diaporama-points {
  position: absolute; left: 50%; bottom: 26px; z-index: 5; transform: translateX(-50%);
  display: flex; gap: 6px;
}
.diaporama-points button {
  width: 22px; height: 22px; padding: 0; border: 0; background: none; position: relative;
}
.diaporama-points button::before {
  content: ''; position: absolute; inset: 7px; border-radius: 50%;
  border: 1px solid #fff; transition: background-color .3s;
}
.diaporama-points button.actif::before { background: #fff; }
.diaporama-fleches {
  position: absolute; top: 50%; right: -45px; z-index: 5; width: 40px;
  transform: translateY(-50%);
  display: flex; flex-direction: column;
}
.diaporama-fleches::before, .diaporama-fleches::after {
  content: ''; position: absolute; width: 100%; height: 1px; background: #666; transition: width .2s linear;
}
.diaporama-fleches::before { top: -10px; left: 0; }
.diaporama-fleches::after { bottom: -8px; right: 0; }
.diaporama-fleches:hover::before, .diaporama-fleches:hover::after { width: 0; }
.diaporama-fleches button, .plein-ecran {
  width: 40px; height: 40px; border: 0;
  display: flex; align-items: center; justify-content: center;
  background: none; color: var(--encre); transition: color .25s;
}
.diaporama-fleches button:hover, .plein-ecran:hover { color: var(--accent); }
.diaporama-fleches svg, .plein-ecran svg { width: 16px; height: 16px; }
.plein-ecran {
  position: absolute; top: 20px; right: 20px; z-index: 5;
  width: 34px; height: 34px; background: rgba(0,0,0,.35); color: #fff;
}
.plein-ecran:hover { background: rgba(0,0,0,.6); color: #fff; }
.diaporama-compteur {
  position: absolute; left: 26px; bottom: 26px; z-index: 5;
  font-size: 11px; letter-spacing: 2px;
}
.diaporama-compteur b { font-weight: 500; font-size: 13px; }
.diaporama:fullscreen { height: 100vh; }
.diaporama:fullscreen .diaporama-fleches { right: 10px; }
.diaporama:fullscreen .diaporama-fleches button { color: #fff; }
.diaporama:fullscreen .diaporama-fleches::before, .diaporama:fullscreen .diaporama-fleches::after { background: #fff; }

/* ---------- 7. Pages galerie / projet ---------- */
/* Panneau de texte (titre, description, infos) */
.fiche {
  background: var(--blanc);
  padding: 50px 30px 40px;
  color: var(--texte);
}
.fiche-retour {
  display: inline-flex; align-items: center; gap: 10px;
  margin-bottom: 34px;
  font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--discret);
  transition: color .25s;
}
.fiche-retour:hover { color: var(--accent); }
.fiche-retour svg { width: 18px; height: 10px; }
.fiche h1 { font-size: 26px; color: #292929; }
.fiche .trait { width: 80px; margin: 20px 0; }
.fiche .sous-titre { color: var(--encre); margin-bottom: 1.1em; }
.fiche-infos {
  list-style: none; margin: 28px 0 0; padding: 22px 0 0;
  border-top: 1px solid var(--trait);
}
.fiche-infos li { display: flex; gap: 14px; padding: 5px 0; font-family: var(--police-italique); font-style: italic; color: var(--encre); }
.fiche-infos li > span:first-child {
  flex: 0 0 92px; font-family: var(--police); font-style: normal;
  font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--discret);
  padding-top: 2px;
}
.fiche-aide {
  display: none; align-items: center; gap: 12px; margin: 36px 0 0;
  font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--discret);
}
.fiche-aide svg { width: 30px; height: 10px; animation: glisse 1.8s ease-in-out infinite; }
@keyframes glisse { 50% { transform: translateX(8px); } }

/* Photo dans une galerie (avec effet au survol) */
.galerie a { position: relative; display: block; overflow: hidden; cursor: zoom-in; background: #eee; }
.galerie a img { transition: transform .8s cubic-bezier(.2,.7,.2,1), opacity .4s; }
.galerie a::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(20,20,20,.18) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.3'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E") center / 34px no-repeat;
  opacity: 0; transition: opacity .35s;
}
.galerie a:hover img { transform: scale(1.03); }
.galerie a:hover::after { opacity: 1; }
.galerie h3 {
  font-size: 11px; letter-spacing: 3px; text-transform: uppercase; color: var(--discret);
}

/* Disposition « horizontal » : bande qui défile de gauche à droite */
.page-galerie[data-disposition="horizontal"], .horizontal {
  display: flex; gap: var(--ecart);
  height: var(--hauteur-cadre); min-height: 420px;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none; overscroll-behavior-x: contain;
}
.page-galerie[data-disposition="horizontal"]::-webkit-scrollbar, .horizontal::-webkit-scrollbar { display: none; }
.page-galerie[data-disposition="horizontal"] > .fiche, .horizontal > .fiche {
  flex: 0 0 var(--fiche); height: 100%; overflow-y: auto;
}
.page-galerie[data-disposition="horizontal"] .fiche-aide, .horizontal .fiche-aide { display: flex; }
.page-galerie[data-disposition="horizontal"] .galerie { display: flex; gap: var(--ecart); height: 100%; flex: none; }
.page-galerie[data-disposition="horizontal"] .galerie a { height: 100%; flex: none; }
.page-galerie[data-disposition="horizontal"] .galerie img { height: 100%; width: auto; max-width: none; }
.page-galerie[data-disposition="horizontal"] .galerie h3 {
  flex: none; display: flex; align-items: center; justify-content: center;
  width: 60px; background: var(--blanc); writing-mode: vertical-rl; transform: rotate(180deg);
}
.glisse-en-cours, .glisse-en-cours * { cursor: grabbing !important; user-select: none; }
.barre-progression {
  position: fixed; left: var(--marge); right: var(--marge); bottom: var(--pied); z-index: 50;
  height: 3px; background: var(--trait);
}
.barre-progression span { display: block; height: 100%; width: 0; background: var(--sombre); }
.compteur-folio {
  position: fixed; top: 50%; right: 0; z-index: 10; width: var(--marge);
  display: flex; flex-direction: column; align-items: center;
  transform: translateY(-50%); font-size: 14px;
}
.compteur-folio .num { position: relative; padding-bottom: 28px; color: #666; }
.compteur-folio .num::after { content: '/'; position: absolute; left: 50%; bottom: -2px; transform: translateX(-50%); color: #000; }
.compteur-folio .total { padding-top: 8px; }

/* Dispositions « colonne » et « mosaique » : panneau fixe à gauche, photos à droite */
.page-galerie[data-disposition="colonne"], .page-galerie[data-disposition="mosaique"] {
  display: grid; grid-template-columns: var(--fiche) minmax(0, 1fr); gap: var(--ecart); align-items: start;
}
.page-galerie[data-disposition="colonne"] > .fiche, .page-galerie[data-disposition="mosaique"] > .fiche {
  position: sticky; top: var(--entete);
  height: var(--hauteur-cadre); overflow-y: auto;
}
.page-galerie[data-disposition="colonne"] .galerie {
  display: flex; flex-direction: column; align-items: center; gap: 50px;
  padding: 50px; background: var(--blanc); min-height: var(--hauteur-cadre);
}
.page-galerie[data-disposition="colonne"] .galerie a { background: none; }
.page-galerie[data-disposition="colonne"] .galerie img {
  width: auto; height: auto; max-width: 100%; max-height: calc(var(--hauteur-cadre) - 100px);
}
.page-galerie[data-disposition="colonne"] .galerie h3 { align-self: stretch; text-align: center; padding-top: 10px; }
.page-galerie[data-disposition="colonne"] .galerie h3::after {
  content: ''; display: block; width: 30px; height: 2px; margin: 14px auto 0; background: var(--accent);
}
.page-galerie[data-disposition="mosaique"] .galerie { columns: 3 260px; column-gap: var(--ecart); }
.page-galerie[data-disposition="mosaique"] .galerie a { margin-bottom: var(--ecart); break-inside: avoid; }
.page-galerie[data-disposition="mosaique"] .galerie img { width: 100%; }
.page-galerie[data-disposition="mosaique"] .galerie h3 { column-span: all; padding: 20px 0 14px; }

/* ---------- 8. Listes : portfolio et projets ---------- */
/* Cartes du portfolio (bande horizontale) */
.carte { flex: none; display: flex; flex-direction: column; height: 100%; }
.carte-image { position: relative; overflow: hidden; background: #e8e8e8; }
.carte-image img {
  height: calc(var(--hauteur-cadre) - 96px); min-height: 324px; width: auto; max-width: none;
  transition: transform 1s cubic-bezier(.2,.7,.2,1);
}
.carte:hover .carte-image img { transform: scale(1.04); }
.carte-image::after {
  content: 'View gallery'; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(20,20,20,.35); color: #fff;
  font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  opacity: 0; transition: opacity .4s;
}
.carte:hover .carte-image::after { opacity: 1; }
html[data-langue="fr"] .carte-image::after { content: 'Voir la galerie'; }
.carte-texte { padding: 22px 4px 0; }
.carte-titre { display: block; font-size: 22px; letter-spacing: 2px; text-transform: uppercase; line-height: 1.2; }
.carte-infos { display: block; margin-top: 6px; font-size: 12px; color: var(--discret); }

/* Grille des projets */
.page-liste .titre-section { padding-top: 70px; padding-bottom: 36px; background: var(--blanc); }
.filtres { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 26px; }
.filtres button {
  padding: 8px 16px; border: 0; background: none;
  font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--texte);
  transition: background-color .25s, color .25s;
}
.filtres button:hover { color: var(--encre); background: var(--fond); }
.filtres button.actif { background: var(--sombre); color: #fff; }
.grille {
  display: grid; gap: var(--ecart);
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}
main.cadre > .grille { margin-top: var(--ecart); }
.carte-projet { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #e8e8e8; color: #fff; }
.carte-projet[hidden] { display: none; }
.carte-projet img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform 1s cubic-bezier(.2,.7,.2,1);
}
.carte-projet::before {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to top, rgba(0,0,0,.6), rgba(0,0,0,0) 55%);
  transition: background-color .4s;
}
.carte-projet:hover::before { background-color: rgba(0,0,0,.35); }
.carte-projet:hover img { transform: scale(1.05); }
.carte-projet .carte-texte { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 30px; }
.carte-projet .carte-infos { color: rgba(255,255,255,.75); }
.carte-projet .carte-voir {
  display: inline-block; margin-top: 14px; padding-bottom: 3px; border-bottom: 2px solid var(--accent);
  font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
  opacity: 0; transform: translateY(8px); transition: opacity .4s, transform .4s;
}
.carte-projet:hover .carte-voir, .carte-projet:focus-visible .carte-voir { opacity: 1; transform: none; }
.apparait { animation: apparition .5s ease both; }

/* ---------- 9. À propos ---------- */
.bloc-sombre { background: var(--sombre); color: rgba(255,255,255,.72); }
.bloc-sombre h1, .bloc-sombre h2 { color: #fff; }
.bloc-sombre .sous-titre { color: #fff; }
.partage { display: grid; grid-template-columns: 1fr 1fr; min-height: var(--hauteur-cadre); }
.partage > .partage-image { position: relative; overflow: hidden; min-height: 360px; }
.partage > .partage-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.partage > .partage-texte { display: flex; flex-direction: column; justify-content: center; padding: 70px clamp(30px, 6vw, 110px); }
.partage-texte h1, .partage-texte h2 { font-size: 46px; font-weight: 300; }
.partage-texte .sous-titre { font-size: 17px; margin-bottom: 1.2em; }
.partage-texte .signature { width: 150px; margin-top: 26px; opacity: .9; }
.partage.inverse > .partage-image { order: 2; }
.partage.moyen { min-height: 560px; }
.partage.clair { background: var(--blanc); color: var(--texte); min-height: 0; }
.partage.clair .partage-image { min-height: 520px; }
.partage.clair h2 { color: var(--encre); }

.services { background: var(--blanc); padding: 10px 60px 80px; }
.services .titre-section { padding-top: 70px; }
.services ol {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 50px;
}
.services li { color: var(--texte); }
.services li b {
  display: block; margin-bottom: 18px;
  font-size: 13px; font-weight: 500; letter-spacing: 2px; color: var(--accent);
}
.services li h3 { margin-bottom: 14px; font-size: 19px; color: var(--encre); }

.materiel { display: grid; grid-template-columns: 1fr 1fr; gap: 0 30px; }
.materiel ul { list-style: none; margin: 0; padding: 0; }
.materiel li { padding: 7px 0; border-bottom: 1px solid var(--trait); font-size: 14px; }

.appel {
  position: relative; overflow: hidden;
  padding: 110px 30px; text-align: center; color: #fff;
}
.appel > img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.appel::before { content: ''; position: absolute; inset: 0; z-index: -1; background: rgba(20,20,20,.55); }
.appel { isolation: isolate; }
.appel h2 { font-size: 40px; font-weight: 300; margin-bottom: 30px; }
.appel .sous-titre { margin-bottom: 4px; }

/* ---------- 10. Contact ---------- */
.entete-page {
  position: relative; isolation: isolate; overflow: hidden;
  height: calc(var(--hauteur-cadre) * .62); min-height: 360px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; color: #fff; padding: 0 30px;
}
.entete-page > img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.entete-page::before { content: ''; position: absolute; inset: 0; z-index: -1; background: rgba(20,20,20,.38); }
.entete-page h1 { font-size: 48px; font-weight: 300; }
.entete-page .trait { margin-left: auto; margin-right: auto; }
.entete-page .defiler {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  width: 1px; height: 46px; background: rgba(255,255,255,.6);
}
.entete-page .defiler::after {
  content: ''; position: absolute; left: -2px; top: 0; width: 5px; height: 5px; border-radius: 50%;
  background: #fff; animation: descend 2s ease-in-out infinite;
}
@keyframes descend { 0% { top: 0; opacity: 0; } 30% { opacity: 1; } 100% { top: 42px; opacity: 0; } }

.coordonnees { list-style: none; margin: 30px 0 0; padding: 0; }
.coordonnees li { padding: 6px 0; }
.coordonnees li > span:first-child { display: inline-block; min-width: 90px; color: rgba(255,255,255,.5); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; }
.coordonnees a { color: #fff; border-bottom: 1px solid rgba(255,255,255,.3); transition: border-color .25s; }
.coordonnees a:hover { border-color: var(--accent); }

.bloc-formulaire { background: var(--blanc); padding: 0 30px 90px; }
.formulaire { max-width: 660px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.formulaire .large { grid-column: 1 / -1; }
.formulaire label { display: block; margin-bottom: 6px; font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--discret); }
.formulaire input, .formulaire select, .formulaire textarea {
  width: 100%; padding: 13px 15px;
  border: 1px solid #eee; border-radius: 0; background: #fff;
  font: inherit; font-size: 14px; color: var(--encre);
  transition: border-color .25s, background-color .25s;
}
.formulaire select { appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%23999' stroke-width='1.4'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E") right 15px center / 11px no-repeat; }
.formulaire textarea { min-height: 170px; resize: vertical; }
.formulaire input:focus, .formulaire select:focus, .formulaire textarea:focus { outline: none; border-color: var(--encre); background: #fff; }
.formulaire .piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.formulaire .mention { font-size: 12px; color: var(--discret); margin: 4px 0 0; }
.formulaire .envoi { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.formulaire button[disabled] { opacity: .5; cursor: wait; }
.statut { margin: 0; font-size: 14px; }
.statut.ok { color: #2e7d32; }
.statut.erreur { color: var(--accent); }

.page-texte { background: var(--blanc); padding: 0 30px 90px; }
.page-texte .contenu { max-width: 760px; margin: 0 auto; color: var(--texte); }
.page-texte h2 { font-size: 20px; margin: 40px 0 12px; color: var(--encre); }
.page-texte a { border-bottom: 1px solid var(--trait); }
.page-texte a:hover { border-color: var(--accent); }

.erreur404 { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: #fff; }
.erreur404 > img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.erreur404::before { content: ''; position: absolute; inset: 0; z-index: -1; background: rgba(20,20,20,.5); }
.erreur404 h1 { font-size: clamp(70px, 12vw, 150px); font-weight: 300; letter-spacing: 6px; line-height: 1; }
.erreur404 p { margin: 10px 0 30px; }

/* ---------- 11. Visionneuse (photo en plein écran) ---------- */
.visionneuse {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(17,17,17,.97); color: #fff;
  opacity: 0; transition: opacity .3s;
}
.visionneuse.ouverte { opacity: 1; }
.visionneuse figure { margin: 0; display: flex; flex-direction: column; align-items: center; }
.visionneuse img {
  max-width: calc(100vw - 180px); max-height: calc(100vh - 130px); width: auto; height: auto;
  box-shadow: 0 10px 50px rgba(0,0,0,.4); transition: opacity .25s;
  user-select: none; -webkit-user-drag: none;
}
.visionneuse figcaption { margin-top: 16px; min-height: 1.5em; font-family: var(--police-italique); font-style: italic; color: rgba(255,255,255,.7); }
.visionneuse button {
  position: absolute; border: 0; background: none; color: #fff;
  display: flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; opacity: .7; transition: opacity .25s, color .25s;
}
.visionneuse button:hover { opacity: 1; color: var(--accent); }
.visionneuse button svg { width: 26px; height: 26px; }
.visionneuse .fermer { top: 14px; right: 14px; }
.visionneuse .precedent { left: 20px; top: 50%; margin-top: -28px; }
.visionneuse .suivant { right: 20px; top: 50%; margin-top: -28px; }
.visionneuse .compteur { position: absolute; top: 30px; left: 34px; font-size: 12px; letter-spacing: 2px; }
.visionneuse .chargement {
  position: absolute; top: 50%; left: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border: 2px solid rgba(255,255,255,.2); border-top-color: #fff; border-radius: 50%;
  animation: tourne .8s linear infinite; opacity: 0; transition: opacity .2s; pointer-events: none;
}
.visionneuse.charge .chargement { opacity: 1; }
@keyframes tourne { to { transform: rotate(360deg); } }
body.bloque { overflow: hidden; }

/* ---------- 12. Mobile et tablette ---------- */
@media (max-width: 1023px) {
  :root { --entete: 62px; --pied: 0px; --marge: 12px; --hauteur-cadre: calc(100svh - var(--entete) - 12px); }
  main.cadre { padding-bottom: 12px; min-height: 0; }
  main.cadre > * + * { margin-top: 12px; }
  .entete { padding: 0 18px; }
  .entete .logo img { height: 38px; }
  .burger { display: block; z-index: 2; }
  .langues { margin-left: auto; margin-right: 6px; padding-left: 0; border-left: 0; position: relative; z-index: 2; }
  .menu-ouvert .langues button { color: rgba(255,255,255,.6); }
  .menu-ouvert .langues button[aria-pressed="true"] { color: #fff; }
  .menu {
    position: fixed; inset: 0; z-index: 1;
    display: flex; align-items: center; justify-content: center;
    background: var(--sombre);
    opacity: 0; visibility: hidden; transition: opacity .35s, visibility 0s .35s;
  }
  .menu-ouvert .menu { opacity: 1; visibility: visible; transition: opacity .35s; }
  .menu-ouvert .burger span, .menu-ouvert .burger::before, .menu-ouvert .burger::after { background: #fff; }
  .menu ul { flex-direction: column; align-items: center; gap: 8px; }
  .menu a { font-size: 26px; font-weight: 300; letter-spacing: 3px; color: #fff; padding: 6px 20px; }
  .menu a:hover { background: none; color: var(--accent); }
  .menu a.actif { background: none; color: var(--accent); }
  .menu-ouvert { overflow: hidden; }
  .onglet { display: none; }

  .pied {
    position: static; height: auto; flex-direction: column; gap: 18px;
    padding: 30px 18px 34px; text-align: center;
  }
  .pied-infos { flex-direction: column; gap: 14px; }
  .pied-infos ul { flex-direction: column; align-items: center; gap: 14px; margin: 0; padding: 0; }
  .pied-infos ul::before, .pied-infos li::before { display: none; }
  .pied-infos li { padding: 0; }

  /* Petits liens : zone de toucher agrandie (invisible) pour le doigt */
  .pied a, .fiche-retour, .coordonnees a, .page-texte a { position: relative; }
  .pied a::before, .fiche-retour::before, .coordonnees a::before, .page-texte a::before {
    content: ''; position: absolute; inset: -12px -6px;
  }
  .diaporama-points button { width: 34px; height: 34px; }
  .pied .reseau::before { inset: -8px -4px; }
  .haut-de-page { width: 34px; height: 34px; }
  .diaporama-points button::before { inset: 13px; }

  .diaporama { height: var(--hauteur-cadre); }
  .diaporama-fleches { right: 12px; top: auto; bottom: 12px; width: auto; transform: none; flex-direction: row; }
  .diaporama-fleches::before, .diaporama-fleches::after { display: none; }
  .diaporama-fleches button { width: 42px; height: 42px; background: var(--blanc); }
  .diaporama-fleches button + button { border-top: 0; border-left: 1px solid var(--trait); }
  .diaporama-compteur { display: none; }
  .diaporama-points { left: 24px; transform: none; bottom: 22px; }
  .diapo h2::before, .diapo h2::after { width: 26px; }
  .diapo h2 { gap: 14px; letter-spacing: 3px; }

  /* Galeries : tout passe en vertical */
  .page-galerie[data-disposition], .horizontal {
    display: block; height: auto; min-height: 0; overflow: visible;
  }
  .page-galerie[data-disposition] > .fiche, .horizontal > .fiche {
    position: static; height: auto; max-height: none; overflow: visible;
    padding: 34px 24px 30px; margin-bottom: var(--ecart);
  }
  .fiche-aide, .page-galerie[data-disposition="horizontal"] .fiche-aide, .horizontal .fiche-aide { display: none; }
  .page-galerie[data-disposition="horizontal"] .galerie,
  .page-galerie[data-disposition="colonne"] .galerie {
    display: flex; flex-direction: column; gap: var(--ecart); height: auto; padding: 0; background: none; min-height: 0;
  }
  .page-galerie[data-disposition="horizontal"] .galerie a { height: auto; }
  .page-galerie[data-disposition] .galerie img,
  .page-galerie[data-disposition="horizontal"] .galerie img,
  .page-galerie[data-disposition="colonne"] .galerie img { width: 100%; height: auto; max-height: none; }
  .page-galerie[data-disposition="horizontal"] .galerie h3 {
    writing-mode: horizontal-tb; transform: none; width: auto; padding: 18px;
  }
  .page-galerie[data-disposition="mosaique"] .galerie { columns: 2 150px; }
  .barre-progression, .compteur-folio { display: none; }

  .carte { height: auto; margin-bottom: var(--ecart); background: var(--blanc); }
  .carte-image img { height: auto; min-height: 0; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
  .carte-texte { padding: 18px 20px 22px; }
  .carte-image::after { display: none; }

  .grille { grid-template-columns: 1fr; }
  .carte-projet .carte-voir { opacity: 1; transform: none; }
  .titre-section { padding: 50px 20px 34px; }
  .titre-section h1, .titre-section h2 { font-size: 34px; }

  .partage { grid-template-columns: 1fr; min-height: 0; }
  .partage > .partage-image { min-height: 0; aspect-ratio: 4 / 5; }
  .partage.clair .partage-image { min-height: 0; aspect-ratio: 4 / 3; }
  .partage.inverse > .partage-image { order: 0; }
  .partage > .partage-texte { padding: 46px 26px; }
  .partage-texte h1, .partage-texte h2 { font-size: 36px; }
  .services { padding: 0 26px 50px; }
  .services ol { grid-template-columns: 1fr 1fr; gap: 34px 24px; }
  .appel { padding: 80px 24px; }
  .appel h2 { font-size: 30px; }
  .entete-page h1 { font-size: 38px; }
  .bloc-formulaire { padding: 0 20px 60px; }
  .page-texte { padding: 0 22px 60px; }

  .visionneuse img { max-width: 100vw; max-height: calc(100vh - 150px); }
  .visionneuse .precedent, .visionneuse .suivant { top: auto; bottom: 14px; margin: 0; }
  .visionneuse .precedent { left: calc(50% - 70px); }
  .visionneuse .suivant { right: calc(50% - 70px); }
  .visionneuse .compteur { top: 30px; left: 22px; }
}
@media (max-width: 560px) {
  .services ol { grid-template-columns: 1fr; }
  .formulaire { grid-template-columns: 1fr; }
  .materiel { grid-template-columns: 1fr; }
  .diapo h2::before, .diapo h2::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
