/* Rouge syntax highlighting — Warm Stone theme */

.highlight:not(pre) {
    background: #252220;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin: 1.5em 0;
    overflow-x: auto;
    position: relative;
}

.highlight pre {
    margin: 0;
    padding: 1rem 1.5rem 0.4rem;
    background: transparent;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.65;
    color: #DED8D2;
    overflow-x: auto;
}

/* Language label — set via data-lang attribute by JS */
.highlight:not(pre)[data-lang]::before {
    display: block;
    padding: 8px 12px 4px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    content: attr(data-lang);
}

/* When label is present, pre needs less top padding — label already provides separation */
.highlight:not(pre)[data-lang] pre {
    padding-top: 0.4rem;
}

/* ── Token colours ─────────────────────────────────── */

/* Comments */
.highlight .c,
.highlight .cm,
.highlight .cp,
.highlight .c1,
.highlight .cs  { color: #8A8480; font-style: italic; }

/* Keywords — warm amber */
.highlight .k,
.highlight .kd,
.highlight .kn,
.highlight .kp,
.highlight .kr,
.highlight .kt  { color: #D4A76A; }

/* Keyword constants (true, false, null) — muted lavender */
.highlight .kc  { color: #C4A0D4; }

/* Strings — sage green */
.highlight .s,
.highlight .sb,
.highlight .sc,
.highlight .sd,
.highlight .s2,
.highlight .se,
.highlight .sh,
.highlight .si,
.highlight .sx,
.highlight .s1,
.highlight .ss  { color: #A8C878; }

/* String regex — warm terracotta */
.highlight .sr  { color: #D4976A; }

/* Numbers — muted lavender */
.highlight .m,
.highlight .mf,
.highlight .mh,
.highlight .mi,
.highlight .mo,
.highlight .il  { color: #C4A0D4; }

/* Built-ins — sage green */
.highlight .nb,
.highlight .bp  { color: #A8C878; }

/* Operators — warm white */
.highlight .o,
.highlight .ow  { color: #DED8D2; }

/* Punctuation — warm white */
.highlight .p   { color: #DED8D2; }

/* Functions, class names — warm gold */
.highlight .nf,
.highlight .nc,
.highlight .nd  { color: #E8D5A8; }

/* Tags, constants, attribute names — warm coral */
.highlight .nt,
.highlight .no,
.highlight .na  { color: #D4826A; }

/* All other names — warm white */
.highlight .n,
.highlight .ni,
.highlight .ne,
.highlight .nl,
.highlight .nn,
.highlight .nx,
.highlight .py,
.highlight .nv  { color: #DED8D2; }

/* Generic diff */
.highlight .gi  { color: #A8C878; }
.highlight .gd  { color: #D4826A; }
.highlight .go  { color: #8A8480; }
.highlight .gp  { color: #8A8480; }
.highlight .ge  { font-style: italic; }
.highlight .gs  { font-weight: bold; }

/* Error */
.highlight .err { color: #DED8D2; background: #D4826A; }

/* Line numbers */
.highlight .lineno {
    color: #665E58;
    padding-right: 1rem;
    user-select: none;
    border-right: 1px solid var(--border);
    margin-right: 1rem;
}
