.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(58, 38, 32, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 100%;
  max-height: 100%;
}

.lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 3px;
  background: var(--bg-cream-deep);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.lightbox-caption {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  color: var(--bg-cream);
  font-size: 18px;
  text-align: center;
  max-width: 600px;
  margin: 0;
}

.lightbox-caption[hidden] {
  display: none;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  background: rgba(253, 246, 240, 0.15);
  color: var(--bg-cream);
  border: none;
  border-radius: 50%;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: background 200ms ease, transform 200ms ease;
}

.lightbox-close:hover,
.lightbox-close:focus-visible {
  background: rgba(253, 246, 240, 0.28);
  transform: scale(1.05);
  outline: none;
}

.polaroid {
  cursor: pointer;
}

.polaroid:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .lightbox {
    transition: none;
  }
  .lightbox-close {
    transition: none;
  }
}
