/* ── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #fafafa;
    --text: #1a1a1a;
    --text-light: #666;
    --link: #0056d2;
    --code-bg: #f0f0f0;
    --accent: #007aff;
    --border: #e0e0e0;
    --max-width: 720px;
}

html { font-size: 18px; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
}

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

/* ── Header ────────────────────────────────────────────────────── */
.site-header {
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 0;
    margin-bottom: 2.5rem;
}
.site-header .container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}
.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
}
.site-nav { display: flex; gap: 1rem; flex-wrap: wrap; }
.site-nav a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
}
.site-nav a:hover { color: var(--link); }

/* ── Footer ────────────────────────────────────────────────────── */
.site-footer {
    border-top: 1px solid var(--border);
    margin-top: 3rem;
    padding: 1.5rem 0;
    text-align: center;
    color: var(--text-light);
    font-size: 0.85rem;
}

/* ── Homepage ──────────────────────────────────────────────────── */
.site-tagline {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text-light);
    margin-bottom: 2.5rem;
    line-height: 1.5;
}
.article-list { display: flex; flex-direction: column; gap: 2rem; }
.article-card h2 { font-size: 1.3rem; margin-bottom: 0.25rem; }
.article-card h2 a { color: var(--text); text-decoration: none; }
.article-card h2 a:hover { color: var(--link); }
.article-meta { font-size: 0.85rem; color: var(--text-light); margin-bottom: 0.5rem; }
.article-meta a { color: var(--text-light); text-decoration: none; }
.article-meta a:hover { color: var(--link); }
.separator { margin: 0 0.35rem; }
.article-desc { color: var(--text-light); font-size: 0.95rem; line-height: 1.6; }

/* ── Article ───────────────────────────────────────────────────── */
.post-header { margin-bottom: 2rem; }
.post-header h1 { font-size: 1.8rem; line-height: 1.3; margin-bottom: 0.5rem; }
.post-meta { font-size: 0.9rem; color: var(--text-light); }
.category-link { color: var(--link); text-decoration: none; }

.post-content { font-size: 1rem; line-height: 1.8; }
.post-content h2 { font-size: 1.4rem; margin: 2rem 0 0.75rem; }
.post-content h3 { font-size: 1.15rem; margin: 1.5rem 0 0.5rem; }
.post-content p { margin-bottom: 1.25rem; }
.post-content ul, .post-content ol { margin: 0 0 1.25rem 1.5rem; }
.post-content li { margin-bottom: 0.4rem; }
.post-content a { color: var(--link); }
.post-content pre {
    background: var(--code-bg);
    padding: 1rem 1.25rem;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 1.25rem;
}
.post-content code {
    background: var(--code-bg);
    padding: 0.15em 0.35em;
    border-radius: 3px;
    font-size: 0.9em;
}
.post-content pre code { background: none; padding: 0; }
.post-content blockquote {
    border-left: 3px solid var(--accent);
    margin: 0 0 1.25rem;
    padding: 0.5rem 0 0.5rem 1rem;
    color: var(--text-light);
}

/* ── Ad Slots ──────────────────────────────────────────────────── */
.ad-slot {
    text-align: center;
    margin: 2rem 0;
    padding: 0.5rem 0;
    min-height: 90px;
    background: var(--border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 0.8rem;
}

/* ── Post Tags ─────────────────────────────────────────────────── */
.post-tags { margin: 2rem 0; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.tag {
    background: var(--code-bg);
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    font-size: 0.8rem;
    color: var(--text-light);
}

/* ── Related Posts ─────────────────────────────────────────────── */
.related-posts {
    border-top: 1px solid var(--border);
    margin-top: 2rem;
    padding-top: 1.5rem;
}
.related-posts h2 { font-size: 1.1rem; margin-bottom: 0.75rem; }
.related-posts ul { list-style: none; }
.related-posts li { margin-bottom: 0.5rem; }
.related-posts a { color: var(--link); text-decoration: none; }
.related-posts .related-date { color: var(--text-light); font-size: 0.85rem; margin-left: 0.5rem; }

/* ── Category Page ──────────────────────────────────────────────── */
.category-page h1 { margin-bottom: 0.5rem; }
.category-desc {
    color: var(--text-light);
    margin-bottom: 2rem;
    font-size: 1rem;
}

/* ── Empty State ────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 0;
    color: var(--text-light);
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
    html { font-size: 16px; }
    .post-header h1 { font-size: 1.5rem; }
    .site-header .container { flex-direction: column; align-items: flex-start; }
    .site-nav { gap: 0.75rem; }
}
