/* ─── 게시글 본문 공통 스타일 ──────────────────────────────
 * 에디터(TinyMCE content_css)와 게시판 상세(.post-content)가 같이 쓴다.
 * 글자 크기·줄 간격·여백을 한 곳에서 정해야 쓰는 화면과 보는 화면이 같아진다.
 * 에디터 iframe 에는 Bootstrap·tokens.css 가 없어 var() 는 대체값을 둔다.
 */
.post-content {
    font-family: var(--font-sans, sans-serif);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-body, #212529);
    word-break: break-word;
}
.post-content p,
.post-content ul,
.post-content ol,
.post-content blockquote {
    margin-block: 0 .75rem;
}
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    margin-block: 1rem .5rem;
    line-height: 1.3;
}
.post-content h1 { font-size: 1.5rem; }
.post-content h2 { font-size: 1.25rem; }
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 { font-size: 1rem; }
.post-content img {
    max-width: 100%;
    height: auto;
}
.post-content table {
    width: 100%;
    margin-block: .5rem;
    border-collapse: collapse;
}
.post-content th,
.post-content td {
    padding: .4rem .65rem;
    line-height: 1.5;
    vertical-align: middle;
    border: 1px solid var(--border-subtle, #dee2e6);
}
.post-content pre,
.page-content pre {
    margin-block: .75rem;
    padding: .75rem 1rem;
    overflow-x: auto;
    font-size: .875rem;
    line-height: 1.55;
    background: var(--surface-muted, #f6f8fa);
    border: 1px solid var(--border-subtle, #dee2e6);
    border-radius: .375rem;
}
.post-content pre code,
.page-content pre code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: pre;
}
/* Prism 테마가 pre 배경을 덮어쓰지 않도록 우리 박스 스타일을 유지 */
.post-content pre[class*="language-"],
.page-content pre[class*="language-"] {
    background: var(--surface-muted, #f6f8fa);
    text-shadow: none;
}
.post-content code[class*="language-"],
.page-content code[class*="language-"] {
    text-shadow: none;
}

/* ─── 게시글 목차·읽기 진행바 (public/js/post-toc.js) ─────── */
.post-progress {
    position: fixed;
    inset: 0 0 auto 0;
    height: 3px;
    z-index: 1040;
    background: transparent;
}
.post-progress__bar {
    display: block;
    height: 100%;
    width: 0;
    background: var(--bs-primary, #0d6efd);
}
.post-toc {
    margin-bottom: 1rem;
    padding: .75rem 1rem;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: .5rem;
    background: var(--bs-tertiary-bg, #f8f9fa);
    font-size: .9rem;
}
.post-toc summary { cursor: pointer; font-weight: 600; }
.post-toc ol { margin: .5rem 0 0; padding-left: 1.25rem; }
.post-toc__h3 { margin-left: 1rem; list-style-type: circle; }
.post-toc__h4 { margin-left: 2rem; list-style-type: square; }
.post-toc a { color: inherit; text-decoration: none; }
.post-toc a:hover,
.post-toc a[aria-current] { color: var(--bs-primary, #0d6efd); text-decoration: underline; }
.board-post-content h2,
.board-post-content h3,
.board-post-content h4 { scroll-margin-top: 1rem; }
/* 넓은 화면: 본문 오른쪽 여백에 고정 */
@media (min-width: 1400px) {
    .post-toc {
        position: fixed;
        top: 6rem;
        right: max(1rem, calc((100vw - 1320px) / 2 - 17rem));
        width: 16rem;
        max-height: calc(100vh - 8rem);
        overflow-y: auto;
        margin: 0;
    }
}
