/* essence-of-elementary-algebra.css
   Modern dark theme for algebra article
   Designed for readability, pleasant aesthetics, and MathJax compatibility
*/

:root {
    --background: #181a20;
    --foreground: #e0e0e0;
    --accent: #4f8cff;
    --math-accent: #9db4ff;
    --header: #22242c;
    --blockquote: #23252e;
    --border: #33353d;
    --code-bg: #23252e;
    --font-main: 'Inter', 'Segoe UI', 'Roboto', 'Arial', sans-serif;
    --font-mono: 'Fira Mono', 'Menlo', 'Consolas', monospace;
    --radius: 10px;
    --shadow: 0 2px 16px rgba(0, 0, 0, 0.15);
}

html,
body {
    background: var(--background);
    color: var(--foreground);
    font-family: var(--font-main);
    font-size: 1.1rem;
    line-height: 1.7;
    margin: 0;
    padding: 0;
}

header,
footer {
    background: var(--header);
    color: var(--accent);
    padding: 1rem 0;
    text-align: center;
    box-shadow: var(--shadow);
}

article {
    max-width: 1400px;
    margin: 2rem auto;
    background: var(--header);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2.5rem 2rem;
}

h1,
h2,
h3 {
    color: var(--accent);
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.2rem;
    letter-spacing: 1px;
    text-align: center;
}

h2 {
    font-size: 1.6rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.3rem;
}

h3 {
    font-size: 1.2rem;
}

p {
    margin: 1.2rem 0;
}

blockquote {
    background: var(--blockquote);
    border-left: 4px solid var(--accent);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: var(--radius);
    color: #b0b8c0;
    font-style: italic;
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}

b,
strong {
    color: var(--accent);
}

i,
em {
    color: #b0b8c0;
}

/* MathJax equations */
.MathJax,
.mjx-chtml {
    font-size: 1.30em !important;
    color: var(--math-accent);
}

/* Code blocks and inline code */
code,
pre {
    background: var(--code-bg);
    color: #e0e0e0;
    font-family: var(--font-mono);
    border-radius: 6px;
    padding: 0.2em 0.5em;
}

pre {
    padding: 1em;
    overflow-x: auto;
}

/* Links */
a {
    color: var(--accent);
    text-decoration: underline;
    transition: color 0.2s;
}

a:hover {
    color: #82b1ff;
}

/* Responsive */
@media (max-width: 800px) {
    article {
        padding: 1.2rem 0.5rem;
        margin: 1rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.2rem;
    }
}

/* Discord-like spoiler effect */
.spoiler {
    background: #181a20;
    color: transparent;
    cursor: pointer;
    user-select: none;
    transition: background 0.3s, filter 0.2s, color 0.3s;
    position: relative;
    border-radius: 4px;
    padding: 0.5em;
    filter: blur(0.5em);
}

.spoiler * {
    user-select: none;
}


.spoiler:hover {
    background: #1c1f20;
}

.spoiler.revealed {
    background: var(--blockquote);
    color: var(--foreground);
    filter: none;
    user-select: text;
}

.spoiler.revealed * {
    user-select: text;
}

/* Make MathJax content inside spoilers unselectable until revealed */
.spoiler .MathJax,
.spoiler .mjx-chtml,
.spoiler .mjx-math {
    user-select: none;
    pointer-events: none;
}

.spoiler.revealed .MathJax,
.spoiler.revealed .mjx-chtml,
.spoiler.revealed .mjx-math {
    user-select: text;
    pointer-events: auto;
}