/* Blog-specific styles, built on tokens defined in site.css */

/* Reading progress bar */
#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0;
    background: var(--accent);
    z-index: 200;
    transition: width 0.1s linear;
}

/* Main layout */
.post-main,
.blog-main {
    padding-top: 80px;
    min-height: 100vh;
}

.post-container {
    max-width: 760px;
}

/* Blog index header */
.blog-header {
    padding: 48px 0 40px;
}

/* Post header */
.post-header {
    padding: 48px 0 36px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 40px;
}

.post-title {
    font-family: var(--font-display);
    font-size: clamp(34px, 5.2vw, 56px);
    font-weight: 400;
    line-height: 1.1;
    margin-bottom: 16px;
    color: var(--text-heading);
}

.post-dek {
    font-size: 18px;
    color: var(--text-muted);
    line-height: 1.65;
    margin-bottom: 20px;
    max-width: 680px;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Cover image */
.post-cover {
    width: 100%;
    border-radius: var(--radius);
    margin-bottom: 40px;
    display: block;
}

/* Post body prose */
.post-body {
    font-size: 18px;
    line-height: 1.8;
    color: var(--text);
}

.post-body h2 {
    font-family: var(--font-display);
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 400;
    margin: 2.4em 0 0.8em;
    line-height: 1.2;
    color: var(--text-heading);
}

.post-body h3 {
    font-family: var(--font-body);
    font-size: 18px;
    font-weight: 600;
    margin: 2em 0 0.6em;
    color: var(--text-heading);
}

.post-body p { margin-bottom: 1.4em; }

.post-body a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.post-body ul,
.post-body ol {
    margin: 0 0 1.4em 1.4em;
}

.post-body li { margin-bottom: 0.4em; }

.post-body blockquote {
    border-left: 3px solid var(--accent);
    margin: 2em 0;
    padding: 0.6em 1.4em;
    font-style: italic;
    color: var(--text-muted);
}

.post-body code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--surface-2);
    padding: 2px 6px;
    border-radius: 4px;
}

.post-body .codehilite {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    overflow-x: auto;
    margin: 1.6em 0;
    font-size: 14px;
    line-height: 1.65;
}

.post-body .codehilite code {
    background: none;
    padding: 0;
}

.post-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.6em 0;
    font-size: 15px;
}

.post-body th {
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    border-bottom: 2px solid var(--border);
    padding: 8px 12px;
    text-align: left;
}

.post-body td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
}

.post-body img {
    max-width: 100%;
    border-radius: var(--radius);
    display: block;
    margin: 1.6em 0;
}

/* Section anchor links (generated by toc permalink) */
.post-body .headerlink {
    opacity: 0;
    margin-left: 10px;
    font-weight: 400;
    color: var(--text-muted);
    text-decoration: none;
}
.post-body h2:hover .headerlink,
.post-body h3:hover .headerlink { opacity: .6; }

/* Table of contents (generated by toc extension) */
.post-body .toc {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin: 2em 0;
    font-size: 15px;
}

.post-body .toc ul { margin: 0.4em 0 0 1.2em; }
.post-body .toc li { margin-bottom: 0.2em; }

/* Post footer */
.post-footer {
    padding: 40px 0;
    border-top: 1px solid var(--border);
    margin-top: 56px;
}

/* Blog index list */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 64px;
}

.post-row {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 28px 32px;
}

.post-row:hover { opacity: 1; }

.post-row-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.post-row-title {
    font-family: var(--font-display);
    font-size: clamp(20px, 2.4vw, 26px);
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: 10px;
    color: var(--text);
}

.post-row-desc {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.65;
    margin-bottom: 16px;
}

.post-row-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

@media (max-width: 640px) {
    .post-row { padding: 20px; }
    .post-body { font-size: 17px; }
}
