#lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 15, 15, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.lightbox-modal {
  background: rgba(20, 20, 20, 0.85); 
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
  max-width: 100%;
  max-height: 100%;
  overflow-y: auto;
  text-align: center;
  position: relative;
}

#lightbox-img {
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
  margin-bottom: 10px;
  background-color: rgba(0, 0, 0, 0.2);
  animation: lightboxImageFadeZoomIn 0.8s ease-in-out;
}

#lightbox-caption {
  width: auto; 
  display: block;
  max-width: 100%; 
  overflow-wrap: break-word;
  word-break: break-word;
  text-align: center;
  text-shadow:
    0 0 2px #000000,
    0 0 3px #000000,
    0 0 3px #000000;
  color: #fff;
  font-family: var(--font-body);
  font-size: var(--font-size-body);
}



.caption-wrapper {
  display: inline-block;
  max-width: 100%;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  text-align: center;
}

#lightbox-close {
  position: absolute;
  top: 8px;
  right: 15px;
  font-size: 1.8rem;
  font-weight: bold;
  color: #888;
  cursor: pointer;
}

#lightbox-prev,
#lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.3);
  padding: 10px;
  cursor: pointer;
  user-select: none;
  z-index: 10000;
}

#lightbox-prev {
  left: 10px;
}

#lightbox-next {
  right: 10px;
}


#lightbox-prev,
#lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  padding: 10px 15px;
  border-radius: 50%;
  cursor: pointer;
  user-select: none;
  z-index: 10000;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  text-shadow: 0 0 6px #ffd1dc, 0 0 8px #ffe0ac, 0 0 8px #e0bbff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

#lightbox-prev:hover,
#lightbox-next:hover {
  background: rgba(255, 255, 255, 0.2);
  text-shadow: 0 0 8px #ffe0ac, 0 0 10px #d0f0fd, 0 0 10px #c1f5c5;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

#lightbox-prev {
  left: 15px;
}

#lightbox-next {
  right: 15px;
}



#lightbox-prev,
#lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.4);
  padding: 10px 15px;
  border-radius: 50%;
  cursor: pointer;
  user-select: none;
  z-index: 10000;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  text-shadow: 0 0 6px #ffd1dc, 0 0 8px #ffe0ac, 0 0 8px #e0bbff;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
}

#lightbox-prev:hover,
#lightbox-next:hover {
  background: rgba(0, 0, 0, 0.6);
  text-shadow: 0 0 8px #ffe0ac, 0 0 10px #d0f0fd, 0 0 10px #c1f5c5;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.6);
}

#lightbox-prev {
  left: 15px;
}

#lightbox-next {
  right: 15px;
}


#lightbox-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 2rem;
  font-weight: bold;
  color: #fff;
  background: rgba(0, 0, 0, 0.4);
  padding: 8px 14px;
  border-radius: 50%;
  cursor: pointer;
  user-select: none;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  text-shadow: 0 0 6px #ffd1dc, 0 0 8px #ffe0ac, 0 0 8px #e0bbff;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
}

#lightbox-close:hover {
  background: rgba(0, 0, 0, 0.6);
  text-shadow: 0 0 8px #ffe0ac, 0 0 10px #d0f0fd, 0 0 10px #c1f5c5;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.6);
}

#lightbox-close:hover,
#lightbox-prev:hover,
#lightbox-next:hover {
  cursor: var(--cursor-hover) !important;
}

@keyframes captionFadeIn {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}


@keyframes lightboxImageFadeZoomIn {
  0% {
    opacity: 0;
    transform: scale(0.98) translateY(4px);
    filter: brightness(0.7); 
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: brightness(1); 
  }
}