/*
 * Doc page content styled like the Sphinx docs: headings, body text, inline
 * code, code blocks and tables. Admonitions, the tab bar and the home page
 * keep the Makersaurus defaults, so every rule skips them.
 *
 * Docusaurus loads this file before its own CSS bundle, so every selector
 * starts with `html` to outrank the bundle.
 */

:root {
  --docs-text-size: 16px;
  --docs-text-leading: 24px;
  --docs-border: #e1e4e5;
  --docs-code-color: #c0392b;
  --docs-code-background: #ffffff;
  --docs-code-block-background: #ffffff;
  --docs-table-stripe: #f3f6f6;
}

html[data-theme='dark'] {
  --docs-border: #3d4247;
  --docs-code-color: #ff8a7f;
  --docs-code-background: #1f2023;
  /* Unset, so code blocks keep the dark Prism theme background. */
  --docs-code-block-background: initial;
  --docs-table-stripe: rgba(255, 255, 255, 0.05);
}

/* Body text. Admonitions and the tab bar inherit their size from the
   element around them, so the size goes on text elements and skips any
   that hold one. */

html:not(.docs-doc-id-index) .theme-doc-markdown.markdown :is(p, li, dt, dd, .katex-display):not(.theme-admonition *, table *, .tabs__item, :has(.theme-admonition, .tabs)) {
  font-size: var(--docs-text-size);
  line-height: var(--docs-text-leading);
}

/* Headings */

html:not(.docs-doc-id-index) .theme-doc-markdown.markdown :is(h1, h2, h3):not(.theme-admonition *) {
  letter-spacing: normal;
}

html:not(.docs-doc-id-index) .theme-doc-markdown.markdown h1:not(.theme-admonition *) {
  font-size: 28px;
}

html:not(.docs-doc-id-index) .theme-doc-markdown.markdown h2:not(.theme-admonition *) {
  font-size: 24px;
}

html:not(.docs-doc-id-index) .theme-doc-markdown.markdown h3:not(.theme-admonition *) {
  font-size: 20px;
}

/* Inline code */

html:not(.docs-doc-id-index) .theme-doc-markdown.markdown :not(pre) > code:not(.theme-admonition *) {
  font-size: 75%;
  color: var(--docs-code-color);
  background: var(--docs-code-background);
  border: 1px solid var(--docs-border);
  border-radius: 0;
  padding: 2px 5px;
  vertical-align: baseline;
}

html:not(.docs-doc-id-index) .theme-doc-markdown.markdown :is(h1, h2, h3, h4) code:not(.theme-admonition *) {
  font-weight: 400;
}

html:not(.docs-doc-id-index) .theme-doc-markdown.markdown a > code:not(.theme-admonition *) {
  color: inherit;
}

/* Code blocks. prism-react-renderer sets colours inline, hence !important. */

html:not(.docs-doc-id-index) .theme-doc-markdown.markdown .theme-code-block:not(.theme-admonition *) {
  background: var(--docs-code-block-background, var(--prism-background-color));
  border: 1px solid var(--docs-border);
  border-radius: 0;
  box-shadow: none;
}

html:not(.docs-doc-id-index) .theme-doc-markdown.markdown .theme-code-block:not(.theme-admonition *) pre {
  background-color: var(--docs-code-block-background, var(--prism-background-color)) !important;
  border-radius: 0;
  font-size: 12px;
  line-height: 18px;
}

html:not(.docs-doc-id-index) .theme-doc-markdown.markdown .theme-code-block:not(.theme-admonition *) pre > code {
  padding: 12px;
}

/* Syntax colours from the Sphinx theme, light mode only. Dark mode keeps
   the Makersaurus Dracula theme. */

html[data-theme='light']:not(.docs-doc-id-index) .theme-doc-markdown.markdown .theme-code-block:not(.theme-admonition *) pre {
  color: #404040 !important;
}

html[data-theme='light']:not(.docs-doc-id-index) .theme-doc-markdown.markdown .theme-code-block:not(.theme-admonition *) :is(.token.comment, .token.prolog) {
  color: #6a6a5e !important;
  font-style: italic !important;
}

html[data-theme='light']:not(.docs-doc-id-index) .theme-doc-markdown.markdown .theme-code-block:not(.theme-admonition *) :is(.token.keyword, .token.boolean, .token.operator) {
  color: inherit !important;
  font-weight: 500;
}

html[data-theme='light']:not(.docs-doc-id-index) .theme-doc-markdown.markdown .theme-code-block:not(.theme-admonition *) .token.punctuation {
  color: inherit !important;
}

html[data-theme='light']:not(.docs-doc-id-index) .theme-doc-markdown.markdown .theme-code-block:not(.theme-admonition *) :is(.token.string, .token.char, .token.attr-value) {
  color: #dd1144 !important;
}

html[data-theme='light']:not(.docs-doc-id-index) .theme-doc-markdown.markdown .theme-code-block:not(.theme-admonition *) .token.number {
  color: #009999 !important;
}

html[data-theme='light']:not(.docs-doc-id-index) .theme-doc-markdown.markdown .theme-code-block:not(.theme-admonition *) .token.builtin {
  color: #0086b3 !important;
}

html[data-theme='light']:not(.docs-doc-id-index) .theme-doc-markdown.markdown .theme-code-block:not(.theme-admonition *) .token.function {
  color: #990000 !important;
  font-weight: 500;
}

html[data-theme='light']:not(.docs-doc-id-index) .theme-doc-markdown.markdown .theme-code-block:not(.theme-admonition *) .token.class-name {
  color: #445588 !important;
  font-weight: 500;
}

html[data-theme='light']:not(.docs-doc-id-index) .theme-doc-markdown.markdown .theme-code-block:not(.theme-admonition *) :is(.token.variable, .token.attr-name, .token.constant) {
  color: #008080 !important;
}

html[data-theme='light']:not(.docs-doc-id-index) .theme-doc-markdown.markdown .theme-code-block:not(.theme-admonition *) .token.tag {
  color: #000080 !important;
}

/* Prism marks shell commands such as java or curl as functions, and flags
   as variables. Sphinx leaves both as plain text. */
html[data-theme='light']:not(.docs-doc-id-index) .theme-doc-markdown.markdown .theme-code-block:not(.theme-admonition *) pre.language-bash :is(.token.function, .token.parameter) {
  color: inherit !important;
  font-weight: 400;
}

/* Tables */

html:not(.docs-doc-id-index) .theme-doc-markdown.markdown table:not(.theme-admonition *) {
  --ifm-table-border-color: var(--docs-border);
  --ifm-table-cell-padding: 8px 16px;
  --ifm-table-head-background: transparent;
  --ifm-table-head-font-weight: 700;
}

html:not(.docs-doc-id-index) .theme-doc-markdown.markdown table:not(.theme-admonition *) :is(thead, tr) {
  background-color: transparent;
}

html:not(.docs-doc-id-index) .theme-doc-markdown.markdown table:not(.theme-admonition *) tbody tr:nth-child(odd) {
  background-color: var(--docs-table-stripe);
}

html:not(.docs-doc-id-index) .theme-doc-markdown.markdown table:not(.theme-admonition *) :is(th, td) {
  font-size: calc(var(--docs-text-size) * 0.9);
  line-height: normal;
}

html:not(.docs-doc-id-index) .theme-doc-markdown.markdown table:not(.theme-admonition *) th {
  text-align: left;
}
