/**
 * JG Website Manager — Page Transition & Prefetch styles
 *
 * Fade-in plays on every page load (body animation).
 * A loading overlay is triggered by JS adding jgwm-leaving to <html> before
 * navigating to the next (prefetched) page.
 * The prefers-reduced-motion block suppresses animations automatically.
 */

@keyframes jgwm-page-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

body {
  animation: jgwm-page-in 0.15s ease-out;
}

html.jgwm-leaving body {
  cursor: progress;
}

.jgwm-page-loader {
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  bottom: 0;
  display: flex;
  justify-content: center;
  left: 0;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  right: 0;
  top: 0;
  transition: opacity 0.1s ease-in;
  visibility: hidden;
  z-index: 2147483647;
}

html.jgwm-leaving .jgwm-page-loader {
  opacity: 1;
  visibility: visible;
}

.jgwm-page-loader-spinner {
  animation: jgwm-loader-spin 0.75s linear infinite;
  border: 4px solid rgba(24, 32, 38, 0.18);
  border-radius: 50%;
  border-top-color: #182026;
  display: block;
  height: 44px;
  width: 44px;
}

.jgwm-page-loader-text {
  clip: rect(1px, 1px, 1px, 1px);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

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

@media (prefers-reduced-motion: reduce) {
  body { animation: none; }
  .jgwm-page-loader { transition: none; }
  .jgwm-page-loader-spinner { animation: none; }
}
