/* ═══════════════════════════════════════════════════════════════
   GALLERY — Lightbox modal overlay
   ═══════════════════════════════════════════════════════════════ */

/* ─── MODAL BACKDROP ─── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  /* Hidden when empty */
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s var(--ease-out);
}

.modal-backdrop:not(:empty) {
  pointer-events: auto;
  opacity: 1;
}

/* ─── MODAL CARD ─── */
.modal {
  background: var(--bg-panel);
  border: 1px solid var(--grid);
  border-radius: var(--radius-md);
  max-width: 900px;
  width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: modalIn 0.3s var(--ease-out);
}

.modal__close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 2rem;
  cursor: pointer;
  z-index: 1;
  line-height: 1;
  transition: color 0.2s;
}
.modal__close:hover { color: var(--text-primary); }

.modal__img {
  width: 100%;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: var(--bg-obsidian);
}

.modal__info {
  padding: var(--space-lg);
}

.modal__title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin-bottom: var(--space-sm);
}

.modal__desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ─── HTMX LOADING INDICATOR ─── */
.htmx-indicator {
  display: none;
}
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  display: inline-block;
}

/* Spinner */
.spinner {
  width: 24px; height: 24px;
  border: 2px solid var(--grid);
  border-top-color: var(--accent-light);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .modal {
    width: 95vw;
    max-height: 85vh;
  }
  .modal__info { padding: var(--space-md); }
  .modal__title { font-size: 1.15rem; }
}
