/* The shared top bar of every site page (generated by site/build_langs.py top_bar), and of the explorer's family:
   the same night-teal ground, mark and search field as app.trailforensics.com. Its colours are scoped to .bar so the
   example page, which has its own light stylesheet, can carry it unchanged. No script: the language menu is a
   <details>, the search is a plain GET form to the explorer. */
.bar {
  --bar-bg: rgba(11, 12, 16, .94); --bar-ink: #f3f4f6; --bar-quiet: #9aa1ad; --bar-rule: #1f232b;
  --bar-field: #111318; --bar-hover: #171a21; --bar-trail: #7ea4ff;
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1.25rem;
  min-height: 4rem; padding: .5rem clamp(1rem, 3vw, 2rem); box-sizing: border-box;
  background: var(--bar-bg); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--bar-rule); color: var(--bar-ink);
  font: 400 15px/1.4 "Atkinson Next", system-ui, sans-serif;
}
.bar *, .bar *::before, .bar *::after { box-sizing: border-box; }
.bar .brand { display: flex; align-items: center; gap: .6rem; color: inherit; text-decoration: none; font-weight: 700;
  font-size: 1.05rem; letter-spacing: .01em; white-space: nowrap; }
.bar .mark { width: 28px; height: 28px; flex: none; }
.bar .mark rect { fill: #3563e9; }
.bar .mark path { fill: none; stroke: #fff; stroke-width: 3; }
.bar .primary { display: flex; gap: .15rem; min-width: 0; }
.bar .primary a { color: var(--bar-quiet); text-decoration: none; padding: .45rem .6rem; border-radius: 6px; white-space: nowrap; }
.bar .primary a:hover { color: var(--bar-ink); background: var(--bar-hover); }
.bar .primary a[aria-current="page"] { color: var(--bar-ink); box-shadow: inset 0 -2px 0 var(--bar-trail); border-radius: 6px 6px 0 0; }
.bar .find { margin: 0 0 0 auto; flex: 0 1 24rem; min-width: 12rem; display: flex; max-width: none; gap: 0; }
.bar .find input { display: block; flex: 1 1 auto; width: auto; margin: 0; font: inherit; color: var(--bar-ink); background: var(--bar-field);
  border: 1px solid var(--bar-rule); border-right: 0; border-radius: 8px 0 0 8px; padding: .55rem .75rem; min-width: 0; }
.bar .find input::placeholder { color: var(--bar-quiet); opacity: 1; }
.bar .find input:focus { outline: 2px solid var(--bar-trail); outline-offset: 1px; }
.bar .find button { flex: none; display: grid; place-items: center; width: 2.75rem; margin: 0; padding: 0; cursor: pointer;
  color: var(--bar-ink); background: var(--bar-hover); border: 1px solid var(--bar-rule); border-radius: 0 8px 8px 0; }
.bar .find button:hover { color: #0b0c10; background: var(--bar-trail); border-color: var(--bar-trail); }
.bar .find button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.bar :focus-visible { outline: 2px solid var(--bar-trail); outline-offset: 2px; }

/* Language menu: a native <details> drop-down */
.bar .lang-menu { position: relative; flex: none; }
.bar .lang-menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .4rem; color: var(--bar-ink);
  border: 1px solid var(--bar-rule); border-radius: 8px; padding: .5rem .65rem; }
.bar .lang-menu summary::-webkit-details-marker { display: none; }
.bar .lang-menu summary::after { content: ""; width: .38rem; height: .38rem; border-right: 2px solid var(--bar-quiet);
  border-bottom: 2px solid var(--bar-quiet); transform: translateY(-.12rem) rotate(45deg); }
.bar .lang-menu[open] summary::after { transform: translateY(.1rem) rotate(-135deg); }
.bar .lang-menu nav.lang { position: absolute; right: 0; top: calc(100% + .4rem); z-index: 30; display: flex; flex-direction: column;
  min-width: 10rem; padding: .3rem; background: var(--bar-field); border: 1px solid var(--bar-rule); border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .45); }
.bar .lang-menu nav.lang a { display: block; margin: 0; padding: .45rem .7rem; color: var(--bar-ink); text-decoration: none;
  border-radius: 6px; font-weight: 400; }
.bar .lang-menu nav.lang a:hover { background: var(--bar-hover); }
.bar .lang-menu nav.lang a[aria-current="page"] { font-weight: 700; color: var(--bar-trail); }

/* Narrower screens: brand and language on the first row, the search across the second, the menu scrolls sideways */
@media (max-width: 1280px) {
  .bar { position: static; flex-wrap: wrap; gap: .6rem 1rem; padding-block: .75rem .25rem; }
  .bar .lang-menu { order: 2; margin-left: auto; }
  .bar .find { order: 3; flex: 1 1 100%; margin: 0; }
  .bar .primary { order: 4; flex: 1 1 100%; overflow-x: auto; scrollbar-width: none; margin-inline: -.6rem; padding: 0 2.5rem .15rem 0;
    /* the right edge fades, so a cut-off item reads as "more this way"; the end padding lets the last item clear the fade */
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent); }
  .bar .primary::-webkit-scrollbar { display: none; }
}

@media print {
  .bar { position: static; background: none; border: 0; color: #000; padding: 0 0 1rem; }
  .bar .primary, .bar .find, .bar .lang-menu { display: none; }
}
