/* User Provided Stylesheet */

/* === FOUC Prevention — loading spinner while React hydrates === */
body:not(.hydrated) {
  overflow: hidden;
}
body:not(.hydrated)::before {
  content: '';
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 10000;
}
body:not(.hydrated)::after {
  content: '';
  position: fixed;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-top-color: rgba(0, 0, 0, 0.4);
  border-radius: 50%;
  animation: myst-spin 0.6s linear infinite;
  z-index: 10001;
}
@keyframes myst-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-color-scheme: dark) {
  body:not(.hydrated)::before {
    background: #111;
  }
  body:not(.hydrated)::after {
    border-color: rgba(255, 255, 255, 0.1);
    border-top-color: rgba(255, 255, 255, 0.5);
  }
}

/* === Lightbox overlay — global click-to-expand === */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 2rem;
}

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

.lightbox-overlay .lightbox-content {
  max-width: 95vw;
  max-height: 95vh;
  overflow: auto;
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

@media (prefers-color-scheme: dark) {
  .lightbox-overlay .lightbox-content {
    background: #1e1e1e;
  }
}

/* Zoomable elements */
.mermaid svg,
article figure img,
article img:not([width="1"]) {
  cursor: zoom-in;
}
