/*
 * nixy.dk syntax theme for Hugo's Chroma highlighter.
 *
 * The palette stays close to the site: ink-black backgrounds, warm amber for
 * structure, and restrained greens for data. Chroma emits the token classes;
 * this file owns their presentation.
 */

:root {
    --syntax-bg: #080b0d;
    --syntax-border: #312815;
    --syntax-accent: #feac33;
    --syntax-fg: #c8c5ba;
    --syntax-muted: #718273;
    --syntax-keyword: #feac33;
    --syntax-name: #b8c5b4;
    --syntax-function: #e0bd72;
    --syntax-string: #8db78a;
    --syntax-number: #d99b4a;
    --syntax-error: #df776d;
    --syntax-inserted: #91bd8e;
    --syntax-highlight: #1b241c;
}

/* Block frame */
.highlight {
    margin: 0 0 1.5rem;
    overflow: hidden;
    background: var(--syntax-bg);
    border: 1px solid var(--syntax-border);
    border-left: 3px solid var(--syntax-accent);
    border-radius: 0;
}

.highlight pre.chroma,
.highlight pre.chroma code {
    background: var(--syntax-bg) !important;
    color: var(--syntax-fg);
}

.highlight pre.chroma {
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    padding: 1.25rem 1.5rem;
    overflow-x: auto;
    border: 0;
    border-radius: 0;
    scrollbar-color: var(--syntax-muted) var(--syntax-bg);
    scrollbar-width: thin;
}

.highlight pre.chroma code {
    display: block;
    min-width: max-content;
    padding: 0;
}

/* Give unhighlighted fenced blocks the same frame. */
pre:not(.chroma) {
    box-sizing: border-box;
    background: var(--syntax-bg) !important;
    color: var(--syntax-fg);
    border: 1px solid var(--syntax-border);
    border-left: 3px solid var(--syntax-accent);
    border-radius: 0;
}

pre:not(.chroma) code {
    background: transparent !important;
    color: inherit;
}

/* Chroma structure, highlighted lines, and optional line numbers */
.chroma {
    color: var(--syntax-fg);
    background: var(--syntax-bg);
}

.chroma .lnlinks {
    color: inherit;
    text-decoration: none;
    outline: none;
}

.chroma .lntable {
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-spacing: 0;
}

.chroma .lntd {
    margin: 0;
    padding: 0;
    vertical-align: top;
    border: 0;
}

.chroma .lntd:first-child {
    width: 1%;
    border-right: 1px solid var(--syntax-border);
}

.chroma .lntd:last-child {
    width: 100%;
}

.chroma .lnt,
.chroma .ln {
    margin-right: 0.8rem;
    padding: 0 0.8rem 0 0;
    color: var(--syntax-muted);
    white-space: pre;
    user-select: none;
}

.chroma .line {
    display: flex;
}

.chroma .hl {
    background: var(--syntax-highlight);
}

/* Errors */
.chroma .err,
.chroma .gr,
.chroma .gt {
    color: var(--syntax-error);
}

/* Keywords and declarations */
.chroma .k,
.chroma .kc,
.chroma .kd,
.chroma .kn,
.chroma .kp,
.chroma .kr,
.chroma .kt {
    color: var(--syntax-keyword);
    font-weight: 600;
}

/* Names */
.chroma .n,
.chroma .nb,
.chroma .bp,
.chroma .no,
.chroma .ni,
.chroma .nl,
.chroma .nn,
.chroma .nx,
.chroma .py,
.chroma .nv,
.chroma .vc,
.chroma .vg,
.chroma .vi,
.chroma .vm {
    color: var(--syntax-name);
}

.chroma .na,
.chroma .nd,
.chroma .nt {
    color: var(--syntax-keyword);
}

.chroma .nc,
.chroma .ne,
.chroma .nf,
.chroma .fm {
    color: var(--syntax-function);
}

/* Strings and literals */
.chroma .s,
.chroma .sa,
.chroma .sb,
.chroma .sc,
.chroma .dl,
.chroma .sd,
.chroma .s2,
.chroma .sh,
.chroma .si,
.chroma .sx,
.chroma .sr,
.chroma .s1,
.chroma .ss {
    color: var(--syntax-string);
}

.chroma .se {
    color: var(--syntax-function);
}

.chroma .m,
.chroma .mb,
.chroma .mf,
.chroma .mh,
.chroma .mi,
.chroma .il,
.chroma .mo {
    color: var(--syntax-number);
}

/* Operators and punctuation */
.chroma .o,
.chroma .ow,
.chroma .p {
    color: var(--syntax-fg);
}

/* Comments and preprocessor text */
.chroma .c,
.chroma .ch,
.chroma .cm,
.chroma .c1,
.chroma .cs,
.chroma .cp,
.chroma .cpf {
    color: var(--syntax-muted);
}

/* Diffs and other generic output */
.chroma .gd {
    color: var(--syntax-error);
}

.chroma .gi {
    color: var(--syntax-inserted);
}

.chroma .gh,
.chroma .gu,
.chroma .gp,
.chroma .gs {
    color: var(--syntax-function);
    font-weight: 600;
}

.chroma .go {
    color: var(--syntax-muted);
}

.chroma .ge {
    font-style: italic;
}

.chroma .gl {
    text-decoration: underline;
}
