/* TerseTS theme for the Zig autodoc (served at /reference).
 *
 * This is an OVERRIDE layer: the generated index.html keeps Zig's inline <style>,
 * and this sheet is injected right before </head> so it wins on source order. We do
 * not modify main.js / main.wasm — only restyle the markup they drive. The Zig autodoc
 * code is MIT-licensed (Zig Software Foundation); its logo is replaced below with the
 * TerseTS mark to avoid implying endorsement.
 *
 * Palette mirrors landing/styles.css and frontend/styles.css. */
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');

:root {
  --bg: #0f1117;
  --panel: #1a1d27;
  --ink: #e7e9ee;
  --muted: #9aa0ad;
  --accent: #5b8cff;
  --accent-2: #ff8c5b;
  --border: #2a2f3d;
  --code-bg: #0d0f16;
}

/* Force the dark theme regardless of the OS color-scheme preference. */
body {
  background-color: var(--bg);
  color: var(--ink);
  font-family: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  padding: 0 1.25rem 3rem;
}

a { color: var(--accent); }
code a { color: var(--accent); }
#status { color: var(--muted); }

/* Code blocks and inline code. */
pre {
  background-color: var(--code-bg);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
code {
  font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink);
}

/* ---- Top bar: replace the Zig logo with the TerseTS mark ---- */
nav { width: 10em; float: left; }
.logo svg { display: none; }            /* hide the bundled Zig wordmark */
.logo {
  display: block;
  width: 8.5em;
  height: 2.6em;
  margin: 0.7em 1em;
  background: url("/assets/tersets.svg") left center / contain no-repeat;
  filter: invert(1);                     /* black art -> white on dark */
}

#navWrap { margin-left: 11em; }
#search {
  background-color: var(--code-bg);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55em 0.7em;
}
#search::placeholder { color: var(--muted); }

/* Breadcrumb / section tabs. */
#listNav { background-color: var(--panel); border-radius: 8px; }
#listNav li a { color: var(--ink); }
#listNav li a:hover { background-color: var(--accent); color: #fff; }
#listNav li a.active { background-color: var(--accent); color: #fff; }

/* Section headings and declaration cards. */
section h1, #hdrName { border-bottom: 1px dashed var(--border); }
section h1 a, #hdrName a { color: var(--accent); }
section h2 { border-bottom: 1px solid var(--border); color: var(--ink); }
dl > div {
  border: 1px solid var(--border);
  background-color: var(--panel);
  border-radius: 8px;
}
.fieldDocs { border-color: var(--border); }
td, th { border-color: var(--border); }

/* Help dialog + search results + errors. */
#helpDialog {
  background-color: var(--panel);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 12px;
}
kbd {
  color: var(--ink);
  background-color: var(--code-bg);
  border: 1px solid var(--border);
  box-shadow: none;
}
#listSearchResults li.selected { background-color: var(--accent); }
#listSearchResults li.selected a { color: #fff; }
#errors { background-color: #4a1417; color: #ffd7d7; }
#errors pre { background-color: #5a181c; color: #ffe3e3; }

/* ---- Syntax highlighting (dark) ---- */
.tok-kw      { color: var(--accent-2); font-weight: 600; }
.tok-str     { color: #7ee787; }
.tok-builtin { color: #79c0ff; }
.tok-comment { color: var(--muted); font-style: italic; }
.tok-fn      { color: #d2a8ff; font-weight: 600; }
.tok-null    { color: #ffa657; }
.tok-number  { color: #ffa657; }
.tok-type    { color: #79c0ff; font-weight: 600; }
