/****************************************************************************\

  programcode.css -- customised <pre> environment

  2018-09-05    Separated from the HTML files.
  2023-04-04    Updated colours.
  2023-11-23    Added support for light/dark theming.
  2024-04-25    Updated colours.
  2025-05-06    Colour for predefined changed for distinction.
  2025-07-08    Changes to light theme colours.
  2026-01-16    Updated light theme for year 2026.

\****************************************************************************/

pre,
code {
    font-family: "Courier10 Win95BT", "Courier New", "Courier", monospace;
    font-weight: normal;
}

pre + p {
    margin-top: 3ex;
}

pre {
    max-width: 100%;
    overflow: auto;
    margin: 1ex 2em;
    padding: 1ex 1em;
    border: 2px dotted rgb(112, 128, 144);
    font-size: 85%;
}

p code {
    font-size: 85%;
}

code.comment {
    font-style: italic;
}

code.keyword,
code.preprocessor {
    font-weight: bold;
}

code.lisp {
    font-variant: small-caps;
}

code.comment,
code.keyword,
code.predefined,
code.lisp,
code.method,
code.preprocessor,
code.value,
code.var {
    background: transparent;
}

/* Light colour theme */
@media (prefers-color-scheme: light) {
    pre {
        background: rgb(248, 248, 255);
        color: rgb(95, 158, 160);
    }

    /* Basic colour for code: syntactic elements, operators */
    code {
        color: rgb(95, 158, 160);
    }

    code.comment {
        color: rgb(119, 136, 153);
    }

    code.eval {
        background: rgb(230, 230, 250);
    }

    code.keyword {
        color: black;
    }

    code.method {
        color: rgb(205, 133, 63);
    }

    code.predefined {
        color: rgb(100, 149, 237);
    }

    code.preprocessor {
        color: rgb(255, 99, 71);
    }

    code.value {
        color: rgb(24, 139, 34);
    }

    code.var {
        color: black;
    }
}

/* Dark colour theme */
@media (prefers-color-scheme: dark) {
    pre {
        /*background: rgb(42, 46, 50);*/
        background: rgb(18, 0, 28);
        color: rgb(135, 206, 235);
    }

    code {
        color: rgb(0, 191, 255);
    }

    code.comment {
        color: rgb(119, 136, 153);
    }

    code.eval {
        background: rgb(85, 26, 139);
    }

    code.keyword {
        color: rgb(255, 255, 127);
    }

    code.method {
        color: rgb(30, 144, 255);
    }

    code.predefined {
        color: rgb(244, 164, 96);
    }

    code.preprocessor {
        color: rgb(255, 20, 147);
    }

    code.value {
        color: rgb(50, 205, 50);
    }

    code.var {
        color: rgb(238, 238, 238);
    }
}

summary {
    margin-bottom: 1ex;
    font-size: 133%;
    font-family: Maecenas-SemiBold;
}
