/* css/main.css - Dark theme with good support for white/light-background diagrams */

:root {
    --bg-page:       #0d1117;        /* GitHub-dark-like main background */
    --bg-section:    #161b22;        /* Slightly lighter for sections/cards */
    --text-primary:  #c9d1d9;
    --text-secondary:#8b949e;
    --accent:        #58a6ff;
    --accent-hover:  #79c0ff;
    --border:        #30363d;
    --code-bg:       #0d1117;
    --header-bg:     #21262d;
    --header-text:   #f0f6fc;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Charter', Georgia, serif;
    line-height: 1.7;
    background: var(--bg-page);
    color: var(--text-primary);
    min-height: 100vh;
}

.page-header {
    background: var(--header-bg);
    color: var(--header-text);
    padding: 3.5rem 1rem 2.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.page-header h1 {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(2.2rem, 5vw, 3rem);
    margin: 0 0 0.6rem;
}

.page-header p {
    font-size: 1.25rem;
    opacity: 0.9;
    margin: 0;
}

.content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}

.section {
    background: var(--bg-section);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 6px 20px rgba(0,0,0,0.35);
}

h2 {
    font-family: 'Poppins', sans-serif;
    color: #f0f6fc;
    font-size: 2rem;
    margin: 0 0 1.3rem;
}

p, li {
    margin-bottom: 1.1rem;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* ────────────────────────────────────────────────
   Images / Diagrams (white/light backgrounds look good)
   ──────────────────────────────────────────────── */
img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 2rem auto;
    border-radius: 8px;
    border: 1px solid #2d333b;              /* subtle dark border */
    box-shadow: 0 10px 30px rgba(0,0,0,0.45); /* soft lift from dark bg */
    background-color: #ffffff;               /* force white bg for transparent PNGs */
    padding: 0.6rem;                         /* small breathing room inside border */
    transition: transform 0.15s ease, box-shadow 0.25s ease;
}

img:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.55);
}

/* Code blocks */
pre {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    overflow-x: auto;
    margin: 1.6rem 0;
    font-size: 0.97rem;
}

code {
    font-family: 'Fira Code', 'Consolas', monospace;
    color: #d2a8ff;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.6rem 0;
}

th, td {
    border: 1px solid var(--border);
    padding: 1rem;
    text-align: left;
}

th {
    background: #21262d;
    color: #f0f6fc;
    font-weight: 600;
}

/* References / small text */
.references {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* MathJax equations usually render with white bg → looks fine in dark theme */
mjx-container {
    margin: 1.2rem 0 !important;
}

/* Responsive */
@media (max-width: 768px) {
    .content {
        padding: 1.5rem 1rem;
    }
    .page-header {
        padding: 2.5rem 1rem 1.8rem;
    }
    h2 {
        font-size: 1.75rem;
    }
    img {
        margin: 1.5rem auto;
        padding: 0.4rem;
    }
}
