/* CEP motion. Scroll timelines on the published site only.
   The builder does not add body.dwc-frontend, so the canvas stays still. */

@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    body.dwc-frontend :is(.cep-hero__media, .cep-not-found__media, .cep-about__media, .cep-facility__media) {
      overflow: clip;
    }

    body.dwc-frontend :is(.cep-hero__media, .cep-not-found__media) :is(img, etch\:img) {
      --hero-parallax-shift: 7%;
      --hero-parallax-scale: 1.16;

      scale: var(--hero-parallax-scale);
      animation: hero-photo-parallax linear both;
      animation-timeline: scroll(root);
      animation-range: 0 100vh;
    }
  }
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    body.dwc-frontend :is(.cep-about__content, .cep-services__header, .cep-gallery__intro, .cep-testimonials__title, .cep-facility__content) {
      --reveal-distance: var(--space-m);

      animation: content-fade-up ease-out both;
      animation-timeline: view();
      animation-range: cover 20vh cover 48vh;
    }

    body.dwc-frontend .cep-about__content {
      animation-range: cover 34vh cover 64vh;
    }

    body.dwc-frontend .cep-about__media {
      --about-parallax-from: var(--space-s);
      --about-parallax-to: calc(var(--space-l) * -1);

      animation: about-photo-parallax linear both;
      animation-timeline: view();
      animation-range: entry 0% exit 0%;
    }

    body.dwc-frontend .cep-services__card {
      --reveal-distance: var(--space-m);

      animation: content-rise ease-out both;
      animation-timeline: view();
      animation-range: cover 18vh cover 46vh;
    }

    body.dwc-frontend .cep-services__card:nth-child(2) {
      animation-range: cover 30vh cover 58vh;
    }

    body.dwc-frontend .cep-services__card:nth-child(3) {
      animation-range: cover 42vh cover 70vh;
    }

    body.dwc-frontend .cep-facility {
      --reveal-distance: var(--space-s);

      animation: content-rise ease-out both;
      animation-timeline: view();
      animation-range: cover 16vh cover 44vh;
    }

    body.dwc-frontend .cep-facility:nth-child(2) {
      animation-range: cover 24vh cover 52vh;
    }

    body.dwc-frontend .cep-facility:nth-child(3) {
      animation-range: cover 32vh cover 60vh;
    }

    body.dwc-frontend .cep-facility:nth-child(4) {
      animation-range: cover 40vh cover 68vh;
    }
  }
}

@media (prefers-reduced-motion: no-preference) {
  body.dwc-frontend :is(.cep-contact__title, .cep-contact__form-wrap, .cep-contact__details, .cep-not-found__content) {
    --reveal-distance: var(--space-s);

    animation: cep-paint-fade 0.9s ease-out both;
    animation-timeline: auto;
    animation-range: normal;
  }
}
