
/* Globals */

:root {
    --sidebar-target-width: 350px;
    --sidebar-width: min(var(--sidebar-target-width), 80vw);
    --sidebar-resize-indicator-width: 8px;
    --sidebar-resize-indicator-space: 2px;
    --page-padding: 20px;
    --content-max-width: 1500px;
    --menu-bar-height: 50px;
    --mono-font: "Source Code Pro", Consolas, "Ubuntu Mono", Menlo, "DejaVu Sans Mono", monospace, monospace;
    --code-font-size: 1.0em; /* please adjust the ace font size accordingly in editor.js */
    --searchbar-margin-block-start: 5px;
}

/* Themes */

.ayu {
    --bg: hsl(210, 25%, 8%);
    --fg: #c5c5c5;

    --sidebar-bg: #14191f;
    --sidebar-fg: #bbbccb;
    --sidebar-non-existant: #5c6773;
    --sidebar-active: #ffffff;
    --sidebar-active-bg: #202830;
    --sidebar-spacer: #9f9f9f;

    --scrollbar: var(--sidebar-fg);

    --icons: #737480;
    --icons-hover: #ced0e2;

    --links: #acf1af;

    --inline-code-color: #8dc5ff;
    --inline-code-bg: #171c23;

    --code-block-bg: #14191f;
    --code-block-fg: #c5c5c5;

    --theme-popup-bg: #14191f;
    --theme-popup-border: #5c6773;
    --theme-hover: #191f26;

    --quote-bg: hsl(226, 15%, 17%);
    --quote-border: hsl(226, 15%, 22%);

    --warning-border: #f1c997;

    --table-border-color: hsl(210, 25%, 13%);
    --table-header-bg: hsl(210, 25%, 28%);
    --table-alternate-bg: hsl(210, 25%, 11%);

    --searchbar-border-color: #f0f0f0;
    --searchbar-bg: #282d34;
    --searchbar-fg: #fff;
    --searchbar-shadow-color: #171c23;
    --searchresults-header-fg: #666;
    --searchresults-border-color: #171c23;
    --searchresults-li-bg: #252932;
    --search-mark-bg: #e3b171;

    --color-scheme: dark;

    --standalone-strong: #c4ffc8;

    /* Same as `--icons` */
    --copy-button-filter: invert(45%) sepia(6%) saturate(621%) hue-rotate(198deg) brightness(99%) contrast(85%);
    /* Same as `--sidebar-active` */
    --copy-button-filter-hover: invert(68%) sepia(55%) saturate(531%) hue-rotate(341deg) brightness(104%) contrast(101%);

    --footnote-highlight: #628ab0;

    --overlay-bg: rgba(33, 40, 48, 0.4);

    --blockquote-note-color: #89bef4;
    --blockquote-tip-color: #7fca7f;
    --blockquote-important-color: #d6b0ff;
    --blockquote-warning-color: #f0cf85;
    --blockquote-caution-color: #ff8890;

    --sidebar-header-border-color: #ffffff;

    --heading-h1: #fcde93;
    --heading-h2: #90d8f8;
    --heading-h3: #a6dff9;
    --heading-h4: #acf1af;
    --heading-h5: #fbd195;
    --heading-h6: #f0b1fb;

    /* MODAL VARIABLES */
    --modal-bg: #14191f;
    --modal-border: #303844;
    --modal-fg: #d3d7dc;
    --modal-muted: #8c949e;

    --modal-section-bg: #171d24;
    --modal-section-border: #252e38;

    --modal-key-bg: #202832;
    --modal-key-border: #3a4654;
    --modal-key-fg: #e4e8ec;

    --modal-accent: #90d8f8;

    --modal-backdrop: rgba(4, 8, 12, 0.68);

    /* HIGHLIGHT VARIABLES */
    --code-keyword: #89b4fa;
    --code-type: #74c7ec;
    --code-string: #a6e3a1;
    --code-number: #fab387;
    --code-function: #89dceb;
    --code-class: #f9e2af;
    --code-comment: #6c7086;
    --code-variable: #cdd6f4;
    --code-literal: #cba6f7;
}

.navy {
    --bg: hsl(222, 28%, 11%);
    --fg: #c7ccd8;

    --sidebar-bg: #171d2a;
    --sidebar-fg: #b9c1d1;
    --sidebar-non-existant: #5d6678;
    --sidebar-active: #ffffff;
    --sidebar-active-bg: #202838;
    --sidebar-spacer: #30394b;

    --scrollbar: #687386;

    --icons: #7d8799;
    --icons-hover: #d6dceb;

    --links: #8dc5ff;

    --inline-code-color: #a6d8ff;
    --inline-code-bg: #1b2330;

    --code-block-bg: #151c28;
    --code-block-fg: #c7ccd8;

    --theme-popup-bg: #171d2a;
    --theme-popup-border: #414b60;
    --theme-hover: #202838;

    --quote-bg: #192231;
    --quote-border: #35445a;

    --warning-border: #f1c997;

    --table-border-color: #252e3e;
    --table-header-bg: #303b50;
    --table-alternate-bg: #151c28;

    --searchbar-border-color: #465167;
    --searchbar-focus-color: #8dc5ff;
    --searchbar-bg: #1b2330;
    --searchbar-fg: #ffffff;
    --searchbar-shadow-color: #111722;

    --searchresults-header-fg: #8993a6;
    --searchresults-border-color: #303a4d;
    --searchresults-li-bg: #20293a;
    --search-mark-bg: #c39a5d;

    --color-scheme: dark;

    --standalone-strong: #9fd8b0;

    --copy-button-filter:
            invert(55%)
            sepia(8%)
            saturate(500%)
            hue-rotate(180deg)
            brightness(95%)
            contrast(90%);

    --copy-button-filter-hover:
            invert(85%)
            sepia(8%)
            saturate(400%)
            hue-rotate(180deg)
            brightness(105%)
            contrast(95%);

    --footnote-highlight: #628ab0;

    --overlay-bg: rgba(20, 27, 40, 0.55);

    --blockquote-note-color: #89bef4;
    --blockquote-tip-color: #7fca7f;
    --blockquote-important-color: #d6b0ff;
    --blockquote-warning-color: #f0cf85;
    --blockquote-caution-color: #ff8890;

    --sidebar-header-border-color: #8dc5ff;

    --heading-h1: #f1d793;
    --heading-h2: #9acdf8;
    --heading-h3: #b1dcfa;
    --heading-h4: #a8ddb1;
    --heading-h5: #eec88e;
    --heading-h6: #d8b1e8;

    /* MODAL VARIABLES */
    --modal-bg: #171d2a;
    --modal-border: #334055;
    --modal-fg: #d7dce5;
    --modal-muted: #929caf;

    --modal-section-bg: #1b2330;
    --modal-section-border: #2b3548;

    --modal-key-bg: #222c3a;
    --modal-key-border: #43516a;
    --modal-key-fg: #edf2f7;

    --modal-accent: #8dc5ff;

    --modal-backdrop: rgba(7, 11, 19, 0.72);
}

.rust {
    /* ====================================================== */
    /* Base                                                   */
    /* ====================================================== */

    --bg: #0d1117;
    --fg: #c9d1d9;

    --color-scheme: dark;


    /* ====================================================== */
    /* Sidebar                                                */
    /* ====================================================== */

    --sidebar-bg: #11161d;
    --sidebar-fg: #aeb6c2;
    --sidebar-non-existant: #626b78;

    /* Current / selected item */
    --sidebar-active: #ffffff;
    --sidebar-active-bg: #1b222c;

    /* Tree / hierarchy lines */
    --sidebar-spacer: #2a313b;
    --sidebar-header-border-color: #3a4654;

    --scrollbar: #596270;


    /* ====================================================== */
    /* Header / icons                                         */
    /* ====================================================== */

    --icons: #77808d;
    --icons-hover: #d4dae2;

    --theme-popup-bg: #161b22;
    --theme-popup-border: #30363d;
    --theme-hover: #1b222c;


    /* ====================================================== */
    /* Links / inline code                                    */
    /* ====================================================== */

    --links: #79b8ff;

    --inline-code-color: #9ecbff;
    --inline-code-bg: #161b22;

    --code-block-bg: #10151b;
    --code-block-fg: #c9d1d9;

    /* ====================================================== */
    /* Quotes / warnings                                      */
    /* ====================================================== */

    --quote-bg: #111820;
    --quote-border: #2b3743;

    --warning-border: #d5a54f;


    /* ====================================================== */
    /* Tables                                                 */
    /* ====================================================== */

    --table-border-color: #242b34;
    --table-header-bg: #181e26;
    --table-alternate-bg: #10151b;


    /* ====================================================== */
    /* Search                                                 */
    /* ====================================================== */

    --searchbar-border-color: #303843;
    --searchbar-focus-color: #6ba6d9;

    --searchbar-bg: #151b22;
    --searchbar-fg: #d6dce4;

    --searchbar-shadow-color: transparent;

    --searchresults-header-fg: #87909c;
    --searchresults-border-color: #2b333d;
    --searchresults-li-bg: #171e27;

    --search-mark-bg: #725f35;


    /* ====================================================== */
    /* Copy button                                            */
    /* ====================================================== */

    --copy-button-filter:
            invert(55%)
            sepia(5%)
            saturate(500%)
            hue-rotate(175deg)
            brightness(95%)
            contrast(90%);

    --copy-button-filter-hover:
            invert(88%)
            sepia(3%)
            saturate(300%)
            hue-rotate(175deg)
            brightness(105%)
            contrast(98%);


    /* ====================================================== */
    /* Overlay / footnotes                                    */
    /* ====================================================== */

    --footnote-highlight: #537da4;

    --overlay-bg: rgba(8, 12, 18, 0.66);


    /* ====================================================== */
    /* Admonitions                                            */
    /* ====================================================== */

    --blockquote-note-color: #79b8ff;
    --blockquote-tip-color: #7cc99a;
    --blockquote-important-color: #bba4e6;
    --blockquote-warning-color: #d8b66c;
    --blockquote-caution-color: #e0878d;


    /* ====================================================== */
    /* Headings                                               */
    /* ====================================================== */

    --heading-h1: #f2f4f7;
    --heading-h2: #d9dee5;
    --heading-h3: #c6ccd5;
    --heading-h4: #b6bec9;
    --heading-h5: #a7b0bc;
    --heading-h6: #99a3b0;


    /* ====================================================== */
    /* Standalone strong text                                 */
    /* ====================================================== */

    --standalone-strong: #c9d1d9;

    /* MODAL VARIABLES */
    --modal-bg: #11161d;
    --modal-border: #30363d;
    --modal-fg: #d4d8de;
    --modal-muted: #89929d;

    --modal-section-bg: #151b22;
    --modal-section-border: #252d36;

    --modal-key-bg: #1c232c;
    --modal-key-border: #3a4652;
    --modal-key-fg: #e6e9ed;

    --modal-accent: #79b8ff;

    --modal-backdrop: rgba(5, 8, 12, 0.72);
}

.coal {
    /* ====================================================== */
    /* Base                                                   */
    /* ====================================================== */

    --bg: #23262f;
    --fg: #c9d1d9;

    --color-scheme: dark;


    /* ====================================================== */
    /* Sidebar                                                */
    /* ====================================================== */

    --sidebar-bg: #11161d;
    --sidebar-fg: #aeb6c2;
    --sidebar-non-existant: #626b78;

    /* Current / selected item */
    --sidebar-active: #f0f3f6;
    --sidebar-active-bg: #3163aa;

    /* Tree / hierarchy lines */
    --sidebar-spacer: #2a313b;
    --sidebar-header-border-color: #3a4654;

    --scrollbar: #596270;


    /* ====================================================== */
    /* Header / icons                                         */
    /* ====================================================== */

    --icons: #77808d;
    --icons-hover: #d4dae2;

    --theme-popup-bg: #161b22;
    --theme-popup-border: #30363d;
    --theme-hover: #1b222c;


    /* ====================================================== */
    /* Links / inline code                                    */
    /* ====================================================== */

    --links: #79b8ff;

    --inline-code-color: #9ecbff;
    --inline-code-bg: #161b22;

    /* ====================================================== */
    /* Quotes / warnings                                      */
    /* ====================================================== */

    --quote-bg: #111820;
    --quote-border: #2b3743;

    --warning-border: #d5a54f;


    /* ====================================================== */
    /* Tables                                                 */
    /* ====================================================== */

    --table-border-color: #242b34;
    --table-header-bg: #181e26;
    --table-alternate-bg: #10151b;


    /* ====================================================== */
    /* Search                                                 */
    /* ====================================================== */

    --searchbar-border-color: #303843;
    --searchbar-focus-color: #6ba6d9;

    --searchbar-bg: #151b22;
    --searchbar-fg: #d6dce4;

    --searchbar-shadow-color: transparent;

    --searchresults-header-fg: #87909c;
    --searchresults-border-color: #2b333d;
    --searchresults-li-bg: #171e27;

    --search-mark-bg: #725f35;


    /* ====================================================== */
    /* Copy button                                            */
    /* ====================================================== */

    --copy-button-filter:
            invert(55%)
            sepia(5%)
            saturate(500%)
            hue-rotate(175deg)
            brightness(95%)
            contrast(90%);

    --copy-button-filter-hover:
            invert(88%)
            sepia(3%)
            saturate(300%)
            hue-rotate(175deg)
            brightness(105%)
            contrast(98%);


    /* ====================================================== */
    /* Overlay / footnotes                                    */
    /* ====================================================== */

    --footnote-highlight: #537da4;

    --overlay-bg: rgba(8, 12, 18, 0.66);


    /* ====================================================== */
    /* Admonitions                                            */
    /* ====================================================== */

    --blockquote-note-color: #79b8ff;
    --blockquote-tip-color: #7cc99a;
    --blockquote-important-color: #bba4e6;
    --blockquote-warning-color: #d8b66c;
    --blockquote-caution-color: #e0878d;


    /* ====================================================== */
    /* Headings                                               */
    /* ====================================================== */

    --heading-h1: #f2f4f7;
    --heading-h2: #d9dee5;
    --heading-h3: #c6ccd5;
    --heading-h4: #b6bec9;
    --heading-h5: #a7b0bc;
    --heading-h6: #99a3b0;


    /* ====================================================== */
    /* Standalone strong text                                 */
    /* ====================================================== */

    --standalone-strong: #c9d1d9;

    /* MODAL VARIABLES */
    --modal-bg: #262a33;
    --modal-border: #3a404c;
    --modal-fg: #d7d9de;
    --modal-muted: #969da7;

    --modal-section-bg: #2c313b;
    --modal-section-border: #3b424e;

    --modal-key-bg: #343a45;
    --modal-key-border: #515866;
    --modal-key-fg: #f0f2f5;

    --modal-accent: #8fb8db;

    --modal-backdrop: rgba(12, 14, 18, 0.72);
}

.light,
html:not(.js) {
    --bg: #f7f8fa;
    --fg: #252931;

    --sidebar-bg: #eef1f5;
    --sidebar-fg: #414854;
    --sidebar-non-existant: #9aa2ae;
    --sidebar-active: #111827;
    --sidebar-active-bg: #dde5ee;
    --sidebar-spacer: #dce1e8;

    --scrollbar: #9aa3af;

    --icons: #747d89;
    --icons-hover: #20252d;

    --links: #2475a8;

    --inline-code-color: #176998;
    --inline-code-bg: #eef1f5;

    --code-block-bg: #f1f3f6;
    --code-block-fg: #252931;

    --theme-popup-bg: #ffffff;
    --theme-popup-border: #ccd2da;
    --theme-hover: #e9edf2;

    --quote-bg: #eef5f9;
    --quote-border: #c8dce8;

    --warning-border: #c9852b;

    --table-border-color: #dce1e7;
    --table-header-bg: #e2e7ed;
    --table-alternate-bg: #f0f3f6;

    --searchbar-border-color: #b8c0ca;
    --searchbar-focus-color: #3d98ca;
    --searchbar-bg: #ffffff;
    --searchbar-fg: #20242b;
    --searchbar-shadow-color: #c6d8e2;

    --searchresults-header-fg: #626b76;
    --searchresults-border-color: #c8ced6;
    --searchresults-li-bg: #e8f3fa;
    --search-mark-bg: #f0d18e;

    --color-scheme: light;

    --standalone-strong: #347347;

    --copy-button-filter: invert(45%);

    --copy-button-filter-hover:
            invert(35%)
            sepia(40%)
            saturate(900%)
            hue-rotate(160deg)
            brightness(90%)
            contrast(90%);

    --footnote-highlight: #73a7ca;

    --overlay-bg: rgba(80, 90, 105, 0.22);

    --blockquote-note-color: #2777b3;
    --blockquote-tip-color: #348348;
    --blockquote-important-color: #7957a8;
    --blockquote-warning-color: #956b17;
    --blockquote-caution-color: #b43b43;

    --sidebar-header-border-color: #4b91bd;

    --heading-h1: #8b6419;
    --heading-h2: #266c96;
    --heading-h3: #337fa6;
    --heading-h4: #397748;
    --heading-h5: #966520;
    --heading-h6: #795485;

    /* MODAL VARIABLES */
    --modal-bg: #ffffff;
    --modal-border: #d8dde4;
    --modal-fg: #252931;
    --modal-muted: #747d89;

    --modal-section-bg: #f6f8fa;
    --modal-section-border: #e4e8ed;

    --modal-key-bg: #eef2f6;
    --modal-key-border: #c7cfd8;
    --modal-key-fg: #2f343c;

    --modal-accent: #347fa8;

    --modal-backdrop: rgba(40, 47, 56, 0.28);
}

@media (prefers-color-scheme: dark) {
    html:not(.js) {
        --bg: hsl(200, 7%, 8%);
        --fg: #98a3ad;

        --sidebar-bg: #292c2f;
        --sidebar-fg: #a1adb8;
        --sidebar-non-existant: #505254;
        --sidebar-active: #3473ad;
        --sidebar-spacer: #393939;

        --scrollbar: var(--sidebar-fg);

        --icons: #43484d;
        --icons-hover: #b3c0cc;

        --links: #2b79a2;

        --inline-code-color: #c5c8c6;

        --theme-popup-bg: #141617;
        --theme-popup-border: #43484d;
        --theme-hover: #1f2124;

        --quote-bg: hsl(234, 21%, 18%);
        --quote-border: hsl(234, 21%, 23%);

        --warning-border: #ff8e00;

        --table-border-color: hsl(200, 7%, 13%);
        --table-header-bg: hsl(200, 7%, 28%);
        --table-alternate-bg: hsl(200, 7%, 11%);

        --searchbar-border-color: #f7f7f7;
        --searchbar-bg: #282d34;
        --searchbar-fg: #000;
        --searchbar-shadow-color: #aaa;
        --searchresults-header-fg: #666;
        --searchresults-border-color: #98a3ad;
        --searchresults-li-bg: #2b2b2f;
        --search-mark-bg: #355c7d;

        --color-scheme: dark;

        /* Same as `--icons` */
        --copy-button-filter: invert(26%) sepia(8%) saturate(575%) hue-rotate(169deg) brightness(87%) contrast(82%);
        /* Same as `--sidebar-active` */
        --copy-button-filter-hover: invert(36%) sepia(70%) saturate(503%) hue-rotate(167deg) brightness(98%) contrast(89%);

        --footnote-highlight: #4079ae;

        --overlay-bg: rgba(33, 40, 48, 0.4);

        --blockquote-note-color: #4493f8;
        --blockquote-tip-color: #08ae08;
        --blockquote-important-color: #ab7df8;
        --blockquote-warning-color: #d29922;
        --blockquote-caution-color: #d91b29;

        --sidebar-header-border-color: #3473ad;
    }
}

/* Highlighted Data */
/* Keywords */
.hljs-keyword {
    color: var(--code-keyword) !important;
}

.hljs-type,
.hljs-built_in {
    color: var(--code-type) !important;
}

.hljs-string {
    color: var(--code-string) !important;
}

.hljs-number {
    color: var(--code-number) !important;
}

.hljs-title.function_,
.hljs-function .hljs-title {
    color: var(--code-function) !important;
}

.hljs-title.class_,
.hljs-title.class_.inherited__ {
    color: var(--code-class) !important;
}

.hljs-comment {
    color: var(--code-comment) !important;
    font-style: italic;
}

.hljs-variable,
.hljs-attr {
    color: var(--code-variable) !important;
}

.hljs-literal {
    color: var(--code-literal) !important;
}

.content strong, .content b {
    display: inline !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: inherit;
    line-height: inherit;
    font-weight: 700;
}