/* ==========================================================================
   roots-motion — smooth scrolling (Lenis) + scroll reveal
   Every selector that targets content inside Enfold's wrapper is paired with
   its #top #wrap_all twin so it wins over the theme and the other packages.
   ========================================================================== */

:root {
  --roots-rv-y: 28px;
  --roots-rv-scale: 1;
  --roots-rv-dur: 800ms;
  --roots-rv-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --roots-rv-delay: 0ms;
  --roots-rv-travel: var(--roots-rv-y);
}

/* --------------------------------------------------------------------------
   Lenis — the window scroller
   -------------------------------------------------------------------------- */

html.lenis,
html.lenis body {
  height: auto;
}

html.lenis {
  scroll-behavior: auto !important;
}

html.lenis:not(.lenis-autoToggle).lenis-stopped {
  overflow: clip;
}

html.lenis [data-lenis-prevent],
html.lenis .roots-motion-prevent {
  overscroll-behavior: contain;
}

/* only while the page is actually moving, so maps, videos and payment
   iframes stay clickable the rest of the time */
html.lenis.lenis-scrolling iframe {
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Reveal — pre-hide
   The head flag adds .roots-mo-pending; the script removes it once every
   block carries its own state. Should the script never run, the 4s
   animation shows the page anyway.
   -------------------------------------------------------------------------- */

html.roots-mo-pending #main .entry-content-wrapper > *,
html.roots-mo-pending #main .roots-pd-page > *,
html.roots-mo-pending #main .roots-ps-page > *,
html.roots-mo-pending #main .roots-bs-page > *,
html.roots-mo-pending #main .roots-sr-page > *,
html.roots-mo-pending #top #wrap_all #main .entry-content-wrapper > *,
html.roots-mo-pending #top #wrap_all #main .roots-pd-page > *,
html.roots-mo-pending #top #wrap_all #main .roots-ps-page > *,
html.roots-mo-pending #top #wrap_all #main .roots-bs-page > *,
html.roots-mo-pending #top #wrap_all #main .roots-sr-page > * {
  opacity: 0;
  animation: roots-mo-safety 0s linear 4s forwards;
}

@keyframes roots-mo-safety {
  to {
    opacity: 1;
  }
}

/* --------------------------------------------------------------------------
   Reveal — states
   .roots-rv         waiting, hidden
   .roots-rv--fade   opacity only (first screen, or the element has its own transform)
   .roots-rv.is-in   animating in; both classes are removed once it has finished
   -------------------------------------------------------------------------- */

.roots-rv,
#top #wrap_all .roots-rv {
  opacity: 0;
  will-change: opacity;
}

.roots-rv:not(.roots-rv--fade),
#top #wrap_all .roots-rv:not(.roots-rv--fade) {
  transform: translate3d(0, var(--roots-rv-travel), 0) scale(var(--roots-rv-scale));
  will-change: opacity, transform;
}

.roots-rv.is-in,
#top #wrap_all .roots-rv.is-in {
  opacity: 1;
  transition: opacity var(--roots-rv-dur) var(--roots-rv-ease) var(--roots-rv-delay);
}

.roots-rv.is-in:not(.roots-rv--fade),
#top #wrap_all .roots-rv.is-in:not(.roots-rv--fade) {
  transform: none;
  transition:
    opacity var(--roots-rv-dur) var(--roots-rv-ease) var(--roots-rv-delay),
    transform var(--roots-rv-dur) var(--roots-rv-ease) var(--roots-rv-delay);
}

/* shorter travel on phones; a separate property so the inline :root values
   printed after this file cannot override it */
@media (max-width: 599px) {
  :root {
    --roots-rv-travel: calc(var(--roots-rv-y) * 0.65);
  }
}

@media (prefers-reduced-motion: reduce) {
  .roots-rv,
  #top #wrap_all .roots-rv,
  html.roots-mo-pending #main .entry-content-wrapper > *,
  html.roots-mo-pending #top #wrap_all #main .entry-content-wrapper > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }
}

@media print {
  .roots-rv,
  #top #wrap_all .roots-rv {
    opacity: 1 !important;
    transform: none !important;
  }
}
