/* 
 * blogcraft Custom Stylesheet
 * 
 * Organized into logical sections for ease of maintenance.
 * 1. Variables (Theming)
 * 2. Base (Reset & Typography)
 * 3. Layout (Structure)
 * 4. Components (Elements)
 * 5. Utilities (Code, etc.)
 */

:root {
    /* 1. Variables */
    --bg-color: #ffffff;
    --text-color: #222222;
    --link-color: #0074d9;
    --code-bg: #f6f8fa;
    --border-color: #eaeaea;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    --container-width: 800px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #121212;
        --text-color: #e0e0e0;
        --link-color: #58a6ff;
        --code-bg: #1e1e1e;
        --border-color: #333333;
    }
}

/* 2. Base */
body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
}

/* 3. Layout */
body > header,
body > main,
body > footer {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 1rem 1.5rem;
}

header {
    margin-top: 2rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    text-align: center;
    opacity: 0.8;
}

/* 4. Components */
h1, h2, h3, h4, h5, h6 {
    margin-top: 2em;
    margin-bottom: 0.5em;
    line-height: 1.25;
}

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

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* 5. Utilities (Code) */
code {
    font-family: var(--font-mono);
    background-color: var(--code-bg);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
}

pre {
    background-color: var(--code-bg);
    padding: 1rem;
    overflow-x: auto;
    border-radius: 6px;
    margin: 1.5rem 0;
}

pre code {
    background-color: transparent;
    padding: 0;
    font-size: 0.95em;
    color: inherit;
}

/* Navigation */
nav ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
}

.separator {
    padding: 0 0.5rem;
    opacity: 0.5;
}

.site-title {
    text-decoration: none;
    color: inherit;
}

.post-date {
    opacity: 0.6;
    font-size: 0.9em;
    margin-left: 0.5rem;
}