/* HQ's own navigation: the wings this person's grants reach. The shell's, because a wing is where
   pages live and no page knows about the others. Tokens only, like everything else.

   In the top line on the ground beside the mark, as the Spec draws it (sheet 1b): each wing a word
   in the ground's grey, the one you are on a round pill in the shell's colours, because a nav pill
   rests on the ground (the corners rule). An empty nav draws nothing at all, which is what somebody
   with no wings should see. */
.wings {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  font-size: var(--text-nav);
  font-weight: var(--weight-medium);
}

.wings:empty {
  display: none;
}

.wing {
  padding: var(--nav-pill-padding);
  border-radius: var(--radius-pill);
  color: var(--color-muted);
  text-decoration: none;
}

.wing:hover {
  color: var(--color-ink);
}

.wing:focus-visible {
  outline: var(--focus-width) solid var(--color-accent);
  outline-offset: var(--focus-offset);
}

/* `leptos_router`'s `<A>` marks the entry whose route is showing. */
.wing[aria-current="page"] {
  background: var(--color-shell);
  color: var(--color-shell-ink);
}

/* **HQ's top line takes two rows on a phone** (docs/decisions.md, the note titled "People in HQ: …",
   (12)): once your first name is the way to Profile it stays on the line, and the mark, the theme
   switch, the name and *Sign out* no longer fit beside four wings at 390 px. So under 36rem the line
   is a grid: the mark with who is here and the way out on the first row, the wings on the second,
   one row of their own that scrolls sideways rather than wrap. The start's box steps aside
   (`display: contents`) so the mark and the wings are the grid's own items, and nothing in the
   markup changes. The "HQ" chip beside the mark goes, because the wings already say which site this
   is; the wings, the theme word and *Sign out* take the quiet size, the wings' pills close to 6 px a
   side, and the line's edge comes in to the shell's. */
@media (max-width: 36rem) {
  .frame-wide .frame-top {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "home end"
      "wings wings";
    align-items: center;
    gap: var(--space-1) var(--space-2);
    padding-inline: var(--shell-inset-narrow);
  }

  .frame-wide .frame-start {
    display: contents;
  }

  .frame-wide .frame-home {
    grid-area: home;
  }

  .frame-wide .wings {
    grid-area: wings;
    flex-wrap: nowrap;
    gap: 0;
    overflow-x: auto;
    font-size: var(--text-quiet);
    white-space: nowrap;
    scrollbar-width: none;
  }

  .frame-wide .frame-end {
    grid-area: end;
    justify-self: end;
    gap: var(--space-2);
    margin-left: 0;
  }

  /* The top line and the page's own gutter close in together. */
  .frame-wide .page {
    padding-inline: var(--space-4);
  }

  .frame-wide .whoami {
    gap: var(--space-2);
  }

  .frame-wide .wing {
    padding-inline: calc(var(--space-1) * 1.5);
  }

  .frame-wide .frame-end .theme-toggle,
  .frame-wide .whoami .button-quiet {
    font-size: var(--text-quiet);
  }

  .frame-wide .site-mark-site {
    display: none;
  }
}

/* **And on a 375 or 360 px phone** (the cleanup round, 21 Oct 2026, the candidates' 25: the top line
   wrapped *Dark* and *Sign out* to a second row there): under 24rem the theme word gives way to its
   glyph (theme-toggle.css; the button's label still says what it does) and the wings' pills close
   to 4 px a side, which keeps one row at 360 px. */
@media (max-width: 24rem) {
  .frame-wide .frame-end .theme-toggle-word {
    display: none;
  }

  .frame-wide .frame-end .theme-toggle-glyph {
    display: inline;
  }

  .frame-wide .wing {
    padding-inline: var(--space-1);
  }
}
