/* ============================================================
   Lightbox — full-screen image / before-after viewer
   Triggered by [data-lightbox] on gallery tiles and home lookbook tiles.
   ============================================================ */

/* Backdrop */
.lb {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(8, 7, 10, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease);
}
.lb.is-open {
  opacity: 1;
  pointer-events: all;
}

/* Inner stage — constrains content vertically */
.lb-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 72px clamp(48px, 8vw, 120px);
  box-sizing: border-box;
}

/* Media area — the image or BA slider */
.lb-media {
  position: relative;
  max-width: 960px;
  width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Plain image */
.lb-media img.lb-img {
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - 160px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-lg);
}

/* BA slider inside lightbox — override the masonry overrides, restore
   the natural 4/5 aspect with full size */
.lb-media .ba {
  position: relative;
  aspect-ratio: 4 / 5;
  width: 100%;
  max-height: calc(100dvh - 160px);
  /* Let aspect-ratio drive width from height */
  max-width: calc((100dvh - 160px) * (4 / 5));
  overflow: hidden;
  border-radius: var(--radius-lg);
}
.lb-media .ba img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Caption */
.lb-caption {
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-top: 14px;
  min-height: 1em;
}

/* Close button */
.lb-close {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 910;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.lb-close:hover {
  background: var(--bg-3);
  border-color: var(--line);
}

/* Prev / Next */
.lb-prev,
.lb-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 910;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
}
.lb-prev { left: 16px; }
.lb-next { right: 16px; }
.lb-prev:hover,
.lb-next:hover { background: var(--bg-3); }
.lb-prev[hidden],
.lb-next[hidden] { display: none; }

/* Counter */
.lb-counter {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* Fade between slides */
.lb-media.is-fading {
  opacity: 0;
  transition: opacity 0.18s var(--ease);
}
.lb-media.is-visible {
  opacity: 1;
  transition: opacity 0.22s var(--ease);
}

@media (max-width: 680px) {
  .lb-stage { padding: 64px 12px; flex-direction: column; }
  .lb-prev { left: 4px; }
  .lb-next { right: 4px; }
  .lb-media .ba { max-width: 100%; max-height: calc(100dvh - 130px); }
  .lb-media img.lb-img { max-height: calc(100dvh - 130px); }
}
