:root {
  --ink: #555;
  --muted: #686868;
  --accent: #e80092;
  --cloud-grey: #c6c6c6;
  --cloud-height: clamp(144px, 16vw, 264px);
  --content-width: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 0; }
body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-family: 'Open Sans', Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.48;
}
main { overflow: clip; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button, input, select, textarea, audio { font: inherit; }
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Médaillon d’entrée, posé sans effet sur un fond blanc. */
.cover {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(18px, 5vw, 58px);
  background: #fff;
}
.cover-link {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.cover-link img {
  width: min(600px, 82vw);
  max-height: 82svh;
  height: auto;
  object-fit: contain;
  filter: none;
  box-shadow: none;
  border: 0;
}

/* Préambule : proportions et typographie proches de la page Divi originale. */
.intro {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(50px, 7vw, 86px) 18px;
  background: #fff;
}
.intro-card {
  position: relative;
  width: min(1120px, calc(100vw - 74px));
  margin: 0 auto;
  padding: clamp(44px, 4.6vw, 62px) clamp(24px, 4.5vw, 64px) clamp(30px, 3.5vw, 44px);
  text-align: center;
  color: #666;
  background: #f5f5f5;
  box-shadow: 0 12px 18px -6px rgba(0,0,0,.30);
}
.intro-loupe {
  position: absolute;
  left: 50%;
  top: 0;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: #f5f5f5;
  transform: translate(-50%, -52%);
  display: grid;
  place-items: center;
}
.intro-loupe svg {
  width: 86px;
  height: 86px;
  overflow: visible;
}
.intro-loupe circle,
.intro-loupe line {
  fill: none;
  stroke: #666;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.intro-card p {
  max-width: 980px;
  margin: 0 auto 1.25em;
  font-size: clamp(.88rem, .94vw, 1rem);
  font-weight: 600;
  line-height: 1.55;
}
.intro-card strong { font-weight: 600; }
.primary-button,
.back-to-map {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .38rem;
  min-height: 38px;
  padding: .25rem 1rem .22rem;
  border: 2px solid var(--accent);
  border-radius: 30px;
  background: transparent;
  color: var(--accent);
  font-size: 15px;
  font-weight: 400;
  text-decoration: none;
  box-shadow: none;
  transition: transform .18s ease, background-color .18s ease;
}
.primary-button:hover,
.primary-button:focus-visible,
.back-to-map:hover,
.back-to-map:focus-visible {
  transform: translateY(-1px);
  background: rgba(255,255,255,.72);
}

/* Carte : ajustée dans la hauteur ET la largeur de l’écran. */
.map-section {
  min-height: 100svh;
  height: 100svh;
  display: grid;
  place-items: center;
  padding: 8px;
  overflow: hidden;
  background: #fff;
}
.map-frame {
  position: relative;
  width: min(960px, calc((100vw - 16px) * .8), calc((127.66svh - 16px) * .8));
  aspect-ratio: 1200 / 940;
  margin: 0 auto;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
#map {
  width: 100%;
  height: 100%;
  background: #fff;
}
.fallback-map { width: 100%; height: auto; }
.location-status {
  position: absolute;
  left: 50%;
  bottom: 12px;
  z-index: 800;
  max-width: min(88%, 620px);
  margin: 0;
  padding: .44rem .68rem;
  border-radius: 9px;
  background: rgba(255,255,255,.95);
  color: #444;
  text-align: center;
  font-size: .76rem;
  box-shadow: 0 5px 16px rgba(0,0,0,.14);
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.location-status.visible { opacity: 1; }
.location-control {
  width: auto;
  min-width: 132px;
  height: 42px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  font: 700 15px/1 Arial, Helvetica, sans-serif;
  color: #111;
  border: 0;
  background: #fff;
  cursor: pointer;
}
.location-symbol { font-size: 22px; font-weight: 400; line-height: 1; }
.leaflet-container { font-family: 'Open Sans', Arial, sans-serif; background: #fff; }
.leaflet-tooltip.map-zone-tooltip {
  border: 0;
  border-radius: 9px;
  padding: .42rem .62rem;
  background: rgba(30,30,30,.92);
  color: #fff;
  font-size: .78rem;
  box-shadow: 0 7px 16px rgba(0,0,0,.2);
}
.leaflet-tooltip-top.map-zone-tooltip::before,
.leaflet-tooltip-bottom.map-zone-tooltip::before,
.leaflet-tooltip-left.map-zone-tooltip::before,
.leaflet-tooltip-right.map-zone-tooltip::before {
  border-top-color: rgba(30,30,30,.92);
  border-bottom-color: rgba(30,30,30,.92);
}
.position-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(232,0,146,.95);
  border: 4px solid #fff;
  box-shadow: 0 0 0 6px rgba(232,0,146,.20);
}

.story-marker {
  filter: drop-shadow(0 3px 4px rgba(0,0,0,.38));
}

/* Sections d’écoute : fond original aux lettres floues, un écran minimum. */
.story-section {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  background: #fff url('../images/fond-page.png') center / cover no-repeat;
}
.cloud-edge {
  position: relative;
  flex: 0 0 var(--cloud-height);
  width: 100%;
  height: var(--cloud-height);
  margin: 0;
  background: transparent;
  pointer-events: none;
  overflow: hidden;
}
.cloud-edge-top {
  display: none;
}
.cloud-edge-bottom {
  margin-top: calc(var(--cloud-height) * -0.10);
  margin-bottom: calc(var(--cloud-height) * -0.06);
}
.cloud-edge-bottom::before,
.cloud-edge-bottom::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  pointer-events: none;
}
/* nuage sombre, venant recouvrir progressivement le bas de la section */
.cloud-edge-bottom::before {
  top: 0;
  height: 72%;
  background-color: var(--cloud-grey);
  -webkit-mask: url('../images/clouds-top.svg') center / 100% 100% no-repeat;
  mask: url('../images/clouds-top.svg') center / 100% 100% no-repeat;
}
/* nuage clair constitué du fond lettré, venant recouvrir le nuage sombre */
.cloud-edge-bottom::after {
  bottom: 0;
  height: 68%;
  background-image: url('../images/fond-page.png');
  background-size: cover;
  background-position: center;
  -webkit-mask: url('../images/clouds-top.svg') center / 100% 100% no-repeat;
  mask: url('../images/clouds-top.svg') center / 100% 100% no-repeat;
}
.story-section:first-of-type .cloud-edge-top {
  display: none;
}
.story-shell {
  position: relative;
  z-index: 3;
  flex: 1 1 auto;
  min-height: 0;
  width: min(var(--content-width), calc(100vw - 36px));
  margin: 0 auto;
  padding: clamp(18px, 2.8vh, 28px) 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.story-heading {
  display: grid;
  grid-template-columns: minmax(64px, 104px) minmax(0, 1fr);
  gap: clamp(14px, 2.5vw, 26px);
  align-items: start;
}
.story-icon-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 7px;
}
.story-symbol {
  width: clamp(54px, 5vw, 76px);
  height: clamp(54px, 5vw, 76px);
  object-fit: contain;
}
.story-audio-card {
  border: 4px solid #000;
  border-radius: 36px;
  padding: clamp(12px, 1.5vw, 18px) clamp(15px, 2.5vw, 26px) clamp(10px, 1.3vw, 16px);
  background-color: rgba(255,255,255,.68);
  background-image:
    radial-gradient(circle at 26px 26px, rgba(0,0,0,.045) 0 34px, transparent 35px),
    radial-gradient(circle at 84px 84px, rgba(0,0,0,.045) 0 34px, transparent 35px);
  background-size: 116px 116px;
  box-shadow: 0 7px 18px rgba(0,0,0,.07);
}
.story-audio-card h2 {
  margin: 0 0 8px;
  color: #494949;
  text-align: center;
  font-size: clamp(1.12rem, 1.7vw, 1.55rem);
  font-weight: 400;
  line-height: 1.18;
}
.story-audio-card audio { display: none; }

/* Lecteur personnalisé identique dans son principe à l’édition 2022. */
.player-controls {
  display: grid;
  grid-template-columns: 34px 42px minmax(90px, 1fr) 42px 34px minmax(58px, 92px);
  align-items: center;
  gap: 8px;
  width: 100%;
}
.play-button,
.mute-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #666;
  cursor: pointer;
}
.play-button span { font-size: 16px; transform: translateX(1px); }
.mute-button span { font-size: 20px; line-height: 1; }
.mute-button.is-muted { opacity: .45; }
.time {
  color: #777;
  font-size: .78rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.progress,
.volume {
  width: 100%;
  height: 18px;
  margin: 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}
.progress::-webkit-slider-runnable-track,
.volume::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: #c8c8c8;
}
.progress::-moz-range-track,
.volume::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: #c8c8c8;
}
.progress::-webkit-slider-thumb,
.volume::-webkit-slider-thumb {
  width: 12px;
  height: 12px;
  margin-top: -4px;
  border: 0;
  border-radius: 50%;
  background: #666;
  appearance: none;
  -webkit-appearance: none;
}
.progress::-moz-range-thumb,
.volume::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: #666;
}

.gallery {
  width: min(640px, 100%);
  margin: clamp(18px, 2.7vh, 28px) auto 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 14px 18px;
}
.gallery-figure { margin: 0; display: grid; gap: 7px; justify-items: center; }
.gallery-item {
  width: 100%;
  min-height: 104px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  min-height: 104px;
  object-fit: cover;
  box-shadow: 0 8px 18px rgba(0,0,0,.09);
  transition: transform .18s ease, box-shadow .18s ease;
}
.gallery-item:hover img,
.gallery-item:focus-visible img {
  transform: translateY(-2px);
  box-shadow: 0 13px 24px rgba(0,0,0,.13);
}
.gallery-figure figcaption {
  max-width: 100%;
  color: #666;
  text-align: center;
  font-size: clamp(.74rem, .95vw, .82rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1.35;
}
.credits {
  max-width: 940px;
  margin: clamp(16px, 2.4vh, 24px) auto 0;
  color: #696969;
  text-align: center;
  font-size: clamp(.75rem, .86vw, .84rem);
  font-weight: 400;
  line-height: 1.42;
}
.credits p { margin: .08rem 0; }
.story-actions { margin-top: clamp(14px, 2vh, 20px); text-align: center; }

.lightbox[hidden] { display: none !important; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  grid-template-columns: 56px minmax(0,1fr) 56px;
  align-items: center;
  gap: 8px;
  padding: max(18px, env(safe-area-inset-top)) 10px max(18px, env(safe-area-inset-bottom));
  background: rgba(10,10,10,.82);
}
.lightbox figure {
  margin: 0;
  justify-self: center;
  max-width: min(92vw, 1200px);
  display: grid;
  gap: 10px;
}
.lightbox img {
  max-height: min(78vh, 960px);
  width: auto;
  max-width: 100%;
  border-radius: 12px;
  box-shadow: 0 24px 44px rgba(0,0,0,.32);
}
.lightbox figcaption { color: #f2f2f2; text-align: center; font-size: .86rem; font-style: italic; }
.lightbox-close,
.lightbox-nav {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 1.8rem;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0,0,0,.2);
}
.lightbox-close { position: absolute; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); }
.lightbox-prev { justify-self: end; }
.lightbox-next { justify-self: start; }
body.lightbox-open { overflow: hidden; }

@media (max-width: 840px) {
  :root { --cloud-height: clamp(120px, 22vw, 200px); }
  .story-heading { grid-template-columns: 1fr; justify-items: center; gap: 9px; }
  .story-icon-wrap { padding-top: 0; }
  .story-audio-card { width: 100%; }
  .intro-card { width: min(760px, calc(100vw - 36px)); }
}

@media (max-width: 640px) {
  :root { --cloud-height: clamp(104px, 28vw, 168px); }
  body { font-size: 13px; }
  .cover-link img { width: min(560px, 92vw); max-height: 78svh; }
  .intro { padding-inline: 11px; }
  .intro-card {
    width: calc(100vw - 22px);
    padding: 42px 17px 28px;
  }
  .intro-loupe { width: 80px; height: 80px; }
  .intro-loupe svg { width: 72px; height: 72px; }
  .intro-card p { font-size: clamp(.84rem, 3.6vw, .94rem); }
  .story-shell { width: calc(100vw - 22px); padding-block: 10px; }
  .story-audio-card { border-width: 3px; border-radius: 27px; padding-inline: 12px; }
  .story-audio-card h2 { font-size: clamp(1.04rem, 4.7vw, 1.32rem); }
  .player-controls {
    grid-template-columns: 30px minmax(90px,1fr) 38px 30px 62px;
    gap: 5px;
  }
  .elapsed { display: none; }
  .play-button, .mute-button { width: 30px; height: 30px; }
  .time { font-size: .72rem; }
  .gallery { width: min(280px,100%); grid-template-columns: 1fr; gap: 12px; }
  .gallery-item, .gallery-item img { min-height: 110px; }
  .credits { font-size: .74rem; }
  .lightbox { grid-template-columns: 44px minmax(0,1fr) 44px; }
}

@media (max-width: 520px) {
  .location-control { min-width: 119px; height: 40px; padding: 0 10px; gap: 5px; font-size: 14px; }
  .location-symbol { font-size: 20px; }
}

@media (orientation: landscape) and (max-height: 620px) {
  :root { --cloud-height: clamp(88px, 18vh, 120px); }
  .intro { padding-block: 36px; }
  .intro-card { padding-block: 34px 22px; }
  .intro-loupe { width: 70px; height: 70px; }
  .intro-loupe svg { width: 62px; height: 62px; }
  .intro-card p { margin-bottom: .72em; font-size: .78rem; }
  .story-shell { padding-block: 7px; }
  .story-heading { grid-template-columns: 68px minmax(0,1fr); gap: 12px; }
  .story-symbol { width: 50px; height: 50px; }
  .story-audio-card { padding-block: 8px; border-radius: 28px; }
  .story-audio-card h2 { font-size: 1.05rem; margin-bottom: 4px; }
  .player-controls { grid-template-columns: 30px 38px minmax(80px,1fr) 38px 30px 70px; gap: 5px; }
  .play-button, .mute-button { width: 30px; height: 30px; }
  .gallery { margin-top: 10px; grid-template-columns: repeat(auto-fit,minmax(145px,1fr)); gap: 9px 12px; }
  .gallery-item, .gallery-item img { min-height: 92px; }
  .gallery-figure figcaption { font-size: .67rem; }
  .credits { margin-top: 10px; font-size: .68rem; line-height: 1.25; }
  .story-actions { margin-top: 8px; }
  .back-to-map { min-height: 32px; padding-inline: .8rem; font-size: .8rem; }
}

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