/* ==========================================================================
   BASE TYPOGRAPHY & DARK THEME
   ========================================================================== */
body {
    background-color: #232323; /* Near-black background */
    color: #D0D0D0;            /* Light gray text */
    max-width: 900px;          /* Readability constraint */
    margin: 40px auto;         /* Centered content with top/bottom padding */
    font-family: serif;        /* Classic readable font */
    line-height: 1.6;          /* Good line spacing */
    font-size: 1.1em;          /* Slightly larger base font */
}

h1, h2, h3, h4 {
    color: #FFFFFF; 
    border-bottom: 1px solid #444; 
    padding-bottom: 5px;
}

h1.title {
    font-size: 3em; 
    font-weight: bold;
    border-bottom: none; /* Looks cleaner without the line on the main title */
}

/* Link Styling */
a:link {
    color: #BB86FC; 
    text-decoration: none;
}

a:visited {
    color: #A090D0; 
}

/* ==========================================================================
   BLOCK INSERTS: Harmonious Spacing for Media, Tables, and Code
   ========================================================================== */

/* 1. Universal Breathing Room */
figure, table, pre, blockquote {
    margin-top: 2.5em;
    margin-bottom: 2.5em;
}

/* 2. Media Centering & Constraints */
figure {
    display: block;
    text-align: center; 
    margin-left: auto;
    margin-right: auto;
}

img, video, audio {
    max-width: 100%; 
    height: auto;
    display: block;
    margin: 0 auto;  
}

/* 3. Refined Captions (Adapted for Dark Theme) */
figcaption, caption {
    margin-top: 0.75em; 
    font-style: italic;
    font-size: 0.9em;
    color: #A0A0A0; /* Softened gray to match your blockquote text */
    text-align: center;
    line-height: 1.4;
}

/* 4. Elegant Academic Tables (Adapted for Dark Theme) */
table {
    border-collapse: collapse;
    width: auto; 
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

th, td {
    border: 1px solid #444444; /* Dark gridlines */
    padding: 8px 12px;
    text-align: left;
}

th {
    background-color: #1E1E1E; /* Matches your code block background */
    font-weight: bold;
    color: #FFFFFF;
}

/* 5. Code Blocks & Quotes (Preserving your purple accent) */
pre, blockquote {
    background-color: #1E1E1E; 
    border-left: 5px solid #BB86FC;
    padding: 1.2em;
    color: #A0A0A0;
    overflow-x: auto; /* Adds horizontal scroll if lines are too long */
}

/* Forces standard monospace for code */
code, pre {
    font-family: 'Consolas', 'Fira Code', 'Courier New', Courier, monospace;
    font-size: 0.95em;
}

/* Inline code (small bits of code inside a normal paragraph) */
p code, li code {
    background-color: #1E1E1E;
    color: #BB86FC; /* Pops the inline code with your accent color */
    padding: 0.1em 0.3em;
    border-radius: 3px;
}
