/* =========================================================================
   Visite virtuelle — collégiale de Huy
   Feuille de styles unique. Variables en haut pour re-thémer facilement.
   ========================================================================= */

:root {
  --color-bg: #f7f4ee;
  --color-bg-alt: #efe9dd;
  --color-text: #2a2621;
  --color-text-muted: #6b645a;
  --color-stone: #8a7f6c;
  --color-accent: #8a1f2b;   /* rouge profond, écho des vitraux */
  --color-accent-dark: #6e1721;
  --color-accent-blue: #1f3a5f; /* bleu profond, écho de la rosace */
  --color-line: #ddd4c2;
  --color-surface: #ffffff;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 10px 30px rgba(30, 24, 14, 0.12);
  --shadow-sm: 0 2px 10px rgba(30, 24, 14, 0.10);
  --font-serif: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  line-height: 1.55;
}
body.modal-open { overflow: hidden; }

img { max-width: 100%; display: block; }
a { color: var(--color-accent-dark); }
code {
  background: var(--color-bg-alt);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
}
.wrap--texte { max-width: 780px; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-accent);
  color: #fff;
  padding: 10px 16px;
  z-index: 999;
}
.skip-link:focus { left: 10px; top: 10px; }

/* ---------- En-tête ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(247, 244, 238, 0.92);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--color-line);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.site-header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-text);
  text-decoration: none;
}
.site-header__crest { border-radius: 50%; }
.site-nav { display: flex; gap: 22px; }
.site-nav a {
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.94rem;
}
.site-nav a:hover { color: var(--color-accent); }

/* ---------- Sélecteur de langue (en-tête) ---------- */
.lang-switcher {
  display: inline-flex;
  gap: 2px;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-line);
  border-radius: 999px;
  padding: 3px;
  flex-shrink: 0;
}
.lang-switcher:empty { display: none; }
.lang-btn {
  border: none;
  background: transparent;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  color: var(--color-text-muted);
}
.lang-btn:hover { color: var(--color-text); }
.lang-btn[aria-pressed="true"] {
  background: var(--color-surface);
  color: var(--color-accent-dark);
  box-shadow: var(--shadow-sm);
}

/* En-tête étroit (mobile) : le nom du site traduit peut être long, et avec
   quatre langues le sélecteur prend de la place — on passe sur deux lignes
   plutôt que de déborder hors de l'écran. */
@media (max-width: 760px) {
  .site-header__inner {
    flex-wrap: wrap;
    height: auto;
    padding-block: 10px;
    row-gap: 8px;
  }
  .site-header__brand { order: 1; font-size: 0.95rem; }
  .lang-switcher { order: 2; }
  .site-nav {
    order: 3;
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 16px;
    font-size: 0.88rem;
  }
}

/* ---------- Hero ----------
   Photo réelle en fond (une des vraies prises Insta360, adoucie) avec un
   dégradé sombre superposé côté texte, façon habillage "site patrimonial" --
   remplace l'ancien aplat de dégradés discrets, jugé un peu terne. Le
   dégradé est réglé pour garder le texte lisible quelle que soit la photo
   utilisée derrière (clair à gauche du texte est toujours assez sombre). */
.hero {
  position: relative;
  padding: 108px 0 84px;
  border-bottom: 1px solid var(--color-line);
  background:
    linear-gradient(
      100deg,
      rgba(16, 13, 9, 0.88) 0%,
      rgba(16, 13, 9, 0.78) 34%,
      rgba(16, 13, 9, 0.38) 62%,
      rgba(16, 13, 9, 0.12) 82%
    ),
    url("../assets/img/hero-bg.jpg") center 32% / cover no-repeat;
  color: #f5efe1;
}
.hero__inner { max-width: 760px; }
.hero__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  color: #e7c987;
  font-weight: 700;
  margin: 0 0 10px;
}
.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  margin: 0 0 8px;
  line-height: 1.15;
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}
.hero__accroche {
  font-size: 1.1rem;
  color: #f1d9a8;
  margin: 0 0 14px;
  font-weight: 600;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.4);
}
.hero__lede {
  color: rgba(245, 239, 225, 0.88);
  font-size: 1.02rem;
  margin: 0 0 26px;
  max-width: 60ch;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }

.btn {
  display: inline-block;
  border: 1px solid var(--color-accent);
  background: var(--color-accent);
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.96rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}
.btn:hover { background: var(--color-accent-dark); border-color: var(--color-accent-dark); }
.btn--primary {}
.btn--ghost {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-line);
}
.btn--ghost:hover { background: var(--color-bg-alt); }
.btn--small { padding: 8px 14px; font-size: 0.86rem; }

/* ---------- Section générique ---------- */
.section { padding: 56px 0; }
.section--texte h2 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  margin: 0 0 16px;
}
.section__heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}
.section__heading h2 { margin: 0 0 16px; }
.section--texte + .section--texte { border-top: 1px solid var(--color-line); }
.note { color: var(--color-text-muted); font-size: 0.9rem; }

/* ---------- Sélecteur de zone (intérieur / extérieur) ---------- */
.zone-switcher {
  display: inline-flex;
  gap: 4px;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-line);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 14px;
}
.zone-switcher[hidden] { display: none; }
.zone-btn {
  border: none;
  background: transparent;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--color-text-muted);
}
.zone-btn:hover { color: var(--color-text); }
.zone-btn[aria-pressed="true"] {
  background: var(--color-surface);
  color: var(--color-accent-dark);
  box-shadow: var(--shadow-sm);
}

/* ---------- Bandeau démo ---------- */
.demo-banner {
  background: #fff6e0;
  border: 1px solid #e8c96a;
  color: #6a5313;
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 18px;
  font-size: 0.92rem;
}

/* ---------- Zone de visite (3D + liste POI) ---------- */
.viewer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}
@media (max-width: 860px) {
  .viewer { grid-template-columns: 1fr; }
}

.splat-stage {
  position: relative;
  width: 100%;
  height: min(70vh, 640px);
  min-height: 380px;
  background: #0d0f14;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  touch-action: none;
}
#canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.hotspot-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.hotspot {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(-9999px, -9999px);
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: opacity 0.15s ease;
  --hotspot-scale: 1;
  margin-left: -14px;
  margin-top: -14px;
}
.hotspot--hidden { opacity: 0; pointer-events: none; }
.hotspot__dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-accent);
  border: 2px solid #fff;
  box-shadow: 0 0 0 4px rgba(138, 31, 43, 0.35), 0 2px 8px rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(var(--hotspot-scale));
  animation: hotspot-pulse 2.4s ease-in-out infinite;
}
.hotspot__label {
  display: none;
}
.hotspot:hover .hotspot__dot,
.hotspot:focus-visible .hotspot__dot {
  background: var(--color-accent-dark);
  animation-play-state: paused;
}
@keyframes hotspot-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(138, 31, 43, 0.35), 0 2px 8px rgba(0,0,0,0.4); }
  50% { box-shadow: 0 0 0 9px rgba(138, 31, 43, 0.12), 0 2px 8px rgba(0,0,0,0.4); }
}

.crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border: 2px solid #ffd24d;
  border-radius: 50%;
  pointer-events: none;
}
.crosshair::before, .crosshair::after {
  content: "";
  position: absolute;
  background: #ffd24d;
}
.crosshair::before { left: 50%; top: -8px; width: 2px; height: 8px; transform: translateX(-1px); }
.crosshair::after { left: -8px; top: 50%; width: 8px; height: 2px; transform: translateY(-1px); }

/* Écran de chargement (repris/adapté du viewer d'origine) */
.scene {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}
.cube-wrapper { transform-style: preserve-3d; }
.cube {
  transform-style: preserve-3d;
  transform: rotateX(45deg) rotateZ(45deg);
  animation: rotation 2s infinite;
}
.cube-faces {
  transform-style: preserve-3d;
  height: 50px;
  width: 50px;
  position: relative;
  transform-origin: 0 0;
  transform: translateX(0) translateY(0) translateZ(-25px);
}
.cube-face {
  position: absolute;
  inset: 0;
  background: var(--color-accent);
  border: solid 1px #ffffff;
}
.cube-face.top { transform: translateZ(50px); }
.cube-face.front { transform-origin: 0 50%; transform: rotateY(-90deg); }
.cube-face.back { transform-origin: 0 50%; transform: rotateY(-90deg) translateZ(-50px); }
.cube-face.right { transform-origin: 50% 0; transform: rotateX(-90deg) translateY(-50px); }
.cube-face.left { transform-origin: 50% 0; transform: rotateX(-90deg) translateY(-50px) translateZ(50px); }
@keyframes rotation {
  0% { transform: rotateX(45deg) rotateY(0) rotateZ(45deg); }
  50% { transform: rotateX(45deg) rotateY(0) rotateZ(225deg); }
  100% { transform: rotateX(45deg) rotateY(0) rotateZ(405deg); }
}

.progress {
  position: absolute;
  top: 0; left: 0;
  height: 4px;
  background: var(--color-accent-blue);
  z-index: 6;
  transition: width 0.1s ease-in-out;
}
.stage-message {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ff8a8a;
  font-weight: 600;
  text-align: center;
  padding: 20px;
  pointer-events: none;
  z-index: 6;
}
.stage-debug {
  position: absolute;
  bottom: 8px;
  left: 10px;
  color: rgba(255,255,255,0.55);
  font-size: 0.72rem;
  z-index: 6;
  pointer-events: none;
}

.stage-controls {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
  z-index: 7;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.stage-btn {
  background: rgba(13, 15, 20, 0.72);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.82rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.stage-btn:hover { background: rgba(13, 15, 20, 0.9); }
.stage-btn[aria-pressed="true"] { background: var(--color-accent); border-color: var(--color-accent); }
.stage-btn span { display: none; }
@media (min-width: 640px) {
  .stage-btn span { display: inline; }
}

/* ---------- Panneau liste des points d'intérêt ---------- */
.poi-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: 16px;
  max-height: min(70vh, 640px);
  overflow-y: auto;
}
.poi-panel h2 {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  margin: 0 0 10px;
}
.poi-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.poi-list__item button {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 8px 8px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.poi-list__item button:hover { background: var(--color-bg-alt); }
.poi-list__thumb-wrap {
  flex: 0 0 auto;
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--color-bg-alt);
  box-shadow: inset 0 0 0 1px var(--color-line);
}
.poi-list__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.poi-list__num {
  position: absolute;
  left: 4px;
  bottom: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85);
}
.poi-list__titre { display: block; font-weight: 600; font-size: 0.92rem; }
.poi-list__resume { display: block; color: var(--color-text-muted); font-size: 0.8rem; margin-top: 2px; }

/* ---------- Petite légende des commandes, à côté de la visionneuse ---------- */
.controls-legend {
  border-bottom: 1px solid var(--color-line);
  padding-bottom: 14px;
  margin-bottom: 14px;
}
.controls-legend dl { margin: 0; }
.controls-legend dt {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-accent-blue);
  font-weight: 700;
  margin-top: 8px;
}
.controls-legend dt:first-child { margin-top: 0; }
.controls-legend dd {
  margin: 2px 0 0;
  font-size: 0.86rem;
  color: var(--color-text);
  line-height: 1.5;
}
.controls-legend__note {
  color: var(--color-text-muted);
  font-size: 0.78rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
}
p.controls-legend__note {
  margin: 10px 0 0;
  line-height: 1.4;
}
kbd {
  display: inline-block;
  min-width: 1.4em;
  text-align: center;
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid var(--color-line);
  background: var(--color-bg-alt);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82em;
  box-shadow: 0 1px 0 var(--color-line);
}

/* ---------- Mode édition ---------- */
.edit-panel {
  margin-top: 16px;
  background: var(--color-surface);
  border: 1px dashed var(--color-accent-blue);
  border-radius: var(--radius-lg);
  padding: 18px;
}
.edit-panel h3 { margin: 0 0 8px; font-family: var(--font-serif); font-size: 1.1rem; }
.edit-panel p { color: var(--color-text-muted); font-size: 0.9rem; }
.edit-panel__row { display: flex; align-items: center; gap: 10px; margin: 12px 0; }
.edit-panel__row input[type="range"] { flex: 1; }
.edit-panel__readout { font-size: 0.88rem; line-height: 1.8; }
.edit-panel__actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.edit-panel__output {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  background: #14151a;
  color: #b7f7c1;
  border-radius: 8px;
  border: none;
  padding: 12px;
  resize: vertical;
}

/* ---------- Fiches points d'intérêt (texte complet) ---------- */
.poi-details {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.poi-card {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.poi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.poi-card__img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  background: var(--color-bg-alt);
}
.poi-card__body { padding: 16px 18px 18px; }
.poi-card__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.poi-card__actions .listen-btn { margin-top: 0; }
.poi-card h3 {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  margin: 0 0 8px;
}
.poi-card p { font-size: 0.92rem; color: var(--color-text-muted); margin: 0 0 12px; }

/* ---------- Pied de page ---------- */
.site-footer {
  border-top: 1px solid var(--color-line);
  padding: 26px 0 40px;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}
.site-footer a { color: var(--color-accent-dark); }

/* ---------- Fiche modale (panorama 360°) ---------- */
.poi-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
/* L'attribut HTML `hidden` doit rester prioritaire sur `display: flex` ci-dessus,
   sinon la fiche reste cliquable/visible même masquée (piège classique du cascade). */
.poi-modal[hidden] {
  display: none;
}
.poi-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 9, 6, 0.72);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.poi-modal--visible .poi-modal__overlay { opacity: 1; }
.poi-modal__dialog {
  position: relative;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  width: min(920px, 100%);
  max-height: 90vh;
  overflow: auto;
  box-shadow: var(--shadow);
  transform: translateY(12px);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.poi-modal--visible .poi-modal__dialog { transform: translateY(0); opacity: 1; }
.poi-modal__pano-frame {
  position: relative;
  padding: 9px;
  background:
    linear-gradient(155deg, #e7c987, var(--color-accent) 38%, var(--color-accent-dark) 75%, #3a1a10);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.poi-modal__pano {
  width: 100%;
  height: min(50vh, 460px);
  background: #0d0f14;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45), inset 0 0 0 5px rgba(10, 9, 6, 0.35);
}
/* Bandeau-titre incrusté en bas du panorama : lisible sur n'importe quelle photo
   grâce au dégradé, et pointer-events:none pour ne jamais gêner le glisser/zoomer
   de Pannellum en dessous. */
.poi-modal__caption {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 999px;
  background: linear-gradient(to top, rgba(10, 9, 6, 0.8), rgba(10, 9, 6, 0.42) 70%, transparent);
  pointer-events: none;
}
.poi-modal__caption-badge {
  flex: none;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: #241a10;
  background: linear-gradient(135deg, #f1d9a0, #b98a3d);
  padding: 3px 8px;
  border-radius: 999px;
}
.poi-modal__caption-title {
  font-family: var(--font-serif);
  color: #fff;
  font-size: 1rem;
  line-height: 1.2;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.poi-modal__text { padding: 20px 22px 24px; }
.poi-modal__text h3 { font-family: var(--font-serif); margin: 0 0 10px; font-size: 1.3rem; }
.poi-modal__text p { margin: 0; color: var(--color-text-muted); }
.poi-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  background: rgba(13,15,20,0.7);
  color: #fff;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
}

/* =========================================================================
   ACCESSIBILITÉ — pensée pour un public senior et/ou en situation de handicap
   ========================================================================= */

/* Utilitaire : visible seulement pour les lecteurs d'écran */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Anneau de focus clair et cohérent partout (double liseré blanc + couleur
   d'accent, visible aussi bien sur fond clair que sur le rendu 3D sombre). */
:focus-visible {
  outline: 3px solid #ffd24d;
  outline-offset: 2px;
  border-radius: 4px;
}
.stage-btn:focus-visible,
.nav-pad__btn:focus-visible,
.a11y-toggle:focus-visible {
  outline: 3px solid #ffd24d;
  outline-offset: 2px;
}

/* Respecte le réglage "réduire les animations" du système d'exploitation,
   même sans que le visiteur touche à quoi que ce soit sur le site. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
/* Bascule manuelle équivalente, pilotée par le panneau d'accessibilité
   (utile sur les systèmes où le réglage global n'est pas accessible). */
html.a11y-motion-reduce *,
html.a11y-motion-reduce *::before,
html.a11y-motion-reduce *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}

/* ---------- Pavé de navigation à l'écran (flèches cliquables) ---------- */
/* Pour les visiteurs qui ne savent pas qu'on peut cliquer-glisser sur       */
/* l'image pour regarder autour de soi : un gros pavé directionnel, à la    */
/* manière d'une télécommande, fait exactement la même chose.               */
.nav-pad {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 7;
  display: grid;
  grid-template-columns: repeat(3, 46px);
  grid-template-rows: repeat(3, 46px);
  gap: 4px;
  touch-action: none;
}
.nav-pad__btn {
  grid-column: 2;
  grid-row: 2;
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: rgba(13, 15, 20, 0.72);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.22);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}
.nav-pad__btn:hover { background: rgba(13, 15, 20, 0.9); }
.nav-pad__btn:active,
.nav-pad__btn.is-pressed { background: var(--color-accent); border-color: var(--color-accent); }
.nav-pad__btn--up { grid-column: 2; grid-row: 1; }
.nav-pad__btn--left { grid-column: 1; grid-row: 2; }
.nav-pad__btn--right { grid-column: 3; grid-row: 2; }
.nav-pad__btn--down { grid-column: 2; grid-row: 3; }
.nav-pad__btn--center {
  grid-column: 2;
  grid-row: 2;
  background: rgba(13, 15, 20, 0.5);
  font-size: 1rem;
}
.nav-pad__btn--center:hover { background: rgba(13, 15, 20, 0.75); }

/* ---------- Astuce discrète à la première visite ---------- */
/* Volontairement NON bloquante : ce n'est pas une fenêtre modale qui force
   à cliquer "j'ai compris" avant de pouvoir continuer. C'est une petite
   bulle dans un coin, qui n'empêche jamais de cliquer/glisser sur l'image
   en dessous, et qui se referme toute seule dès qu'on commence à naviguer
   (glisser, flèches, pavé) — pour ne pas gêner les visiteurs déjà à l'aise
   avec ce genre d'image à 360°, tout en donnant un coup de pouce clair aux
   autres. Elle ne s'affiche qu'une seule fois (mémorisé sur l'appareil).  */
.stage-hint {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 8;
  max-width: 360px;
  background: rgba(20, 17, 12, 0.92);
  color: #fff;
  border-radius: var(--radius);
  padding: 12px 40px 12px 14px;
  box-shadow: var(--shadow);
  font-size: 0.86rem;
  line-height: 1.4;
}
.stage-hint[hidden] { display: none; }
.stage-hint p { margin: 0; }
.stage-hint__close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.14);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
}
.stage-hint__close:hover { background: rgba(255,255,255,0.26); }

/* ---------- Barre d'outils d'accessibilité ---------- */
.a11y-toggle {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-accent-blue);
  color: #fff;
  border: 2px solid #fff;
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0,0,0,0.28);
}
.a11y-toggle:hover { background: #14283f; }
.a11y-toggle__icon { font-size: 1.2rem; }

.a11y-panel {
  position: fixed;
  right: 16px;
  bottom: 78px;
  z-index: 50;
  width: min(320px, calc(100vw - 32px));
  max-height: min(72vh, 560px);
  overflow-y: auto;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 18px;
}
.a11y-panel[hidden] { display: none; }
.a11y-panel h2 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  margin: 0 0 4px;
}
.a11y-panel__intro {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin: 0 0 16px;
}
.a11y-group { margin: 0 0 16px; }
.a11y-group:last-of-type { margin-bottom: 8px; }
.a11y-group legend {
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0 0 8px;
}
.a11y-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.a11y-btn {
  flex: 1 1 auto;
  background: var(--color-bg-alt);
  color: var(--color-text);
  border: 1px solid var(--color-line);
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 0.85rem;
  cursor: pointer;
  min-height: 40px;
}
.a11y-btn[aria-pressed="true"] {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
  font-weight: 700;
}
.a11y-btn:hover { filter: brightness(0.97); }
.a11y-panel__reset {
  width: 100%;
  margin-top: 4px;
  background: none;
  border: 1px dashed var(--color-line);
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  cursor: pointer;
}
.a11y-panel__reset:hover { color: var(--color-text); border-color: var(--color-stone); }

/* Taille de texte : on agit sur le html entier, tout le site suit. */
html.a11y-text-lg { font-size: 112%; }
html.a11y-text-xl { font-size: 128%; }

/* Contraste élevé : fonds plus francs, textes plus foncés, bordures plus
   marquées, ombres réduites (moins de "flou" pour les basses visions). */
html.a11y-contrast-high {
  --color-bg: #ffffff;
  --color-bg-alt: #eeeeee;
  --color-text: #000000;
  --color-text-muted: #1a1a1a;
  --color-line: #000000;
  --color-surface: #ffffff;
}
html.a11y-contrast-high .hero {
  background: #000 !important;
}
html.a11y-contrast-high .btn--primary,
html.a11y-contrast-high .stage-btn[aria-pressed="true"] {
  outline: 2px solid #fff;
}
html.a11y-contrast-high .poi-list__item button:hover,
html.a11y-contrast-high a { text-decoration: underline; }

/* Palettes adaptées aux daltonismes les plus courants. On ne touche QUE aux
   couleurs d'interface (boutons, badges, pastilles des points d'intérêt) :
   les photos et le rendu 3D restent inchangés, ce n'est pas un filtre qui
   déforme l'image, seulement un re-thémage des éléments d'interface via les
   variables déjà utilisées partout dans cette feuille de styles. */
/* Deutéranopie / Protanopie (confusion rouge-vert) : bleu/orange (palette
   Okabe-Ito), un classique de l'accessibilité, bien distinguable pour ces
   deux types de daltonisme. */
html.a11y-palette-rougevert {
  --color-accent: #0072b2;
  --color-accent-dark: #00507e;
  --color-accent-blue: #e69f00;
}
/* Tritanopie (confusion bleu-jaune) : on évite justement le duo bleu/jaune,
   au profit d'un rouge vermillon et d'un pourpre, bien séparés sur cet axe. */
html.a11y-palette-bleujaune {
  --color-accent: #d55e00;
  --color-accent-dark: #a34600;
  --color-accent-blue: #cc79a7;
}

/* ---------- Bouton "Écouter" (lecture audio) ---------- */
.listen-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-line);
  color: var(--color-text);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 0.82rem;
  cursor: pointer;
  min-height: 36px;
}
.listen-btn:hover { background: var(--color-line); }
.listen-btn[aria-pressed="true"] {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}
.poi-card__body .listen-btn,
.poi-modal__text .listen-btn { margin-top: 10px; }
/* Variante sur fond sombre (bandeau d'accueil), même logique de couleurs
   que .btn--ghost mais lisible sur la photo assombrie du hero. */
.listen-btn--hero {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}
.listen-btn--hero:hover { background: rgba(255, 255, 255, 0.2); }
.listen-btn--hero[aria-pressed="true"] {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

