/* 블로그 페이지 공통 스타일 */

/* article 자체는 1400px 카드 */
.blog-article {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 28px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    min-width: 0;
}

/* JS가 만드는 wrap: article 옆에 TOC 배치 */
.blog-layout {
    max-width: 1700px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: flex-start;
    gap: 24px;
}
.blog-layout .blog-article {
    flex: 1 1 auto;
    margin: 0;
}

/* 본문 타이포 (이전과 동일하되 .blog-content 의존성 제거) */
.blog-article h1 { font-size: 1.95rem; line-height: 1.35; margin-bottom: 16px; letter-spacing: -.02em; }
.blog-article .meta { color: #6b7280; font-size: .9rem; margin-bottom: 32px; padding-bottom: 16px; border-bottom: 1px solid #e5e7eb; }
.blog-article h2 { font-size: 1.4rem; margin: 40px 0 14px; padding-bottom: 8px; border-bottom: 2px solid #1f2937; scroll-margin-top: 88px; }
.blog-article h3 { font-size: 1.1rem; margin: 24px 0 10px; }
.blog-article p { margin-bottom: 1.2em; line-height: 1.85; color: #1f2937; word-break: keep-all; }
.blog-article ul, .blog-article ol { margin: 0 0 1.2em 1.5em; padding-left: .5em; }
.blog-article li { list-style: disc; margin-bottom: .4em; line-height: 1.7; word-break: keep-all; }
.blog-article ol li { list-style: decimal; }
.blog-article table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: .95rem; }
.blog-article th, .blog-article td { padding: 10px 12px; border: 1px solid #e5e7eb; text-align: left; }
.blog-article th { background: #f9fafb; font-weight: 600; }
.blog-article blockquote { border-left: 4px solid #2563eb; padding: 8px 20px; margin: 20px 0; background: #f9fafb; color: #4b5563; border-radius: 0 8px 8px 0; }

.cta-box { background: #dbeafe; border-radius: 8px; padding: 20px; margin: 24px 0; text-align: center; }
.cta-box a { display: inline-block; padding: 10px 20px; background: #2563eb; color: #fff; border-radius: 6px; font-weight: 600; text-decoration: none; margin-top: 8px; }

.related { margin-top: 48px; padding-top: 24px; border-top: 1px solid #e5e7eb; }
.related h3 { font-size: 1rem; margin-bottom: 12px; }
.related ul { list-style: none; margin: 0; padding: 0; }
.related li { list-style: none; padding: 6px 0; }
.related a { color: #2563eb; font-weight: 500; }

/* 블로그 인덱스 카드 */
.post-list-grid { display: grid; gap: 16px; margin-top: 24px; }
.post-card { display: block; padding: 20px; background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; transition: all .2s; color: #1f2937; text-decoration: none; }
.post-card:hover { border-color: #2563eb; box-shadow: 0 4px 12px rgba(0,0,0,.08); transform: translateY(-2px); }
.post-card .cat { display: inline-block; font-size: .75rem; color: #2563eb; font-weight: 600; margin-bottom: 6px; }
.post-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; color: #1f2937; }
.post-card p { color: #6b7280; font-size: .9rem; margin: 0; }

/* TOC 사이드바 — article 외부 오른쪽 */
.blog-toc {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: 88px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 12px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    border: 1px solid #e5e7eb;
}
.blog-toc h3 {
    font-size: .8rem;
    font-weight: 700;
    color: #6b7280;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 0;
    border: none;
}
.blog-toc ul { list-style: none; margin: 0; padding: 0; }
.blog-toc li { list-style: none; margin-bottom: 4px; padding: 0; }
.blog-toc a {
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: .875rem;
    color: #4b5563;
    text-decoration: none;
    transition: all .15s;
    border-left: 3px solid transparent;
    line-height: 1.4;
    word-break: keep-all;
}
.blog-toc a:hover { background: #fff; color: #2563eb; border-left-color: #2563eb; }
.blog-toc a.active {
    background: #dbeafe;
    color: #2563eb;
    font-weight: 600;
    border-left-color: #2563eb;
}

@media (max-width: 1024px) {
    .blog-layout { flex-direction: column; padding: 0 16px; }
    .blog-toc { display: none; }
}
@media (max-width: 640px) {
    .blog-article { padding: 24px 16px; }
    .blog-article h1 { font-size: 1.5rem; }
    .blog-article h2 { font-size: 1.2rem; }
}
.blog-cat-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 24px; padding: 8px 0; }
.blog-cat-tabs button { padding: 8px 16px; border: 1px solid #e5e7eb; background: #fff; border-radius: 20px; cursor: pointer; font-size: .9rem; font-family: inherit; color: #4b5563; transition: all .15s; }
.blog-cat-tabs button:hover { border-color: #2563eb; color: #2563eb; }
.blog-cat-tabs button.active { background: #2563eb; color: #fff; border-color: #2563eb; font-weight: 600; }
.blog-cat-tabs .count { display: inline-block; margin-left: 4px; font-size: .8rem; opacity: .7; }