/* Lightbox — full-screen overlay for gallery zoom.
   Paired with static/js/lightbox.js. */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal, 100);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(17, 13, 11, 0.94);
  backdrop-filter: blur(4px);
  animation: lightbox-fade-in 0.18s ease-out both;
}

.lightbox[hidden] {
  display: none;
}

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

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

html.is-lightbox-open {
  overflow: hidden;
}

.lightbox__figure {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.lightbox__img {
  max-width: min(100%, 1600px);
  max-height: calc(100vh - 6rem);
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  background: #1a1716;
}

.lightbox__caption {
  color: rgba(255, 245, 230, 0.88);
  font-size: 0.9rem;
  font-family: var(--font-sans, "Work Sans", sans-serif);
  text-align: center;
  max-width: min(100%, 800px);
  line-height: 1.45;
}

.lightbox__caption[hidden] {
  display: none;
}

.lightbox__close,
.lightbox__nav {
  position: absolute;
  z-index: 1;
  background: rgba(26, 23, 22, 0.6);
  border: 1px solid rgba(197, 165, 90, 0.35);
  color: #f5efe6;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font-sans, sans-serif);
  line-height: 1;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.lightbox__close:hover,
.lightbox__nav:hover,
.lightbox__close:focus-visible,
.lightbox__nav:focus-visible {
  background: rgba(74, 28, 35, 0.85);
  border-color: rgba(197, 165, 90, 0.85);
  outline: none;
}

.lightbox__close {
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  font-size: 1.8rem;
  padding: 0;
}

.lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  font-size: 2.2rem;
  padding: 0 0 4px;
}

.lightbox__nav--prev { left: 1rem; }
.lightbox__nav--next { right: 1rem; }

.lightbox__nav[hidden] {
  display: none;
}

@media (max-width: 640px) {
  .lightbox__nav { width: 40px; height: 40px; font-size: 1.8rem; }
  .lightbox__close { width: 40px; height: 40px; font-size: 1.5rem; }
}

/* Opt-in cursor on any gallery link that uses the lightbox. */
a[data-lightbox] {
  cursor: zoom-in;
  display: block;
}
