/********************************************************************/
/* Modal Overlay */
/********************************************************************/
.image-modal {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  background: var(--imgviewer-overlay-bg);

  backdrop-filter: blur(var(--imgviewer-backdrop-blur, 0px));
  -webkit-backdrop-filter: blur(var(--imgviewer-backdrop-blur, 0px));

  z-index: var(--imgviewer-z);
  flex-direction: column;
  padding: 1rem;
}

.image-modal.visible {
  display: flex;
}

#modal-img {
  max-width: 90%;
  max-height: 80vh;
  border-radius: var(--media-radius);
  box-shadow: 0 0 20px rgba(255,255,255,0.15);
}

.modal-caption {
  margin-top: 1rem;
  color: var(--ui-text);
  font-size: 1rem;
  text-align: center;
  max-width: 90%;
}

.modal-description {
  margin-top: 0.5rem;
  color: var(--ui-text-muted);
  font-size: 0.9rem;
  text-align: center;
  max-width: 90%;
  line-height: 1.4;
}

.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
  background: none;
  border: none;
  color: var(--ui-text);
  cursor: pointer;
  padding: 0 1rem;
  user-select: none;
}

.nav-btn:hover {
  color: var(--ui-hover);
  opacity: 1;
}

.nav-btn:active {
  transform: translateY(-50%) scale(0.98);
}

.prev-btn { left: 0; }
.next-btn { right: 0; }
