/* === gateline docs bar for the generated API section =======================
   Injected into every page under api/ by scripts/build-site.py, so the
   TypeDoc output is reachable from the rest of the documentation site and
   links back into it. It is the site header (assets/site.css .site-header)
   drawn on top of TypeDoc's page: the 3px ink band, the gate|line wordmark,
   the section links in the UI face, and the active section in signal blue.

   The @font-face rules live in assets/typedoc.css, which TypeDoc links on
   every api/ page before this file; the family names here resolve to those.
   The colours repeat assets/site.css by value. Keep the two in step.
   ========================================================================== */

:root {
  --gl-bar-ground: #ffffff;
  --gl-bar-ink: #0b0c0c;
  --gl-bar-muted: #4f5459;
  --gl-bar-line: #c8cacc;
  --gl-bar-accent: #1d70b8;
  --gl-bar-focus: #ffdd00;
  --gl-bar-font-ui: "Atkinson Hyperlegible Next", "Public Sans", Arial, sans-serif;
  --gl-bar-font-mark: "Overpass", "Public Sans", Arial, sans-serif;
  --gl-bar-h: 56px;
  --gl-bar-frame-w: 1320px;
  --gl-bar-gutter: 24px;
}

.gateline-docsbar {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 3;
  box-sizing: border-box;
  display: flex;
  align-items: stretch;
  gap: 28px;
  height: var(--gl-bar-h);
  padding: 0 max(var(--gl-bar-gutter), calc((100% - var(--gl-bar-frame-w)) / 2 + var(--gl-bar-gutter)));
  background: var(--gl-bar-ground);
  border-top: 3px solid var(--gl-bar-ink);
  border-bottom: 1px solid var(--gl-bar-line);
  font-family: var(--gl-bar-font-ui);
  font-size: 0.875rem;
  line-height: 1;
}

/* TypeDoc's own toolbar (search, title, menu) is sticky at top: 0 — it sits
   under this bar. */
.tsd-page-toolbar {
  top: var(--gl-bar-h);
}

/* Wordmark: "gate|line", the same treatment as the site header. The builder
   emits the word as two spans, <span>gate</span><span>line</span>; the
   accessible name is the plain word, and the bar between the halves is a
   2px accent rule. */
.gateline-docsbar-mark {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  margin-right: auto;
  font-family: var(--gl-bar-font-mark);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--gl-bar-ink);
  text-decoration: none;
}

.gateline-docsbar-mark > span:first-child {
  padding-right: 0.28em;
  border-right: 2px solid var(--gl-bar-accent);
}

.gateline-docsbar-mark > span:last-child {
  padding-left: 0.28em;
}

.gateline-docsbar-mark:hover {
  color: var(--gl-bar-accent);
}

.gateline-docsbar-mark:focus-visible {
  outline: 3px solid var(--gl-bar-focus);
  outline-offset: 4px;
  background: none;
}

.gateline-docsbar-nav {
  display: flex;
  align-items: stretch;
  gap: 28px;
  flex: 0 1 auto;
  min-width: 0;
  white-space: nowrap;
}

.gateline-docsbar-nav a,
.gateline-docsbar-here {
  display: flex;
  align-items: center;
  margin-bottom: -1px;               /* the active rule sits on the hairline */
  border-bottom: 2px solid transparent;
  font-weight: 500;
  color: var(--gl-bar-muted);
  text-decoration: none;
  white-space: nowrap;
}

.gateline-docsbar-nav a:hover {
  color: var(--gl-bar-ink);
  text-decoration: none;
}

.gateline-docsbar-nav a:focus-visible {
  outline: 3px solid var(--gl-bar-focus);
  outline-offset: -3px;
  background: var(--gl-bar-focus);
  color: var(--gl-bar-ink);
}

/* "API reference" is the active section: the same mark as the site nav. */
.gateline-docsbar-here {
  flex: 0 0 auto;
  color: var(--gl-bar-accent);
  border-bottom-color: var(--gl-bar-accent);
}

/* Phone: two rows — wordmark, then the section links on their own hairline —
   and the bar stops being sticky, as the site header does below 600px.
   TypeDoc's toolbar then takes the top of the viewport. */
@media (max-width: 599px) {
  :root {
    --gl-bar-gutter: 16px;
  }

  .gateline-docsbar {
    position: static;
    height: auto;
    flex-wrap: wrap;
    gap: 0;
  }

  .gateline-docsbar-mark {
    height: 48px;
  }

  .gateline-docsbar-mark {
    font-size: 1.125rem;
  }

  .gateline-docsbar-nav {
    flex-basis: 100%;
    gap: 20px;
    height: 40px;
    border-top: 1px solid var(--gl-bar-line);
    overflow-x: auto;
    scrollbar-width: none;
  }

  .gateline-docsbar-nav::-webkit-scrollbar {
    display: none;
  }

  .gateline-docsbar-nav a {
    margin-bottom: 0;
  }

  /* Five links do not fit in 390px. The wordmark is already the link home,
     and the active-section marker is dropped as the site header drops it. */
  .gateline-docsbar-nav a:first-child,
  .gateline-docsbar-here {
    display: none;
  }

  .tsd-page-toolbar {
    top: 0;
  }
}
