/* ========================================
   LIGHTBOX.CSS - Image Overlay Modal
   ======================================== */

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

.lightbox--active {
  opacity: 1;
  visibility: visible;
}

/* Dark backdrop */
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  cursor: pointer;
}

/* Image container */
.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lightbox--active .lightbox-content {
  transform: scale(1);
}

/* Image wrapper for watermark positioning */
.lightbox-image-wrapper {
  position: relative;
  display: inline-block;
  overflow: hidden;
  border-radius: var(--radius-md, 8px);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
}

/* The image */
.lightbox-image {
  display: block;
  max-width: 90vw;
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Diagonal watermark - corner to corner */
.lightbox-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150%;
  text-align: center;
  transform: translate(-50%, -50%) rotate(-45deg);
  font-size: 4rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.25);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  letter-spacing: 0.5em;
  text-transform: uppercase;
}

/* Close button */
.lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid #000;
  border-radius: 50%;
  color: #000;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

/* Navigation arrows */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
  z-index: 10;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-nav--prev {
  left: -70px;
}

.lightbox-nav--next {
  right: -70px;
}

/* Image caption/counter */
.lightbox-caption {
  position: absolute;
  bottom: -35px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  white-space: nowrap;
}

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

/* Responsive */
@media (max-width: 767px) {
  .lightbox-content {
    max-width: 95vw;
  }

  .lightbox-image {
    max-width: 95vw;
    max-height: 80vh;
  }

  .lightbox-close {
    top: 8px;
    right: 8px;
  }

  .lightbox-nav {
    width: 40px;
    height: 40px;
    font-size: 22px;
  }

  .lightbox-nav--prev {
    left: 10px;
  }

  .lightbox-nav--next {
    right: 10px;
  }

  .lightbox-caption {
    bottom: -30px;
    font-size: 0.75rem;
  }
}
