/* 공통 글 상세 — 1120 본문 + 우측 목차 200px */

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

:root {
    --post-article-max: 1120px;
    --post-article-toc-width: 200px;
    --post-article-gap: 2rem;
    --post-article-sticky-top: calc(64px + 1rem + 5px);
}

.post-article-page {
    padding: 2.5rem 0 4rem;
}

.post-article {
    width: min(var(--post-article-max), calc(100% - 32px));
    margin: 0 auto;
}

.post-article__head {
    margin-bottom: 1.25rem;
}

.post-article__cat {
    display: inline-block;
    margin-bottom: .75rem;
    padding: .25rem .65rem;
    font-size: .75rem;
    font-weight: 700;
    color: #147985;
    background: rgba(20, 121, 133, .1);
    border-radius: 999px;
}

.post-article__title {
    margin: 0 0 .75rem;
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -.02em;
    color: #1a2e35;
}

.post-article__date {
    display: block;
    font-size: .875rem;
    font-weight: 600;
    color: #6b7c85;
}

.post-article__lead {
    margin: 0 0 1.5rem;
    padding: 1rem 1.25rem;
    font-size: 1.0625rem;
    line-height: 1.7;
    color: #1a2e35;
    background: #f0ebe3;
    border-left: 4px solid #147985;
    border-radius: 0 12px 12px 0;
}

.post-article__main .post-article__lead {
    margin-top: 0;
}

.post-article__thumb {
    margin: 0 0 2rem;
    border-radius: 12px;
    overflow: hidden;
    background: #f0ebe3;
}

.post-article__thumb img {
    width: 100%;
    height: auto;
    display: block;
}

.post-article__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--post-article-toc-width);
    gap: var(--post-article-gap);
    align-items: start;
}

.post-article__layout--no-toc {
    grid-template-columns: 1fr;
}

.post-article__main {
    min-width: 0;
}

.post-article__content {
    font-size: 1.0625rem;
    line-height: 1.85;
    color: #1a2e35;
}

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

.post-article__content h2,
.post-article__content h3,
.post-article__content h4 {
    scroll-margin-top: var(--post-article-sticky-top);
    color: #0c3d5c;
    line-height: 1.35;
}

.post-article__content h2 {
    margin: 2.5rem 0 1.5rem;
    padding: .875rem 0 .875rem 1rem;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.5;
    color: #2a3441;
    background: #f3f4f6;
    border-left: 4px solid #3d4f5f;
    border-bottom: 1px solid #c5cad1;
    box-sizing: border-box;
}

.post-article__content h3 {
    margin: 2rem 0 .875rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.post-article__content p {
    margin: 0 0 1.125rem;
}

.post-article__content ul,
.post-article__content ol {
    margin: 0 0 1.25rem 1.25rem;
    padding: 0;
}

.post-article__content li {
    margin-bottom: .5rem;
}

.post-article__content a.internal-link {
    display: inline;
    padding: .2em .5em;
    background: #dbeef1;
    color: #0a4f5c;
    font-weight: 600;
    border-radius: 4px;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}

.post-article__content a.internal-link:hover {
    background: #147985;
    color: #fff;
}

.post-article__content a.internal-link-underline {
    background: none;
    color: #147985;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.post-article__content a.internal-link-underline:hover {
    color: #0c3d5c;
}

.post-article__content ul:has(a.internal-link-underline) {
    list-style: square;
    padding-left: 1.35rem;
}

.post-article__content ul:has(a.internal-link-underline) li {
    display: list-item;
}

.post-article__content blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    color: #6b7c85;
    background: #fff;
    border-left: 4px solid #d4735e;
    border-radius: 0 12px 12px 0;
}

.post-article__content pre {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    overflow-x: auto;
    font-size: .875rem;
    line-height: 1.6;
    background: #1a2e35;
    color: #eef4f6;
    border-radius: 12px;
}

.post-article__content code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .92em;
}

.post-article__content :not(pre) > code {
    padding: .15rem .4rem;
    background: #f0ebe3;
    border-radius: 4px;
}

.post-article__content table {
    width: 100%;
    margin: 1.5rem 0;
    border-collapse: collapse;
    font-size: .9375rem;
    background: #fff;
    border: 1px solid #e8e0d6;
    border-radius: 12px;
    overflow: hidden;
}

.post-article__content th,
.post-article__content td {
    padding: .75rem .875rem;
    border: 1px solid #e8e0d6;
    text-align: left;
    vertical-align: top;
}

.post-article__content th {
    font-weight: 700;
    color: #0c3d5c;
    background: #f0ebe3;
}

.post-article__content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

.post-article__toc {
    width: var(--post-article-toc-width);
    position: sticky;
    top: var(--post-article-sticky-top);
    align-self: start;
}

.post-toc {
    padding: 1rem .875rem;
    background: #fff;
    border: 1px solid #e8e0d6;
    border-radius: 12px;
}

.post-toc__title {
    margin: 0 0 .75rem;
    font-size: .8125rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #0c3d5c;
}

.post-toc__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.post-toc__item {
    margin: 0 0 .5rem;
    font-size: .8125rem;
    line-height: 1.45;
}

.post-toc__item a {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    color: #6b7c85;
    text-decoration: none;
    transition: color .15s ease;
}

.post-toc__item a::before {
    content: '';
    flex-shrink: 0;
    width: 3px;
    min-width: 3px;
    max-width: 3px;
    height: 1em;
    margin-top: calc((1.45em - 1em) / 2);
    background: #d1d5db;
    border-radius: 0;
    transition: background .15s ease;
}

.post-toc__item a:hover {
    color: #147985;
}

.post-toc__item a:hover::before {
    background: #147985;
}

@media (max-width: 960px) {
    .post-article__layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .post-article__toc {
        width: 100%;
        position: static;
        order: -1;
    }
}
