/* Risk Swan · La galerie photo (version 2 du site en 3D)
   S'ajoute à styles.css, le style du site de référence. Tout ce qui suit ne vaut que lorsque galerie.js a monté
   la scène (classe « galerie-on ») : sans le script, la page reste le site classique.
   Charte : bleu nuit, ivoire, or doux ; Georgia pour les titres, Calibri pour le texte. */

:root { --marge: clamp(12px, 4.5vw, 128px); --pad: clamp(20px, 4.6vw, 68px); }
.g-scene, .g-boussole, .g-progres, .g-indice { display: none; }

/* ---------- La scène : fixe, sous l'en-tête ---------- */
.galerie-on body { background: var(--night); }
.galerie-on .g-scene { display: block; position: fixed; left: 0; right: 0; bottom: 0; top: var(--hdr, 82px); z-index: 0; overflow: hidden; pointer-events: none; background: var(--night); animation: g-entre 1.4s ease both; }
@keyframes g-entre { from { opacity: 0; } to { opacity: 1; } }
.g-plateau { position: absolute; inset: 0; transform-origin: 0 0; }
.g-photo { position: absolute; left: -2%; top: -2%; width: 104%; height: 104%; object-fit: cover; display: block; }
.g-photo[hidden] { display: none; }
/* la porte : la salle suivante, ou la lumière après la dernière */
.g-porte { position: absolute; overflow: hidden; opacity: 0; background: radial-gradient(ellipse at 50% 50%, #fffdf8 0%, #faf1df 28%, #efd9ad 62%, #dfb773 100%); }
.g-vue-b { position: absolute; left: 0; top: 0; transform-origin: 0 0; overflow: hidden; }
.g-chambranle { position: absolute; opacity: 0; perspective: 900px; box-shadow: 0 0 0 2px var(--gold), 0 0 0 7px rgba(0, 10, 36, 0.6), 0 0 0 8px rgba(223, 183, 115, 0.6), 0 0 90px 12px rgba(223, 183, 115, 0.35); }
.g-vantail { position: absolute; top: 0; bottom: 0; width: 50%; background: linear-gradient(90deg, #12223f, #0a1632); box-shadow: inset 0 0 0 9px #0d1b3a, inset 0 0 0 10px rgba(223, 183, 115, 0.8), inset 0 -60px 70px -40px rgba(0, 0, 0, 0.5); backface-visibility: hidden; }
.g-vantail.g { left: 0; transform-origin: 0 50%; }
.g-vantail.d { right: 0; transform-origin: 100% 50%; }
.g-vantail::after { content: ""; position: absolute; top: 50%; width: 4px; height: 13%; margin-top: -6%; background: linear-gradient(#f0d49b, #b8955a); border-radius: 2px; }
.g-vantail.g::after { right: 14%; }
.g-vantail.d::after { left: 14%; }
/* les cadres dorés qui défilent pendant le passage */
.g-cadres { position: absolute; inset: 0; }
.g-cadre { position: absolute; opacity: 0; border: 2px solid rgba(223, 183, 115, 0.9); box-shadow: inset 0 0 0 7px rgba(0, 10, 36, 0.22), inset 0 0 0 8px rgba(223, 183, 115, 0.4), 0 0 40px rgba(0, 0, 0, 0.25); }
/* le voile : il assombrit la photographie pendant la lecture */
.g-voile { position: absolute; inset: 0; background: radial-gradient(ellipse 75% 70% at 50% 45%, rgba(0, 10, 36, 0.55), rgba(0, 6, 22, 0.92)); opacity: 0.15; }
.g-scene::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 160px rgba(0, 4, 16, 0.65); pointer-events: none; }

/* ---------- La page devant la scène ---------- */
.galerie-on main, .galerie-on footer { position: relative; z-index: 1; }
.galerie-on main { overflow-x: hidden; overflow-x: clip; }
.galerie-on .g-seuil { height: 75vh; height: 75svh; }
.galerie-on .g-seuil-fin { height: 85vh; height: 85svh; }
.galerie-on footer { padding-bottom: 96px; }
.galerie-on .reveal { opacity: 1; transform: none; transition: none; }

/* chaque partie : son titre posé sur la photographie, puis un panneau plein, puis le lien vers la suivante */
.galerie-on main > section:not(.hero) { padding: 0; background: transparent; }
.galerie-on .g-entete, .galerie-on main > section:not(.hero) > .wrap, .galerie-on .g-suite {
  box-sizing: border-box; max-width: none; margin: 0 auto;
  width: min(calc(100% - 2 * var(--marge)), calc(var(--wrap) + 2 * var(--pad)));
}
.galerie-on .g-entete {
  min-height: clamp(240px, 44vh, 480px); display: flex; flex-direction: column; justify-content: flex-end;
  padding: var(--pad) var(--pad) clamp(28px, 3.6vw, 52px);
  background: linear-gradient(0deg, rgba(0, 10, 36, 0.92), rgba(0, 10, 36, 0.5) 48%, rgba(0, 10, 36, 0));
  border: 1px solid rgba(223, 183, 115, 0.5); border-bottom: 0;
}
.galerie-on .g-entete .tag { color: #f2ddba; margin-bottom: 18px; }
.galerie-on .g-entete .tag::before { background: var(--gold); }
.galerie-on .g-entete h2 { color: var(--ivory); font-size: clamp(2.2rem, 4.8vw, 4.3rem); line-height: 1.08; max-width: 19ch; text-shadow: 0 2px 26px rgba(0, 10, 36, 0.85); }
.galerie-on .g-entete h2 em { color: var(--gold); }
.galerie-on main > section:not(.hero) > .wrap {
  position: relative; padding: clamp(34px, 4.6vw, 68px) var(--pad);
  background: var(--white); border-top: 2px solid var(--gold);
  box-shadow: 0 0 0 1px rgba(223, 183, 115, 0.3), 0 50px 120px -40px rgba(0, 4, 16, 0.85);
}
.galerie-on main > section.paper > .wrap { background: var(--paper); }
.galerie-on main > section.night:not(.hero) > .wrap { background: linear-gradient(165deg, #0c1730, var(--night) 70%); }
.galerie-on main > section > .wrap > .lede:first-child { margin-top: 0; }
.galerie-on .split > div:first-child > .lede:first-child, .galerie-on .contact .wrap > div:first-child > p:first-child { margin-top: 0; }
.galerie-on .g-suite { margin-bottom: 0; padding: 0; background: var(--night); border: 1px solid rgba(223, 183, 115, 0.35); border-top: 0; }
.galerie-on .g-suite a { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: flex-end; gap: 6px 12px; padding: 18px var(--pad); color: var(--ivory); text-decoration: none; }
.galerie-on .g-suite-mot { font: 700 0.78rem/1.2 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: #9d9ba1; }
.galerie-on .g-suite-nom { font-family: var(--serif); font-size: 1.22rem; }
.galerie-on .g-suite-nom::after { content: "\2192"; margin-left: 12px; color: var(--gold); font-family: var(--sans); transition: margin 0.2s; }
.galerie-on .g-suite a:hover .g-suite-nom::after { margin-left: 18px; }

/* ---------- L'accueil : le titre au centre de la rotonde, la fiche en dessous ---------- */
.galerie-on .hero { background: transparent; padding: 0 0 10vh; isolation: isolate; overflow: visible; }
.galerie-on .hero::before { display: none; }
.galerie-on .hero::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(ellipse 62% 48% at 50% 34%, rgba(0, 10, 36, 0.82), rgba(0, 10, 36, 0.45) 72%, rgba(0, 10, 36, 0.2)); }
.galerie-on .hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 0; max-width: 1240px; text-align: center; }
.galerie-on .hero .wrap > div:first-child {
  position: relative; min-height: calc(100vh - var(--hdr, 82px)); min-height: calc(100svh - var(--hdr, 82px));
  display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 48px 0 96px;
  opacity: calc(1 - var(--depart, 0) * 0.9); transform: translateY(calc(var(--depart, 0) * -6vh));
}
.galerie-on .hero .tag { justify-content: center; text-align: center; color: #f2ddba; text-shadow: 0 1px 12px var(--night); }
.galerie-on .hero .tag::before { display: none; }
.galerie-on .hero h1 { font-size: clamp(2.8rem, 7.2vw, 6.8rem); line-height: 1.03; text-shadow: 0 3px 30px rgba(0, 10, 36, 0.9); }
.galerie-on .hero .lede { margin: 28px auto 32px; max-width: 44em; text-shadow: 0 2px 16px rgba(0, 10, 36, 0.95); }
.galerie-on .hero .actions, .galerie-on .hero .creds { justify-content: center; }
.galerie-on .hero .calc { width: min(100%, 800px); max-width: none; text-align: left; box-shadow: 0 0 0 1px rgba(223, 183, 115, 0.45), 0 0 0 9px rgba(0, 10, 36, 0.5), 0 0 0 10px rgba(223, 183, 115, 0.3), 0 50px 110px -30px rgba(0, 0, 0, 0.85); }
.galerie-on .g-indice { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 44px 0 0; color: var(--ivory); font: 700 0.78rem/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; white-space: nowrap; text-shadow: 0 1px 10px var(--night); opacity: calc(0.9 - var(--depart, 0) * 3); }
.galerie-on .g-indice::before { content: ""; width: 1px; height: 34px; background: linear-gradient(transparent, var(--gold)); animation: g-indice 2.4s ease-in-out infinite; transform-origin: 50% 0; }
@keyframes g-indice { 0%, 100% { transform: scaleY(0.35); } 50% { transform: scaleY(1); } }

/* ---------- La mise au point : le passage lu est net ---------- */
.galerie-focus .g-net { transition: opacity 0.55s ease, transform 0.55s ease, filter 0.55s ease; }
.galerie-focus .g-net.loin { opacity: 0.32; transform: scale(0.985); }

/* ---------- La barre de visite (en bas) et l'avancement (sous l'en-tête) ---------- */
.galerie-on .g-progres { display: block; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: rgba(223, 183, 115, 0.16); pointer-events: none; }
.g-progres span { display: block; height: 100%; background: var(--gold); transform-origin: 0 50%; transform: scaleX(0); }
.galerie-on .g-boussole { display: flex; position: fixed; z-index: 45; left: 50%; bottom: 14px; transform: translateX(-50%); align-items: stretch; gap: 2px; padding: 4px; background: rgba(0, 10, 36, 0.92); border: 1px solid rgba(223, 183, 115, 0.45); border-radius: 3px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45); color: var(--ivory); font-family: var(--sans); }
.g-boussole button { font: inherit; font-size: 0.92rem; color: inherit; background: transparent; border: 0; border-radius: 2px; padding: 9px 12px; cursor: pointer; line-height: 1.2; }
.g-boussole button:hover:not(:disabled) { background: rgba(239, 235, 231, 0.1); }
.g-boussole button:disabled { opacity: 0.35; cursor: default; }
.g-boussole :focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.g-fleche { font-size: 1.1rem !important; padding: 9px 13px !important; }
.g-ici { display: flex; align-items: baseline; gap: 10px; min-width: 15em; text-align: left; }
.g-ici .n { color: var(--gold); font-weight: 700; letter-spacing: 0.1em; }
.g-ici .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 24ch; }
.g-ici::after { content: "\25B4"; margin-left: auto; color: #9d9ba1; font-size: 0.75rem; }
.g-mode { border-left: 1px solid rgba(223, 183, 115, 0.3) !important; border-radius: 0 2px 2px 0 !important; color: #cfcac4 !important; }
.g-mode[aria-pressed="true"] { background: var(--gold) !important; color: var(--night) !important; font-weight: 700; }
.g-plan { position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); margin: 0; padding: 6px; list-style: none; background: rgba(0, 10, 36, 0.97); border: 1px solid rgba(223, 183, 115, 0.45); border-radius: 3px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5); max-height: 70vh; overflow: auto; }
.g-plan[hidden] { display: none; }
.g-plan a { display: flex; gap: 12px; padding: 8px 10px; color: #cfcac4; text-decoration: none; border-radius: 2px; font-size: 0.95rem; }
.g-plan a:hover, .g-plan a:focus-visible { background: rgba(239, 235, 231, 0.08); color: var(--ivory); }
.g-plan a[aria-current] { color: var(--night); background: var(--gold); }
.g-plan .n { font-weight: 700; letter-spacing: 0.1em; min-width: 2ch; }

/* ---------- Écrans moyens et petits ---------- */
@media (max-width: 700px) {
  .galerie-on .g-seuil { height: 62vh; height: 62svh; }
  .galerie-on .g-entete { min-height: clamp(200px, 36vh, 320px); }
  .galerie-on .g-entete h2 { font-size: clamp(1.9rem, 8vw, 2.6rem); }
  .galerie-on .hero h1 { font-size: clamp(2.4rem, 11vw, 3.4rem); }
  .galerie-on .hero .wrap > div:first-child { padding: 32px 0 88px; }
  .galerie-on .g-boussole { left: 8px; right: 8px; transform: none; }
  .g-ici { min-width: 0; flex: 1; }
  .g-ici .t { max-width: none; }
  .g-mode { font-size: 0.8rem !important; padding: 9px 9px !important; }
  .g-fleche { padding: 9px 10px !important; }
  .galerie-focus .g-net.loin { opacity: 0.45; transform: none; }
}

/* ---------- Lecture simple et mouvement réduit : plus rien ne bouge ---------- */
.galerie-simple .g-seuil { height: 12vh; }
.galerie-simple .g-seuil-fin { height: 16vh; }
.galerie-simple .g-scene { animation: none; }
.galerie-simple .g-indice { display: none; }
.galerie-simple .g-net { opacity: 1; transform: none; transition: none; }
@media (prefers-reduced-motion: reduce) { .galerie-on .g-boussole, .galerie-on .g-plan a { transition: none; } }

/* ---------- Impression : le texte seul ---------- */
@media print {
  .g-scene, .g-seuil, .g-boussole, .g-progres, .g-indice, .g-suite { display: none !important; }
  .galerie-on body { background: #fff; }
  .galerie-on .g-entete { min-height: 0; background: none; border: 0; color: var(--ink); }
  .galerie-on .g-entete h2 { color: var(--ink); text-shadow: none; }
  .galerie-on .g-net { opacity: 1 !important; transform: none !important; }
  .galerie-on main > section:not(.hero) > .wrap { box-shadow: none; }
}
