/* Nine Angels Villa — Lightbox overlay */

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(20, 18, 14, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s cubic-bezier(0.22, 0.61, 0.36, 1),
              visibility 0.35s;
  cursor: zoom-out;
}

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

.lightbox-overlay img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 24px 80px -20px rgba(0, 0, 0, 0.6);
  transform: scale(0.94);
  transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
  pointer-events: none;
}

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

/* Caption */
.lightbox-caption {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.85);
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-align: center;
  max-width: 80vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Close button */
.lightbox-close {
  position: absolute;
  top: 24px;
  right: 28px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s, border-color 0.2s;
  z-index: 10;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.6);
}

/* Nav arrows */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s, border-color 0.2s;
  z-index: 10;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.5);
}

.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }

/* Counter */
.lightbox-counter {
  position: absolute;
  top: 28px;
  left: 28px;
  color: rgba(255, 255, 255, 0.6);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.1em;
}

/* Cursor for gallery images */
.gallery-grid .ph[data-img] {
  cursor: zoom-in;
}

/* Mobile adjustments */
@media (max-width: 600px) {
  .lightbox-nav { width: 36px; height: 36px; font-size: 16px; }
  .lightbox-prev { left: 12px; }
  .lightbox-next { right: 12px; }
  .lightbox-close { top: 16px; right: 16px; }
  .lightbox-caption { font-size: 12px; bottom: 20px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .lightbox-overlay,
  .lightbox-overlay img {
    transition-duration: 0.01ms !important;
  }
}
