/* Wardrop Digital effects library — page-transitions 1.0.0 (Wardrop Digital original). */
/* Turns on cross-document View Transitions. Browsers without them ignore every rule here and load pages normally. */
@view-transition { navigation: auto; }

/* Reduced motion (contract 18): no transition at all; the next page simply loads. */
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

/* The page: the old one fades out and lifts 24px, the new one fades in from 24px below. Opacity and transform only. */
::view-transition-old(root) { animation: fx-pt-out 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
::view-transition-new(root) { animation: fx-pt-in 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
/* Going back, it slides the other way (set by script from the link or the Back button). */
:root[data-fx-pt="back"]::view-transition-old(root) { animation-name: fx-pt-out-back; }
:root[data-fx-pt="back"]::view-transition-new(root) { animation-name: fx-pt-in-back; }

@keyframes fx-pt-out      { to   { opacity: 0; transform: translateY(-24px); } }
@keyframes fx-pt-in       { from { opacity: 0; transform: translateY(24px); } }
@keyframes fx-pt-out-back { to   { opacity: 0; transform: translateY(24px); } }
@keyframes fx-pt-in-back  { from { opacity: 0; transform: translateY(-24px); } }

/* Shared elements (data-fx-vt) glide between their two places. Pictures keep their crop while they resize. */
::view-transition-group(*) {
  animation-duration: 0.45s;
  animation-timing-function: cubic-bezier(0.2, 0.7, 0.2, 1);
}
::view-transition-old(*),
::view-transition-new(*) { height: 100%; object-fit: cover; }

/* A header marked data-fx-vt="header" stays still while the page changes. Named here as well as by script,
   so it holds even before the script has run. */
[data-fx-vt="header"] { view-transition-name: fx-header; }
