/* ATC docs theme, the DESIGN.md industrial system, applied to mdbook.
 * Token source of truth: frontend/ota/src/styles/design-system.css.
 * Two live themes: .light (light tokens) and .navy (dark tokens); the other
 * built-ins are hidden from the picker below. No blue, no purple, ever. */

:root {
  --mono-font: 'Commit Mono', ui-monospace, Menlo, Consolas, monospace;
}

/* mdbook hardcodes "Open Sans" on html (general.css), no --sans-font var
 * exists, so override the family directly. */
html {
  font-family: 'Archivo', 'Univers', system-ui, sans-serif;
}

/* ── light ─────────────────────────────────────────────────────────── */
.light,
html:not(.js) {
  --bg: #f5f5f5;                /* paper */
  --fg: #1f262a;                /* ink */

  --sidebar-bg: #ece3cf;        /* sand block */
  --sidebar-fg: #1f262a;        /* ink */
  --sidebar-non-existant: #5a6470; /* muted */
  --sidebar-active: #1e4d2b;    /* green accent */
  --sidebar-spacer: #c7ad77;    /* cap */
  --sidebar-header-border-color: #c7ad77; /* cap, structural, not alarm-red */

  --scrollbar: #5a6470;         /* muted */

  --icons: #5a6470;
  --icons-hover: #1f262a;

  --links: #1e4d2b;             /* green, never blue */

  --inline-code-color: #800000; /* maroon */

  --theme-popup-bg: #ffffff;    /* panel */
  --theme-popup-border: #d8d2c4;/* hairline */
  --theme-hover: #eee7d8;       /* row-hover */

  --quote-bg: #ece3cf;          /* chapter-bg */
  --quote-border: #c7ad77;      /* cap */

  --warning-border: #c8761a;    /* amber */

  --table-border-color: #d8d2c4;
  --table-header-bg: #ece3cf;
  --table-alternate-bg: #efede8;

  --searchbar-border-color: #d8d2c4;
  --searchbar-bg: #ffffff;
  --searchbar-fg: #1f262a;
  --searchbar-shadow-color: #d8d2c4;
  --searchresults-header-fg: #5a6470;
  --searchresults-border-color: #d8d2c4;
  --searchresults-li-bg: #ffffff;
  --search-mark-bg: #dbc8a2;    /* sand */

  --color-scheme: light;

  /* muted #5a6470 */
  --copy-button-filter: invert(41%) sepia(8%) saturate(507%) hue-rotate(174deg) brightness(92%) contrast(87%);
  --copy-button-filter-hover: invert(11%) sepia(9%) saturate(756%) hue-rotate(158deg) brightness(95%) contrast(89%);

  --footnote-highlight: #c7ad77;

  --overlay-bg: rgba(31, 38, 42, 0.4);

  --blockquote-note-color: #1e4d2b;      /* green */
  --blockquote-tip-color: #1e4d2b;
  --blockquote-important-color: #800000; /* maroon */
  --blockquote-warning-color: #c8761a;   /* amber */
  --blockquote-caution-color: #c92c2c;   /* red */
}

/* ── dark (the "navy" slot, rebuilt on dark tokens, nothing navy left) ── */
.navy {
  --bg: #14191c;                /* paper (dark) */
  --fg: #f0ece3;                /* ink (dark) */

  --sidebar-bg: #1e252a;        /* panel (dark) */
  --sidebar-fg: #f0ece3;        /* ink (dark) */
  --sidebar-non-existant: #8a939a; /* muted (dark) */
  --sidebar-active: #8fbf9c;    /* green accent (dark) */
  --sidebar-spacer: #cbb079;    /* cap (dark) */
  --sidebar-header-border-color: #cbb079; /* cap (dark) */

  --scrollbar: #8a939a;         /* muted (dark) */

  --icons: #8a939a;
  --icons-hover: #f0ece3;

  --links: #8fbf9c;             /* bw (dark) */

  --inline-code-color: #cf9a9a; /* maroon (dark) */

  --theme-popup-bg: #1e252a;    /* panel (dark) */
  --theme-popup-border: #333d43;/* hairline (dark) */
  --theme-hover: #2a333a;       /* row-hover (dark) */

  --quote-bg: #333d44;          /* chapter-bg (dark) */
  --quote-border: #cbb079;      /* cap (dark) */

  --warning-border: #cf9a5a;    /* amber (dark) */

  --table-border-color: #333d43;
  --table-header-bg: #333d44;
  --table-alternate-bg: #1a2125;

  --searchbar-border-color: #333d43;
  --searchbar-bg: #1e252a;
  --searchbar-fg: #f0ece3;
  --searchbar-shadow-color: #333d43;
  --searchresults-header-fg: #8a939a;
  --searchresults-border-color: #333d43;
  --searchresults-li-bg: #1e252a;
  --search-mark-bg: #dbc8a2;

  --color-scheme: dark;

  /* muted (dark) #8a939a */
  --copy-button-filter: invert(62%) sepia(6%) saturate(303%) hue-rotate(158deg) brightness(92%) contrast(85%);
  --copy-button-filter-hover: invert(97%) sepia(6%) saturate(432%) hue-rotate(345deg) brightness(103%) contrast(88%);

  --footnote-highlight: #cbb079;

  --overlay-bg: rgba(0, 0, 0, 0.5);

  --blockquote-note-color: #74a583;      /* green (dark) */
  --blockquote-tip-color: #74a583;
  --blockquote-important-color: #cf9a9a; /* maroon (dark) */
  --blockquote-warning-color: #cf9a5a;   /* amber (dark) */
  --blockquote-caution-color: #e0645c;   /* hud-fail */
}

/* ── theme picker: only the two branded themes are selectable ───────── */
#mdbook-theme-rust,
#mdbook-theme-coal,
#mdbook-theme-ayu {
  display: none;
}

/* ── brand rules beyond variables ────────────────────────────────────── */

body {
  font-weight: 500; /* Archivo text register per DESIGN.md */
}

/* Display register: heavy, uppercase, letterspaced (h1/h2 only; deeper
 * headings stay bold sentence case for prose readability). */
.content h1,
.content h2 {
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Top bar: gunmetal with the 6px red rule (the brand frame). */
#mdbook-menu-bar,
#mdbook-menu-bar-hover-placeholder {
  background-color: #1f262a;
  color: #f5f5f5;
  border-bottom: 6px solid #c92c2c;
}
#mdbook-menu-bar .icon-button,
#mdbook-menu-bar a {
  color: #aeb6bd; /* topbar-fg */
}
#mdbook-menu-bar .icon-button:hover,
#mdbook-menu-bar a:hover {
  color: #f5f5f5; /* topbar-fg-strong */
}
.menu-title {
  color: #f5f5f5;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Sidebar: flat sand/panel surface (the cheatsheet register); the current
 * chapter keeps the red end-cap, plus green text and a deeper tint. */
.chapter li.chapter-item {
  line-height: 1.9em;
}
/* Sidebar chapter list in the mono face (instrument-panel register). */
.sidebar .chapter {
  font-family: var(--mono-font);
}
.sidebar .chapter a.active {
  box-shadow: inset 4px 0 0 #c92c2c;
  background: #dcd2bd; /* btn-bg */
  font-weight: 700;
}
.sidebar .chapter a:hover {
  background: #dcd2bd;
  text-decoration: none;
}
.navy .sidebar .chapter a.active,
.navy .sidebar .chapter a:hover {
  background: #333d44; /* chapter-bg (dark) */
}

/* Square corners, no soft shadows, instrument panel, not a SaaS card. */
pre,
code,
.theme-popup,
#mdbook-searchbar,
table {
  border-radius: 2px;
}

/* Tables: heavy header rule, engineering-caps header row. */
.content table thead th {
  border-bottom: 4px solid #1f262a;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8em;
  font-weight: 700;
}
.navy .content table thead th {
  border-bottom-color: #f0ece3;
}
