/* OHIER Cartographie - feuille de style
   Palette tirée des cartes : papier froid, encre, bleu hydrographique, sable. */

@font-face { font-family: "Barlow"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/barlow-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-weight: 400; font-style: italic; font-display: swap; src: url("../fonts/source-serif-4-latin-400-italic.woff2") format("woff2"); }

:root {
  --papier: #f3f5f5;
  --blanc: #ffffff;
  --encre: #13283a;
  --encre-douce: #42596a;
  --eau: #22698a;
  --eau-pale: #e8f1f5;
  --sable: #e9a23b;
  --courbe: #a9b6bc;
  --trait: #d4dcdf;

  --sans: "Barlow", "Segoe UI", system-ui, sans-serif;
  --serif: "Source Serif 4", Georgia, serif;

  --conteneur: 76rem;
  --marge: clamp(1.25rem, 4vw, 2.5rem);
  --bande: 6px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--papier);
  color: var(--encre);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--eau); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--encre); }
:focus-visible { outline: 3px solid var(--sable); outline-offset: 2px; }
button { font: inherit; color: inherit; }

h1, h2, h3, h4 { line-height: 1.15; margin: 0; font-weight: 600; letter-spacing: -.005em; }
h2 { font-size: clamp(1.9rem, 3.2vw, 2.4rem); margin-bottom: .6rem; }
h3 { font-size: 1.12rem; margin: 2rem 0 .7rem; }
p { margin: 0 0 1rem; }

/* Noms de lieux composés comme des toponymes sur une carte */
.lieu { font-family: var(--serif); font-style: italic; color: var(--eau); }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.evitement { position: absolute; left: -999px; top: 0; background: var(--encre); color: var(--blanc); padding: .6rem 1rem; z-index: 10; }
.evitement:focus { left: 1rem; }

.conteneur { width: 100%; max-width: var(--conteneur); margin-inline: auto; padding-inline: var(--marge); }

/* Bandeau : nom, contacts, sommaire, sur fond d'encre avec des courbes de niveau */
.bandeau {
  background: var(--encre) url("../img/courbes.svg") center / cover no-repeat;
  color: var(--blanc);
}
.bandeau-grille { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.5rem 3rem; padding-block: clamp(2rem, 4.5vw, 3.25rem) 1.6rem; }
.marque { font-size: clamp(2.1rem, 4.6vw, 3.2rem); font-weight: 500; letter-spacing: -.01em; line-height: 1; margin: 0 0 .7rem; }
.marque a { color: var(--blanc); text-decoration: none; }
.marque b { font-weight: 700; letter-spacing: .03em; }
.accroche { font-size: clamp(1.1rem, 1.7vw, 1.3rem); font-weight: 500; margin: 0 0 .2rem; }
.signature { color: #b9c8d2; margin: 0; }
.contacts { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.contacts li { display: grid; grid-template-columns: 5.5rem auto; align-items: baseline; }
.bandeau .etiquette { color: #9fb2bf; }
.bandeau a { color: var(--blanc); text-decoration-color: rgb(255 255 255 / .45); }
.bandeau a:hover { color: #9fd3ea; }
.etiquette { font-size: .82rem; color: var(--encre-douce); }
.sommaire { border-top: 1px solid rgb(255 255 255 / .18); }
.sommaire ul { display: flex; flex-wrap: wrap; gap: .2rem 2rem; list-style: none; margin: 0; padding: .8rem 0 .9rem; }
.sommaire a { display: inline-block; padding-bottom: .15rem; border-bottom: 2px solid transparent; color: #c9d6de; text-decoration: none; font-weight: 500; }
.sommaire a:hover { color: var(--blanc); border-bottom-color: rgb(255 255 255 / .4); }
.sommaire a[aria-current="page"] { color: var(--blanc); border-bottom-color: var(--sable); }

/* Sections */
.titre-page { font-size: clamp(1.9rem, 3.2vw, 2.4rem); margin-bottom: .6rem; }
.sous-titre { font-size: 1.12rem; margin: 2rem 0 .7rem; }
.sous-titre-section { font-size: clamp(1.4rem, 2.4vw, 1.75rem); margin: 3rem 0 .5rem; padding-top: 2rem; border-top: 1px solid var(--trait); }
.titre-page + .intro + .sous-titre-section { border-top: 0; padding-top: 0; margin-top: 2.25rem; }
.section { padding-block: clamp(3rem, 6vw, 5rem); }
.section + .section { border-top: 1px solid var(--trait); }
.intro { color: var(--encre-douce); max-width: 64ch; margin-bottom: 0; }
.section-tete { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.75rem; }

/* Volets d'expertise : une pile de cartes au format paysage.
   La carte active est au premier plan, les trois suivantes dépassent sur la droite. */
.volets-commandes { display: flex; gap: .5rem; flex: none; }
.fleche { width: 2.6rem; height: 2.6rem; display: grid; place-items: center; background: var(--blanc); border: 1px solid var(--encre); border-radius: 2px; cursor: pointer; }
.fleche svg { width: 1.2rem; height: 1.2rem; }
.fleche:hover:not(:disabled) { background: var(--encre); color: var(--blanc); }
.fleche:disabled { opacity: .35; cursor: default; }

.pile {
  /* largeur des volets et positions calculées par le script selon la place disponible */
  --w: 32%;
  position: relative;
  display: grid;
  padding-block: .5rem;
  touch-action: pan-y;
}
.pile:focus-visible { outline: 3px solid var(--sable); outline-offset: 6px; }
.volet {
  grid-area: 1 / 1;
  position: relative;
  width: var(--w);
  display: flex; flex-direction: column;
  background: var(--blanc);
  border: 1px solid var(--encre);
  transform: translateX(var(--x, 0px)) scale(var(--s, 1));
  transform-origin: right center;
  z-index: var(--z, 1);
  box-shadow: -8px 0 16px -12px rgb(19 40 58 / .6);
  transition: transform .45s cubic-bezier(.2, .7, .2, 1), opacity .3s ease, visibility .45s;
}
.volet.est-passee { opacity: 0; visibility: hidden; }
.volet.est-attente .volet-bas { opacity: .4; }
.volet-image { aspect-ratio: 16 / 9; overflow: hidden; border-bottom: 1px solid var(--trait); }
.volet-image img { width: 100%; height: 100%; object-fit: cover; }
.volet-bas { display: flex; gap: .85rem; align-items: flex-start; padding: .9rem 1.1rem 1rem; min-height: 6.4rem; }
.volet-num {
  flex: none; width: 2.2rem; height: 2.2rem; display: grid; place-items: center;
  background: var(--encre); color: var(--blanc); border-radius: 50%; font-weight: 600;
}
.volet h3 { font-size: 1.12rem; line-height: 1.25; margin: .2rem 0 .3rem; }
.volet-ouvrir { all: unset; cursor: pointer; }
.volet-ouvrir::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.volet-ouvrir:focus-visible { outline: none; }
.volet:has(.volet-ouvrir:focus-visible) { outline: 3px solid var(--sable); outline-offset: 2px; }
.volet:hover { border-color: var(--eau); }
.volet:hover h3 { color: var(--eau); }
.volet-lieux { margin: 0; font-family: var(--serif); font-style: italic; color: var(--eau); font-size: .93rem; line-height: 1.35; }
.volet-activer { display: none; position: absolute; inset: 0; z-index: 2; border: 0; padding: 0; background: transparent; cursor: pointer; }
.volet.est-attente .volet-activer { display: block; }

.etapes { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .5rem; }
.etapes button {
  width: 100%; height: 100%; display: flex; align-items: flex-start; gap: .55rem; text-align: left;
  padding: .55rem .7rem; background: transparent; border: 0; border-top: 3px solid var(--trait);
  font-size: .92rem; line-height: 1.25; color: var(--encre-douce); cursor: pointer;
}
.etapes button:hover { color: var(--encre); border-top-color: var(--encre); }
.etapes button.est-visible { border-top-color: var(--courbe); color: var(--encre); }
.etapes-num { flex: none; font-weight: 600; color: var(--eau); }

@media (prefers-reduced-motion: reduce) { .volet { transition: none; } }

/* Fenêtre de détail d'une étape */
.detail {
  width: min(94vw, 72rem); max-width: none; max-height: 92vh;
  padding: 0; border: 1px solid var(--encre); background: var(--papier); color: var(--encre);
  overflow: hidden;
}
.detail[open] { display: flex; flex-direction: column; }
.detail::backdrop { background: rgb(19 40 58 / .78); }
.detail-barre, .detail-pied { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem 1.25rem; background: var(--blanc); }
.detail-barre { border-bottom: 1px solid var(--trait); }
.detail-pied { border-top: 1px solid var(--trait); }
.detail-etape { margin: 0; font-size: .9rem; color: var(--encre-douce); }
.detail-fermer, .detail-nav, .visionneuse button {
  font-size: .95rem; font-weight: 500; padding: .4rem .85rem;
  border: 1px solid var(--courbe); background: var(--blanc); color: var(--encre); border-radius: 2px; cursor: pointer; text-align: left;
}
.detail-fermer:hover, .detail-nav:hover, .visionneuse button:hover { border-color: var(--encre); }
.detail-nav-suiv { margin-left: auto; text-align: right; }
.detail-contenu { overflow-y: auto; padding: clamp(1.25rem, 3vw, 2.25rem); }
.detail-tete { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1rem 3rem; align-items: start; padding-bottom: 1.5rem; border-bottom: 1px solid var(--trait); }
.detail h2 { display: flex; align-items: center; gap: .8rem; font-size: clamp(1.6rem, 3vw, 2.1rem); margin-bottom: .9rem; }
.detail-num { flex: none; width: 2.5rem; height: 2.5rem; display: grid; place-items: center; background: var(--encre); color: var(--blanc); border-radius: 50%; font-size: 1.15rem; }
.detail-desc { max-width: 62ch; margin: 0; }
.detail-outils h3 { margin-top: .3rem; }
.projets > h3 { margin-top: 1.75rem; }
.projets-liste { display: grid; align-items: start; grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr)); gap: 1.25rem; }
.projet { background: var(--blanc); border: 1px solid var(--trait); padding: 1.2rem 1.3rem; }
.projet h4 { font-size: 1.05rem; line-height: 1.3; margin-bottom: .45rem; }
.projet-meta { display: flex; flex-wrap: wrap; gap: .15rem 1rem; font-size: .88rem; color: var(--encre-douce); margin-bottom: .8rem; }
.projet p { font-size: .98rem; }
.projet-lien { font-size: .9rem; margin: .5rem 0 0; }
.puces { margin: 0 0 1rem; padding-left: 1.1rem; font-size: .96rem; }
.puces li { margin-bottom: .25rem; }
.autres-cartes { margin-top: 1rem; }

.mini-galerie { list-style: none; margin: .4rem 0 .6rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 1rem; }
.autres-cartes .mini-galerie { grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); }
.vignette { display: block; width: 100%; padding: 0; border: 1px solid var(--trait); background: var(--blanc); cursor: zoom-in; aspect-ratio: 4 / 3; overflow: hidden; }
.vignette:hover { border-color: var(--encre); }
.vignette img { width: 100%; height: 100%; object-fit: contain; }
.legende { display: flex; flex-direction: column; font-size: .86rem; line-height: 1.3; margin: .4rem 0 0; color: var(--encre-douce); }
.legende .lieu { font-size: .86rem; }

.termes { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; margin: 0; padding: 0; }
.termes li { border: 1px solid var(--courbe); background: var(--blanc); padding: .1rem .55rem; font-size: .92rem; border-radius: 2px; }

/* Bailleurs et clients */
.logos-groupe h3 { margin-top: 1.5rem; }
.logos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: .75rem; }
.logo { height: 5.5rem; display: grid; place-items: center; padding: .7rem 1rem; border: 1px solid var(--trait); background: var(--blanc); text-align: center; font-weight: 500; font-size: .95rem; line-height: 1.25; color: var(--encre-douce); }
.logo img { max-height: 3.4rem; max-width: 100%; width: auto; object-fit: contain; filter: grayscale(1); opacity: .85; }
.logo:hover img { filter: none; opacity: 1; }
.logo:has(img) span { display: none; }

/* Parcours */
.parcours { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: 3.5rem; align-items: start; }
.portrait { width: 100%; border: 1px solid var(--encre); box-shadow: 0 0 0 5px var(--blanc), 0 0 0 6px var(--trait); }
.parcours .titre-page { margin-bottom: 1.1rem; }
.honoraires { font-size: 1.15rem; }
.profil { max-width: 70ch; }
.fiche { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 0 3.5rem; }
.chrono { list-style: none; margin: 0; padding: 0; }
.chrono li { margin-bottom: .7rem; }
.annees { display: block; font-size: .88rem; color: var(--encre-douce); }
.precision { font-size: .92rem; color: var(--encre-douce); }
.pays { display: flex; flex-wrap: wrap; gap: .2rem 1.2rem; list-style: none; margin: 0; padding: 0; font-family: var(--serif); font-style: italic; font-size: 1.2rem; color: var(--eau); }

/* Références */
.refs { width: 100%; margin-top: 1.75rem; border-collapse: collapse; background: var(--blanc); border: 1px solid var(--trait); }
.refs th { text-align: left; font-weight: 600; font-size: .9rem; color: var(--encre-douce); padding: .8rem .9rem; border-bottom: 2px solid var(--encre); }
.refs td { padding: 1rem .9rem; border-bottom: 1px solid var(--trait); vertical-align: top; }
.refs td:first-child { white-space: nowrap; color: var(--encre-douce); }
.refs td:nth-child(2) { white-space: nowrap; }
.refs td:nth-child(3) { width: 52%; }
.refs tr:target td { background: var(--eau-pale); }
.refs .etiquette { display: block; }
.refs summary { cursor: pointer; font-weight: 500; list-style: none; padding-left: 1.4rem; position: relative; }
.refs summary::-webkit-details-marker { display: none; }
.refs summary::before { content: "+"; position: absolute; left: 0; top: -.05em; width: 1rem; font-weight: 600; color: var(--eau); }
.refs details[open] summary::before { content: "\2212"; }
.refs summary:hover { color: var(--eau); }
.detail-projet { margin: .8rem 0 .2rem 1.4rem; font-size: .97rem; color: var(--encre-douce); }
.detail-projet dt { font-weight: 600; color: var(--encre); }
.detail-projet dd { margin: 0 0 .7rem; max-width: 70ch; }

mark.a-completer { background: #fbe7a6; color: var(--encre); padding: 0 .2rem; }

/* Pied de page */
.pied { border-top: 1px solid var(--trait); font-size: .92rem; color: var(--encre-douce); background: var(--blanc); }
.pied-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; padding-block: 1.5rem; }
.pied p { margin: 0; }
.pied-contacts { display: flex; flex-wrap: wrap; gap: .3rem 1.5rem; }

/* Page de texte (mentions légales) */
.page-texte .conteneur { max-width: 50rem; }
.page-texte h1 { font-size: clamp(2rem, 4vw, 2.6rem); margin-bottom: 2rem; }
.page-texte h2 { font-size: 1.3rem; margin: 2.25rem 0 .6rem; }

/* Visionneuse de cartes */
.visionneuse { width: min(96vw, 1700px); max-width: none; max-height: 96vh; padding: 0; border: 1px solid var(--encre); background: var(--blanc); color: var(--encre); }
.visionneuse::backdrop { background: rgb(19 40 58 / .88); }
.visionneuse-barre { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem .9rem; border-bottom: 1px solid var(--trait); }
.visionneuse-compteur { margin: 0; font-size: .9rem; color: var(--encre-douce); }
.visionneuse-boutons { display: flex; gap: .4rem; }
.visionneuse figure { margin: 0; padding: .9rem; }
.visionneuse img { margin-inline: auto; max-height: calc(96vh - 9.5rem); width: auto; }
.visionneuse figcaption { display: flex; flex-wrap: wrap; justify-content: center; gap: .2rem 1rem; align-items: baseline; padding-top: .7rem; }

/* Écrans moyens et étroits */
@media (max-width: 860px) {
  .etapes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .detail-tete { grid-template-columns: 1fr; }
  .parcours { grid-template-columns: 1fr; gap: 2rem; }
  .portrait { max-width: 11rem; }
}
@media (max-width: 760px) {
  .refs, .refs thead, .refs tbody, .refs tr, .refs td { display: block; }
  .refs { border: 0; background: transparent; }
  .refs thead { position: absolute; left: -9999px; }
  .refs tr { background: var(--blanc); border: 1px solid var(--trait); margin-bottom: 1rem; padding: .4rem 0; }
  .refs td { border: 0; padding: .35rem .9rem; width: auto !important; white-space: normal !important; }
  .refs td::before { content: attr(data-label); display: block; font-size: .8rem; color: var(--encre-douce); }
  .refs td[data-label="Client et financement"]::before { display: none; }
  .visionneuse-barre { flex-direction: column; align-items: stretch; }
  .detail-pied { flex-direction: column; align-items: stretch; }
  .detail-nav-suiv { margin-left: 0; }
}
@media (max-width: 600px) {
  .etapes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-tete { align-items: flex-start; flex-direction: column; }
  .detail { width: 100vw; max-height: 100vh; height: 100vh; }
}
@media print {
  .sommaire, .volets-commandes, .visionneuse, .detail { display: none; }
}
