/* Shared base styles — readable minimalism inspired by simonwillison.net */

:root {
    --text: #1a1a1a;
    --text-secondary: #555;
    --text-muted: #888;
    --bg: #fff;
    --bg-secondary: #f5f5f5;
    --border: #ddd;
    --link: #0066cc;
    --link-visited: #551a8b;
    --accent: #d00;
    --code-bg: #f4f4f4;
    --code-border: #ddd;
    --blockquote-border: #ccc;
    --max-width: 740px;
}

[data-theme="dark"] {
    --text: #e0e0e0;
    --text-secondary: #aaa;
    --text-muted: #777;
    --bg: #1a1a1a;
    --bg-secondary: #252525;
    --border: #333;
    --link: #6baaef;
    --link-visited: #b39ddb;
    --accent: #f44;
    --code-bg: #2d2d2d;
    --code-border: #444;
    --blockquote-border: #555;
}

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

html {
    font-size: 16px;
}

body {
    font-family: Georgia, 'Times New Roman', Times, serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* --- Layout --- */

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Header / Nav --- */

header {
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
    margin-bottom: 40px;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px;
}

header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
}

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

header h1 a:hover {
    text-decoration: underline;
}

header nav {
    display: flex;
    gap: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.9rem;
}

header nav a {
    color: var(--text-secondary);
    text-decoration: none;
}

header nav a:hover {
    color: var(--link);
    text-decoration: underline;
}

/* --- Links --- */

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

a:visited {
    color: var(--link-visited);
}

a:hover {
    text-decoration: underline;
}

/* --- Typography --- */

h1, h2, h3, h4, h5, h6 {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.3;
    color: var(--text);
}

/* --- Footer --- */

footer {
    border-top: 1px solid var(--border);
    padding: 30px 0;
    margin-top: 60px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}

/* --- Tags --- */

.tag {
    display: inline-block;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.8rem;
    color: var(--link);
    text-decoration: none;
    padding: 0;
    margin-right: 4px;
}

.tag::before {
    content: '#';
}

.tag:hover {
    text-decoration: underline;
}

/* --- Utility --- */

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.error {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    padding: 16px 20px;
    color: var(--text);
    font-size: 0.95rem;
}

.error strong {
    display: block;
    margin-bottom: 6px;
}

/* --- Theme Toggle --- */

.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.theme-toggle:hover {
    border-color: var(--text-muted);
    color: var(--text);
}

/* --- Responsive --- */

@media (max-width: 600px) {
    html {
        font-size: 15px;
    }

    header .container {
        flex-direction: column;
        gap: 8px;
    }

    .container {
        padding: 0 16px;
    }
}
