/* ============================================================
   LUMINEYES — /02 Galerie 3 colonnes (colonne centrale sticky)
   Inspiré d'un layout sticky-scroll : les colonnes latérales
   défilent, la colonne centrale reste figée à l'écran.
   Effet 100% CSS (position: sticky), aucun JS requis.
   ============================================================ */

.gallery3 {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  padding: 0.6rem;
  background: var(--bg, #080807);
  align-items: start;
}

.gallery3-col {
  display: grid;
  gap: 0.6rem;
}

/* Colonne latérale : images empilées qui défilent normalement */
.gallery3-col figure {
  margin: 0;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
}

.gallery3-col figure img {
  display: block;
  width: 100%;
  height: 26rem;
  object-fit: cover;
  object-position: center;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), filter 0.5s ease;
}

.gallery3-col figure:hover img {
  transform: scale(1.04);
  filter: brightness(1.08);
}

/* Colonne centrale : reste figée pendant le scroll des latérales */
.gallery3-col--sticky {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  align-content: stretch;
}

.gallery3-col--sticky figure {
  height: 100%;
}

.gallery3-col--sticky figure img {
  height: 100%;
}

/* ── Titre centré conservé, par-dessus la galerie ──────────── */
/* On réutilise .bento-center-title (déjà stylé par bento-gallery.css).
   Mais ici il n'y a plus de JS qui pilote son opacité : on le rend
   visible en permanence, centré et fixe pendant la traversée. */
/* Titre /02 autonome : plus besoin de l'ancien bento-gallery.css/js. */
.bento-mobile-header {
  display: none;
  background: var(--bg, #080807);
  color: var(--paper, #f5f0e8);
  padding: 4.5rem 1rem 1.4rem;
}

.bento-section-code {
  display: block;
  margin-bottom: 1rem;
  color: var(--gold, #cd9847);
  font-family: var(--mono, monospace);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.bento-mobile-header h2,
.gallery3 .bento-center-title h2 {
  margin: 0;
  color: var(--paper, #f5f0e8);
  font-family: var(--display, serif);
  font-size: clamp(2.8rem, 6vw, 6rem);
  font-weight: 400;
  line-height: 0.94;
  letter-spacing: -0.04em;
}

.bento-mobile-header h2 span,
.gallery3 .bento-center-title h2 span {
  color: var(--gold, #cd9847);
}

.gallery3 .bento-center-title {
  position: -webkit-sticky;
  position: sticky;
  top: 50%;
  grid-column: 1 / -1;
  grid-row: 1;
  justify-self: center;
  align-self: start;
  margin-top: 40vh;
  transform: translateY(-50%);
  opacity: 1 !important;
  visibility: visible !important;
  z-index: 10;
  pointer-events: none;
  text-align: center;
  width: min(640px, 90vw);
}

/* Halo sombre flou derrière le titre : le rend lisible quelles que soient
   les images derrière, sans bord net (dégradé radial très adouci). */
.gallery3 .bento-center-title::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 150%;
  height: 260%;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center,
    rgba(8, 8, 7, 0.92) 0%,
    rgba(8, 8, 7, 0.80) 30%,
    rgba(8, 8, 7, 0.45) 55%,
    transparent 78%);
  filter: blur(18px);
  z-index: -1;
  pointer-events: none;
}

/* Renforce un peu le texte par-dessus le halo */
.gallery3 .bento-center-title h2,
.gallery3 .bento-center-title .bento-section-code {
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.9);
}

/* Mobile : meme principe sticky, adapte a un ecran etroit */
@media (max-width: 768px) {
  .bento-mobile-header {
    display: block;
    position: relative;
    z-index: 2;
    min-height: 42dvh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 5.5rem 1rem 2rem;
  }
  .bento-mobile-header h2 {
    font-size: clamp(2.3rem, 11vw, 3.3rem);
  }
  .gallery3 {
    grid-template-columns: minmax(3.2rem, 0.45fr) minmax(13rem, 2.1fr) minmax(3.2rem, 0.45fr);
    gap: 0.32rem;
    padding: 0.35rem;
    align-items: start;
    min-height: 245dvh;
    overflow: clip;
  }
  .gallery3-col {
    gap: 0.35rem;
  }
  .gallery3-col:not(.gallery3-col--sticky) {
    padding-block: 18dvh;
  }
  .gallery3-col:last-of-type {
    padding-top: 34dvh;
  }
  .gallery3-col figure {
    border-radius: 9px;
  }
  .gallery3-col figure img {
    height: 58dvh;
    min-height: 21rem;
    transition: none;
  }
  .gallery3-col--sticky {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    z-index: 3;
    align-content: stretch;
  }
  .gallery3-col--sticky figure {
    height: 100%;
    border-radius: 14px;
    box-shadow: 0 1.4rem 4rem rgba(0, 0, 0, 0.62), 0 0 0 1px rgba(205, 152, 71, 0.28);
  }
  .gallery3-col--sticky figure img {
    height: 100%;
  }
  /* Sur mobile le titre centré est masqué : le .bento-mobile-header
     (au-dessus de la galerie) prend le relais. */
  .gallery3 .bento-center-title {
    display: none;
  }
}

@media (max-width: 430px) {
  .gallery3 {
    grid-template-columns: minmax(2.6rem, 0.38fr) minmax(12rem, 2.25fr) minmax(2.6rem, 0.38fr);
    gap: 0.28rem;
    padding-inline: 0.28rem;
  }
  .gallery3-col figure {
    border-radius: 8px;
  }
}
