.lightbox {
  display: none;
  position: fixed;
  z-index: 1050;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.lightbox.active {
  display: block;
}

.lightbox-container {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
}

.lightbox-content {
  display: block;
  max-width: 80%;
  max-height: 80vh;
  object-fit: contain;
  border: 3px solid #333;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
}

.lightbox-content.loading {
  opacity: 0.5;
}

.lightbox-caption {
  display: block;
  margin: auto;
  width: 80%;
  max-width: 800px;
  text-align: center;
  color: #f9f9f9;
  padding: 10px 0;
  font-size: clamp(1rem, 2vw, 1.25rem);
}

.lightbox button {
  border: none;
  background: none;
  color: #f1f1f1;
  cursor: pointer;
  transition: color 0.3s, background 0.3s;
}

.lightbox button[hidden] {
  display: none;
}

.lightbox-close-btn {
  position: absolute;
  top: 15px;
  right: 35px;
  font-size: 40px;
  font-weight: bold;
}

.lightbox-prev-btn,
.lightbox-next-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 28px;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.4);
}

.lightbox-prev-btn {
  left: 15px;
}

.lightbox-next-btn {
  right: 15px;
}

.lightbox button:hover,
.lightbox button:focus-visible {
  color: #b3b3b3;
}

[data-bs-theme="light"] .lightbox-caption {
  color: #212529;
}

@media (prefers-reduced-motion: reduce) {
  .lightbox button,
  .theme-toggle {
    transition: none;
  }
}
