/* ==========================================================================
   Lightbox — Full-screen image viewer with title, credit, count
   ========================================================================== */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}

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

/* ── Top Bar ────────────────────────────────────────────────────────────── */
.lightbox-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-start;
  padding: var(--space-4) var(--space-6);
  z-index: 2;
}

.lightbox-info {
  flex: 1;
  min-width: 0;
}

.lightbox-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 300;
  color: #fff;
  line-height: 1.2;
}

.lightbox-subtitle {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: var(--space-1);
}

.lightbox-count {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
  margin: var(--space-1) var(--space-4) 0 var(--space-4);
}

/* ── Close ──────────────────────────────────────────────────────────────── */
.lightbox-close {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.75rem;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity var(--duration-fast) ease;
}

.lightbox-close:hover { opacity: 1; }

/* ── Image ──────────────────────────────────────────────────────────────── */
.lightbox-image {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 0;
  transform: scale(0.92);
  opacity: 0;
  transition:
    transform 380ms cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 380ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lightbox.active .lightbox-image {
  transform: scale(1);
  opacity: 1;
}

/* ── Navigation Arrows ──────────────────────────────────────────────────── */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #fff;
  font-size: 1.75rem;
  cursor: pointer;
  border-radius: 50%;
  z-index: 2;
  transition: background var(--duration-fast) ease;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.18);
}

.lightbox-nav:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

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

.lightbox-prev { left: var(--space-4); }
.lightbox-next { right: var(--space-4); }

/* ── Credit ─────────────────────────────────────────────────────────────── */
.lightbox-credit {
  position: absolute;
  bottom: var(--space-4);
  left: var(--space-6);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-accent);
  z-index: 2;
}

/* ── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .lightbox-image {
    max-width: 96vw;
    max-height: 75vh;
  }

  .lightbox-top { padding: var(--space-3) var(--space-4); }

  .lightbox-nav {
    width: 36px;
    height: 36px;
    font-size: 1.25rem;
  }

  .lightbox-prev { left: var(--space-2); }
  .lightbox-next { right: var(--space-2); }
}
