/* =====================
   m_lightbox — section-scoped image lightbox
   Pattern: Osmo «Lightbox Setup» (storyboard: 03_Library/Storyboards/
   osmo-lightbox-setup). Open = FLIP from the grid cell (0.35s power2.out)
   + black overlay 0.8; prev/next = hard swap + 0.15s container resize;
   close = fade + scale-down IN PLACE (no reverse flip).
   Group = the images of one section (data-lightbox wrappers).
===================== */

[data-lightbox] { cursor: zoom-in; }

.m_lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none; /* swallow touch-scroll gestures over the box */
}
.m_lightbox[hidden] { display: none; }

.m_lightbox_overlay {
  position: absolute;
  inset: 0;
  background: #000;
  /* final opacity (0.8) is animated by GSAP via autoAlpha */
}

/* fixed stage — no per-image resize; images crossfade inside it */
.m_lightbox_media {
  position: relative;
  z-index: 1;
  margin: 0;
  width: 80vw;
  height: 82vh;
}
.m_lightbox_media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain; /* any aspect fits the stage without cropping */
  display: block;
  opacity: 0;
}
.m_lightbox_media img.is-active { opacity: 1; }

.m_lightbox_ui {
  position: absolute;
  z-index: 2;
  left: var(--site--margin);
  right: var(--site--margin);
  bottom: var(--site--margin);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--swatch--off-white);
  font-size: var(--font-size--caption);
  line-height: var(--line-height--tight);
}

.m_lightbox_nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
}

.m_lightbox_ui button {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.m_lightbox_ui button:hover { color: #fff; }

/* NOTE: no overflow:hidden while open — hiding the scrollbar reflows the page
   (~15px jump). The scrollbar stays; scrolling is blocked at the event level
   (wheel/keys/touch) in the Lightbox init block. .is-lightbox-open remains
   the state hook for the slide-scroll guard. */
