/* Lightbox styles for image gallery */

.lightbox-overlay {
  display: none;
  position: absolute;
  width: 100%;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  overflow: auto;
  pointer-events: auto; /* Allow clicking on the overlay */
}

.lightbox-container {
  position: relative;
  top: 50vh;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 90vw;
  max-height: 80vh;
  pointer-events: auto; /* Re-enable pointer events for the container */
  z-index: 10000; /* Ensure it's above the overlay */
}

.lightbox-image {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  margin: 0 auto;
  border: 2px solid white;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
  background-color: rgba(0, 0, 0, 0.3);
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  color: white;
  font-size: 30px;
  font-weight: bold;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 5px 10px;
  pointer-events: auto; /* Ensure the button is clickable */
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  font-size: 30px;
  font-weight: bold;
  cursor: pointer;
  background-color: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 4px;
  padding: 10px 15px;
  opacity: 0.8;
  pointer-events: auto; /* Ensure the buttons are clickable */
}

.lightbox-nav:hover {
  opacity: 1;
  background-color: rgba(0, 0, 0, 0.7);
}

.lightbox-prev {
  left: 10px;
}

.lightbox-next {
  right: 10px;
}

.lightbox-caption {
  position: absolute;
  bottom: -40px;
  left: 0;
  right: 0;
  color: white;
  text-align: center;
  padding: 10px;
  pointer-events: auto; /* Ensure the caption is selectable */
}

/* When lightbox is active */
.lightbox-active {
  display: block;
}

/* For gallery images */
.gallery-item a {
  display: block;
  cursor: pointer;
}

/* Animation for lightbox */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox-active {
  animation: fadeIn 0.3s ease-in-out;
}