/* ── Reset & base ─────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #fafaf8;
    color: #1c1c1e;
    line-height: 1.7;
    padding: 2rem 1rem;
}

.container {
    max-width: 780px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ── Header ────────────────────────────────────── */
.site-header {
    border-bottom: 2px solid #eaeaea;
    padding-bottom: 1.5rem;
    margin-bottom: 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.site-title {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-decoration: none;
    color: #1c1c1e;
}

.site-title:hover {
    color: #0066cc;
}

.nav-link {
    color: #555;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    transition: background 0.2s;
}

.nav-link:hover {
    background: #eaeaea;
    color: #1c1c1e;
}

/* ── Blog posts list ───────────────────────────── */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.post-preview {
    padding: 1.5rem 1.8rem;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    border: 1px solid #f0f0ee;
    transition: box-shadow 0.2s, transform 0.15s;
    cursor: pointer;
}

.post-preview:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.post-preview h2 {
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 0.3rem;
}

.post-preview h2 a {
    color: #1c1c1e;
    text-decoration: none;
}

.post-preview h2 a:hover {
    color: #0066cc;
}

.post-meta {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.post-excerpt {
    color: #444;
    font-size: 0.98rem;
}

.post-excerpt p {
    margin: 0;
}

/* ── Single post view ──────────────────────────── */
#post-content {
    background: #ffffff;
    padding: 2.2rem 2.5rem;
    border-radius: 14px;
    border: 1px solid #f0f0ee;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

#post-content .post-title {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.2rem;
    line-height: 1.2;
}

#post-content .post-meta {
    margin-bottom: 1.8rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

#post-content .post-body {
    font-size: 1.05rem;
}

#post-content .post-body h2 {
    font-size: 1.5rem;
    margin-top: 1.8rem;
    margin-bottom: 0.6rem;
    font-weight: 600;
}

#post-content .post-body h3 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 0.4rem;
    font-weight: 600;
}

#post-content .post-body p {
    margin-bottom: 1.2rem;
}

#post-content .post-body ul,
#post-content .post-body ol {
    margin-bottom: 1.2rem;
    padding-left: 1.8rem;
}

#post-content .post-body li {
    margin-bottom: 0.3rem;
}

#post-content .post-body blockquote {
    border-left: 4px solid #0066cc;
    padding-left: 1.2rem;
    margin: 1.2rem 0;
    color: #444;
    background: #f8f8f6;
    padding: 0.8rem 1.2rem;
    border-radius: 0 8px 8px 0;
}

#post-content .post-body code {
    background: #f0f0ee;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'Monaco', 'Menlo', monospace;
}

#post-content .post-body pre {
    background: #1c1c1e;
    color: #f0f0ee;
    padding: 1.2rem 1.5rem;
    border-radius: 10px;
    overflow-x: auto;
    margin: 1.2rem 0;
    font-size: 0.9rem;
    line-height: 1.6;
}

#post-content .post-body pre code {
    background: transparent;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

#post-content .post-body img {
    max-width: 100%;
    border-radius: 10px;
    margin: 1.2rem 0;
}

#post-content .post-body a {
    color: #0066cc;
    text-decoration: underline;
    text-underline-offset: 2px;
}

#post-content .post-body a:hover {
    color: #004c99;
}

/* ── Back link ─────────────────────────────────── */
.back-link {
    display: inline-block;
    margin-bottom: 1.5rem;
    color: #555;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.4rem 0;
}

.back-link:hover {
    color: #0066cc;
}

.back-link::before {
    content: '← ';
}

/* ── Loading & error ───────────────────────────── */
.loading,
.error {
    text-align: center;
    padding: 3rem 1rem;
    color: #888;
    font-size: 1.1rem;
}

.error {
    color: #b33;
}

/* ── Responsive ────────────────────────────────── */
@media (max-width: 600px) {
    .site-header {
        flex-direction: column;
        align-items: flex-start;
    }

    #post-content {
        padding: 1.5rem 1.2rem;
    }

    #post-content .post-title {
        font-size: 1.6rem;
    }

    .post-preview {
        padding: 1.2rem 1.2rem;
    }

    .post-preview h2 {
        font-size: 1.2rem;
    }
}

/* ── Utility ───────────────────────────────────── */
.hidden {
    display: none !important;
}