/* Lightbox gallery: click a photo to zoom + navigate. Reusable across any
   project sub-page's photo grid. */

[data-lightbox-gallery] img,
.sg-lightbox-trigger {
  cursor: zoom-in;
}

.sg-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 8, 8, 0.94);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

.sg-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.sg-lightbox__stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
  padding: 64px;
  box-sizing: border-box;
}

.sg-lightbox__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform;
  transition: transform 0.2s ease;
}

.sg-lightbox__img.is-zoomed {
  cursor: grab;
  transition: none;
}

.sg-lightbox__img.is-dragging {
  cursor: grabbing;
}

.sg-lightbox__close,
.sg-lightbox__nav {
  position: absolute;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s ease;
  z-index: 2;
  font-family: sans-serif;
}

.sg-lightbox__close:hover,
.sg-lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.2);
}

.sg-lightbox__close {
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  font-size: 20px;
  line-height: 1;
}

.sg-lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  font-size: 26px;
}

.sg-lightbox__prev {
  left: 20px;
}

.sg-lightbox__next {
  right: 20px;
}

.sg-lightbox__caption,
.sg-lightbox__counter {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  color: #fff;
  font-family: sans-serif;
  pointer-events: none;
}

.sg-lightbox__caption {
  bottom: 46px;
  font-size: 15px;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.sg-lightbox__counter {
  bottom: 20px;
  font-size: 12px;
  opacity: 0.6;
}

body.sg-lightbox-open {
  overflow: hidden;
}

@media (max-width: 700px) {
  .sg-lightbox__nav {
    width: 40px;
    height: 40px;
    font-size: 22px;
  }
  .sg-lightbox__prev {
    left: 8px;
  }
  .sg-lightbox__next {
    right: 8px;
  }
  .sg-lightbox__close {
    top: 10px;
    right: 10px;
  }
  .sg-lightbox__stage {
    padding: 20px;
  }
  .sg-lightbox__caption {
    font-size: 13px;
    bottom: 40px;
  }
}
