:root {
    --bg: #ffffff;
    --text: #333333;
    --border-strong: #222222;
    --border-light: #cccccc;
    --footer-text: #777777;
}

/* Automatically switch to dark mode if OS prefers it */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #111111;
        --text: #e5e5e5;
        --border-strong: #ffffff;
        --border-light: #444444;
        --footer-text: #aaaaaa;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
}

h1 {
    font-size: 2.2em;
    margin-bottom: 0.2em;
    border-bottom: 2px solid var(--border-strong);
    padding-bottom: 0.3em;
}

h2 {
    margin-top: 1.5em;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 0.2em;
}

h3 {
    margin-bottom: 0.2em;
}

p {
    margin: 0.5em 0;
}

ul {
    margin: 0.5em 0 1em 1.2em;
}

li {
    margin-bottom: 0.3em;
}

strong {
    font-weight: 600;
}

footer {
    margin-top: 40px;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
    font-size: 0.9em;
    color: var(--footer-text);
    text-align: center;
}

@media print {
    body {
        margin: 0;
    }
}

/* Make images responsive inside markdown content */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Optional: center standalone markdown images */
p>img:only-child {
    margin: 1em auto;
}

/* If markdown wraps images in links */
a>img {
    max-width: 100%;
    height: auto;
}