/* Page-level styles for <top-bar>. Load in each page's <head> alongside
   /shared/top-bar.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;
}

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