/* The book in 4got's own dark scheme: the gruvbox colours of static/style.css
   (page #1d2021, cards #282828, text #d5c4a1, accent --blue #83a598), and its
   code highlighter's palette (.hl-* in static/style.css) for highlight.js.
   book.toml makes "fourgot" the default theme; mdbook puts the name on <html>. */

.fourgot {
    --bg: #1d2021;
    --fg: #d5c4a1;

    --sidebar-bg: #141617;
    --sidebar-fg: #bdae93;
    --sidebar-non-existant: #665c54;
    --sidebar-active: #83a598;
    --sidebar-spacer: #3c3836;
    --sidebar-header-border-color: #83a598;

    --scrollbar: #504945;

    --icons: #928374;
    --icons-hover: #ebdbb2;

    --links: #83a598;

    --inline-code-color: #ebdbb2;

    --theme-popup-bg: #282828;
    --theme-popup-border: #504945;
    --theme-hover: #3c3836;

    --quote-bg: #282828;
    --quote-border: #504945;

    --warning-border: #fe8019;

    --table-border-color: #3c3836;
    --table-header-bg: #3c3836;
    --table-alternate-bg: #222526;

    --searchbar-border-color: #504945;
    --searchbar-bg: #282828;
    --searchbar-fg: #ebdbb2;
    --searchbar-shadow-color: #141617;
    --searchresults-header-fg: #a89984;
    --searchresults-border-color: #504945;
    --searchresults-li-bg: #282828;
    --search-mark-bg: #b57614;

    --color-scheme: dark;

    /* Copy button: black recoloured to about #928374 (--icons), then #83a598 on hover. */
    --copy-button-filter: invert(58%) sepia(9%) saturate(560%) hue-rotate(358deg) brightness(92%) contrast(88%);
    --copy-button-filter-hover: invert(66%) sepia(14%) saturate(560%) hue-rotate(124deg) brightness(91%) contrast(86%);

    --footnote-highlight: #83a598;

    --overlay-bg: rgba(20, 22, 23, 0.6);

    --blockquote-note-color: #83a598;
    --blockquote-tip-color: #b8bb26;
    --blockquote-important-color: #d3869b;
    --blockquote-warning-color: #d8a657;
    --blockquote-caution-color: #fb4934;
}

.fourgot body {
    background-color: var(--bg);
}
.fourgot :is(h1, h2, h3, h4, h5, h6) {
    color: #ebdbb2;
}
.fourgot strong {
    color: #ebdbb2;
}

/* The top bar stays put while the page scrolls (always on a wide screen,
   and on a narrow one when scrolling back up), so it is solid: the text goes
   under it, not through it. */
.fourgot #mdbook-menu-bar {
    background-color: var(--bg);
}
.fourgot #mdbook-menu-bar.bordered {
    border-block-end-color: #3c3836;
}

/* Code: 4got's .code look (a #282828 card with a #3c3836 edge). */
.fourgot pre > code.hljs,
.fourgot code.hljs {
    background: #282828;
    color: #ebdbb2;
}
.fourgot pre {
    border: 1px solid #3c3836;
    border-radius: 3px;
}
.fourgot :not(pre) > code {
    background: #282828;
}
.fourgot a code {
    color: var(--links);
}
/* The user guide's cards, in every theme. An example is one thing to type,
   so it never breaks across lines (the page's longest, a JWT, fits a
   phone), a comma stays with it, and a thin edge sets it apart on Light's
   white. A card's name reads as its title, and a group, ruled off, stands
   apart from the cards under it. */
main:has(#oracles-instant-answers) :is(p, li) > code {
    white-space: nowrap;
    box-shadow: 0 0 0 1px var(--theme-popup-border);
}
main:has(#oracles-instant-answers) h4 {
    font-size: 1.12em;
    margin-block: 1.6em 0.4em;
}
main:has(#oracles-instant-answers) h3:has(+ h4) {
    font-size: 1.3em;
    margin-block: 2.2em 0;
    padding-block-start: 0.7em;
    border-block-start: 1px solid var(--theme-popup-border);
}
main:has(#oracles-instant-answers) h3 + h4 {
    margin-block-start: 1.1em;
}
/* Its "query → result" blocks wrap at the edge rather than run out of
   sight with no sign that they scroll. */
main:has(#oracles-instant-answers) pre > code {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* Syntax colours: 4got's own highlighter (.hl-c comment, .hl-s string,
   .hl-n number, .hl-k keyword, .hl-f function, .hl-h heading), plus gruvbox's
   aqua and orange for what it has no class for. The .fourgot prefix outranks
   mdbook's highlight.css, which stays enabled for an unknown theme. */
.fourgot .hljs-comment,
.fourgot .hljs-quote {
    color: #928374;
    font-style: italic;
}
.fourgot .hljs-keyword,
.fourgot .hljs-selector-tag,
.fourgot .hljs-deletion {
    color: #fb4934;
}
.fourgot .hljs-string,
.fourgot .hljs-regexp,
.fourgot .hljs-addition,
.fourgot .hljs-template-tag {
    color: #b8bb26;
}
.fourgot .hljs-number,
.fourgot .hljs-literal,
.fourgot .hljs-symbol,
.fourgot .hljs-bullet {
    color: #d3869b;
}
.fourgot .hljs-title,
.fourgot .hljs-section,
.fourgot .hljs-function .hljs-title,
.fourgot .hljs-name,
.fourgot .hljs-selector-id {
    color: #83a598;
}
.fourgot .hljs-attr,
.fourgot .hljs-attribute,
.fourgot .hljs-property,
.fourgot .hljs-selector-class,
.fourgot .hljs-selector-attr,
.fourgot .hljs-selector-pseudo,
.fourgot .hljs-tag {
    color: #8ec07c;
}
.fourgot .hljs-built_in,
.fourgot .hljs-type,
.fourgot .hljs-class .hljs-title,
.fourgot .hljs-variable,
.fourgot .hljs-template-variable {
    color: #fe8019;
}
.fourgot .hljs-subst,
.fourgot .hljs-params,
.fourgot .hljs-punctuation,
.fourgot .hljs-operator {
    color: #d5c4a1;
}
.fourgot .hljs-meta {
    color: #d8a657;
}
.fourgot .hljs-section,
.fourgot .hljs-strong {
    font-weight: bold;
}
.fourgot .hljs-emphasis {
    font-style: italic;
}
.fourgot .hljs-link {
    color: #83a598;
    text-decoration: underline;
}
