/* ==========================================================================
   Krummi Lightbox
   ========================================================================== */

.k-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

/* Backdrop */
.k-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  cursor: pointer;
}

/* Close button */
.k-lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: color 0.2s, background 0.2s;
}

.k-lightbox__close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* Stage */
.k-lightbox__stage {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 60px 80px;
  pointer-events: none;
}

/* Image */
.k-lightbox__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.k-lightbox__img.is-loaded {
  opacity: 1;
  transform: scale(1);
}

/* Nav arrows */
.k-lightbox__prev,
.k-lightbox__next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  padding: 12px;
  border-radius: 50%;
  transition: color 0.2s, background 0.2s;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.k-lightbox__prev { left: 16px; }
.k-lightbox__next { right: 16px; }

.k-lightbox__prev:hover,
.k-lightbox__next:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
}

/* Counter */
.k-lightbox__counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  color: rgba(255, 255, 255, 0.7);
  font-family: var(--k-font-heading, sans-serif);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  background: rgba(0, 0, 0, 0.4);
  padding: 6px 16px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Make content images show they're clickable */
.k-prose img,
.wp-block-gallery img,
.gallery img {
  cursor: zoom-in;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .k-lightbox__stage {
    padding: 50px 16px;
  }

  .k-lightbox__prev,
  .k-lightbox__next {
    padding: 10px;
    top: auto;
    bottom: 60px;
    transform: none;
  }

  .k-lightbox__prev { left: 24px; }
  .k-lightbox__next { right: 24px; }

  .k-lightbox__counter {
    bottom: 68px;
  }
}
