/* GB preference shim — banner shown when a page doesn't exist in the
 * chosen Language (ADR 0006). Material CSS variables only, so it is
 * correct in light and dark scheme alike. */
.gb-banner {
  padding: .65rem .8rem;
  font-size: .7rem;
  font-weight: 600;
  text-align: center;
  color: var(--md-primary-bg-color);
  background: var(--md-primary-fg-color);
}

/* --- Anti-FOUC (dark mode) ------------------------------------------------
 * The head script in main.html mirrors the stored colour scheme onto <html>
 * before first paint; gb-prefs.js keeps it in sync with the toggle afterwards.
 * Material paints the page background on <body>, but <body> ships with the
 * hard-coded light default until Material's deferred JS swaps it — the white
 * flash on navigation. This makes <body> adopt <html>'s background instead.
 * No hard-coded colour: `inherit` pulls the value straight from <html>, where
 * the slate scheme has already defined --md-default-bg-color. */
html[data-md-color-scheme="slate"] body { --md-default-bg-color: inherit; }

/* --- Single-version selector ---------------------------------------------
 * Material renders its version dropdown even for a Module with one version,
 * where there is nothing to switch to. When the runtime-injected list holds a
 * single entry, present it as a plain label: no caret, no hover/focus menu.
 * :has() reacts to whatever Material injects, so this self-corrects if a
 * second version is ever published. */
.md-version:has(.md-version__list > li:only-child) .md-version__current {
  cursor: default;
  pointer-events: none;
}
.md-version:has(.md-version__list > li:only-child) .md-version__current::after {
  display: none; /* the dropdown caret */
}
.md-version:has(.md-version__list > li:only-child) .md-version__list {
  display: none;
}

/* --- Header spacing -------------------------------------------------------
 * Give the theme + language controls some breathing room from the search box.
 * Applied to the search side so it is independent of how many controls render
 * (a single-language Module has no language switcher). */
.md-header__option ~ .md-search,
.md-header__option ~ [for="__search"] {
  margin-left: .4rem;
}
