/* Base styles */
:root {
    --bg: #fafafa;
    --text: #1a1a1a;
    --text-muted: #666;
    --accent: #0066cc;
    --border: #e0e0e0;
    --article-bg: #ffffff;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1a1a1a;
        --text: #e0e0e0;
        --text-muted: #999;
        --accent: #66b3ff;
        --border: #333;
        --article-bg: #242424;
    }
}

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

html {
    font-size: 18px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Layout */
header, main, footer {
    max-width: 700px;
    width: 100%;
    margin: 0 auto;
    padding: 0 1.5rem;
}

header {
    padding-top: 3rem;
    padding-bottom: 2rem;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

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

main {
    flex: 1;
}

footer {
    padding: 3rem 1.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Article list (index page) */
.articles article {
    margin-bottom: 1.5rem;
}

.articles article a {
    display: block;
    padding: 1.25rem;
    background: var(--article-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s;
}

.articles article a:hover {
    border-color: var(--accent);
}

.articles article h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text);
}

.articles article time {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.articles article p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Article page */
.article-header {
    margin-bottom: 2rem;
}

.article-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.article-header time {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.article-content {
    font-size: 1rem;
}

.article-content p {
    margin-bottom: 1.25rem;
}

.article-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.article-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.article-content ul, 
.article-content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content a {
    color: var(--accent);
    text-decoration: underline;
}

.article-content a:hover {
    text-decoration: none;
}

.article-content blockquote {
    border-left: 3px solid var(--border);
    padding-left: 1rem;
    margin: 1.25rem 0;
    color: var(--text-muted);
    font-style: italic;
}

.article-content code {
    font-family: 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.9em;
    background: var(--border);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.article-content pre {
    background: var(--article-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    margin-bottom: 1.25rem;
}

.article-content pre code {
    background: none;
    padding: 0;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.25rem 0;
}

/* Back link */
.back-link {
    display: inline-block;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
}

.back-link:hover {
    color: var(--accent);
}

/* Categories section */
.categories {
    margin-bottom: 3rem;
}

.categories h2,
.articles h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.category-link {
    display: flex;
    flex-direction: column;
    padding: 1rem 1.25rem;
    background: var(--article-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s;
    min-width: 140px;
}

.category-link:hover {
    border-color: var(--accent);
}

.category-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
}

.category-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Article meta with category tag */
.article-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.article-meta time {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.category-tag {
    font-size: 0.75rem;
    color: var(--accent);
    background: var(--bg);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--border);
}

/* Updated article card for h3 */
.articles article h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text);
}

/* Category page header */
.category-header {
    margin-bottom: 2rem;
}

.category-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.category-header p {
    color: var(--text-muted);
}
