/* ===== Post Page Specific Styles ===== */

/* Post Header */
.post-header {
    max-width: var(--content-width);
    margin: 0 auto var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-light);
}

.post-header .post-meta {
    margin-bottom: var(--space-lg);
}

.post-header .post-title {
    font-family: var(--font-display);
    font-size: var(--text-4xl);
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-lg);
}

.post-header .post-excerpt {
    font-size: var(--text-xl);
    line-height: 1.6;
    color: var(--text-secondary);
}

.post-author {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-top: var(--space-xl);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--border-light);
}

.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: var(--text-xl);
    color: var(--accent);
}

.author-info {
    flex: 1;
}

.author-name {
    font-weight: 500;
    margin-bottom: var(--space-xs);
}

.author-bio {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.reading-time {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-muted);
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-secondary);
    border-radius: 2px;
}

/* Post Content */
.post-content {
    max-width: var(--content-width);
    margin: 0 auto;
    width: 100%;
}

.post-content h1 {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: 500;
    margin-top: var(--space-3xl);
    margin-bottom: var(--space-sm);
    letter-spacing: -0.02em;
}

.post-content h2 {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 500;
    margin-top: var(--space-2xl);
    margin-bottom: var(--space-sm);
    letter-spacing: -0.02em;
}

.post-content h3 {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 500;
    margin-top: var(--space-lg);
    margin-bottom: var(--space-xs);
}

.post-content h4 {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 600;
    margin-top: var(--space-md);
    margin-bottom: var(--space-xs);
}

.post-content > :first-child {
    margin-top: 0;
}

.post-content h1 + h2,
.post-content h2 + h3,
.post-content h3 + h4 {
    margin-top: var(--space-sm);
}

.post-content p {
    margin-bottom: var(--space-lg);
    font-size: var(--text-lg);
    line-height: 1.8;
}

.post-content a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: text-decoration-color var(--transition-fast);
}

.post-content a:hover {
    text-decoration-color: transparent;
}

.post-content strong {
    font-weight: 600;
}

.post-content em {
    font-style: italic;
}

/* Lists */
.post-content ul,
.post-content ol {
    margin-bottom: var(--space-lg);
    padding-left: var(--space-xl);
}

.post-content li {
    margin-bottom: var(--space-sm);
    font-size: var(--text-lg);
    line-height: 1.7;
}

.post-content ul li::marker {
    color: var(--accent);
}

.post-content ol li::marker {
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
}

/* Blockquotes */
.post-content blockquote {
    margin: var(--space-2xl) 0;
    padding: var(--space-lg) var(--space-xl);
    border-left: 3px solid var(--accent);
    background: var(--bg-secondary);
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-style: italic;
    line-height: 1.6;
}

.post-content blockquote p:last-child {
    margin-bottom: 0;
}

/* Code Blocks */
.post-content code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--bg-secondary);
    padding: 0.15em 0.4em;
    border-radius: 3px;
    border: 1px solid var(--border-light);
}

.post-content pre {
    margin: var(--space-lg) 0;
    padding: var(--space-xl);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow-x: auto;
    position: relative;
}

.post-content pre code {
    background: none;
    padding: 0;
    border: none;
    font-size: var(--text-sm);
    line-height: 1.7;
    color: var(--text-primary);
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-xl);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    margin-top: var(--space-2xl);
}

.code-header + pre {
    margin-top: 0;
    border-radius: 0 0 4px 4px;
}

.code-lang {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.code-copy {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.code-copy:hover {
    color: var(--accent);
}

/* Images */
.post-content img {
    margin: var(--space-2xl) 0;
    border-radius: 4px;
    border: 1px solid var(--border-light);
}

.post-content figure {
    margin: var(--space-3xl) 0;
}

.post-content figure img {
    margin: 0;
}

.post-content figcaption {
    margin-top: var(--space-md);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--text-muted);
    text-align: center;
}

/* Full-width images */
.post-content .full-width {
    width: 100vw;
    max-width: none;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    border-radius: 0;
    border-left: none;
    border-right: none;
}

/* Math/LaTeX */
.post-content .math-block {
    margin: var(--space-2xl) 0;
    padding: var(--space-xl);
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow-x: auto;
    text-align: center;
}

.post-content .math-inline {
    padding: 0 0.2em;
}

/* Tables */
.post-content table {
    width: 100%;
    margin: var(--space-2xl) 0;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.post-content th {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: left;
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border-color);
}

.post-content td {
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-light);
}

.post-content tr:hover {
    background: var(--bg-secondary);
}

/* Horizontal Rule */
.post-content hr {
    border: none;
    height: 1px;
    background: var(--border-color);
    margin: var(--space-3xl) 0;
}

/* Footnotes */
.post-content .footnote {
    font-size: var(--text-sm);
    color: var(--accent);
    vertical-align: super;
}

.post-content .footnotes {
    margin-top: var(--space-4xl);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--border-color);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* Info/Warning/Note boxes */
.post-content .note,
.post-content .warning,
.post-content .info {
    margin: var(--space-2xl) 0;
    padding: var(--space-lg) var(--space-xl);
    border-radius: 4px;
    font-size: var(--text-base);
}

.post-content .note {
    background: rgba(13, 148, 136, 0.08);
    border-left: 3px solid var(--accent-secondary);
}

.post-content .warning {
    background: rgba(67, 56, 202, 0.08);
    border-left: 3px solid var(--accent);
}

.post-content .info {
    background: var(--bg-secondary);
    border-left: 3px solid var(--text-muted);
}

/* Post Navigation */
.post-nav {
    max-width: var(--content-width);
    margin: var(--space-4xl) auto 0;
    padding-top: var(--space-2xl);
    border-top: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
}

.post-nav-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.post-nav-item.next {
    text-align: right;
}

.post-nav-label {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.post-nav-title {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    color: var(--text-primary);
    transition: color var(--transition-fast);
}

.post-nav-item:hover .post-nav-title {
    color: var(--accent);
}

/* Table of Contents */
.toc {
    padding-left: var(--space-xl);
    border-left: 1px solid var(--border-light);
    width: 250px;
}

.toc-title {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.toc-list {
    list-style: none;
    padding: 0;
}

.toc-list li {
    margin-bottom: var(--space-sm);
}

.toc-list a {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.toc-list a:hover,
.toc-list a.active {
    color: var(--accent);
}

.toc-list .toc-sub {
    padding-left: var(--space-md);
}

/* Post layout - content aligned with header, TOC extends to the right */
.post-layout {
    max-width: var(--content-width);
    margin: 0 auto;
    position: relative;
}

.toc {
    position: absolute;
    left: calc(100% + var(--space-3xl));
    top: 0;
}

@media (max-width: 1100px) {
    .toc {
        display: none;
    }
}

@media (max-width: 600px) {
    .post-header .post-title {
        font-size: var(--text-3xl);
    }

    .post-content h2 {
        font-size: var(--text-2xl);
    }

    .post-content h3 {
        font-size: var(--text-xl);
    }

    .post-content p,
    .post-content li {
        font-size: var(--text-base);
    }

    .post-nav {
        grid-template-columns: 1fr;
    }

    .post-nav-item.next {
        text-align: left;
    }
}
