/* Custom CSS for AlignMemory.jl Docs */

/* Code Blocks & Output */
/* Force background to black for all code blocks */
.content pre,
.content pre.language-julia,
.content pre.language-julia-repl,
.content pre code,
.hljs {
    background-color: #000000 !important;
    color: #f8f8f2 !important; /* Ensure text is visible */
}

/* Override all possible syntax highlighting selectors */
/* Strings - Make them lighter/pastel */
pre code .hljs-string,
pre .hljs-string,
.hljs-string,
pre code .s,
pre .s,
pre code .s1,
pre .s1,
pre code .s2,
pre .s2 {
    color: #ffb3b3 !important; /* Very light pastel red */
}

/* Comments - Lighter green */
pre code .hljs-comment,
pre .hljs-comment,
.hljs-comment,
pre code .c,
pre .c,
pre code .c1,
pre .c1,
pre code .cm,
pre .cm {
    color: #b3ffb3 !important; /* Very light pastel green */
    font-style: italic !important;
}

/* Keywords - Lighter blue */
pre code .hljs-keyword,
pre .hljs-keyword,
.hljs-keyword,
pre code .hljs-built_in,
pre .hljs-built_in,
.hljs-built_in,
pre code .k,
pre .k,
pre code .kd,
pre .kd {
    color: #b3d9ff !important; /* Very light pastel blue */
    font-weight: bold !important;
}

/* Functions */
pre code .hljs-function,
pre .hljs-function,
.hljs-function,
pre code .hljs-title.function,
pre .hljs-title.function,
pre code .nf,
pre .nf {
    color: #99ccff !important; /* Light blue */
}

/* Numbers */
pre code .hljs-number,
pre .hljs-number,
.hljs-number,
pre code .hljs-literal,
pre .hljs-literal,
pre code .m,
pre .m,
pre code .mi,
pre .mi,
pre code .mf,
pre .mf {
    color: #ffcc99 !important; /* Light orange */
}

/* Types */
pre code .hljs-type,
pre .hljs-type,
.hljs-type,
pre code .hljs-class,
pre .hljs-class,
pre code .nc,
pre .nc {
    color: #cc99ff !important; /* Light purple */
}

/* Variables */
pre code .hljs-variable,
pre .hljs-variable,
.hljs-variable,
pre code .n,
pre .n {
    color: #f0f0f0 !important; /* Very light gray */
}

/* Inline Code (`text`) - Theme-aware colors */
/* Light theme inline code */
html[data-theme="documenter-light"] .content code:not(pre code),
html[data-theme="catppuccin-latte"] .content code:not(pre code) {
    background-color: rgba(0, 0, 0, 0.05) !important;
    color: #005580 !important; /* Darker, more readable blue for light mode */
    font-weight: bold;
    font-style: italic;
    padding: 0.1rem 0.3rem;
    border-radius: 0.2rem;
}

/* Dark theme inline code */
html[data-theme="documenter-dark"] .content code:not(pre code),
html[data-theme="catppuccin-frappe"] .content code:not(pre code),
html[data-theme="catppuccin-macchiato"] .content code:not(pre code),
html[data-theme="catppuccin-mocha"] .content code:not(pre code) {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: #66b3ff !important; /* Lighter, more readable blue for dark mode */
    font-weight: bold;
    font-style: italic;
    padding: 0.1rem 0.3rem;
    border-radius: 0.2rem;
}

/* Fallback for any theme not explicitly listed */
.content code:not(pre code) {
    font-weight: bold;
    font-style: italic;
    padding: 0.1rem 0.3rem;
    border-radius: 0.2rem;
}

/* Implementation Detail Blocks (currently using !!! warning) */
.admonition.warning,
.admonition.is-warning {
    background-color: #ffffcc !important; /* Light Yellow background */
    border-left: 5px solid #ffcc00 !important; /* Stronger yellow border */
    color: #000000 !important; /* Black text */
}

.admonition.warning .admonition-title,
.admonition.is-warning .admonition-title,
.admonition.is-warning .admonition-header {
    background-color: #ffcc00 !important; /* Yellow title background */
    color: #000000 !important; /* Black title text */
    font-weight: bold;
}

.admonition.warning .content,
.admonition.is-warning .admonition-body {
    color: #000000 !important;
}

/* Fix inline code in warning blocks - override theme colors */
.admonition.warning code:not(pre code),
.admonition.is-warning code:not(pre code) {
    background-color: rgba(0, 0, 0, 0.1) !important;
    color: #003366 !important; /* Dark blue that's readable on yellow */
    font-weight: bold !important;
    font-style: normal !important;
    padding: 0.1rem 0.3rem;
    border-radius: 0.2rem;
}


/* ANSI color codes in terminal output */
/* Red ANSI */
.ansi .sgr31,
.ansi .sgr91 {
    color: #ff6b6b !important;
}

/* Green ANSI */
.ansi .sgr32,
.ansi .sgr92 {
    color: #40cc40 !important;
}

/* Blue ANSI */
.ansi .sgr34,
.ansi .sgr94 {
    color: #4da6ff !important;
}

/* Cyan ANSI */
.ansi .sgr36,
.ansi .sgr96 {
    color: #40e0d0 !important;
}

/* Yellow ANSI */
.ansi .sgr33,
.ansi .sgr93 {
    color: #ffff66 !important;
}

/* Magenta ANSI */
.ansi .sgr35,
.ansi .sgr95 {
    color: #ff66ff !important;
}
