/* ─────────────────────────────────────────
   COMPONENT — LIGHTBOX
   Full-screen viewer for images marked [data-lightbox] (the dress code
   mood boards). Tap the image to zoom in and pan around; tap × , the dark
   background or press Esc to close. Behaviour: js/script.js → lightbox().
───────────────────────────────────────── */

.lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: none;
  background: var(--scrim);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--cream-50);
  overscroll-behavior: contain;
}

.lightbox::backdrop {
  background: transparent;
}

.lightbox[open] {
  display: flex;
  flex-direction: column;
  animation: lightbox-in 250ms var(--ease);
}

@keyframes lightbox-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.lightbox-stage {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 16px 16px;
  -webkit-overflow-scrolling: touch;
}

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border: 6px solid var(--cream-50);
  cursor: zoom-in;
  transition: max-width 250ms var(--ease), max-height 250ms var(--ease);
}

/* zoomed: image at 2.2× the screen width, pan by scrolling/swiping */
.lightbox.is-zoomed .lightbox-stage {
  align-items: flex-start;
  justify-content: flex-start;
}

.lightbox.is-zoomed .lightbox-img {
  max-width: none;
  max-height: none;
  width: 220vw;
  cursor: zoom-out;
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(253, 250, 244, 0.5);
  color: var(--cream-50);
  font-size: 26px;
  line-height: 1;
  background: rgba(59, 29, 18, 0.6);
}

.lightbox-close:hover {
  background: var(--cream-50);
  color: var(--inverse);
}

.lightbox-hint {
  text-align: center;
  color: var(--on-inverse-muted);
  padding: 12px 16px 20px;
}

@media (hover: hover) {
  .lightbox-hint::after {
    content: ' · Esc to close';
  }
}
