/* ============================================================
   LIGHTBOX — a shot at full size
   Shared by the home gallery and the case study pages: both have pictures
   that are cropped or scaled down on the page, and both open them here.
   The markup is built by Assets/Scripts/lightbox.js, so a page needs only
   this sheet, that script, and data-zoom on the pictures.
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  /* Dark enough to read a light screenshot against, blurred so the page
     underneath reads as a place the picture came from rather than clutter. */
  background: rgba(20, 20, 20, 0.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  /* The backdrop is the way out, and says so */
  cursor: zoom-out;
}

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

/* Up to the export's own size, never past the window. The frame on the page
   crops; here the whole picture shows. */
.lightbox__img {
  display: block;
  max-width: min(100%, 2000px);
  max-height: calc(100dvh - 48px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
  /* Not part of the way out — this is the thing being looked at */
  cursor: default;
  animation: shot-in 0.24s ease both;
}

@keyframes shot-in {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Pinned to the window: there is no dialog box here to hang it on. */
.lightbox__close {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  /* Fallback radius — the @supports block below carries the real corner */
  border-radius: 12px;
  transition: background 0.3s ease;
}

.lightbox__close svg {
  width: 18px;
  height: 18px;
  display: block;
}

.lightbox__close:hover {
  background: rgba(255, 255, 255, 0.24);
}

/* After .lightbox__close's own radius, not before it: same specificity, so
   source order decides, and declared earlier only the radius would lose. */
@supports (corner-shape: squircle) {
  .lightbox__close {
    border-radius: 22px;
    corner-shape: squircle;
  }
}

/* The button the script wraps each picture in. It carries no look of its own
   — the picture keeps whatever the page gave it. */
.shot-zoom {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}

.shot-zoom:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

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