/* ==========================================================================
   Artedi Lightbox
   ========================================================================== */

/* Overlay */
.artedi-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.artedi-lightbox.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* Image wrapper: grid stacks both imgs in the same cell for crossfade */
.artedi-lightbox-img-wrap {
  display: grid;
  align-items: center;
  justify-items: center;
}

/* Both images in the same grid cell, crossfade via opacity */
.artedi-lightbox-img {
  grid-area: 1 / 1;
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-select: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.artedi-lightbox-img.is-active {
  opacity: 1;
}

/* Outgoing image: stays visible on top until is-leaving is removed */
.artedi-lightbox-img.is-leaving {
  z-index: 1;
  opacity: 1;
}

/* Close button */
.artedi-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.5rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
  padding: 0.25rem 0.5rem;
  z-index: 1;
}

.artedi-lightbox-close:hover,
.artedi-lightbox-close:focus {
  opacity: 1;
  background: none;
  outline: none;
  box-shadow: none;
}

/* Prev / Next buttons */
.artedi-lightbox-prev,
.artedi-lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #fff;
  font-size: 3rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
  padding: 1rem;
  z-index: 1;
  user-select: none;
  -webkit-user-select: none;
}

.artedi-lightbox-prev { left: 0.5rem; }
.artedi-lightbox-next { right: 0.5rem; }

.artedi-lightbox-prev:hover,
.artedi-lightbox-prev:focus,
.artedi-lightbox-next:hover,
.artedi-lightbox-next:focus {
  opacity: 1;
  background: none;
  outline: none;
  box-shadow: none;
}

/* Hide nav arrows for single images */
.artedi-lightbox-prev.is-hidden,
.artedi-lightbox-next.is-hidden {
  display: none;
}

/* Caption */
.artedi-lightbox-caption {
  color: #ccc;
  text-align: center;
  margin-top: 1rem;
  font-size: 0.95rem;
  line-height: 1.4;
  max-width: 90vw;
}

.artedi-lightbox-caption .line1 {
  font-weight: 700;
  color: #eee;
}

.artedi-lightbox-caption .line2 {
  opacity: 0.85;
}

/* Clickable images */
.artedi-artwork img,
.artedi-slide img {
  cursor: pointer;
}

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

/* Mobile adjustments */
@media (max-width: 600px) {
  .artedi-lightbox-prev,
  .artedi-lightbox-next {
    display: none;
  }

  .artedi-lightbox-img {
    max-width: 95vw;
    max-height: 85vh;
  }
}
