/* Lightbox overlay */
.custom-lightbox {
  display: flex;
  align-items: center; 
  justify-content: center;
  position: fixed;
  z-index: 9999;
  left: 0; top: 0; width: 100vw; height: 100vh;
  background: rgba(20,20,20,0.92);

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(.4,0,.2,1);
}

.custom-lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

/* Lightbox content area */
.custom-lightbox-content {
  position: relative;
  max-width: 90vw; 
  max-height: 90vh;
  display: flex; 
  flex-direction: column; 
  align-items: center;
}

/* Lightbox image */
.custom-lightbox-img {
  max-width: 80vw;
  max-height: 70vh;
  border-radius: 10px;
  box-shadow: 0 4px 32px rgba(0,0,0,0.35);

  /* Fade-in transition */
  opacity: 0;
  transition: opacity 0.45s cubic-bezier(.4,0,.2,1);
}
.custom-lightbox-img.loaded {
  opacity: 1;
}

/* Close & arrow buttons */
.custom-lightbox-close, .custom-lightbox-arrow {
  position: absolute;
  background: #111a; 
  border: none;
  color: #fff; 
  font-size: 2rem; 
  cursor: pointer;
  padding: 0.35em 0.6em;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s;
  z-index: 2;
  outline: none;
}

.custom-lightbox-close { 
  top: 1rem; 
  right: 1rem; 
}
.custom-lightbox-arrow.left { 
  top: 50%; 
  left: 1.5rem; 
  transform: translateY(-50%);
}
.custom-lightbox-arrow.right { 
  top: 50%; 
  right: 1.5rem; 
  transform: translateY(-50%);
}

.custom-lightbox-arrow:hover, 
.custom-lightbox-close:hover, 
.custom-lightbox-arrow:focus,
.custom-lightbox-close:focus {
  background: #333; 
  color: #fff;
}

.custom-lightbox-caption {
  color: #fff;
  text-align: center;
  margin-top: 1.25rem;
  font-size: 1.5rem;
  text-shadow: 0 2px 6px rgba(0,0,0,0.25);
  max-width: 80vw;
  word-break: break-word;
}

/* Responsive tweaks */
@media (max-width: 600px) {
  .custom-lightbox-content { max-width: 100vw; }
  .custom-lightbox-img { max-width: 98vw; max-height: 45vh; }
  .custom-lightbox-arrow.left { left: 0.5rem; }
  .custom-lightbox-arrow.right { right: 0.5rem; }
  .custom-lightbox-close { top: 0.6rem; right: 0.6rem; font-size: 1.5rem; }
  .custom-lightbox-caption { font-size: 1.5rem; }
}
