/* ===========================================================
   Mise en page « immersive » (pôle Photo & Vidéo — voir samten_render_immersive dans lib.php)
   Grandes images à fond perdu, parallaxe, apparitions douces.
   Tout reste lisible sans JavaScript : les effets ne sont
   activés que si <html> porte la classe .imm-js.
   =========================================================== */

/* Lenis (défilement fluide) gère lui-même le lissage */
html.lenis, html.lenis body { height: auto; }
html.lenis { scroll-behavior: auto; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }

.imm { overflow-x: clip; }

/* ---------- Conteneur d'image avec parallaxe ---------- */

.imm-media {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--bg-soft);
}

.imm-media img {
  position: absolute;
  left: 0;
  top: -12%;
  width: 100%;
  height: 124%;          /* marge haute/basse pour le déplacement */
  max-width: none;
  object-fit: cover;
  will-change: transform;
}

/* ---------- Ouverture ---------- */

.imm-hero {
  position: relative;
  height: calc(100svh - var(--imm-hdr, 120px));
  min-height: 420px;
  display: flex;
  align-items: flex-end;
}

.imm-hero .imm-media {
  position: absolute;
  inset: 0;
}

.imm-hero .imm-media img { object-position: 30% 40%; }

/* voile pour la lisibilité du titre */
.imm-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(14,14,16,0.85) 0%, rgba(14,14,16,0.15) 45%, rgba(14,14,16,0) 70%);
  pointer-events: none;
}

.imm-hero-text {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 6vw, 6rem) clamp(2.5rem, 8vh, 5rem);
  text-align: right;
}

.imm-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.imm-hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3rem, 9vw, 7.5rem);
  line-height: 0.95;
  letter-spacing: 0.01em;
}

/* petit trait animé invitant à défiler */
.imm-scroll {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: 1.4rem;
  width: 1px;
  height: 46px;
  background: rgba(232,230,225,0.25);
  overflow: hidden;
}
.imm-scroll::after {
  content: "";
  position: absolute;
  left: 0; top: -50%;
  width: 1px; height: 50%;
  background: var(--text);
  animation: imm-scroll 2.2s ease-in-out infinite;
}
@keyframes imm-scroll { to { top: 100%; } }

/* ---------- Introduction ---------- */

.imm-intro {
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(4rem, 12vh, 8rem) 1.5rem;
  text-align: center;
}

.imm-intro p {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
  line-height: 1.45;
  color: var(--text);
}
.imm-intro a { color: var(--accent); }

/* ---------- Bandes de prestations ---------- */

.imm-band {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 88svh;
  margin-bottom: clamp(4rem, 16vh, 10rem);
}

/* Cadre au ratio exact de la photo (aucun recadrage).
   Paysage : colonne image plus large. Portrait : hauteur limitée à l'écran,
   la largeur en découle. Dans les deux cas, la photo touche le bord de l'écran. */
.imm-band.landscape { grid-template-columns: 58fr 42fr; min-height: 0; align-items: center; }
.imm-band.landscape.flip { grid-template-columns: 42fr 58fr; }
.imm-band.portrait { min-height: 0; align-items: center; }

.imm-band .imm-frame {
  aspect-ratio: var(--ar);
  width: min(100%, calc(86svh * var(--arn)));
  justify-self: start;               /* bord gauche de l'écran */
}
.imm-band.flip .imm-frame { justify-self: end; order: 2; }

.imm-band .imm-frame img {
  position: static;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.imm-band.flip .imm-media { order: 2; }

.imm-text {
  align-self: center;
  max-width: 520px;
  padding: 3rem clamp(1.5rem, 6vw, 6rem);
}
.imm-band:not(.flip) .imm-text { justify-self: start; }
.imm-band.flip .imm-text { justify-self: end; }

.imm-num {
  display: block;
  font-family: var(--serif);
  font-size: 0.95rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 1.2rem;
}
.imm-num::after {
  content: "";
  display: inline-block;
  vertical-align: middle;
  width: 48px;
  height: 1px;
  margin-left: 0.9rem;
  background: var(--accent);
  opacity: 0.6;
}

.imm-text h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 3.4vw, 3rem);
  line-height: 1.1;
  margin-bottom: 1.4rem;
}

.imm-text p {
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1.75;
}
.imm-text p a { color: var(--accent); }

.imm-more { margin-top: 2rem; }
.imm-more a {
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text) !important;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 0.35rem;
  transition: color 0.2s;
}
.imm-more a:hover { color: var(--accent) !important; }

/* survol de l'image : léger zoom */
.imm-band .imm-media img { transition: scale 1.2s cubic-bezier(.2,.7,.2,1); }
.imm-band .imm-media:hover img { scale: 1.04; }

.imm-after { padding-top: 0; }

/* ---------- Apparitions (seulement si JS actif) ---------- */

.imm-js .imm-reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 1.1s ease, transform 1.1s cubic-bezier(.2,.7,.2,1);
}
.imm-js .imm-reveal.is-in { opacity: 1; transform: none; }

/* ---------- Mobile / tablette ---------- */

@media (max-width: 860px) {
  .imm-band,
  .imm-band.landscape,
  .imm-band.landscape.flip { grid-template-columns: 1fr; min-height: 0; margin-bottom: 3.5rem; }
  .imm-band .imm-frame,
  .imm-band.flip .imm-frame { width: 100%; justify-self: stretch; }
  .imm-band.flip .imm-media { order: 0; }
  .imm-text,
  .imm-band.flip .imm-text { justify-self: stretch; max-width: none; padding: 2rem 1.5rem 0; }
  .imm-hero-text { text-align: left; }
  .imm-scroll { display: none; } /* le trait croiserait le titre aligné à gauche */
}

/* ---------- Mouvement réduit : aucune animation ---------- */

@media (prefers-reduced-motion: reduce) {
  .imm-media img { top: 0; height: 100%; transform: none !important; }
  .imm-frame { transform: none !important; }
  .imm-js .imm-reveal { opacity: 1; transform: none; transition: none; }
  .imm-scroll::after { animation: none; }
  .imm-band .imm-media img { transition: none; }
}

/* titres longs (pages de spécialités) */
.imm-hero-long h1 { font-size: clamp(2.2rem, 4.6vw, 4.2rem); line-height: 1.05; max-width: 19ch; margin-left: auto; text-wrap: balance; text-shadow: 0 2px 24px rgba(0,0,0,0.45); }
.imm-kicker a { color: inherit; }
.imm-kicker a:hover { color: var(--text); }
@media (max-width: 860px) {
  .imm-hero-long h1 { margin-left: 0; }
}

/* mention « Sans IA » sous l'intro (page Photo & Vidéo) */
.imm-intro .no-ai-note {
  font-family: var(--sans);
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-dim);
  margin: 1.6rem auto 0;
  max-width: 46rem;
}

/* ---------- Mini-galerie (pages de spécialités) ----------
   Rangées « justifiées » : chaque vignette grandit selon son ratio, donc
   toutes les images d'une rangée ont la même hauteur et aucune n'est recadrée. */
.imm-gallery-wrap { max-width: 1400px; margin: 0 auto clamp(3rem, 10vh, 6rem); padding: 0 1.5rem; }
.imm-gallery-title { font-family: var(--serif); font-weight: 400; font-size: clamp(1.6rem, 2.6vw, 2.2rem); margin-bottom: 1.4rem; }
.imm-gallery { display: flex; flex-wrap: wrap; gap: 10px; }
.imm-gallery::after { content: ""; flex-grow: 999; } /* évite d'étirer la dernière rangée */
.imm-gallery a {
  flex-grow: var(--ar);
  flex-basis: calc(var(--ar) * 240px);
  aspect-ratio: var(--ar);
  overflow: hidden;
  background: var(--bg-soft);
}
.imm-gallery img { width: 100%; height: 100%; object-fit: cover; transition: scale 0.8s cubic-bezier(.2,.7,.2,1), opacity 0.3s; }
.imm-gallery a:hover img { scale: 1.04; }
.imm-gallery-more { margin-top: 1.4rem; }
@media (max-width: 860px) { .imm-gallery a { flex-basis: calc(var(--ar) * 140px); } }

/* rubrique « Questions fréquentes » dans la colonne de texte */
.faq-block { margin: 3rem 0 1rem; }
.faq-block h2 { margin-bottom: 1rem; }

/* ---------- Mise en page « récit » (bio) ---------- */
.imm-split { min-height: 0; margin-bottom: clamp(2rem, 8vh, 5rem); grid-template-columns: auto 1fr; }
.imm-split .imm-frame { width: min(55vw, calc(86svh * var(--arn))); }
.imm-split .imm-text { max-width: 640px; }
.imm-split .imm-text { align-self: end; padding-bottom: clamp(2rem, 8vh, 5rem); }
.imm-split h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  line-height: 1;
  margin-bottom: 1rem;
}
.imm-split .imm-text .imm-split-sub { font-family: var(--serif); font-size: clamp(1.2rem, 2vw, 1.6rem); color: var(--text); line-height: 1.4; }
.imm-split .imm-text .imm-split-credit { margin-top: 2rem; font-size: 0.78rem; color: var(--text-dim); }
.imm-split .imm-text .imm-split-credit a { color: var(--text-dim); text-decoration: underline; }
.imm-split .imm-text .imm-split-credit a:hover { color: var(--text); }
.imm-split-noimg { display: block; max-width: 820px; margin: 0 auto; padding: 3rem 1.5rem 0; }
.imm-flow { padding-top: 0; padding-bottom: clamp(2rem, 6vh, 4rem); }
.imm-flow > h2:first-child { margin-top: 0; }
@media (max-width: 860px) {
  .imm-split { grid-template-columns: 1fr; }
  .imm-split .imm-frame { width: 100%; }
  .imm-split .imm-text { padding-top: 1.5rem; }
}

/* ---------- Pages d'albums ---------- */
.imm-hero.imm-hero-album { height: min(72svh, calc(100svh - var(--imm-hdr, 120px))); }
.imm-album-grid { padding-top: 0; }

/* boucle vidéo dans une bande : même cadrage que les photos */
.imm-band .imm-frame video { display: block; width: 100%; height: 100%; object-fit: cover; }
