/* ============================================================
   Lightbox Modal
   Full-screen overlay with accessible modal container.
   z-index: 9999 — sits above header (z-index: 1000) and all
   other page elements.
   ============================================================ */

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Hidden by default */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

/* Dark semi-transparent backdrop */
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.88);
}

/* Centered content container */
.lightbox-container {
  position: relative;
  z-index: 1;
  max-width: min(92vw, 1200px);
  max-height: 92vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Content area scrolls if overflowing */
.lightbox-content {
  position: relative;
  overflow: auto;
  max-height: 85vh;
}

/* Close button — 44x44 touch target, top-right above container */
.lightbox-close {
  position: absolute;
  top: -48px;
  right: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  color: var(--color-white, #ffffff);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.1);
}

.lightbox-close:focus-visible {
  outline: 2px solid var(--color-accent, #c9a227);
  outline-offset: 3px;
}

/* Slide-in animation for content */
.lightbox-overlay.is-open .lightbox-container {
  animation: lightboxEnter 0.3s ease forwards;
}

@keyframes lightboxEnter {
  from { transform: translateY(12px) scale(0.98); opacity: 0; }
  to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  .lightbox-overlay,
  .lightbox-overlay.is-open .lightbox-container {
    animation: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
  }
}

/* ── Responsive ── */
@media (max-width: 767px) {
  .lightbox-container {
    max-width: 100vw;
    max-height: 100dvh;
    border-radius: 0;
  }

  .lightbox-close {
    top: var(--space-3, 12px);
    right: var(--space-3, 12px);
    position: fixed;
    z-index: 2;
  }
}
