/*
 * SithBit brand theme for the mdBook docs. Overrides mdBook's per-theme CSS
 * variables so the book carries the same dark-side identity as the webclient
 * shells. The palette hexes here MIRROR webclients/shared/brand.css (the SoT) —
 * keep the two in sync when the palette changes (mdBook can't reach webclients/,
 * so the values are duplicated by necessity, not by choice).
 *
 * mdBook scopes theme vars by an <html> class (.light/.rust are light,
 * .coal/.navy/.ayu are dark). This file is an additional-css, injected after
 * mdBook's own theme CSS, so equal-specificity class rules win by source order.
 */

/* ---- Light-group themes: violet accent on the near-white brand background. ---- */
.light,
.rust,
html:not(.js) {
  --bg: #fafafb;
  --sidebar-bg: #f1f0f5;
  --links: #6d28d9;
  --sidebar-active: #6d28d9;
  --inline-code-color: #6d28d9;
  --search-mark-bg: #c4b5fd;
  --quote-border: #7c3aed;
}

/* ---- Dark-group themes: the full dark-side palette. ---- */
.coal,
.navy,
.ayu {
  --bg: #0b0b0f;
  --fg: #e7e7ea;
  --sidebar-bg: #16161d;
  --sidebar-fg: #a6a6ae;
  --sidebar-active: #9f67ff;
  --links: #9f67ff;
  --inline-code-color: #c4b5fd;
  --theme-popup-bg: #16161d;
  --theme-popup-border: #33333f;
  --table-border-color: #33333f;
  --table-header-bg: #1f1f29;
  --table-alternate-bg: #121218;
  --quote-bg: #16161d;
  --quote-border: #7c3aed;
  --searchbar-bg: #16161d;
  --searchbar-fg: #e7e7ea;
  --searchresults-li-bg: #1f1f29;
  --scrollbar: #33333f;
  --search-mark-bg: #5b21b6;
}

/* ---- The SithBit mark, prepended to the menu-bar title by js/brand-logo.js. ---- */
.menu-title .sb-mark {
  vertical-align: text-bottom;
  margin-right: 0.45rem;
}

/* ---- Prose tables: wrap in place instead of scrolling horizontally. ----
 * mdBook's default is a shrink-to-fit table inside an overflow-x wrapper, so
 * the wide key/default/meaning tables (Configuration reference above all) cut
 * off their last column behind a scrollbar. Instead: span the text column,
 * slim the 20px cell padding, and let long tokens in every column but the
 * first break at the overflow point — the first column holds config keys,
 * which must never break mid-token. A width floor under a middle column stops
 * the auto layout from crushing "Default" to a sliver when a long "Meaning"
 * dominates the row. Explicit per-column alignments (`:---:`) emit inline
 * styles and still win over the left-aligned header default. */
.content table {
  width: 100%;
}
.content table th {
  text-align: left;
}
.content table th,
.content table td {
  padding: 3px 10px;
}
.content table td:not(:first-child) {
  overflow-wrap: anywhere;
}
.content table td:nth-child(2):not(:last-child) {
  min-width: 16ch;
}

/* ---- Sitewide footer, appended to every page by js/footer.js. ---- */
.sb-footer {
  padding: 1.25rem 1rem;
  text-align: center;
  font-size: 0.8em;
  color: var(--sidebar-fg, var(--fg));
  border-top: 1px solid var(--table-border-color, currentColor);
}
