/* Click-to-enlarge lightbox. Pairs with assets/js/lightbox.js, which tags
   eligible content images with .lightbox-trigger and builds the overlay. */

.prose img,
.case-study-shots img {
  cursor: zoom-in;
}

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

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 48px);
  background: rgba(0, 0, 0, 0.86);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  cursor: zoom-out;
}

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

.lightbox-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  max-height: 100%;
}

.lightbox-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  cursor: default;
}

.lightbox-caption {
  margin: 0;
  max-width: min(92vw, 70ch);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.85rem;
  line-height: 1.5;
  text-align: center;
  cursor: default;
}

.lightbox-close {
  position: fixed;
  top: clamp(12px, 2.5vw, 24px);
  right: clamp(12px, 2.5vw, 24px);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}

.lightbox-close:hover,
.lightbox-close:focus-visible {
  background: rgba(255, 255, 255, 0.24);
  outline: none;
}

html.lightbox-open,
html.lightbox-open body {
  overflow: hidden;
}

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