/* The flip (page.html, `custom.neighbours` or `custom.turn`): moving between neighbours animates, as a
   cross-document view transition — the page cross-fades and the lead picture slides out one way and in the other. Its
   own file, linked only on such pages, because the rule that turns it on cannot be scoped by a selector: in
   theme.css it would animate every navigation on the site. A browser without view transitions loads the page as
   ever. The lead picture is named by `turn.js` (`.lead-shot`), and the direction is its `data-turn`; without the
   script the page still cross-fades. */
@view-transition { navigation: auto; }

.lead-shot { view-transition-name: lead-shot; }

::view-transition-old(lead-shot), ::view-transition-new(lead-shot) {
  height: 100%;
  animation-duration: 280ms;
  animation-timing-function: cubic-bezier(.2, .7, .2, 1);
  animation-fill-mode: both;
}
::view-transition-old(lead-shot) { animation-name: turn-out; }
::view-transition-new(lead-shot) { animation-name: turn-in; }
:root[data-turn="back"]::view-transition-old(lead-shot) { animation-name: turn-out-back; }
:root[data-turn="back"]::view-transition-new(lead-shot) { animation-name: turn-in-back; }

@keyframes turn-out { to { transform: translateX(-8%); opacity: 0; } }
@keyframes turn-in { from { transform: translateX(8%); opacity: 0; } }
@keyframes turn-out-back { to { transform: translateX(8%); opacity: 0; } }
@keyframes turn-in-back { from { transform: translateX(-8%); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}
