/* The shared #lightbox modal: templates/components/lightbox.html,
   static/js/components/lightbox.js. Used by the homepage, artwork pages and
   product pages (#55), so nothing here may depend on gallery.css. */
.modal-backdrop {
  --bs-backdrop-opacity: 0.88;
}

.lightbox-modal .modal-content {
  background: transparent;
  border: 0;
  border-radius: 0;
}

.lightbox-img {
  display: block;
  max-width: 100%;
  max-height: 88vh;
  margin: 0 auto;
  object-fit: contain;
  cursor: zoom-out;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.lightbox-video {
  display: block;
  max-width: 100%;
  max-height: 82vh;
  margin: 0 auto;
  background: #000;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

/* display:block above would otherwise beat the UA's [hidden] rule. */
.lightbox-img[hidden],
.lightbox-video[hidden] {
  display: none;
}

.lightbox-caption {
  margin: 0.75rem auto 0;
  max-width: 40rem;
  color: #fff;
  text-align: center;
  font-style: italic;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1;
}

/* Square like the artwork it frames. Fixed to the viewport edges rather than
   the image, so they stay put as differently-shaped images swap in. */
.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 1.25rem;
  transition: background-color 0.2s ease;
}

/* display:flex above would otherwise beat the UA's [hidden] rule. */
.lightbox-nav[hidden] {
  display: none;
}

.lightbox-nav:hover,
.lightbox-nav:focus-visible {
  background: rgba(0, 0, 0, 0.8);
}

.lightbox-nav:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.lightbox-prev {
  left: 1rem;
}

.lightbox-next {
  right: 1rem;
}

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