/* The "J Maher | Match Cut v" group at the top left of every page.

   Colors are taken from the hero rather than written down, because Wander's
   hero is light where the family's are dark: white text here was invisible on
   its topo ground. `currentColor` plus an opacity works on both.

   Its own file because Wander does not use the family stylesheet -- it is an
   older design, kept as it was -- and this is the one piece of chrome every
   page shares regardless. One copy, loaded by all of them, rather than the
   same rules pasted into two stylesheets that would then drift.
   --------------------------------------------------------------------------- */

/* ------------------------------------------------- the Apps drop-down */
/* "J Maher | Match Cut v" at the top left: the name is the way home, and the
   app beside it opens the list of them. It sits here rather than off on the
   right because it names the page you are on, which is a job for the left.
   It is outside the hamburger, so unlike the rest of the nav it stays a real
   drop-down at every width. */
.hero .topnav .nav-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.hero .topnav .nav-sep {
  color: currentColor;
  opacity: 0.4;
  font-size: 1.05rem;
  line-height: 1;
  user-select: none;
}

.hero .topnav .nav-apps { position: relative; }

.hero .topnav .nav-apps-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 0;
  padding: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: currentColor;
  opacity: 0.8;
  white-space: nowrap;
  cursor: pointer;
}
.hero .topnav .nav-apps-toggle:hover,
.hero .topnav .nav-apps-toggle[aria-expanded="true"] { opacity: 1; }
.hero .topnav .nav-apps-toggle svg { transition: transform 0.15s ease; opacity: 0.8; }
.hero .topnav .nav-apps-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.hero .topnav .nav-apps-toggle:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 4px; }

.hero .topnav .nav-apps-menu {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  min-width: 228px;
  padding: 6px;
  background: var(--page);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
  z-index: 7;
}
.hero .topnav .nav-apps-toggle[aria-expanded="true"] + .nav-apps-menu { display: block; }

/* Left, not centered. The hero sets `text-align: center` and the menu was
   inheriting it, which left six names of different lengths floating on a
   center line with nothing to read down. */
.hero .topnav .nav-apps-menu { text-align: left; }

.hero .topnav .nav-apps-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 0.95rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

/* `display: block`, not `contents`: in a flex row `contents` promotes the
   <source> as well as the <img>, which puts an empty item in the row and
   pushes the name over by the gap. */
.hero .topnav .nav-apps-menu picture { display: block; flex: none; }
.hero .topnav .nav-apps-menu img {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 6px;
}
.hero .topnav .nav-apps-menu a:hover { background: var(--surface); }
/* The app you are in, marked in the switcher. On the app's own page that is
   `page`; on one of its sub-pages it is `true` -- the current item in the set,
   which is what it is, rather than the page you are on, which it is not. It
   said `page` everywhere and so read as the destination rather than a door
   back to the app's front page. Either value is highlighted the same. */
.hero .topnav .nav-apps-menu a[aria-current] { font-weight: 600; background: var(--surface); }

@media (max-width: 520px) {
  /* Smaller, not shorter. The chevron is the only thing saying this opens
     something, so it stays at every width; the longest name is "Liner Notes"
     and the pair still fits beside the menu button. */
  .hero .topnav .nav-brand { gap: 7px; }
  .hero .topnav .wordmark,
  .hero .topnav .nav-apps-toggle { font-size: 0.95rem; }
  .hero .topnav .nav-sep { font-size: 0.95rem; }
}
