/* ============================================
   Syntax Highlighting - Pristine Theme
   Clean, minimal code highlighting
   ============================================ */

/* Pygments classes */
.highlight .hll { background-color: var(--color-highlight); }
.highlight .c { color: var(--color-text-muted); font-style: italic; } /* Comment */
.highlight .err { color: var(--color-error); } /* Error */
.highlight .k { color: #8250df; font-weight: 500; } /* Keyword */
.highlight .o { color: var(--color-text-secondary); } /* Operator */
.highlight .ch { color: var(--color-text-muted); font-style: italic; } /* Comment.Hashbang */
.highlight .cm { color: var(--color-text-muted); font-style: italic; } /* Comment.Multiline */
.highlight .cp { color: #cf222e; font-weight: 500; } /* Comment.Preproc */
.highlight .cpf { color: var(--color-text-muted); font-style: italic; } /* Comment.PreprocFile */
.highlight .c1 { color: var(--color-text-muted); font-style: italic; } /* Comment.Single */
.highlight .cs { color: var(--color-text-muted); font-weight: 500; font-style: italic; } /* Comment.Special */
.highlight .gd { color: #82071e; background-color: #ffebe9; } /* Generic.Deleted */
.highlight .ge { font-style: italic; } /* Generic.Emph */
.highlight .gr { color: var(--color-error); } /* Generic.Error */
.highlight .gh { color: var(--color-text); font-weight: 600; } /* Generic.Heading */
.highlight .gi { color: #116329; background-color: #dafbe1; } /* Generic.Inserted */
.highlight .go { color: var(--color-text-muted); } /* Generic.Output */
.highlight .gp { color: var(--color-text-muted); font-weight: 600; } /* Generic.Prompt */
.highlight .gs { font-weight: 600; } /* Generic.Strong */
.highlight .gu { color: #0550ae; font-weight: 600; } /* Generic.Subheading */
.highlight .gt { color: var(--color-error); } /* Generic.Traceback */
.highlight .kc { color: #8250df; font-weight: 500; } /* Keyword.Constant */
.highlight .kd { color: #8250df; font-weight: 500; } /* Keyword.Declaration */
.highlight .kn { color: #cf222e; font-weight: 500; } /* Keyword.Namespace */
.highlight .kp { color: #8250df; } /* Keyword.Pseudo */
.highlight .kr { color: #8250df; font-weight: 500; } /* Keyword.Reserved */
.highlight .kt { color: #953800; font-weight: 500; } /* Keyword.Type */
.highlight .m { color: #0550ae; } /* Literal.Number */
.highlight .s { color: #0a3069; } /* Literal.String */
.highlight .na { color: var(--color-text-secondary); } /* Name.Attribute */
.highlight .nb { color: #953800; } /* Name.Builtin */
.highlight .nc { color: #953800; font-weight: 500; } /* Name.Class */
.highlight .no { color: #0550ae; } /* Name.Constant */
.highlight .nd { color: #8250df; font-weight: 500; } /* Name.Decorator */
.highlight .ni { color: var(--color-text); } /* Name.Entity */
.highlight .ne { color: #953800; font-weight: 500; } /* Name.Exception */
.highlight .nf { color: #8250df; font-weight: 500; } /* Name.Function */
.highlight .nl { color: var(--color-text); font-weight: 500; } /* Name.Label */
.highlight .nn { color: #953800; } /* Name.Namespace */
.highlight .nt { color: #116329; font-weight: 500; } /* Name.Tag */
.highlight .nv { color: #0550ae; } /* Name.Variable */
.highlight .ow { color: #8250df; font-weight: 500; } /* Operator.Word */
.highlight .w { color: var(--color-text-muted); } /* Text.Whitespace */
.highlight .mb { color: #0550ae; } /* Literal.Number.Bin */
.highlight .mf { color: #0550ae; } /* Literal.Number.Float */
.highlight .mh { color: #0550ae; } /* Literal.Number.Hex */
.highlight .mi { color: #0550ae; } /* Literal.Number.Integer */
.highlight .mo { color: #0550ae; } /* Literal.Number.Oct */
.highlight .sa { color: #0a3069; } /* Literal.String.Affix */
.highlight .sb { color: #0a3069; } /* Literal.String.Backtick */
.highlight .sc { color: #0a3069; } /* Literal.String.Char */
.highlight .dl { color: #0a3069; } /* Literal.String.Delimiter */
.highlight .sd { color: var(--color-text-muted); font-style: italic; } /* Literal.String.Doc */
.highlight .s2 { color: #0a3069; } /* Literal.String.Double */
.highlight .se { color: #0550ae; font-weight: 500; } /* Literal.String.Escape */
.highlight .sh { color: #0a3069; } /* Literal.String.Heredoc */
.highlight .si { color: #0550ae; } /* Literal.String.Interpol */
.highlight .sx { color: #0a3069; } /* Literal.String.Other */
.highlight .sr { color: #0a3069; } /* Literal.String.Regex */
.highlight .s1 { color: #0a3069; } /* Literal.String.Single */
.highlight .ss { color: #0a3069; } /* Literal.String.Symbol */
.highlight .bp { color: #953800; } /* Name.Builtin.Pseudo */
.highlight .fm { color: #8250df; font-weight: 500; } /* Name.Function.Magic */
.highlight .vc { color: #0550ae; } /* Name.Variable.Class */
.highlight .vg { color: #0550ae; } /* Name.Variable.Global */
.highlight .vi { color: #0550ae; } /* Name.Variable.Instance */
.highlight .vm { color: #0550ae; } /* Name.Variable.Magic */
.highlight .il { color: #0550ae; } /* Literal.Number.Integer.Long */

/* Dark theme overrides */
[data-theme="dark"] .highlight .hll { background-color: rgba(255, 214, 10, 0.15); }
[data-theme="dark"] .highlight .c { color: #8b949e; }
[data-theme="dark"] .highlight .k { color: #ff7b72; }
[data-theme="dark"] .highlight .kc { color: #79c0ff; }
[data-theme="dark"] .highlight .kd { color: #ff7b72; }
[data-theme="dark"] .highlight .kn { color: #ff7b72; }
[data-theme="dark"] .highlight .kp { color: #79c0ff; }
[data-theme="dark"] .highlight .kr { color: #ff7b72; }
[data-theme="dark"] .highlight .kt { color: #ffa657; }
[data-theme="dark"] .highlight .m { color: #79c0ff; }
[data-theme="dark"] .highlight .s { color: #a5d6ff; }
[data-theme="dark"] .highlight .na { color: #c9d1d9; }
[data-theme="dark"] .highlight .nb { color: #ffa657; }
[data-theme="dark"] .highlight .nc { color: #ffa657; }
[data-theme="dark"] .highlight .no { color: #79c0ff; }
[data-theme="dark"] .highlight .nd { color: #d2a8ff; }
[data-theme="dark"] .highlight .nf { color: #d2a8ff; }
[data-theme="dark"] .highlight .nn { color: #ffa657; }
[data-theme="dark"] .highlight .nt { color: #7ee787; }
[data-theme="dark"] .highlight .nv { color: #79c0ff; }
[data-theme="dark"] .highlight .ow { color: #ff7b72; }
[data-theme="dark"] .highlight .cp { color: #ffa657; }
[data-theme="dark"] .highlight .gd { color: #ffdcd7; background-color: #67060c; }
[data-theme="dark"] .highlight .gi { color: #aff5b4; background-color: #033a16; }
[data-theme="dark"] .highlight .gu { color: #79c0ff; }
[data-theme="dark"] .highlight .mb { color: #79c0ff; }
[data-theme="dark"] .highlight .mf { color: #79c0ff; }
[data-theme="dark"] .highlight .mh { color: #79c0ff; }
[data-theme="dark"] .highlight .mi { color: #79c0ff; }
[data-theme="dark"] .highlight .mo { color: #79c0ff; }
[data-theme="dark"] .highlight .sa { color: #a5d6ff; }
[data-theme="dark"] .highlight .sb { color: #a5d6ff; }
[data-theme="dark"] .highlight .sc { color: #a5d6ff; }
[data-theme="dark"] .highlight .dl { color: #a5d6ff; }
[data-theme="dark"] .highlight .sd { color: #8b949e; }
[data-theme="dark"] .highlight .s2 { color: #a5d6ff; }
[data-theme="dark"] .highlight .se { color: #79c0ff; }
[data-theme="dark"] .highlight .sh { color: #a5d6ff; }
[data-theme="dark"] .highlight .si { color: #79c0ff; }
[data-theme="dark"] .highlight .sx { color: #a5d6ff; }
[data-theme="dark"] .highlight .sr { color: #a5d6ff; }
[data-theme="dark"] .highlight .s1 { color: #a5d6ff; }
[data-theme="dark"] .highlight .ss { color: #a5d6ff; }
[data-theme="dark"] .highlight .bp { color: #ffa657; }
[data-theme="dark"] .highlight .fm { color: #d2a8ff; }
[data-theme="dark"] .highlight .vc { color: #79c0ff; }
[data-theme="dark"] .highlight .vg { color: #79c0ff; }
[data-theme="dark"] .highlight .vi { color: #79c0ff; }
[data-theme="dark"] .highlight .vm { color: #79c0ff; }
[data-theme="dark"] .highlight .il { color: #79c0ff; }

/* Code block enhancements */
.highlight {
    position: relative;
}

/* Language label */
.highlight[data-lang]::before {
    content: attr(data-lang);
    position: absolute;
    top: 0;
    right: var(--space-3);
    padding: var(--space-1) var(--space-2);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    text-transform: uppercase;
}

/* Copy button */
.highlight .copy-button {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    padding: var(--space-2);
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-muted);
    cursor: pointer;
    opacity: 0;
    transition: all var(--transition-fast);
}

.highlight:hover .copy-button {
    opacity: 1;
}

.highlight .copy-button:hover {
    color: var(--color-text);
    background: var(--color-bg-muted);
}

.highlight .copy-button.copied {
    color: var(--color-success);
}

/* Line numbers (optional) */
.highlight.linenums .lineno {
    display: inline-block;
    width: 3em;
    padding-right: 1em;
    margin-right: 1em;
    text-align: right;
    color: var(--color-text-muted);
    border-right: 1px solid var(--color-border-subtle);
    user-select: none;
}

/* Inline code in different contexts */
.admonition code {
    background: var(--color-bg);
}

blockquote code {
    background: var(--color-bg);
}

/* Code diff styling */
.highlight .gi {
    background-color: rgba(46, 160, 67, 0.15);
    display: inline-block;
    width: 100%;
}

.highlight .gd {
    background-color: rgba(248, 81, 73, 0.15);
    display: inline-block;
    width: 100%;
}
