/* ── LIGHTBOX MODAL ── */

.modal-lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  overflow: auto;
  animation: fadeIn 0.2s ease;
}

.modal-lightbox.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  animation: slideDown 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-lightbox-img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border: 1px solid var(--border);
}

.modal-lightbox-img--error {
  opacity: 0.3;
}

.modal-lightbox-content.image-error::after {
  content: 'Image failed to load';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #999;
  font-size: 0.875rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 1rem;
  border-radius: 4px;
  text-align: center;
  z-index: 10001;
}

.modal-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text);
  font-size: 2rem;
  cursor: pointer;
  padding: 0.5rem;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: all 0.2s ease;
  font-weight: 700;
  line-height: 1;
}

.modal-lightbox-close:hover {
  color: var(--electric);
  text-shadow: 0 0 10px var(--electric);
}

.modal-lightbox-close:focus-visible {
  outline: 2px solid var(--electric);
  outline-offset: 2px;
}

/* ── MODAL ANIMATIONS ── */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* ── RESPONSIVE ── */

@media (max-width: 768px) {
  .modal-lightbox-content {
    max-width: 95vw;
    max-height: 85vh;
  }
  .modal-lightbox-close {
    top: 0.75rem;
    right: 0.75rem;
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .modal-lightbox-content {
    max-width: 98vw;
    max-height: 80vh;
  }
  .modal-lightbox-close {
    top: 0.5rem;
    right: 0.5rem;
    width: 2rem;
    height: 2rem;
    font-size: 1.25rem;
  }
}