/* edition.css already enables same-origin MPA transitions when motion is welcome. */
@media (prefers-reduced-motion: no-preference) {
  .mast {
    view-transition-name: csr-mast;
  }
  [data-csr-shared] {
    view-transition-name: csr-editorial-image;
  }
  ::view-transition-group(root) {
    animation-duration: 210ms;
  }
  ::view-transition-old(root) {
    animation: csr-page-leave 160ms ease-in both;
  }
  ::view-transition-new(root) {
    animation: csr-page-enter 215ms ease-out both;
  }
  html.csr-return::view-transition-new(root) {
    animation-name: csr-page-return;
  }
  ::view-transition-old(csr-mast) {
    animation: none;
    opacity: 0;
  }
  ::view-transition-new(csr-mast) {
    animation: none;
  }
  ::view-transition-group(csr-editorial-image) {
    animation-duration: 330ms;
    animation-timing-function: cubic-bezier(0.2, 0.72, 0.2, 1);
    z-index: 1;
  }
  ::view-transition-old(csr-editorial-image),
  ::view-transition-new(csr-editorial-image) {
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation-duration: 240ms;
  }
  @keyframes csr-page-enter {
    from {
      opacity: 0;
      transform: translateY(6px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
  @keyframes csr-page-return {
    from {
      opacity: 0;
      transform: translateY(-5px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
  @keyframes csr-page-leave {
    from {
      opacity: 1;
    }
    to {
      opacity: 0;
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }
}

/* Artwork approaches its reading size as a gallery row reaches the viewport. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    :is(
        .edition-rankings,
        .edition-estatisticas,
        .edition-resultados,
        .edition-pilotos,
        .edition-publicacoes
      )
      :is(.story-art, .driver-card .portrait) {
      animation: csr-gallery-plane linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 42%;
    }
    @keyframes csr-gallery-plane {
      from {
        scale: 0.92;
        translate: 0 24px;
      }
      to {
        scale: 1;
        translate: 0 0;
      }
    }
  }
}
