/* Full-screen image viewer. Paired with static/js/lightbox.js; images are marked
   data-lightbox server-side by app.py's _lightboxify(). */

img[data-lightbox] {
  cursor: zoom-in;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(0, 0, 0, 0.9);
  cursor: zoom-out;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  cursor: default;
  /* Charts and tables are the main payload here — keep them crisp when the
     original is larger than the box we're fitting it into. */
  object-fit: contain;
  background: #fff;
  box-shadow: 0 2px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 2.25rem;
  line-height: 1;
  cursor: pointer;
}

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

/* Stop the page behind the overlay from scrolling. */
.lightbox-open,
.lightbox-open body {
  overflow: hidden;
}

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