/* Blog Header */

.blog-header {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    padding: 2.5rem 0 2rem;
}

.blog-header-home {
    font-family: "Syne", sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.01em;
    transition: color 0.15s;
}

.blog-header-home:hover {
    color: var(--purple);
}

.blog-header-divider {
    color: var(--purple);
    font-family: "Syne", sans-serif;
    font-size: 1rem;
    opacity: 0.7;
}

.blog-header-title {
    font-family: "Syne", sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
}

/* Blog Section Layout */

.blog-section {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 0 3.5rem;
    padding: 3rem 0;
    border-bottom: 1px solid var(--border);
}

.blog-section-head {
    padding-top: 0.15rem;
}

.blog-section-head h2 {
    font-family: "Syne", sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.blog-section-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Post Meta Header (individual post) */

.post-meta-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding-top: 0.2rem;
}

.post-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.03em;
}

.post-category {
    font-family: "Syne", sans-serif;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--purple);
    background: var(--purple-faint);
    border: 1px solid var(--purple-dim);
    padding: 0.18rem 0.55rem;
    border-radius: 3px;
}

.post-category a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s;
}

.post-category a:hover {
    color: var(--purple-bright);
}

/* Post Title (individual post) */

.post-title {
    font-family: "Syne", sans-serif;
    font-size: clamp(1.4rem, 3.5vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.15;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* Post Content (rendered markdown) */

.post-content {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.85;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
    font-family: "Syne", sans-serif;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-top: 2rem;
    margin-bottom: 0.6rem;
}

.post-content h1 {
    font-size: 1.5rem;
    font-weight: 800;
}
.post-content h2 {
    font-size: 1.2rem;
    font-weight: 700;
}
.post-content h3 {
    font-size: 1rem;
    font-weight: 700;
}
.post-content h4 {
    font-size: 0.9rem;
    font-weight: 600;
}

.post-content p {
    margin-bottom: 1.1rem;
}

.post-content a {
    color: var(--purple);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: var(--purple-dim);
    transition:
        color 0.15s,
        text-decoration-color 0.15s;
}

.post-content a:hover {
    color: var(--purple-bright);
    text-decoration-color: var(--purple);
}

.post-content code {
    font-size: 0.85em;
    background: var(--bg-raised);
    border: 1px solid var(--border-mid);
    padding: 0.15em 0.4em;
    border-radius: 3px;
    color: var(--purple-bright);
    font-family: "Syne", monospace;
}

.post-content pre {
    background: var(--bg-surface);
    border: 1px solid var(--border-mid);
    border-radius: 6px;
    padding: 1.25rem 1.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.post-content pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.post-content blockquote {
    border-left: 3px solid var(--purple);
    margin: 1.5rem 0;
    padding: 0.75rem 1.25rem;
    background: var(--bg-card);
    border-radius: 0 6px 6px 0;
    color: var(--text-secondary);
    font-style: italic;
}

.post-content ul,
.post-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1.1rem;
    color: var(--text-secondary);
}

.post-content li {
    margin-bottom: 0.35rem;
}

.post-content hr {
    border: none;
    height: 1px;
    background: var(--border-mid);
    margin: 2rem 0;
}

.post-content img {
    max-width: 100%;
    border-radius: 6px;
    border: 1px solid var(--border-mid);
}

/* Blog Post Card (listing) */

.blog-post-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-mid);
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    transition:
        border-color 0.2s,
        background 0.2s;
}

.blog-post-card:hover {
    border-color: var(--purple-dim);
    background: var(--bg-card);
}

.blog-post-card + .blog-post-card {
    margin-top: 1rem;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.post-meta .post-date {
    font-size: 0.78rem;
    color: var(--text-muted);
    letter-spacing: 0.03em;
}

.post-meta .post-category a {
    font-family: "Syne", sans-serif;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--purple);
    text-decoration: none;
    transition: color 0.15s;
}

.post-meta .post-category a:hover {
    color: var(--purple-bright);
}

.blog-post-card h3 {
    font-family: "Syne", sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.blog-post-card h3 a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.15s;
}

.blog-post-card h3 a:hover {
    color: var(--purple-bright);
}

.blog-post-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.read-more {
    font-size: 0.78rem;
    color: var(--purple);
    text-decoration: none;
    letter-spacing: 0.03em;
    width: fit-content;
    transition: color 0.15s;
}

.read-more:hover {
    color: var(--purple-bright);
}

/* Pagination */

.blog-pagination {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 1rem;
    position: relative;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: "Syne", sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--purple-bright);
    text-decoration: none;
    border: 1px solid var(--purple-dim);
    padding: 0.45rem 1rem;
    border-radius: 4px;
    background: var(--purple-faint);
    white-space: nowrap;
    transition:
        background 0.15s,
        border-color 0.15s,
        color 0.15s;
}

.pagination-btn:hover {
    background: var(--purple-dim);
    border-color: var(--purple-mid);
    color: #fff;
}

.pagination-btn.next-btn {
    margin-left: auto;
}

.page-info {
    font-size: 0.78rem;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

/* Back bar */

.blog-back-bar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem 0 3rem;
    flex-wrap: wrap;
}

.blog-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.825rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s;
}

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

.blog-back-link .icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.6;
}

.blog-back-link:hover .icon {
    opacity: 1;
}

/* 404 */

.blog-404 .blog-section-head h2 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--purple);
}

/* Responsive */

@media (max-width: 680px) {
    .blog-header {
        padding: 2rem 0 1.5rem;
    }

    .blog-section {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 2.25rem 0;
    }

    .blog-pagination {
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .page-info {
        position: static;
        transform: none;
        order: -1;
        width: 100%;
    }

    .pagination-btn.next-btn {
        margin-left: 0;
    }
}

@media (min-width: 681px) and (max-width: 860px) {
    .blog-section {
        grid-template-columns: 160px 1fr;
        gap: 0 2.5rem;
    }
}
