/* Page-level styles for <top-bar> and <bottom-bar>. Load in each page's <head>
   alongside /shared/nav.js. These have to live in the page, not the component:
   @view-transition and view-transition-name only work at document level. */

/* Cross-page view transition: the top bar stays put, the rest crossfades.
   Both pages must opt in for the transition to run. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
}

top-bar {
  view-transition-name: top-bar;
}

/* No view-transition-name on <bottom-bar>: it sits at a different height on
   each page, so a named transition would slide it across the screen. It
   crossfades with the rest of the page instead. */

/* Reserve space before the components are defined, so the page doesn't jump.
   Uses the page's theme colours if it sets them. */
top-bar:not(:defined) {
  display: block;
  height: 48px;
  background: var(--top-bar-bg, var(--nav-bg, #10185f));
}

bottom-bar:not(:defined) {
  display: block;
  height: 185px;
  background: var(--bottom-bar-bg, var(--nav-bg, #10185f));
}
