/**
 * ezx-highlight.css — Syntax highlighting theme for eZX Spectrum assembly
 *
 * Designed around the column format used in the eZX documentation:
 *
 *   $ED $91 $07 $06      NEXTREG $07, %110       ; raise speed
 *   hex opcode bytes     mnemonic  operands       comment
 *
 * Colour scheme (dark theme):
 *   Hex bytes / numbers   →  blue-grey    (structural, not semantic)
 *   Z80 mnemonics         →  yellow       (workhorse instructions)
 *   eZX / Z80N mnemonics  →  light blue   (platform extensions)
 *   RISC mnemonics        →  purple       (NDA extension, visually distinct)
 *   Mode prefixes         →  bright red   (ALT, X8, X32, N8, N32 — important)
 *   Registers             →  green        (both Z80 and RISC Rn forms)
 *   RISC registers        →  bright green (R0–R15, Zero — distinct from Z80)
 *   Register lists        →  inherit from above
 *   Comments              →  grey italic  (de-emphasised)
 *   Labels                →  salmon/pink  (call targets, entry points)
 *   Local labels          →  light pink   (.loop, .fill)
 *   Placeholders          →  cyan         (lo, hi, xx — obviously not real bytes)
 *   Condition codes       →  orange       (NZ, Z, NC, C etc.)
 *   Binary literals       →  amber        (same family as hex)
 *
 * Add to your page after prism-core.css (or instead of a Prism theme).
 */

/* ── Code block wrapper ───────────────────────────────────────────────────── */

/* Cancel any left border Bootstrap or site CSS adds to pre elements */
pre {
    border-left: none !important;
}

pre.code-block {
    background:      #fffdf5;
    border:          1px solid #e8e4d8;
    border-radius:   4px;
    padding:         1rem 1.25rem;
    overflow-x:      auto;
    font-family:     'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size:       0.875rem;
    line-height:     1.6;
    tab-size:        4;
    color:           #24283b;
    margin:          1.25rem 0;
}

/* Language-specific left border colours */
pre.code-block.language-ezx { border-left: 3px solid #7aaaee !important; }
pre.code-block.language-z80 { border-left: 3px solid #7abf8a !important; }

pre.code-block code {
    background:  none;
    padding:     0;
    font-size:   inherit;
    color:       inherit;
}

/* Prevent prism-core.css adding background/padding to token spans */
pre.code-block .token {
    background: none !important;
    padding:    0 !important;
}

/* ── Token colours ────────────────────────────────────────────────────────── */

/* Comments — grey, italic, de-emphasised */
.token.comment {
    color:        #555870;
    font-style:   italic;
}

/* Hex numbers ($XX, $XXXX) and binary (%110) — blue-grey */
.token.hex-number,
.token.number,
.token.binary-number {
    color: #0050a0;
}

/* Z80 standard mnemonics (LD, PUSH, JP, CALL, etc.) */
.token.instruction {
    color:       #1a5a9a;
    font-weight: 600;
}

/* eZX native + Z80N instructions (NEXTREG, OSCALL, SWAPNIB, etc.) */
.token.ezx-instruction,
.token.z80n-instruction {
    color:       #1a5a9a;
    font-weight: 600;
}

/* RISC instructions (MOV, ADDI, JRNZ, etc.) */
.token.risc-instruction {
    color:       #2a4a8a;
    font-weight: 600;
}

/* Mode-switch prefixes (ALT, X8, X32, N8, N32) — slightly darker, still distinct */
.token.mode-prefix {
    color:       #0a3a7a;
    font-weight: 700;
}

/* Z80 registers (HL, DE, BC, AF, IX, IY, SP, PC, A, B, C…) — green */
.token.register {
    color: #1a7a40;
}

/* RISC registers (R0–R15, Zero, R8hi, R9lo…) — brighter green */
.token.risc-register {
    color: #0a7a6a;
}

/* Labels (NMI_HANDLER:, STATE_INPUT:) — salmon */
.token.label {
    color:       #8a2800;
    font-style:  normal;
}

/* Local labels (.loop, .fill) */
.token.local-label {
    color: #7a3060;
}

/* Prevent Bootstrap .char styles (cursor:wait, opacity:.5) leaking into code blocks */
pre.code-block .char,
pre.code-block .token {
    cursor:  inherit !important;
    opacity: 1 !important;
}

/* Placeholders (lo, hi, xx) — cyan, clearly not real bytes */
.token.placeholder {
    color:       #005f7a !important;
    font-style:  italic;
}

/* Condition codes (NZ, Z, NC, C, PO, PE) — subtle dark grey */
.token.condition,
.token.selector {
    color: #555;
}

/* Symbols (.loop without colon, forward refs) */
.token.symbol {
    color: #c0709a;
}

/* Ellipsis (... continuation) — styled like comment */
.token.ellipsis {
    color: #8c8fa1;
}

/* Punctuation — subdued */
.token.punctuation {
    color: #888;
}

/* Builtins / functions / keywords — now unused as aliases removed */
/* Kept for safety in case any Prism internals still emit them */
.token.builtin,
.token.function,
.token.keyword {
    color:       #1a5a9a;
    font-weight: 600;
}

/* Properties / variable — now unused as aliases removed */
.token.property,
.token.variable {
    color: #1a7a40;
}

/* Selector — now unused as aliases removed */
.token.selector {
    color: #555;
}