/**
 * VH Core, front-end image lightbox.
 * Theme-agnostic overlay slideshow. Colors are neutral so it sits on any theme.
 */

.vh-lightbox {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
}

.vh-lightbox::backdrop {
  background: rgba(10, 12, 16, 0.88);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.vh-lightbox.is-open::backdrop {
  opacity: 1;
}

.vh-lightbox__figure {
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: clamp(1rem, 4vw, 3rem);
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.vh-lightbox.is-open .vh-lightbox__figure {
  opacity: 1;
  transform: none;
}

.vh-lightbox__img {
  max-width: min(1200px, 90vw);
  max-height: 82vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Showcase variant: tall full-page screenshots render near the full lightbox
   width (inside the prev/next controls, with breathing room) and scroll
   vertically from user input, instead of shrinking to fit the viewport height.
   `safe center` keeps short images centered while preventing the flexbox
   top-clipping bug when an image is taller than the viewport. */
.vh-lightbox--showcase .vh-lightbox__figure {
  justify-content: safe center;
  overflow-y: auto;
  overflow-x: hidden;
  padding-left: clamp(4rem, 8vw, 6rem);
  padding-right: clamp(4rem, 8vw, 6rem);
}

.vh-lightbox--showcase .vh-lightbox__img {
  width: 100%;
  max-width: 1600px; /* matches vh-core's 1600px upload cap; never upscales */
  max-height: none;
}

.vh-lightbox__caption {
  max-width: 90vw;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  text-align: center;
}

.vh-lightbox__caption[hidden] {
  display: none;
}

/* Controls */
.vh-lightbox__close,
.vh-lightbox__nav {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  transition: background 0.2s ease, transform 0.2s ease;
}

.vh-lightbox__close:hover,
.vh-lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.25);
}

.vh-lightbox__close {
  top: clamp(0.75rem, 2vw, 1.5rem);
  right: clamp(0.75rem, 2vw, 1.5rem);
  width: 44px;
  height: 44px;
  font-size: 1.6rem;
  line-height: 1;
}

.vh-lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  font-size: 2rem;
  line-height: 1;
}

.vh-lightbox__nav--prev {
  left: clamp(0.5rem, 2vw, 1.5rem);
}

.vh-lightbox__nav--next {
  right: clamp(0.5rem, 2vw, 1.5rem);
}

.vh-lightbox__nav:hover {
  transform: translateY(-50%) scale(1.06);
}

.vh-lightbox__nav[hidden],
.vh-lightbox__close[hidden] {
  display: none;
}

.vh-lightbox__counter {
  position: absolute;
  bottom: clamp(0.75rem, 2vw, 1.5rem);
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

.vh-lightbox__counter[hidden] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .vh-lightbox::backdrop,
  .vh-lightbox__figure {
    transition: none;
  }
}
