/* --- Pandoc Dark Mode Theme --- */

/* --- Google Font Imports --- */
@import url('https://fonts.googleapis.com/css2?family=Merriweather:ital,wght@0,400;0,700;1,400&family=Fira+Code:wght@400;500&display=swap');

/* --- General Body & Typography --- */
body {
    background-color: #1e1e2e; /* Dark background */
    color: #cdd6f4;            /* Light text */
    font-family: 'Merriweather', Georgia, serif; /* Professional & readable serif */
    line-height: 1.7;
    margin: 0 auto;
    max-width: 800px;
    padding: 2em;
    font-size: 18px;
}

/* --- Headers --- */
h1, h2, h3, h4, h5, h6 {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; /* Bold, common, expected sans-serif */
    color: #f5e0dc; /* A slightly warmer white for headers */
    font-weight: 700;
    line-height: 1.2;
    margin-top: 2em;
    margin-bottom: 0.8em;
    border-bottom: 1px solid #45475a;
    padding-bottom: 0.3em;
}

h1 { font-size: 2.5em; }
h2 { font-size: 2em; }
h3 { font-size: 1.6em; }
h4 { font-size: 1.3em; }
h5 { font-size: 1.1em; }
h6 { font-size: 1em; color: #a6adc8; } /* Muted color for the smallest header */

/* --- Links & Blockquotes --- */
a {
    color: #89b4fa; /* Bright blue for links */
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

a:hover {
    color: #b4befe;
    text-decoration: underline;
}

blockquote {
    border-left: 4px solid #585b70;
    padding-left: 1em;
    margin-left: 0;
    color: #a6adc8; /* Slightly muted text for quotes */
    font-style: italic;
}

/* --- Code Blocks & Inline Code --- */
/* For inline code and code blocks */
code, pre {
    font-family: 'Fira Code', 'Menlo', 'Consolas', monospace; /* Identifiable & readable monospaced */
    font-size: 0.9em;
    background-color: #181825; /* Slightly different dark background */
}

/* Inline code styling */
code {
    padding: 0.2em 0.4em;
    border-radius: 4px;
    color: #f38ba8; /* A distinct color for inline code */
}

/* Code block styling */
pre {
    border: 1px solid #313244;
    border-radius: 6px;
    padding: 1em;
    overflow-x: auto; /* Allow horizontal scrolling for long lines */
    line-height: 1.4;
}

pre code {
    background-color: transparent; /* Remove double background */
    padding: 0;
    color: inherit; /* Inherit color from the syntax highlighting rules */
}

/* --- Syntax Highlighting (Pandoc classes) --- */
/* Inspired by the Catppuccin color scheme */
code .kw { color: #cba6f7; font-weight: bold; } /* Keyword */
code .dt { color: #f9e2af; } /* DataType */
code .dv { color: #fab387; } /* DecVal */
code .bn { color: #fab387; } /* BaseN */
code .fl { color: #fab387; } /* Float */
code .ch { color: #a6e3a1; } /* Char */
code .st { color: #a6e3a1; } /* String */
code .co { color: #7f849c; font-style: italic; } /* Comment */
code .ot { color: #94e2d5; } /* Other */
code .al { color: #f38ba8; font-weight: bold; } /* Alert */
code .fu { color: #89b4fa; } /* Function */
code .er { color: #f38ba8; font-weight: bold; } /* Error */
code .wa { color: #fab387; font-weight: bold; } /* Warning */
code .cn { color: #f9e2af; } /* Constant */
code .sc { color: #a6e3a1; } /* SpecialChar */
code .im { color: #cba6f7; } /* Import */
code .vs { color: #a6e3a1; } /* VerbatimString */
code .va { color: #cdd6f4; } /* Variable */
code .op { color: #94e2d5; } /* Operator */

/* --- Other Elements --- */
hr {
    border: 0;
    height: 1px;
    background-color: #45475a;
    margin: 3em 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
}

th, td {
    border: 1px solid #45475a;
    padding: 0.8em;
    text-align: left;
}

thead {
    background-color: #313244;
}

th {
    color: #f5e0dc;
    font-weight: bold;
}

tbody tr:nth-child(odd) {
    background-color: #181825; /* Subtle striping for table rows */
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 2em auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* --- LaTeX / MathJax --- */
/* Basic styling for math elements */
.math.inline, .math.display {
    color: #f9e2af; /* A distinct color for math/LaTeX */
    font-family: 'Merriweather', 'Times New Roman', serif;
}

/* Ensure images generated from LaTeX are visible on a dark background */
img.formula {
    background-color: #cdd6f4;
    padding: 0.3em;
    border-radius: 4px;
}