/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.88);
  padding: 2rem 4rem;
  cursor: zoom-out;
  align-items: center;
  justify-content: center;
}

.lightbox.is-open {
  display: flex;
}

.lightbox-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: min(1200px, 95vw);
  cursor: default;
}

.lightbox img {
  max-width: min(1200px, 95vw);
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  transition: opacity 0.15s ease;
}

.lightbox-counter {
  margin: 0.75rem 0 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.875rem;
  letter-spacing: 0.04em;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 2.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  z-index: 2;
}

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

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 2.25rem;
  line-height: 1;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  z-index: 2;
  transition: background 0.15s ease;
}

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

.lightbox-prev {
  left: 1rem;
}

.lightbox-next {
  right: 1rem;
}

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

@media (max-width: 640px) {
  .lightbox {
    padding: 1rem 0.5rem;
  }

  .lightbox-nav {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1.75rem;
  }

  .lightbox-prev {
    left: 0.35rem;
  }

  .lightbox-next {
    right: 0.35rem;
  }
}
