/* === Shared Blog Post Styles === */
body {
    min-height: 100vh;
}

.page-post {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* === Header === */
.header-post {
    position: relative;
    display: flex;
    align-items: center;
    padding: var(--space-6);
    gap: var(--space-6);
}

.header-post .logo {
    font-size: var(--text-xs);
    white-space: nowrap;
}

.nav-header {
    position: absolute;
    left: 50%;
    display: flex;
    gap: var(--space-6);
}

.nav-header .nav-link {
    font-size: var(--text-xs);
}

/* === Back Link === */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--fg-faded);
    padding: 0 var(--space-6);
    margin-bottom: var(--space-8);
    transition: color 0.2s ease;
}

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

.back-link .arrow {
    transition: transform 0.2s ease;
}

.back-link:hover .arrow {
    transform: translateX(-3px);
}

/* === Content Card === */
.content-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    border: var(--border-medium);
    background: var(--bg-card);
    margin: 0 var(--space-4);
    margin-bottom: var(--space-8);
}

/* === Hero Image === */
.post-hero {
    height: 16rem;
    overflow: hidden;
}

.post-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* === Content Grid === */
.post-grid {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* === Article Content === */
.post-content {
    flex: 1;
    padding: var(--space-6);
}

.post-title {
    font-family: "Playfair Display", serif;
    font-size: var(--text-h1);
    font-weight: 400;
    line-height: 1.15;
    margin-bottom: var(--space-4);
}

.post-header {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

.post-header-main {
    min-width: 0;
}

.post-subtitle {
    font-size: 1.125rem;
    color: var(--fg-muted);
    line-height: 1.75;
    margin-bottom: 0;
    max-width: 42rem;
    font-style: italic;
}

.post-meta-inline {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-6);
    align-items: flex-start;
}

.post-meta-inline .metadata-item {
    border-bottom: none;
    padding-bottom: 0;
}

.post-meta-inline .metadata-label {
    letter-spacing: 0.12em;
    color: var(--fg-faded);
}

.post-meta-inline .metadata-value {
    font-size: var(--text-xs);
    font-weight: 500;
    line-height: 1.55;
}

.post-body {
    font-size: 1.125rem;
    line-height: 1.92;
    color: var(--fg-ink);
    text-wrap: pretty;
    width: 100%;
}

.post-body > :not(figure.post-figure) {
    max-width: 44rem;
    margin-left: auto;
    margin-right: auto;
}

.post-body p {
    margin-bottom: var(--space-8);
}

/* Opt-in paragraph sizing for emphasized sections */
.post-body p.post-p-large {
    font-size: var(--post-p-large-size, 1.125em);
    line-height: var(--post-p-large-line-height, 1.9);
}

.post-body p.post-p-xl {
    font-size: var(--post-p-xl-size, 1.25em);
    line-height: var(--post-p-xl-line-height, 1.85);
}

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

/* === Legacy Metadata Containers (unused) === */
.metadata-sidebar,
.metadata-row {
    display: none;
}
/* === Footer === */
.footer-post {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-6);
}

.footer-email {
    font-size: var(--text-xxs);
    color: var(--fg-faded);
    letter-spacing: 0.04em;
}

.footer-email a {
    color: var(--fg-muted);
    transition: color 0.2s ease;
}

.footer-email a:hover {
    color: var(--fg-ink);
}

.footer-social {
    display: flex;
    gap: var(--space-6);
}

.footer-social a {
    font-size: var(--text-xxs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--fg-faded);
    transition: color 0.2s ease;
}

.footer-social a:hover {
    color: var(--fg-ink);
}

/* === Responsive === */
@media (max-width: 640px) {
    .header-post {
        flex-wrap: wrap;
    }

    .nav-header {
        gap: var(--space-4);
    }

    .footer-post {
        flex-direction: column;
        gap: var(--space-3);
        align-items: flex-start;
    }
}

@media (min-width: 768px) {
    .header-post .logo {
        font-size: var(--text-sm);
    }

    .content-card {
        margin: 0 var(--space-6) var(--space-8);
    }

    .post-hero {
        height: 20rem;
    }

    .post-content {
        padding: calc(var(--space-8) + 0.25rem);
    }

    .post-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 180px;
        column-gap: calc(var(--space-8) + 0.25rem);
        align-items: start;
        margin-bottom: calc(var(--space-8) + var(--space-2));
    }

    .post-meta-inline {
        flex-direction: column;
        gap: var(--space-4);
        margin-top: var(--space-3);
    }

    .back-link {
        padding: 0 var(--space-6);
    }
}

@media (min-width: 1024px) {
    .post-hero {
        height: 24rem;
    }

    .post-header {
        grid-template-columns: minmax(0, 1fr) 220px;
    }
}

@media (min-width: 1200px) {
    .content-card {
        max-width: 1100px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* === Figures & Captions === */
figure.post-figure {
    margin: calc(var(--space-12) + var(--space-2)) auto;
    width: 100%;
    max-width: none;
    padding: 0;
}

figure.post-figure--breakout-right {
    /* Legacy wide-figure modifier: keep centered, optionally cap width. */
    --figure-max-width: 72rem;
    width: min(100%, var(--figure-max-width));
    margin-left: auto;
    margin-right: auto;
}

figure.post-figure img {
    width: 100%;
    border: var(--border-subtle);
    display: block;
}

figure.post-figure figcaption {
    font-size: var(--text-xs);
    color: var(--fg-faded);
    text-align: center;
    margin-top: var(--space-4);
    font-style: italic;
    font-family: "Inter", sans-serif;
    line-height: 1.7;
    max-width: 42rem;
    margin-left: auto;
    margin-right: auto;
}
