/* Syntax Highlighting Theme - VS Code Dark+ Inspired */
/* For Hugo's Chroma syntax highlighter */

:root {
    /* Code block background */
    --code-bg: #1e1e1e;
    --code-border: #2d2d30;

    /* Base text color */
    --code-text: #d4d4d4;

    /* Syntax colors - VS Code Dark+ Theme */
    --syntax-comment: #6A9955;
    --syntax-keyword: #569CD6;
    --syntax-string: #CE9178;
    --syntax-number: #B5CEA8;
    --syntax-function: #DCDCAA;
    --syntax-type: #4EC9B0;
    --syntax-variable: #9CDCFE;
    --syntax-operator: #D4D4D4;
    --syntax-punctuation: #D4D4D4;
    --syntax-constant: #4FC1FF;
    --syntax-tag: #569CD6;
    --syntax-attribute: #9CDCFE;
    --syntax-namespace: #4EC9B0;
    --syntax-error: #F44747;
}

/* Main code block container */
.highlight,
pre {
    background: var(--code-bg) !important;
    border-radius: 0.5rem !important;
    padding: 0 !important;
    margin: 1.5rem 0 !important;
    overflow: hidden !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

.highlight pre,
pre code {
    background: transparent !important;
    padding: 1rem 1.25rem !important;
    color: var(--code-text) !important;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important;
    font-size: 0.9rem !important;
    line-height: 1.5 !important;
    display: block !important;
    overflow-x: auto !important;
}

/* Hugo Chroma classes */

/* Comments */
.highlight .c,   /* Comment */
.highlight .c1,  /* Comment.Single */
.highlight .ch,  /* Comment.Hashbang */
.highlight .cm,  /* Comment.Multiline */
.highlight .cp,  /* Comment.Preproc */
.highlight .cpf, /* Comment.PreprocFile */
.highlight .cs   /* Comment.Special */ {
    color: var(--syntax-comment) !important;
    font-style: italic !important;
}

/* Keywords */
.highlight .k,   /* Keyword */
.highlight .kc,  /* Keyword.Constant */
.highlight .kd,  /* Keyword.Declaration */
.highlight .kn,  /* Keyword.Namespace */
.highlight .kp,  /* Keyword.Pseudo */
.highlight .kr,  /* Keyword.Reserved */
.highlight .kt   /* Keyword.Type */ {
    color: var(--syntax-keyword) !important;
}

/* Strings */
.highlight .s,   /* String */
.highlight .s1,  /* String.Single */
.highlight .s2,  /* String.Double */
.highlight .sa,  /* String.Affix */
.highlight .sb,  /* String.Backtick */
.highlight .sc,  /* String.Char */
.highlight .sd,  /* String.Doc */
.highlight .se,  /* String.Escape */
.highlight .sh,  /* String.Heredoc */
.highlight .si,  /* String.Interpol */
.highlight .sr,  /* String.Regex */
.highlight .ss,  /* String.Symbol */
.highlight .sx   /* String.Other */ {
    color: var(--syntax-string) !important;
}

/* Numbers */
.highlight .m,   /* Number */
.highlight .mb,  /* Number.Bin */
.highlight .mf,  /* Number.Float */
.highlight .mh,  /* Number.Hex */
.highlight .mi,  /* Number.Integer */
.highlight .il,  /* Number.Integer.Long */
.highlight .mo   /* Number.Oct */ {
    color: var(--syntax-number) !important;
}

/* Functions */
.highlight .nf,  /* Name.Function */
.highlight .fm   /* Name.Function.Magic */ {
    color: var(--syntax-function) !important;
}

/* Types/Classes */
.highlight .nc,  /* Name.Class */
.highlight .nn,  /* Name.Namespace */
.highlight .nb,  /* Name.Builtin */
.highlight .nt   /* Name.Tag */ {
    color: var(--syntax-type) !important;
}

/* Variables/Properties */
.highlight .n,   /* Name */
.highlight .na,  /* Name.Attribute */
.highlight .nd,  /* Name.Decorator */
.highlight .ne,  /* Name.Exception */
.highlight .ni,  /* Name.Entity */
.highlight .nl,  /* Name.Label */
.highlight .no,  /* Name.Constant */
.highlight .nv,  /* Name.Variable */
.highlight .nx,  /* Name.Other */
.highlight .py,  /* Name.Property */
.highlight .vc,  /* Name.Variable.Class */
.highlight .vg,  /* Name.Variable.Global */
.highlight .vi   /* Name.Variable.Instance */ {
    color: var(--syntax-variable) !important;
}

/* Operators & Punctuation */
.highlight .o,   /* Operator */
.highlight .ow,  /* Operator.Word */
.highlight .p    /* Punctuation */ {
    color: var(--syntax-operator) !important;
}

/* Built-in constants */
.highlight .bp   /* Name.Builtin.Pseudo */ {
    color: var(--syntax-constant) !important;
}

/* Errors */
.highlight .gr,  /* Generic.Error */
.highlight .err  /* Error */ {
    color: var(--syntax-error) !important;
}

/* Special styling for specific elements */
.highlight .gd { /* Generic.Deleted */
    color: var(--syntax-error) !important;
    background-color: rgba(255, 0, 0, 0.1) !important;
}

.highlight .gi { /* Generic.Inserted */
    color: var(--syntax-string) !important;
    background-color: rgba(0, 255, 0, 0.1) !important;
}

.highlight .gu { /* Generic.Subheading */
    color: var(--syntax-type) !important;
    font-weight: bold !important;
}

.highlight .gh { /* Generic.Heading */
    color: var(--syntax-type) !important;
    font-weight: bold !important;
}

/* Line numbers (if enabled) */
.highlight .ln,
.highlight .lnt {
    color: #858585 !important;
    margin-right: 1em !important;
}

/* Inline code */
code:not(pre code),
p code,
li code,
td code {
    background: #f3f4f6 !important;
    color: #1f2937 !important;
    padding: 0.125rem 0.25rem !important;
    border-radius: 0.25rem !important;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important;
    font-size: 0.875em !important;
}

/* Copy button for code blocks */
.highlight-copy-btn {
    position: absolute !important;
    top: 0.5rem !important;
    right: 0.5rem !important;
    padding: 0.25rem 0.5rem !important;
    background: var(--syntax-keyword) !important;
    color: white !important;
    border: none !important;
    border-radius: 0.25rem !important;
    font-size: 0.75rem !important;
    cursor: pointer !important;
    opacity: 0.7 !important;
    transition: opacity 0.2s !important;
}

.highlight-copy-btn:hover {
    opacity: 1 !important;
}

/* Selection in code blocks */
.highlight ::selection,
.highlight code::selection {
    background: rgba(86, 156, 214, 0.25) !important;
}

/* Scrollbar for code blocks */
.highlight pre::-webkit-scrollbar,
pre::-webkit-scrollbar {
    height: 8px !important;
}

.highlight pre::-webkit-scrollbar-track,
pre::-webkit-scrollbar-track {
    background: var(--code-bg) !important;
}

.highlight pre::-webkit-scrollbar-thumb,
pre::-webkit-scrollbar-thumb {
    background: var(--code-border) !important;
    border-radius: 4px !important;
}

.highlight pre::-webkit-scrollbar-thumb:hover,
pre::-webkit-scrollbar-thumb:hover {
    background: #3e3e42 !important;
}

/* Ensure proper display */
.highlight {
    position: relative !important;
}

.highlight > pre {
    margin: 0 !important;
}

/* Language-specific adjustments */

/* Go specific */
.language-go .k,
.language-go .kd {
    color: var(--syntax-keyword) !important;
}

.language-go .s,
.language-go .s1,
.language-go .s2 {
    color: var(--syntax-string) !important;
}

.language-go .nf {
    color: var(--syntax-function) !important;
}

.language-go .c,
.language-go .c1 {
    color: var(--syntax-comment) !important;
    font-style: italic !important;
}

/* Make sure plain text code blocks still look good */
.language-text .highlight,
.language-plaintext .highlight,
.language-txt .highlight {
    color: var(--code-text) !important;
}

/* Bash/Shell specific */
.language-bash .nb,
.language-shell .nb {
    color: var(--syntax-function) !important;
}

.language-bash .nv,
.language-shell .nv {
    color: var(--syntax-variable) !important;
}

/* JSON specific */
.language-json .nt {
    color: var(--syntax-variable) !important;
}

.language-json .s2 {
    color: var(--syntax-string) !important;
}

/* YAML specific */
.language-yaml .nt {
    color: var(--syntax-variable) !important;
}

.language-yaml .s {
    color: var(--syntax-string) !important;
}

/* Remove any default backgrounds that might interfere */
.highlight span {
    background: transparent !important;
}