/*
 * levimc-kit overlay for doxygen-awesome-css v2.4.1 ("Impression, Craft" on Doxygen API pages).
 *
 * Doxyfile:
 *   HTML_HEADER            = docs/api/header.html          (copy of kit/static/doxygen/header.html)
 *   HTML_FOOTER            = docs/api/footer.html          (copy of kit/static/doxygen/footer.html)
 *   HTML_EXTRA_STYLESHEET  = docs/api/doxygen-awesome-css/doxygen-awesome.css \
 *                            kit/static/kit-chrome.css \
 *                            kit/static/doxygen/doxygen-kit.css
 *   HTML_EXTRA_FILES       = kit/static/kit.js
 *   HTML_COLORSTYLE        = LIGHT      (the kit scripts toggle html.dark-mode / html.light-mode)
 * Do NOT include doxygen-awesome-darkmode-toggle.js: kit.js owns the theme (cookie levimc_theme, shared by every LeviMC site).
 */

html {
  --primary-color: #3a7047;
  --primary-dark-color: #2b5636;
  --primary-light-color: #6fbf73;
  --on-primary-color: #ffffff;
  --link-color: #356b42;

  --page-background-color: #f7f3e8;
  --page-foreground-color: #1f2a33;
  --page-secondary-foreground-color: #5b6770;
  --separator-color: #e2dacb;

  --border-radius-large: 0px;
  --border-radius-small: 0px;
  --border-radius-medium: 0px;

  --box-shadow: 0 2px 0 0 rgb(31 42 51 / 0.12), 0 6px 0 0 rgb(31 42 51 / 0.05);
  --odd-color: rgb(31 42 51 / 0.025);

  --font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-family-monospace: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --page-font-size: 15.5px;
  --content-line-height: 27px;

  --warning-color: #faf1dc;
  --warning-color-dark: #b7791f;
  --warning-color-darker: #5c3d0c;
  --note-color: #e3edf3;
  --note-color-dark: #3e6e8e;
  --note-color-darker: #1f3a4d;
  --todo-color: #ece6f6;
  --todo-color-dark: #7a63a8;
  --todo-color-darker: #3b2c5c;
  --deprecated-color: #eeebe3;
  --deprecated-color-dark: #6f7479;
  --deprecated-color-darker: #3c3f42;
  --bug-color: #f8e1e0;
  --bug-color-dark: #c0392b;
  --bug-color-darker: #6e1d16;
  --invariant-color: #e3eddc;
  --invariant-color-dark: #2f8a4f;
  --invariant-color-darker: #1d4a2c;

  --blockquote-background: #f0ebdd;
  --blockquote-foreground: #5b6770;
  --tablehead-background: #f0ebdd;
  --tablehead-foreground: #1f2a33;

  --menu-focus-foreground: #ffffff;
  --menu-focus-background: #3a7047;
  --menu-selected-background: rgb(79 138 91 / 0.12);

  --header-background: #fffdf7;
  --header-foreground: #1f2a33;
  --searchbar-background: #fffdf7;
  --searchbar-foreground: #1f2a33;
  --searchbar-border-radius: 0px;

  --code-background: #fbf8ef;
  --code-foreground: #26323b;
  --fragment-background: #fbf8ef;
  --fragment-foreground: #26323b;
  --fragment-keyword: #7a3f9c;
  --fragment-keywordtype: #0e6a73;
  --fragment-keywordflow: #a12f4f;
  --fragment-token: #2f6f3d;
  --fragment-comment: #69737b;
  --fragment-link: #2a5d84;
  --fragment-preprocessor: #a12f4f;
  --fragment-linenumber-color: #9aa0a3;
  --fragment-linenumber-background: #f1ecdf;
  --fragment-linenumber-border: #e2dacb;

  --side-nav-background: #fbf8ef;
  --side-nav-foreground: #1f2a33;
  --toc-background: #fffdf7;
  --toc-foreground: #1f2a33;
  --webkit-scrollbar-color: #c4b9a2;
}

html.dark-mode {
  color-scheme: dark;
  --primary-color: #6fbf73;
  --primary-dark-color: #8fd48f;
  --primary-light-color: #3a7047;
  --on-primary-color: #0f1b26;
  --link-color: #7fcc83;

  --page-background-color: #0f1b26;
  --page-foreground-color: #e8eef2;
  --page-secondary-foreground-color: #9aaab8;
  --separator-color: #233648;
  --box-shadow: 0 2px 0 0 rgb(0 0 0 / 0.35), 0 6px 0 0 rgb(0 0 0 / 0.18);
  --odd-color: rgb(255 255 255 / 0.025);

  --warning-color: #2b2416;
  --warning-color-dark: #f2b05e;
  --warning-color-darker: #f7d9a8;
  --note-color: #17283a;
  --note-color-dark: #78aedb;
  --note-color-darker: #cfe3f3;
  --todo-color: #221d33;
  --todo-color-dark: #b7a4e6;
  --todo-color-darker: #e3daf7;
  --deprecated-color: #1c2731;
  --deprecated-color-dark: #a3adb6;
  --deprecated-color-darker: #dce3e8;
  --bug-color: #2e1a1d;
  --bug-color-dark: #f07a6e;
  --bug-color-darker: #f8cdc8;
  --invariant-color: #15291f;
  --invariant-color-dark: #6fcf8a;
  --invariant-color-darker: #cdeed5;

  --blockquote-background: #152535;
  --blockquote-foreground: #9aaab8;
  --tablehead-background: #1a2d3f;
  --tablehead-foreground: #e8eef2;
  --menu-selected-background: rgb(111 191 115 / 0.14);
  --menu-focus-foreground: #0f1b26;
  --menu-focus-background: #6fbf73;

  --header-background: #152535;
  --header-foreground: #e8eef2;
  --searchbar-background: #0b1620;
  --searchbar-foreground: #e8eef2;

  --code-background: #0b1620;
  --code-foreground: #dce5ec;
  --fragment-background: #0b1620;
  --fragment-foreground: #dce5ec;
  --fragment-keyword: #c6a8ff;
  --fragment-keywordtype: #e9c46a;
  --fragment-keywordflow: #f394b4;
  --fragment-token: #9bd69e;
  --fragment-comment: #8496a8;
  --fragment-link: #8fd3e0;
  --fragment-preprocessor: #f394b4;
  --fragment-linenumber-color: #5d7184;
  --fragment-linenumber-background: #0e1b27;
  --fragment-linenumber-border: #1a2d3f;

  --side-nav-background: #122130;
  --side-nav-foreground: #e8eef2;
  --toc-background: #152535;
  --toc-foreground: #e8eef2;
  --webkit-scrollbar-color: #36506a;
}

/* doxygen-awesome applies its own dark palette for prefers-color-scheme: dark unless html.light-mode is set;
   the kit's theme-init script always sets exactly one of .dark-mode / .light-mode, so mirror the dark
   values here for that media query too (covers the first paint before kit.js loads). */
@media (prefers-color-scheme: dark) {
  html:not(.light-mode) {
    --page-background-color: #0f1b26;
    --page-foreground-color: #e8eef2;
    --side-nav-background: #122130;
    --header-background: #152535;
  }
}

/* ------------------------------------------------------------------ one header
   The LeviMC bar, then the project's own row — logo + name, the same tabs as the docs row (Developer Guides, which
   holds the API reference, is the current one) and Doxygen's search — exactly like the header of the docs pages:
   one light row on the page's canvas with the docs row's "stuck" hairline under it (the content scrolls below it,
   so it is always stuck). Doxygen's menubar (Main Page,
   Related Pages, Classes, Files) is hidden on wide screens: the tree on the left lists the same pages. Phones:
   Doxygen's menu button is the only one (the bar's menu is off); it opens the docs sections, Doxygen's menu and
   the LeviMC links in one panel under the row. */
body {
  background: var(--page-background-color);
}
#top {
  background: var(--page-background-color);
  border-bottom: 0;
  /* the docs row's hairline (.kit-site-header while stuck), not a border */
  box-shadow: 0 1px 0 0 color-mix(in srgb, var(--color-line) 70%, transparent);
}
/* skip link (first in <body>): kit-chrome.css has no base layer, so its style is here; above Doxygen's layers */
a.kit-skip-link:is(:link, :visited) {
  position: fixed;
  left: 1rem;
  top: 0.75rem;
  z-index: 10003;
  transform: translateY(-200%);
  padding: 0.5rem 0.875rem;
  background: var(--color-surface);
  color: var(--color-ink) !important;
  font-family: var(--font-family);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none !important;
  box-shadow:
    0 calc(var(--px) * -1) 0 0 var(--color-focus),
    0 var(--px) 0 0 var(--color-focus),
    calc(var(--px) * -1) 0 0 0 var(--color-focus),
    var(--px) 0 0 0 var(--color-focus);
}
a.kit-skip-link:focus,
a.kit-skip-link:focus-visible {
  transform: none;
  outline: none;
}
#doc-content:focus {
  outline: none;
}
#top > .kit-gbar {
  position: relative;
  /* above Doxygen's own layers in #top (main menu .sm 9999, #MSearchBox 102, search
     select/results windows 10000/10001), so the open Docs / sites menus are painted and clickable on top */
  z-index: 10002;
  flex: 0 0 100%;
  width: 100%;
  order: -1;
}
#titlearea.kit-dox-row {
  display: flex;
  align-items: stretch;
  gap: 0.25rem;
  min-width: 0;
  height: var(--spacing-header);
  padding: 0 0 0 1.5rem;
  background: none;
  border: 0;
  color: var(--page-foreground-color);
  font-family: var(--font-family);
}
a.kit-dox-brand:is(:link, :visited, :hover, :focus, :active) {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 1 auto;
  min-width: 0;
  padding-right: 1rem;
  margin-right: 0.5rem;
  color: var(--page-foreground-color) !important;
  text-decoration: none !important;
  /* a short rule between the project and its sections */
  background: linear-gradient(var(--separator-color), var(--separator-color)) right center / 1px 1.25rem no-repeat;
}
.kit-dox-logo {
  flex: none;
  width: 24px;
  height: 24px;
  object-fit: contain;
}
#projectname.kit-dox-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-family);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
a.kit-dox-brand:hover .kit-dox-title {
  color: var(--primary-color);
}
.kit-dox-tabs {
  flex: 1 1 auto;
  min-width: 0;
}
.kit-dox-tabs > ul {
  display: flex;
  height: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}
.kit-dox-tabs li {
  display: flex;
  flex: none;
  margin: 0;
}
a.kit-dox-tab:is(:link, :visited, :hover, :focus, :active) {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 100%;
  padding: 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--page-secondary-foreground-color) !important;
  text-decoration: none !important;
  white-space: nowrap;
}
a.kit-dox-tab:hover,
a.kit-dox-tab.is-active {
  color: var(--page-foreground-color) !important;
}
a.kit-dox-tab.is-active {
  font-weight: 600;
}
/* external tabs (LegacyScriptEngine, About): the docs row's external mark */
a.kit-dox-tab,
a.kit-dox-drawer-link {
  gap: 0.3rem;
}
.kit-dox-tab-ext {
  flex: none;
  width: 12px;
  height: 12px;
  opacity: 0.6;
}
/* current section: a 2px pixel rule in the primary colour, flush with the row's bottom edge */
a.kit-dox-tab.is-active::after {
  content: "";
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0;
  height: 2px;
  background: var(--primary-color);
}
.kit-dox-search {
  display: flex;
  align-items: center;
  margin-left: auto;
  padding-right: 1rem;
}
/* the phone panel (see the 767px block) */
.kit-dox-drawer {
  display: none;
}
.kit-dox-drawer-sections > ul {
  margin: 0;
  padding: 0.375rem 0.75rem 0.5rem;
  list-style: none;
}
.kit-dox-drawer-sections li {
  margin: 0;
}
a.kit-dox-drawer-link:is(:link, :visited, :hover, :focus, :active) {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--page-foreground-color) !important;
  text-decoration: none !important;
}
a.kit-dox-drawer-link.is-active {
  color: var(--primary-color) !important;
  font-weight: 600;
  background: var(--menu-selected-background);
  box-shadow: inset 3px 0 0 0 var(--primary-color);
}
.kit-dox-drawer-network {
  padding: 0.75rem 0.75rem 1rem;
  border-top: 1px solid var(--separator-color);
}
.kit-dox-drawer-title {
  margin: 0 0.75rem 0.25rem;
  font-family: var(--font-pixel);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--page-secondary-foreground-color);
}
.kit-dox-drawer-network a:is(:link, :visited, :hover, :focus, :active) {
  color: var(--color-ink) !important;
  text-decoration: none !important;
}

@media screen and (min-width: 768px) {
  #top {
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-start;
  }
  #titlearea.kit-dox-row {
    flex: 1 1 0;
  }
  /* Doxygen's phone menu button + search holder (kit.js moves it into the row): empty on wide screens */
  :is(#top, #titlearea) > .sm-dox {
    display: none;
  }
  /* Doxygen's search moves into the row; its menubar items are hidden (the tree lists them) */
  #main-nav {
    flex: none;
    display: flex;
    align-items: center;
    height: var(--spacing-header);
    padding: 0 1.5rem 0 0.5rem;
  }
  #main-nav #main-menu {
    padding: 0;
    background: none;
    line-height: normal;
  }
  #main-menu > li:not(#searchBoxPos2) {
    display: none !important;
  }
  #main-menu > li#searchBoxPos2 {
    float: none !important;
    padding: 0;
  }
}
/* too narrow for brand + sections + search in one row: the sections get their own row below (like the docs
   header's tabs row; Doxygen keeps its menu button off until 768px, so on the narrowest of these widths the
   tabs wrap onto a second line instead of being clipped) */
@media screen and (min-width: 768px) and (max-width: 1299px) {
  /* the sections row takes the full width (as on the docs pages); the search sits at the right of the brand row */
  #top {
    position: relative;
  }
  #titlearea.kit-dox-row {
    flex: 1 1 100%;
    flex-wrap: wrap;
    height: auto;
  }
  #main-nav {
    position: absolute;
    top: var(--spacing-globalbar);
    right: 0;
  }
  a.kit-dox-brand:is(:link, :visited, :hover, :focus, :active) {
    height: var(--spacing-header);
    background: none;
  }
  .kit-dox-tabs {
    flex: 0 0 100%;
    margin-left: -0.75rem;
  }
  .kit-dox-tabs > ul {
    flex-wrap: wrap;
    height: auto;
  }
  .kit-dox-tabs li {
    height: 2.75rem;
  }
}
@media screen and (max-width: 767px) {
  #top {
    display: flex;
    flex-direction: column;
    position: relative;
  }
  #top > .kit-gbar {
    flex: none;
  }
  /* room for Doxygen's menu button (left) and its search box (right), which sit on this row */
  #titlearea.kit-dox-row {
    order: 0;
    position: relative;
    padding: 0 calc(10.5rem + 1.25rem) 0 3.25rem;
  }
  a.kit-dox-brand:is(:link, :visited, :hover, :focus, :active) {
    padding-right: 0;
    margin-right: 0;
    background: none;
  }
  .kit-dox-tabs {
    display: none;
  }
  /* Doxygen's menu button (left) and search (right) on the row: menu.js inserts them before #main-nav and
     kit.js moves them into header#titlearea (so they are inside its landmark) */
  :is(#top, #titlearea) > .sm-dox {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: var(--spacing-header);
    padding: 0;
    background: none;
    pointer-events: none;
  }
  #top > .sm-dox {
    top: var(--spacing-globalbar);
  }
  :is(#top, #titlearea) > .sm-dox > * {
    pointer-events: auto;
  }
  /* the menu button is a label for a visually hidden checkbox: show the kit's pixel focus ring on the label */
  #main-menu-state:focus-visible + .main-menu-btn {
    outline: var(--px) solid var(--color-focus);
    outline-offset: var(--px);
  }
  :is(#top, #titlearea) > .sm-dox > .main-menu-btn {
    position: absolute;
    top: calc((var(--spacing-header) - 36px) / 2);
    left: 0.625rem;
    margin: 0;
  }
  :is(#top, #titlearea) > .sm-dox > label.main-menu-btn ~ #searchBoxPos1 {
    top: calc((var(--spacing-header) - 36px) / 2) !important;
    right: 1rem !important;
    left: auto !important;
    width: 10.5rem;
    align-items: center;
  }
  :is(#top, #titlearea) > .sm-dox > #searchBoxPos1 > #MSearchBox {
    width: 100%;
    margin: 0;
  }
  #searchBoxPos1 #MSearchField {
    width: calc(100% - 56px);
  }
  .kit-dox-drawer-sections {
    order: 1;
  }
  #main-nav {
    order: 2;
    padding: 0 0.75rem;
  }
  .kit-dox-drawer-network {
    order: 3;
  }
  #top:has(#main-menu-state:checked) > .kit-dox-drawer {
    display: block;
  }
}
@media screen and (max-width: 400px) {
  #titlearea.kit-dox-row {
    padding-right: calc(8.5rem + 1.25rem);
  }
  :is(#top, #titlearea) > .sm-dox > label.main-menu-btn ~ #searchBoxPos1 {
    width: 8.5rem;
  }
}
.sm-dox,
.sm-dox a,
.sm-dox a:hover {
  font-family: var(--font-family);
}
.sm-dox a.highlighted,
.sm-dox a:hover {
  border-radius: 0 !important;
}
/* search.css greys the idle field (#909090, 3.1:1 on the light header);
   use the muted ink (AA in both themes). The active field keeps doxygen-awesome's --searchbar-foreground. */
#MSearchField {
  color: var(--page-secondary-foreground-color);
}
#MSearchField::placeholder {
  color: var(--page-secondary-foreground-color);
  opacity: 1;
}
#MSearchBox {
  border-radius: 0 !important;
  box-shadow:
    0 -2px 0 0 var(--separator-color),
    0 2px 0 0 var(--separator-color),
    -2px 0 0 0 var(--separator-color),
    2px 0 0 0 var(--separator-color) !important;
}

/* page title in the display face */
div.header .title,
div.headertitle .title {
  font-family: "Manrope", "Manrope Fallback", ui-sans-serif, system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* side tree: active item like the docs sidebar */
#nav-tree .selected {
  background: var(--menu-selected-background) !important;
  box-shadow: inset 3px 0 0 0 var(--primary-color);
  text-shadow: none;
}
#nav-tree .selected a {
  color: var(--primary-color) !important;
  font-weight: 600;
}

/* members & fragments get stepped pixel frames instead of rounded cards */
.memitem,
div.fragment,
pre.fragment,
.memproto,
table.memberdecls,
table.fieldtable,
div.contents table.doxtable,
div.contents table.markdownTable {
  border-radius: 0 !important;
}
.memitem {
  box-shadow:
    0 -2px 0 0 var(--separator-color),
    0 2px 0 0 var(--separator-color),
    -2px 0 0 0 var(--separator-color),
    2px 0 0 0 var(--separator-color),
    0 6px 0 0 var(--odd-color) !important;
  margin: 2px 2px 28px;
}
.memtitle {
  border-radius: 0 !important;
  background: var(--tablehead-background) !important;
  font-family: var(--font-family-monospace);
}
div.fragment {
  box-shadow:
    0 -2px 0 0 var(--fragment-linenumber-border),
    0 2px 0 0 var(--fragment-linenumber-border),
    -2px 0 0 0 var(--fragment-linenumber-border),
    2px 0 0 0 var(--fragment-linenumber-border);
  border: 0 !important;
  margin: 12px 2px;
}

/* @note / @warning / @bug …: kit admonition edge */
dl.section {
  border-radius: 0 !important;
  border-left-width: 4px !important;
}

/* footer from the kit */
.kit-dox-footer .kit-footer {
  margin-top: 3rem;
}
#nav-path {
  border-radius: 0;
}

/* focus ring */
a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid #8e5cf6;
  outline-offset: 2px;
}
html.dark-mode a:focus-visible,
html.dark-mode button:focus-visible,
html.dark-mode summary:focus-visible {
  outline-color: #5de0e6;
}

/* ------------------------------------------------------------------ kit chrome inside Doxygen
   doxygen-awesome forces `a:link … { color: var(--link-color) !important }`; restore the chrome colours. */
.kit-gbar a:is(:link, :visited, :hover, :focus, :active),
.kit-gbar summary {
  color: var(--gbar-muted) !important;
  font-weight: inherit;
  text-decoration: none !important;
  background: transparent;
}
.kit-gbar :is(a.kit-gbar-link, summary.kit-gbar-link, a.kit-gbar-more-link, summary.kit-gbar-more-link) {
  font-weight: 500;
}
.kit-gbar a.kit-gbar-brand:is(:link, :visited, :hover, :focus, :active),
.kit-gbar a.kit-gbar-link:is(:hover, [aria-current="page"]),
.kit-gbar summary.kit-gbar-link:is(:hover, [aria-current="page"]),
.kit-gbar .kit-menu[open] > summary.kit-gbar-link,
.kit-gbar a.kit-gbar-icon:hover {
  color: #ffffff !important;
}
.kit-gbar .kit-menu-panel a:is(:link, :visited, :hover, :focus, :active) {
  color: var(--color-ink) !important;
}
.kit-footer a:is(:link, :visited, :active, :focus) {
  color: #e0d3bc !important;
  font-weight: 400;
}
.kit-footer a:hover {
  color: #ffffff !important;
}
.kit-footer a.kit-footer-logo:is(:link, :visited, :hover) {
  color: #ffffff !important;
}
.kit-footer a.kit-footer-social-link:is(:link, :visited, :hover, :focus, :active) {
  color: #eadfcb !important;
  background: rgb(0 0 0 / 0.18);
}
.kit-footer a.kit-footer-social-link:hover {
  color: #ffffff !important;
  background: rgb(93 161 48 / 0.35);
}
.kit-menu-panel a.kit-proj-link:is(:link, :visited, :active, :focus),
.kit-dox-drawer a.kit-proj-link:is(:link, :visited, :active, :focus) {
  color: var(--color-muted) !important;
  font-weight: 600;
}
.kit-menu-panel a.kit-proj-link:hover,
.kit-dox-drawer a.kit-proj-link:hover,
.kit-menu-panel a.kit-proj-all:hover,
.kit-dox-drawer a.kit-proj-all:hover {
  color: var(--color-primary-strong) !important;
}
.kit-footer a.kit-footer-support:is(:link, :visited, :active, :focus) {
  color: #eadfcb !important;
}
