/*
 * Syntax-highlighting theme for the git.bvdl.io file browser.
 *
 * Hand-authored to sit on top of the application's inline design system rather
 * than shipping one of Prism's stock single-mode themes: it deliberately does
 * not set a background or border on the code block (the layout's `pre` rules
 * already provide `--code-bg` and the panel border) and it defines token
 * colours for both light and dark via `prefers-color-scheme`, so highlighted
 * code matches the surrounding UI in either mode.
 */

/* Light palette (One Light-inspired), harmonised with the app's link/accent hues. */
:root {
    --code-token-comment: #6a737d;
    --code-token-punctuation: #4b5563;
    --code-token-keyword: #a626a4;
    --code-token-string: #116329;
    --code-token-number: #b45309;
    --code-token-function: #1957c2;
    --code-token-class: #9a6700;
    --code-token-operator: #b02a37;
    --code-token-variable: #cf222e;
    --code-token-tag: #116329;
    --code-token-attr: #9a6700;
}

@media (prefers-color-scheme: dark) {
    :root {
        /* Dark palette (One Dark / Tomorrow-Night-inspired). */
        --code-token-comment: #8b949e;
        --code-token-punctuation: #abb2bf;
        --code-token-keyword: #c678dd;
        --code-token-string: #98c379;
        --code-token-number: #d19a66;
        --code-token-function: #61afef;
        --code-token-class: #e5c07b;
        --code-token-operator: #56b6c2;
        --code-token-variable: #e06c75;
        --code-token-tag: #e06c75;
        --code-token-attr: #d19a66;
    }
}

code[class*="language-"],
pre[class*="language-"] {
    color: var(--text);
    background: none;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 13px;
    tab-size: 4;
    -moz-tab-size: 4;
}

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
    color: var(--code-token-comment);
    font-style: italic;
}

.token.punctuation {
    color: var(--code-token-punctuation);
}

.token.property,
.token.tag,
.token.symbol,
.token.deleted {
    color: var(--code-token-tag);
}

.token.boolean,
.token.number,
.token.constant {
    color: var(--code-token-number);
}

.token.selector,
.token.string,
.token.char,
.token.builtin,
.token.inserted,
.token.char-class {
    color: var(--code-token-string);
}

.token.attr-name {
    color: var(--code-token-attr);
}

.token.attr-value {
    color: var(--code-token-string);
}

.token.operator,
.token.entity,
.token.url {
    color: var(--code-token-operator);
}

.token.atrule,
.token.keyword {
    color: var(--code-token-keyword);
}

.token.function {
    color: var(--code-token-function);
}

.token.class-name,
.token.namespace {
    color: var(--code-token-class);
}

.token.variable,
.token.regex,
.token.important {
    color: var(--code-token-variable);
}

.token.important,
.token.bold {
    font-weight: 700;
}

.token.italic {
    font-style: italic;
}
