﻿/* Smooth page transition between staff pages: the same effect the public mobile site uses (cross-document View Transitions).
   It is pure CSS. BOTH the page you leave and the page you open must opt in, so every staff page links this file.
   Browsers without support simply navigate as before. */

/* Enable transitions between pages on the same domain */
@view-transition {
    navigation: auto;
}

/* Current page disappearing */
::view-transition-old(root) {
    animation: page-out 180ms ease-in both;
}

/* New page appearing */
::view-transition-new(root) {
    animation: page-in 280ms ease-out both;
}

@keyframes page-out {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(0.985);
    }
}

@keyframes page-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* The bottom tab bar is its own layer: it stays in place while the page content changes (only the active tab changes colour). */
.tab-bar {
    view-transition-name: tab-bar;
}

/* Respect users who disable animations */
@media (prefers-reduced-motion: reduce) {
    ::view-transition-old(root),
    ::view-transition-new(root),
    ::view-transition-group(tab-bar) {
        animation: none;
    }
}
