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

/* Post Header */
.post-header {
    padding: 140px 0 48px;
    background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg-alt) 100%);
}

.back-link {
    display: inline-flex;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-muted);
    margin-bottom: 24px;
    transition: color var(--transition-fast);
}

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

.post-header .post-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.post-header .post-date {
    font-size: 0.9375rem;
    color: var(--color-text-muted);
}

.post-header .post-tag {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-accent);
    background: var(--color-accent-light);
    padding: 6px 14px;
    border-radius: var(--radius-full);
}

.post-header .post-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text);
}

/* Post Body */
.post-body {
    padding: 48px 0 80px;
}

/* Typography */
.post-body p {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--color-text);
    margin-bottom: 24px;
}

.post-body .lead {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    line-height: 1.7;
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border-color);
}

.post-body h2 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text);
    margin-top: 48px;
    margin-bottom: 20px;
}

.post-body h3 {
    font-family: var(--font-display);
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--color-text);
    margin-top: 36px;
    margin-bottom: 16px;
}

.post-body h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text);
    margin-top: 28px;
    margin-bottom: 12px;
}

/* Links */
.post-body a {
    color: var(--color-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.post-body a:hover {
    color: var(--color-accent-dark);
}

/* Lists */
.post-body ul,
.post-body ol {
    margin-bottom: 24px;
    padding-left: 24px;
}

.post-body ul {
    list-style: disc;
}

.post-body ol {
    list-style: decimal;
}

.post-body li {
    font-size: 1.0625rem;
    line-height: 1.7;
    margin-bottom: 8px;
    color: var(--color-text);
}

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

/* Code */
.post-body code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.875em;
    background: var(--color-accent-light);
    color: var(--color-accent-dark);
    padding: 2px 8px;
    border-radius: 4px;
}

.post-body pre {
    background: var(--color-text);
    color: #e2e8f0;
    padding: 24px;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin-bottom: 24px;
    font-size: 0.875rem;
    line-height: 1.6;
}

.post-body pre code {
    background: none;
    color: inherit;
    padding: 0;
    font-size: inherit;
}

/* Blockquotes */
.post-body blockquote {
    border-left: 4px solid var(--color-accent);
    background: var(--gradient-subtle);
    padding: 24px 28px;
    margin: 32px 0;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.post-body blockquote p {
    font-size: 1.125rem;
    font-style: italic;
    color: var(--color-text);
    margin-bottom: 8px;
}

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

.post-body blockquote cite {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    font-style: normal;
}

/* Images & Figures */
.post-body figure {
    margin: 32px 0;
}

.post-body figure img {
    width: 100%;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.post-body figcaption {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    text-align: center;
    margin-top: 12px;
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
    margin: 32px 0;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.post-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
    margin: 0;
}

.post-body th,
.post-body td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.post-body th {
    font-weight: 600;
    background: var(--gradient-subtle);
    color: var(--color-text);
    white-space: nowrap;
}

.post-body th:first-child {
    background: var(--color-accent);
    color: white;
}

.post-body td:first-child {
    font-weight: 500;
    background: var(--color-bg);
}

.post-body tr:last-child td {
    border-bottom: none;
}

.post-body tr:hover td {
    background: var(--color-accent-light);
}

.post-body tr:hover td:first-child {
    background: var(--color-bg);
}

.post-body td code {
    font-size: 0.8125rem;
    white-space: nowrap;
}

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

/* Post Navigation */
.post-nav {
    padding: 40px 0;
    border-top: 1px solid var(--border-color);
    background: var(--color-bg);
}

.post-nav .container-narrow {
    display: flex;
    justify-content: space-between;
    gap: 24px;
}

.post-nav-link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 45%;
}

.post-nav-link.next {
    text-align: right;
    margin-left: auto;
}

.post-nav-label {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.post-nav-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    transition: color var(--transition-fast);
}

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

/* Responsive */
@media (max-width: 768px) {
    .post-header {
        padding: 120px 0 40px;
    }

    .post-body {
        padding: 40px 0 60px;
    }

    .post-body h2 {
        font-size: 1.5rem;
        margin-top: 40px;
    }

    .post-body h3 {
        font-size: 1.25rem;
        margin-top: 32px;
    }

    .post-body pre {
        padding: 20px;
        margin-left: -24px;
        margin-right: -24px;
        border-radius: 0;
    }

    .post-body blockquote {
        padding: 20px;
        margin-left: -24px;
        margin-right: -24px;
        border-radius: 0;
    }

    .post-nav .container-narrow {
        flex-direction: column;
    }

    .post-nav-link {
        max-width: 100%;
    }

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