.pcsc-post {
    --post-orange: #ff8617;
    --post-surface: color-mix(in srgb, var(--core-body-background) 91%, var(--core-text-color) 9%);
    --post-surface-raised: color-mix(in srgb, var(--core-body-background) 84%, var(--core-text-color) 16%);
    --post-surface-soft: color-mix(in srgb, var(--core-body-background) 96%, var(--core-text-color) 4%);
    --post-line: color-mix(in srgb, var(--core-text-color) 13%, transparent);
    --post-line-soft: color-mix(in srgb, var(--core-text-color) 8%, transparent);
    --post-shadow: 0 24px 70px color-mix(in srgb, #000 18%, transparent);
    --post-radius: 1.15rem;
    height: calc(100vh - var(--pcsc-header-height, 66px));
    overflow-x: hidden;
    overflow-y: auto;
    color: var(--core-text-color);
    background: var(--core-body-background);
    scroll-behavior: smooth;
    scroll-padding-top: 1.25rem;
}

.pcsc-post *,
.pcsc-post *::before,
.pcsc-post *::after { box-sizing: border-box; }

.pcsc-post h1,
.pcsc-post h2,
.pcsc-post h3,
.pcsc-post p { margin: 0; padding: 0; text-shadow: none; }

.pcsc-post button,
.pcsc-post input,
.pcsc-post select,
.pcsc-post textarea { font: inherit; }

.post-container { width: min(calc(100% - 2rem), 1180px); margin-inline: auto; }

.post-eyebrow {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: .4rem;
    color: var(--post-orange);
    font-size: .73rem;
    font-weight: 850;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.post-eyebrow > span {
    width: 1.65rem;
    height: 2px;
    background: var(--post-orange);
}

.post-muted { color: var(--core-secondary-text-color); }

.post-header {
    padding: 1.35rem 0 1rem;
    background: var(--post-surface-soft);
    border-bottom: 1px solid var(--post-line);
}

.post-header__layout {
    display: grid;
    align-items: center;
    grid-template-columns: minmax(280px, 1fr) auto auto;
    gap: 1.5rem;
}

.post-header__title h1 {
    color: var(--core-text-color);
    font-size: clamp(1.7rem, 3.2vw, 2.55rem);
    line-height: 1.08;
    letter-spacing: -.04em;
}

.post-header__title > p:last-child {
    max-width: 62ch;
    margin-top: .5rem;
    color: var(--core-secondary-text-color);
    font-size: .92rem;
    line-height: 1.55;
}

.post-header__stats {
    display: grid;
    grid-template-columns: repeat(3, auto);
    margin: 0;
    overflow: hidden;
    background: var(--post-surface);
    border: 1px solid var(--post-line);
    border-radius: .7rem;
}

.post-header__stats > div {
    display: grid;
    min-width: 78px;
    gap: .15rem;
    padding: .65rem .85rem;
    border-right: 1px solid var(--post-line-soft);
}

.post-header__stats > div:last-child { border: 0; }

.post-header__stats dt {
    color: var(--core-secondary-text-color);
    font-size: .5rem;
    font-weight: 850;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.post-header__stats dd {
    margin: 0;
    color: var(--core-text-color);
    font-size: 1rem;
    font-weight: 850;
}

.post-header__links { display: grid; gap: .22rem; }

.post-header__links a {
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .3rem .4rem;
    color: var(--core-secondary-text-color) !important;
    font-size: .72rem;
    font-weight: 750;
    text-decoration: none;
    white-space: nowrap;
}

.post-header__links a:hover { color: var(--hyperlink-color-hover, var(--post-orange)) !important; }
.post-header__links i { width: .9rem; color: var(--post-orange); text-align: center; }

.post-main { padding: 1.15rem 0 2.4rem; }

.post-layout {
    display: grid;
    align-items: start;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 1.1rem;
}

.post-article,
.post-rail__card,
.post-comments,
.post-file,
.post-comment-form,
.post-comment-login,
.post-comment {
    background: var(--post-surface);
    border: 1px solid var(--post-line);
    border-radius: var(--post-radius);
}

.post-article { padding: 1.15rem 1.2rem 1.3rem; }

.post-byline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .7rem 1rem;
    margin-bottom: 1rem;
}

.post-byline__avatar,
.post-comment__avatar {
    width: 2.35rem;
    height: 2.35rem;
    object-fit: cover;
    border-radius: 50%;
}

.post-byline a,
.post-comment__meta a,
.post-author,
.post-chip-list a,
.post-related a,
.post-comment__actions a {
    color: var(--hyperlink-color, var(--post-orange)) !important;
    text-decoration: none;
}

.post-byline a:hover,
.post-comment__meta a:hover,
.post-author:hover,
.post-chip-list a:hover,
.post-related a:hover,
.post-comment__actions a:hover {
    color: var(--hyperlink-color-hover, #ffdc45) !important;
}

.post-byline small { display: block; color: var(--core-secondary-text-color); font-size: .78rem; }

.post-byline__badges { display: flex; flex-wrap: wrap; gap: .35rem; margin-left: auto; }

.post-byline__badges span {
    padding: .18rem .55rem;
    border: 1px solid var(--post-line);
    border-radius: 999px;
    color: var(--post-orange);
    font-size: .62rem;
    font-weight: 800;
}

.post-hero {
    margin: 0 0 1.15rem;
    overflow: hidden;
    border-radius: .9rem;
}

.post-hero img {
    display: block;
    width: 100%;
    max-height: 420px;
    object-fit: cover;
}

.post-prose {
    max-width: 78ch;
    overflow-x: auto;
    color: var(--core-text-color);
    font-size: 1.02rem;
    line-height: 1.75;
}

.post-prose > *:first-child { margin-top: 0; }
.post-prose p,
.post-prose ul,
.post-prose ol,
.post-prose blockquote,
.post-prose pre,
.post-prose table { margin: 0 0 1rem; }
.post-prose h1,
.post-prose h2,
.post-prose h3,
.post-prose h4 {
    margin: 1.35rem 0 .55rem;
    color: var(--core-text-color);
    line-height: 1.25;
    letter-spacing: -.02em;
}
.post-prose h2 { font-size: 1.35rem; }
.post-prose h3 { font-size: 1.12rem; }
.post-prose a { color: var(--hyperlink-color, var(--post-orange)); }
.post-prose a:hover { color: var(--hyperlink-color-hover, #ffdc45); }
.post-prose img,
.post-prose video {
    display: block;
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 1rem auto;
    border-radius: .8rem;
}
.post-prose iframe {
    display: block;
    width: 100%;
    max-width: 100%;
    min-height: 280px;
    margin: 1rem auto;
    border-radius: .8rem;
}
.post-prose ul,
.post-prose ol { padding-left: 1.2rem; }
.post-prose blockquote {
    padding: .2rem 0 .2rem 1rem;
    color: var(--core-secondary-text-color);
    border-left: 3px solid var(--post-orange);
}
.post-prose table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.post-prose th,
.post-prose td { padding: .45rem .55rem; border-bottom: 1px solid var(--post-line-soft); text-align: left; }
.post-prose pre,
.post-prose code {
    overflow-x: auto;
    background: var(--post-surface-soft);
    border-radius: .45rem;
}
.post-prose pre { padding: .85rem 1rem; }
.post-prose code { padding: .1rem .3rem; }

.post-file {
    display: grid;
    gap: .8rem;
    margin-top: 1.1rem;
    padding: 1rem 1.05rem;
}

.post-file h2 { font-size: 1rem; }
.post-file p { color: var(--core-secondary-text-color); font-size: .86rem; line-height: 1.55; }
.post-file a {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    color: var(--hyperlink-color, var(--post-orange)) !important;
    font-size: .82rem;
    font-weight: 800;
    text-decoration: none;
}
.post-file a:hover { color: var(--hyperlink-color-hover, #ffdc45) !important; }

.post-file__pdf {
    position: relative;
    overflow: hidden;
    padding-top: 72%;
    background: var(--post-surface-soft);
    border: 1px solid var(--post-line-soft);
    border-radius: .75rem;
}

.post-file__pdf embed {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.post-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: 1.2rem;
}

.post-btn {
    display: inline-flex;
    min-height: 2.45rem;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .4rem .9rem;
    border: 1px solid transparent;
    border-radius: .55rem;
    font-size: .82rem;
    font-weight: 750;
    text-decoration: none !important;
    cursor: pointer;
}

.post-btn.is-primary {
    color: #1c0e02 !important;
    background: var(--post-orange);
}

.post-btn.is-ghost {
    color: var(--core-text-color) !important;
    background: var(--post-surface-soft);
    border-color: var(--post-line);
}

.post-btn.is-ghost:hover { color: var(--hyperlink-color-hover, #ffdc45) !important; }

.post-rail { display: grid; gap: .85rem; }
.post-rail__card { padding: 1rem 1.05rem 1.1rem; }
.post-rail__card h2 { margin-bottom: .75rem; font-size: .92rem; }

.post-author {
    display: grid;
    grid-template-columns: 3rem minmax(0, 1fr);
    gap: .75rem;
    align-items: center;
}

.post-author img,
.post-author__fallback {
    width: 3rem;
    height: 3rem;
    border-radius: .8rem;
    object-fit: cover;
}

.post-author__fallback {
    display: grid;
    place-items: center;
    color: var(--core-secondary-text-color);
    background: var(--post-surface-raised);
}

.post-author strong { display: block; color: var(--core-text-color); }
.post-author small { color: var(--core-secondary-text-color); }

.post-chip-list { display: flex; flex-wrap: wrap; gap: .35rem; }

.post-chip-list a,
.post-chip-list span {
    display: inline-flex;
    min-height: 1.85rem;
    align-items: center;
    padding: 0 .65rem;
    border: 1px solid var(--post-line);
    border-radius: 2rem;
    background: var(--post-surface-soft);
    font-size: .68rem;
    font-weight: 750;
}

.post-chip-list span { color: var(--core-secondary-text-color); }

.post-related { margin: 0; padding: 0; list-style: none; }
.post-related li { border-bottom: 1px solid var(--post-line-soft); }
.post-related li:last-child { border: 0; }
.post-related a {
    display: grid;
    grid-template-columns: 3.2rem minmax(0, 1fr);
    gap: .7rem;
    align-items: center;
    padding: .55rem 0;
}

.post-related img,
.post-related__fallback {
    width: 3.2rem;
    height: 3.2rem;
    border-radius: .55rem;
    object-fit: cover;
}

.post-related__fallback {
    display: grid;
    place-items: center;
    color: var(--post-orange);
    background: var(--post-surface-raised);
}

.post-related strong {
    display: block;
    overflow: hidden;
    color: var(--core-text-color);
    font-size: .8rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-related small { color: var(--core-secondary-text-color); font-size: .68rem; }

.post-comments {
    grid-column: 1 / -1;
    padding: 1.15rem 1.2rem 1.3rem;
}

.post-comments__header { margin-bottom: 1rem; }
.post-comments__header h2 { font-size: 1.2rem; }
.post-comments__header p { margin-top: .3rem; color: var(--core-secondary-text-color); font-size: .86rem; }

.post-comment-form,
.post-comment-login,
.post-comment {
    margin-bottom: .75rem;
    padding: 1rem 1.05rem;
}

.post-comment-form label {
    display: block;
    margin-bottom: .45rem;
    font-size: .78rem;
    font-weight: 800;
}

.post-comment-form textarea {
    width: 100%;
    min-height: 7.5rem;
    margin: 0 0 .75rem;
    padding: .75rem .85rem;
    resize: vertical;
    color: var(--core-text-color);
    background: var(--post-surface-soft);
    border: 1px solid var(--post-line);
    border-radius: .65rem;
}

body.dark-theme .post-comment-form textarea { color-scheme: dark; }

.post-comment-form__actions,
.post-comment-login { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.post-comment-login { justify-content: space-between; }
.post-comment-login p { color: var(--core-secondary-text-color); }

.post-comment__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .45rem .7rem;
    margin-bottom: .55rem;
    color: var(--core-secondary-text-color);
    font-size: .78rem;
}

.post-comment__body {
    overflow-x: auto;
    font-size: .95rem;
    line-height: 1.65;
}

.post-comment__body img,
.post-comment__body iframe {
    display: block;
    max-width: 100%;
    height: auto;
    margin: .7rem 0;
    border-radius: .65rem;
}

.post-comment__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .55rem .75rem;
    margin-top: .75rem;
}

.post-comment__actions small { color: var(--core-secondary-text-color); font-weight: 750; }
.post-comment__actions a { font-size: .75rem; font-weight: 750; }
.post-comment__actions .post-btn { min-height: 2.1rem; padding: .25rem .7rem; }

.post-empty {
    padding: 1.6rem 1rem;
    color: var(--core-secondary-text-color);
    text-align: center;
}

.post-empty i { display: block; margin-bottom: .45rem; color: var(--post-orange); font-size: 1.3rem; }

.post-pagination {
    display: grid;
    align-items: center;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.post-pagination > a,
.post-pagination > span {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--core-text-color) !important;
    font-size: .74rem;
    font-weight: 800;
    text-decoration: none;
}

.post-pagination > a:last-child,
.post-pagination > span:last-child { justify-self: end; }
.post-pagination .is-disabled { opacity: .35; }
.post-pagination > a:hover { color: var(--hyperlink-color-hover, var(--post-orange)) !important; }

@media (max-width: 1100px) {
    .post-header__layout { grid-template-columns: 1fr auto; }
    .post-header__links {
        grid-column: 1 / -1;
        display: flex;
        overflow-x: auto;
        padding-top: .45rem;
        border-top: 1px solid var(--post-line-soft);
    }
}

@media (max-width: 900px) {
    .post-layout { grid-template-columns: 1fr; }
    .post-comments { grid-column: auto; }
}

@media (max-width: 700px) {
    .pcsc-post { height: calc(100vh - var(--pcsc-header-height-mobile, 60px)); }
    .post-container { width: min(calc(100% - 1.25rem), 1180px); }
    .post-header { padding: 1.15rem 0; }
    .post-header__layout { grid-template-columns: 1fr; gap: .8rem; }
    .post-header__stats { width: 100%; grid-template-columns: repeat(3, 1fr); }
    .post-header__stats > div { min-width: 0; padding: .5rem; }
    .post-header__title h1 { font-size: 1.7rem; }
    .post-article,
    .post-comments { padding: 1rem .9rem 1.1rem; }
    .post-pagination { grid-template-columns: auto 1fr auto; }
    .post-pagination > a span,
    .post-pagination > span span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .pcsc-post { scroll-behavior: auto; }
}
