/* Click-to-enlarge lightbox for post/page images.
   Loaded site-wide via `site-css` in _config.yml. Paired with /assets/js/lightbox.js. */

/* Cue that content images are clickable */
.blog-post img.zoomable,
main img.zoomable {
  cursor: zoom-in;
}

/* Full-screen overlay */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2vmin;
  background: rgba(0, 0, 0, 0.9);
  opacity: 0;
  /* Closed state: fully out of the way so it can't capture the cursor or clicks. */
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0s linear 0.2s;
  cursor: zoom-out;
  overscroll-behavior: contain;
}

.lightbox-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.2s ease, visibility 0s;
}

.lightbox-overlay img {
  max-width: 96vw;
  max-height: 92vh;
  width: auto;
  height: auto;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  transform: scale(0.98);
  transition: transform 0.2s ease;
  cursor: default;
}

.lightbox-overlay.is-open img {
  transform: scale(1);
}

/* Close button */
.lightbox-close {
  position: fixed;
  top: 14px;
  right: 18px;
  font-size: 40px;
  line-height: 1;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.85;
  padding: 4px 12px;
  z-index: 2001;
}

.lightbox-close:hover {
  opacity: 1;
}

/* Lock scroll while the lightbox is open */
body.lightbox-open {
  overflow: hidden;
}

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