/* Reportage autonome. Le fond cartographique conserve intégralement ses pixels. */
:root {
  --abyss: #14262C;
  --green: #305B57;
  --ivory: #F3EFE6;
  --sand: #D9C9AD;
  --copper: #B78456;
  --ink: #263438;
  color-scheme: light;
  scroll-behavior: smooth;
  scroll-padding-top: 2rem;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--ivory); color: var(--ink); font: 1.0625rem/1.75 "Instrument Sans", sans-serif; }
:where(h1,h2,h3,h4,p,figure,dl,dd) { margin: 0; }
:where(h1,h2,h3,h4) { font-family: "Syne", sans-serif; font-weight: 600; line-height: 1.2; text-wrap: balance; }
:where(p,h1,h2,h3,h4,a,td,th) { overflow-wrap: anywhere; }
a { color: inherit; text-underline-offset: .25em; }
a:hover { text-decoration-thickness: 2px; }
:where(a,button,summary,select,[tabindex]):focus-visible { outline: 3px solid currentColor; outline-offset: 5px; }
:where(a,button,summary,select) { touch-action: manipulation; }
img { display: block; max-width: 100%; height: auto; }
button,select { font: inherit; }
button,summary { cursor: pointer; }
button { min-height: 44px; padding: .65rem 1.1rem; border: 1px solid var(--green); border-radius: 2px; background: var(--green); color: var(--ivory); }
button:disabled,fieldset:disabled button { cursor: not-allowed; background: transparent; color: var(--ink); border-color: var(--ink); opacity: .65; }
[hidden] { display: none !important; }
.wide { width: min(1240px, calc(100% - 6rem)); margin-inline: auto; }
.reading { width: min(660px, calc(100% - 3rem)); margin-inline: auto; }
.kicker { font-family: "Syne", sans-serif; font-size: .7rem; font-weight: 600; line-height: 1.65; letter-spacing: .13em; text-transform: uppercase; }
.site-header,.site-footer { display: flex; justify-content: space-between; align-items: center; gap: 2rem; padding: 1.5rem clamp(1.25rem,4vw,4rem); }
.site-header { background: var(--ivory); }
.brand img { width: 155px; }
.site-header nav,.site-footer nav { display: flex; flex-wrap: wrap; gap: .75rem 2rem; font-size: .85rem; }
.skip-link { position: fixed; z-index: 20; top: 1rem; left: 1rem; padding: .8rem 1rem; background: var(--ivory); color: var(--ink); transform: translateY(-200%); }
.skip-link:focus { transform: none; }
.opening { padding-block: clamp(3rem,7vw,7rem) 4rem; }
.opening h1 { max-width: 1100px; margin-block: 1.5rem; font-size: clamp(3rem,8.4vw,8.3rem); line-height: 1; letter-spacing: -.065em; }
.opening h1 em { color: var(--green); font-style: normal; }
.opening-subtitle { font-family: Georgia,serif; font-size: clamp(1.25rem,2.5vw,1.9rem); }
.opening-link { display: inline-block; margin-top: 2rem; font-size: .9rem; }
.edition-note { margin-top: 2rem; font-size: .75rem; }
.contents { padding-block: 2rem 5rem; border-top: 1px solid var(--sand); }
.contents h2 { font-size: clamp(1.7rem,3vw,2.7rem); margin: .7rem 0 1.8rem; }
.contents ol { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .4rem 3rem; }
.contents a { display: flex; align-items: baseline; gap: 1rem; padding: .6rem 0; text-decoration: none; font-size: .95rem; }
.contents a:hover { text-decoration: underline; }
.contents a span { flex: 0 0 4rem; font-size: .65rem; font-family: "Syne",sans-serif; color: var(--green); }
.chapter { padding-block: clamp(4rem,8vw,8rem); }
.chapter-heading { margin-bottom: 3.5rem; }
.chapter-heading h2 { max-width: 1000px; margin-top: 1rem; font-size: clamp(2rem,4.2vw,4.2rem); letter-spacing: -.035em; }
.chapter-0 { background: var(--abyss); color: var(--ivory); }
.chapter-0 .kicker,.final-atlas .kicker { color: var(--sand); }
.chapter-1 { background: linear-gradient(var(--ivory) 85%,#eee7db); }
.chapter-2 { background: linear-gradient(#eee7db,var(--ivory)); }
.chapter-4 { background: linear-gradient(var(--ivory),#e8dfd0 85%,var(--ivory)); }
.manuscript { font-family: Georgia,"Times New Roman",serif; font-size: clamp(1.1rem,1.45vw,1.24rem); line-height: 1.95; }
.manuscript > * + * { margin-top: 1.5rem; }
.manuscript h3 { margin-top: 3.5rem; margin-bottom: 1.75rem; font-size: clamp(1.4rem,2.4vw,2rem); line-height: 1.4; letter-spacing: -.025em; }
.manuscript > p:last-child strong { display: block; margin-top: 2rem; font-size: 1.15em; line-height: 1.65; }
.manuscript code { font-size: .85em; }
.chapter-next { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; font: .8rem/1.7 "Instrument Sans",sans-serif; }
.atlas { width: 100%; margin: 0 auto 4rem; }
.map-surface { position: relative; width: 100%; max-width: 1672px; margin-inline: auto; aspect-ratio: 1672 / 941; }
.map-surface > img { width: 100%; height: auto; }
.atlas figcaption { width: min(1240px,calc(100% - 3rem)); margin: 1rem auto 0; font-size: .75rem; line-height: 1.7; }
/* Les pourcentages placent le centre du point ; seule sa cible tactile est élargie. */
.map-pin { position: absolute; left: var(--x); top: var(--y); display: grid; place-items: center; width: 44px; height: 44px; transform: translate(-50%,-50%); border-radius: 50%; color: var(--ivory); }
.pin-dot { display: block; width: clamp(9px,1vw,15px); aspect-ratio: 1; border: 2px solid var(--ivory); border-radius: 50%; background: var(--copper); box-shadow: 0 1px 5px #14262c; }
.map-pin:hover .pin-dot,.map-pin:focus-visible .pin-dot { box-shadow: 0 0 0 5px #b7845666; }
.map-pin-silent { pointer-events: none; }
.margin-anchor { position: relative; }
.manuscript > .margin-anchor { margin-top: 3.5rem; }
.manuscript .margin-anchor > h3 { margin: 0 0 1.75rem; }
.cross-reference { padding: 1.5rem; margin-bottom: 2rem; background: var(--ivory); border-top: 2px solid var(--copper); font: .9rem/1.7 "Instrument Sans",sans-serif; }
.cross-reference h3 { margin: .8rem 0 1rem; font-size: 1.25rem; }
.cross-reference a { display: inline-block; margin-top: 1rem; color: var(--green); }
.demonstration,.catalogue { margin-top: 4rem; padding: clamp(1.5rem,4vw,3.5rem); background: #e7e3d9; border-top: 2px solid var(--copper); }
.demonstration h3,.catalogue > h3 { margin: .8rem 0 1.5rem; font-size: clamp(1.6rem,3vw,2.6rem); }
.demo-intro,.waiting,.catalogue > p:not(.kicker) { max-width: 48rem; font-size: .95rem; }
.waiting { border-left: 2px solid var(--green); padding-left: 1rem; }
fieldset { margin: 2rem 0 0; padding: 0; border: 0; min-width: 0; }
legend { margin-bottom: 1rem; font-size: .8rem; }
.filter-row { display: flex; align-items: end; flex-wrap: wrap; gap: 1rem; }
.filter-row label { display: grid; gap: .5rem; flex: 1 1 180px; font-size: .9rem; }
select { min-height: 44px; width: 100%; padding: .6rem; border: 1px solid var(--ink); color: var(--ink); background: var(--ivory); }
select:disabled { opacity: .8; }
.result-status { margin-top: 1.5rem; font-size: .8rem; }
.relation-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1.5rem; margin-top: 2rem; }
.relation-grid details { padding: 1.5rem; border: 1px solid var(--copper); background: var(--ivory); }
.relation-grid summary { min-height: 44px; font-family: "Syne",sans-serif; font-weight: 600; color: var(--green); }
.relation-grid details[open] { border-top: 3px solid var(--green); }
.relation-grid p { font-size: .9rem; }
.destination-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 2rem; margin-top: 2.5rem; }
.destination { padding-top: 1rem; border-top: 1px solid var(--copper); scroll-margin-top: 3rem; }
.destination h4 { font-size: 1rem; margin-bottom: .6rem; }
.destination p { font-size: .8rem; }
.position-notes { border-top: 1px solid var(--sand); margin-top: 2rem; padding-top: 1rem; font-size: .85rem; }
.position-notes summary { min-height: 44px; }
.table-scroll { overflow-x: auto; margin-top: 1.5rem; }
table { width: 100%; border-collapse: collapse; font-size: .8rem; }
caption { text-align: left; margin-bottom: .8rem; }
th,td { text-align: left; padding: .8rem; border-bottom: 1px solid var(--sand); vertical-align: top; }
th:nth-child(2),td:nth-child(2) { white-space: nowrap; }
.chapter-6 { padding-bottom: 0; }
.final-atlas { margin-top: 5rem; padding-block: 4rem 3rem; background: var(--abyss); color: var(--ivory); }
.final-heading h3 { font-size: clamp(2rem,4vw,4rem); margin: 1rem 0 1.5rem; }
.final-heading > p:last-child { font-size: .9rem; margin-bottom: 3rem; }
.final-atlas .atlas { margin-bottom: 2rem; }
.destination-links { display: flex; justify-content: center; flex-wrap: wrap; gap: .6rem 1.5rem; }
.destination-links a { display: inline-flex; align-items: center; min-height: 44px; font-size: .85rem; }
dialog { width: min(580px,calc(100% - 2.5rem)); max-height: calc(100dvh - 3rem); padding: clamp(1.25rem,4vw,2.5rem); overflow-y: auto; border: 1px solid var(--copper); background: var(--ivory); color: var(--ink); }
dialog::backdrop { background: #14262cd9; }
.dialog-top { display: flex; gap: 1rem; justify-content: space-between; align-items: center; }
.dialog-close { background: transparent; color: var(--ink); }
dialog h2 { font-size: clamp(1.8rem,4vw,2.5rem); margin: 1.8rem 0 1.5rem; }
.dialog-note { font-size: .85rem; margin-top: 1.5rem; }
.site-footer { background: var(--abyss); color: var(--ivory); border-top: 1px solid #d9c9ad44; font-size: .8rem; padding-block: 2.5rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media(min-width:1200px) {
  .cross-reference { position: absolute; right: calc(100% + 2rem); top: 0; width: min(230px,calc((100vw - 660px)/2 - 3rem)); margin: 0; }
}
@media(max-width:900px) {
  .wide { width: calc(100% - 3rem); }
  .relation-grid { grid-template-columns: 1fr; }
  .destination-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .contents ol { grid-template-columns: 1fr; }
}
@media(max-width:600px) {
  .wide,.reading { width: calc(100% - 2.5rem); }
  .site-header { align-items: start; padding: 1.25rem; gap: 1rem; }
  .brand img { width: 115px; }
  .site-header nav { flex-direction: column; font-size: .75rem; gap: .5rem; }
  .opening { padding-bottom: 3rem; }
  .opening h1 { font-size: clamp(2.8rem,11vw,4rem); }
  .chapter-heading { margin-bottom: 2.5rem; }
  .demonstration,.catalogue { padding: 1.25rem; }
  .destination-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .dialog-top { align-items: start; }
  .site-footer { flex-direction: column; align-items: start; }
  th,td { padding: .5rem; min-width: 6rem; }
  .cross-reference { padding: 1.25rem; }
}
@media(prefers-reduced-motion:reduce) { html { scroll-behavior: auto; } }
@media print {
  .site-header,.site-footer,.chapter-next,.opening-link,.edition-note { display: none; }
  .chapter,.final-atlas { background: white; color: black; }
  .chapter { break-before: page; }
  .cross-reference { position: static; width: auto; }
  .position-notes:not([open]) > :not(summary) { display: block; }
  .map-surface { break-inside: avoid; }
}

/* Mission 6 : collection de départ et illustrations du récit. */
.contact-sheet { margin-bottom: 4rem; }
.contact-sheet > a { display: block; }
.contact-sheet img { width: 100%; height: auto; background: var(--ivory); }
.contact-sheet figcaption { margin-top: 1rem; font: .8rem/1.7 "Instrument Sans",sans-serif; color: var(--sand); }
.contact-sheet figcaption a { display: inline-block; padding-block: .5rem; }
.photo-anchor { position: relative; }
.margin-photo { width: min(260px,100%); margin: 1.5rem auto 2rem; font: .75rem/1.65 "Instrument Sans",sans-serif; }
.margin-photo img { width: auto; max-width: 100%; max-height: 280px; height: auto; margin-inline: auto; }
.margin-photo figcaption { margin-top: .65rem; }
/* Espace réel du chapitre : 660 + 2 × (180 image + 24 écart + 20 bord) = 1108 px.
   Les conteneurs ne coupent pas les marges et ne changent pas la largeur de lecture. */
.chapter { container-type: inline-size; }
@container (min-width:1108px) {
  .photo-anchor > .margin-photo { position: absolute; top: 0; width: clamp(180px,calc(50cqw - 374px),220px); margin: 0; }
  .photo-anchor > .margin-photo-gauche { right: calc(100% + 24px); }
  .photo-anchor > .margin-photo-droite { left: calc(100% + 24px); }
}
@media print {
  .margin-photo { position: static; margin: 1.5rem auto 2rem; break-inside: avoid; }
  .contact-sheet { break-inside: avoid; }
}

/* Consultation intégrée : le dialog natif confine le focus et neutralise le fond. */
.contact-viewer { position: fixed; inset: 0; width: 100%; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; background: var(--abyss); color: var(--ivory); overflow: hidden; }
.contact-viewer[open] { display: flex; flex-direction: column; }
.contact-viewer::backdrop { background: var(--abyss); }
.contact-viewer-toolbar { flex: none; display: flex; align-items: center; flex-wrap: wrap; gap: 1rem 2rem; padding: 1rem clamp(1rem,3vw,3rem); border-bottom: 1px solid var(--sand); }
.contact-viewer-toolbar h2 { flex: 1 1 220px; margin: 0; font-size: clamp(1rem,2vw,1.4rem); }
.contact-viewer-back { background: var(--ivory); color: var(--abyss); }
.contact-viewer-zoom { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; font: .85rem/1.5 "Instrument Sans",sans-serif; }
.contact-viewer-zoom input { width: 120px; min-height: 44px; accent-color: var(--sand); }
.contact-viewer-zoom output { min-width: 3.5rem; }
.contact-viewer-scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; touch-action: pan-x pan-y pinch-zoom; }
.contact-viewer-canvas { width: max-content; min-width: 100%; padding: 1rem; }
.contact-viewer-canvas img { width: var(--sheet-width,calc(100vw - 2rem)); max-width: none; height: auto; margin-inline: auto; }
@media(max-width:600px) {
  .margin-photo { width: min(220px,100%); margin-block: 1rem 1.5rem; }
  .margin-photo img { max-height: 240px; }
  .contact-viewer-toolbar { gap: .5rem 1rem; padding: .75rem 1rem; }
  .contact-viewer-toolbar h2 { flex-basis: 100%; font-size: 1rem; }
}
@media print {
  .photo-anchor > .margin-photo { position: static; margin: 1.5rem auto 2rem; }
  .contact-viewer { display: none !important; }
}
/* Contenir l’extrémité des cibles tactiles de la carte sur les petits écrans,
   sans déplacer les repères ni modifier leurs dimensions. */
.final-atlas { overflow-x: clip; }

/* Relief limité aux photographies marginales, sans modifier leurs dimensions. */
.margin-photo-open { display: block; width: max-content; max-width: 100%; min-height: 0; margin-inline: auto; padding: 0; border: 0; border-radius: 0; background: transparent; color: inherit; line-height: 0; cursor: zoom-in; }
.margin-photo-open img { box-shadow: 0 3px 12px #10182026, 0 1px 3px #1018201a; transition: box-shadow 160ms ease; }
@media(hover:hover) {
  .margin-photo-open:hover img { box-shadow: 0 5px 16px #10182033, 0 1px 4px #10182026; }
}
.margin-viewer { width: fit-content; max-width: min(980px,calc(100% - 2rem)); max-height: calc(100dvh - 2rem); padding: 0 1rem 1rem; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--sand); background: var(--ivory); color: var(--ink); box-shadow: 0 12px 40px #10182040; }
.margin-viewer::backdrop { background: #10182088; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.margin-viewer-toolbar { display: flex; justify-content: end; position: sticky; top: 0; z-index: 1; padding-block: .5rem; background: var(--ivory); }
.margin-viewer-close { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; background: transparent; border: 0; color: var(--ink); font-size: 1.8rem; line-height: 1; }
.margin-viewer figure { width: fit-content; max-width: 100%; margin-inline: auto; }
.margin-viewer figure img { width: auto; max-width: 100%; max-height: max(180px,calc(100dvh - 10rem)); height: auto; margin-inline: auto; }
.margin-viewer figcaption { max-width: 45rem; margin-top: .8rem; font: .85rem/1.6 "Instrument Sans",sans-serif; }
@media(prefers-reduced-motion:reduce) {
  .margin-photo-open img { transition: none; }
}
@media print {
  .margin-photo-open img { box-shadow: none; }
  .margin-viewer { display: none !important; }
}

/* Catalogue documentaire : uniquement les démonstrations III/V et leur fiche. */
.keyword-controls { display: flex; flex-wrap: wrap; gap: .65rem; }
.keyword-controls button { background: transparent; color: var(--green); }
.keyword-controls button[aria-pressed="true"] { background: var(--green); color: var(--ivory); }
.documentary-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1.5rem; margin-top: 1.5rem; }
.documentary-grid:empty { display: none; }
.documentary-card { display: flex; flex-direction: column; width: 100%; min-width: 0; padding: .8rem; border: 1px solid var(--sand); background: var(--ivory); color: var(--ink); text-align: left; }
.documentary-card:hover { border-color: var(--green); }
.documentary-card img { width: 100%; height: 160px; object-fit: contain; margin-bottom: .8rem; }
.documentary-card-title { font: 600 1rem/1.5 "Syne",sans-serif; }
.documentary-card-destination { margin-top: .4rem; font-size: .85rem; }
.documentary-viewer { width: min(1100px,calc(100% - 2rem)); max-width: none; max-height: calc(100dvh - 2rem); padding: 0 1.25rem 1.25rem; border: 1px solid var(--sand); overscroll-behavior: contain; }
.documentary-viewer::backdrop { background: #10182088; backdrop-filter: blur(4px); }
.documentary-toolbar { position: sticky; top: 0; z-index: 1; display: flex; justify-content: end; padding-block: .5rem; background: var(--ivory); }
.documentary-close { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; color: var(--ink); font-size: 1.8rem; }
.documentary-sheet { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,1fr); align-items: start; gap: 2rem; }
.documentary-image { width: auto; max-width: 100%; max-height: calc(100dvh - 8rem); height: auto; margin-inline: auto; }
.documentary-info { min-width: 0; }
.documentary-info h2 { margin: .6rem 0 1.5rem; font-size: clamp(1.4rem,2.8vw,2rem); }
.documentary-info dl { display: grid; gap: .25rem; font-size: .85rem; }
.documentary-info dt { margin-top: .6rem; font-weight: 600; }
.documentary-info dd { overflow-wrap: anywhere; }
.documentary-info > p:not(.kicker) { margin-top: 1.5rem; font-size: .95rem; }
.documentary-info h3 { margin-top: 1.5rem; font-size: 1rem; }
.documentary-info ul { display: flex; flex-wrap: wrap; gap: .4rem .8rem; list-style: none; padding: 0; font-size: .85rem; }
.documentary-info li { border-bottom: 1px solid var(--copper); }
@media(max-width:900px) { .documentary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media(max-width:700px) {
  .documentary-sheet { grid-template-columns: 1fr; gap: 1.5rem; }
  .documentary-image { max-height: 55dvh; }
}
@media(max-width:600px) { .documentary-grid { grid-template-columns: 1fr; } }
@media print { .documentary-viewer { display: none !important; } }

/* Six destinations : mêmes vignettes et même fiche que les recherches III/V. */
.destination-viewer { width: min(1100px,calc(100% - 2rem)); max-width: none; padding: 0 1.25rem 1.25rem; border: 1px solid var(--sand); overscroll-behavior: contain; }
.destination-viewer::backdrop { background: #10182088; backdrop-filter: blur(4px); }
.destination-toolbar { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: .75rem; background: var(--ivory); }
.destination-close { background: transparent; color: var(--ink); }
.documentary-back { margin-right: auto; background: transparent; color: var(--ink); font-size: .85rem; }
@media print { .destination-viewer { display: none !important; } }
@media(max-width:600px) {
  .destination-toolbar { flex-wrap: wrap; gap: .5rem; }
  .destination-toolbar .kicker { flex-basis: 100%; }
  .destination-close { margin-left: auto; white-space: nowrap; }
}

/* Aperçu hors du flux : le texte et les proportions des photographies restent intacts. */
.geography-story .geography-file-reference{font:inherit;line-height:inherit;min-height:0;vertical-align:baseline;color:inherit;background:none;border:0;border-radius:2px;padding:0;margin:0;cursor:pointer;text-decoration:underline;text-decoration-style:dotted;text-underline-offset:.2em}
.geography-story .geography-file-reference:hover{ text-decoration-style:solid }
.geography-story .geography-file-preview{position:fixed;z-index:30;width:300px;padding:12px;background:var(--ivory);color:var(--ink);border:1px solid var(--green);border-radius:6px;box-shadow:0 8px 28px #10182030;overflow:auto;animation:geography-file-preview-in 100ms ease-out}
.geography-story .geography-file-preview img{width:auto;height:auto;max-width:100%;max-height:280px;object-fit:contain;margin-inline:auto}
.geography-story .geography-file-preview figcaption{font-family:"Instrument Sans",sans-serif;font-size:.75rem;padding-top:8px}
.geography-story .geography-file-preview-close{display:block;margin:0 0 6px auto;width:36px;height:36px;min-height:36px;padding:0;border:1px solid var(--green);border-radius:50%;background:transparent;color:inherit;font:24px/1 "Instrument Sans",sans-serif;cursor:pointer}
@keyframes geography-file-preview-in{from{opacity:0}to{opacity:1}}
@media(prefers-reduced-motion:reduce){.geography-story .geography-file-preview{animation:none}}
@media print{.geography-story .geography-file-preview{display:none!important}.geography-story .geography-file-reference{text-decoration:none}}

/* Correction 002 : seuls les paragraphes consécutifs sont rapprochés. */
.manuscript > p + p { margin-top: 0; }
