/* Zorion action effects. The canvas is hit-transparent. Recolor is a class
   the effect adds and then removes; !important only so theme rules cannot
   hide the temporary shift. */

.prism-fx {
  pointer-events: none !important;
  background: transparent !important;
}

.prism-fx-recolor {
  --prism-fx-hue: 272;
  isolation: isolate;
  border-color: hsl(var(--prism-fx-hue) 46% 64% / 0.82) !important;
  background-color: rgba(28, 20, 48, 0.8) !important;
  background-image: linear-gradient(
    128deg,
    hsl(var(--prism-fx-hue) 52% 40% / 0.32),
    rgba(36, 26, 18, 0.28) 46%,
    hsl(40 48% 42% / 0.2)
  ) !important;
  box-shadow:
    0 0 0 1px hsl(40 52% 58% / 0.5),
    0 0 16px hsl(var(--prism-fx-hue) 70% 60% / 0.32),
    inset 0 0 22px hsl(var(--prism-fx-hue) 55% 42% / 0.12) !important;
}

html[data-theme="light"] .prism-fx-recolor {
  border-color: hsl(var(--prism-fx-hue) 42% 34% / 0.72) !important;
  background-color: rgba(255, 250, 244, 0.92) !important;
  background-image: linear-gradient(
    128deg,
    hsl(var(--prism-fx-hue) 62% 48% / 0.14),
    rgba(255, 252, 246, 0.72) 52%,
    hsl(40 62% 46% / 0.12)
  ) !important;
  box-shadow:
    0 0 0 1px hsl(36 42% 36% / 0.4),
    0 0 14px hsl(var(--prism-fx-hue) 50% 40% / 0.18),
    inset 0 0 16px hsl(var(--prism-fx-hue) 55% 48% / 0.06) !important;
}

.prism-fx-recolor::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  border-radius: inherit;
  background-image: linear-gradient(
    105deg,
    transparent 0%,
    transparent 40%,
    hsl(40 85% 82% / 0.02) 46%,
    hsl(40 90% 88% / 0.34) 50%,
    hsl(var(--prism-fx-hue) 75% 78% / 0.16) 55%,
    transparent 62%,
    transparent 100%
  );
  background-size: 220% 100%;
  background-repeat: no-repeat;
  animation: prism-fx-shimmer 2.8s ease-in-out infinite;
}

@keyframes prism-fx-shimmer {
  0% { background-position: 115% 0; }
  100% { background-position: -35% 0; }
}

.prism-fx-recolor[data-prism-still="true"]::before {
  animation: none !important;
  background-position: 42% 0;
  opacity: 0.7;
}

@media (prefers-reduced-motion: reduce) {
  .prism-fx-recolor::before {
    animation: none !important;
    background-position: 42% 0;
    opacity: 0.55;
  }
}

/* Speaking highlight for a tour stop. Static outline is the reduced-motion form. */
#main-content [data-zorion-speaking="true"] {
  outline: 2px solid hsl(var(--prism-fx-hue, 40) 62% 58% / 0.95);
  outline-offset: 4px;
  scroll-margin: 96px;
}

#main-content [data-zorion-speaking="end"] {
  outline: 2px solid transparent;
  outline-offset: 4px;
  transition: outline-color 280ms ease;
}

@media (prefers-reduced-motion: reduce) {
  #main-content [data-zorion-speaking="end"] {
    transition: none;
  }
}

@media print {
  .prism-fx,
  .prism-fx-recolor::before {
    display: none !important;
    animation: none !important;
  }
}
