/*
 * korean-blog-pro-style.css
 * 상용 페이지 수준의 고급스러운 한국어 블로그 스타일
 */

/* 1. 기본 설정 및 한국어 폰트 최적화 */
.post-content {
    /* 폰트 스택: 깔끔한 산세리프 계열을 메인으로 사용 */
    /* font-family: 'Apple SD Gothic Neo', 'Malgun Gothic', 'Nanum Gothic', 'Segoe UI', sans-serif;
    line-height: 1.8; /* 한글은 1.7~1.8이 가독성이 좋음 */
    color: #2c3e50; /* 다크 네이비 계열로 깊이 있는 텍스트 색상 */
    /* font-size: 1rem; /* 기본 폰트 크기 약간 키움 */
    max-width: 768px; /* 최적의 읽기 너비 (태블릿 세로 폭 정도) */
    margin: 0 auto;
    /* padding: 30px 15px; /* 내부 패딩 추가 */
}

/* 2. 제목 (Headings) - 여백과 깊이 강조 */
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
    font-family: inherit; /* 본문과 동일한 폰트로 일관성 유지 */
    font-weight: 700;
    color: #1c2833;
    margin-top: 45px; /* 위쪽 여백 크게 */
    margin-bottom: 20px;
}

.post-content h2 {
    font-size: 2em;
    padding-bottom: 10px;
    /* 미니멀한 구분선: 살짝 두꺼운 회색 선 */
    border-bottom: 2px solid #e9ecef;
}

.post-content h3 {
    /* 요청하신 ### 타이틀 스타일 */
    font-size: 1.5em;
    color: #34495e;
    font-weight: 600; /* 약간 얇게 */
    margin-top: 50px !important;
}

.post-content h4 {
    font-size: 1.2em;
    color: #34495e;
    font-weight: 600;
    margin-top: 30px;
    margin-bottom: 10px;
}

/* 3. 문단 및 본문 요소 */
.post-content p {
    margin-top: 10px;
    margin-bottom: 10px; /* 문단 간격을 넓혀 읽기 편하게 */
    text-align: justify; /* 양쪽 정렬로 전문성 부여 */
}

/* 강조 텍스트 */
.post-content strong {
    color: #fd7e14; /* 강조 색상 */
    font-weight: 700;
}

/* 4. 리스트 (Lists) - 깔끔한 간격 */
.post-content ul,
.post-content ol {
    margin: 25px 0;
    /*padding-left: 10px;*/
}

.post-content ul li {
    /* 요청하신 * 리스트 스타일 */
    /* list-style-type: '— '; /* 하이픈 또는 작은 사각형을 사용해 세련된 느낌 */
    margin-bottom: 12px;
    /*padding-left: 10px;*/
}

/* 5. 인용 (Blockquotes) - 매거진 스타일 */
/* PostX — 업종 로테이션 요약 카드 */
.post-content .postx-rotation-brief {
    margin: 1.25rem 0 1.75rem;
    padding: 1.1rem 1.15rem 1rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: linear-gradient(145deg, #f8fafc 0%, #ffffff 55%, #f1f5f9 100%);
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
}

.post-content .postx-rotation-brief__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.35rem 1rem;
    margin-bottom: 0.85rem;
}

.post-content .postx-rotation-brief__title {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
}

.post-content .postx-rotation-brief__scope {
    font-size: 0.88rem;
    color: #475569;
}

.post-content .postx-rotation-brief__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    margin-bottom: 0.85rem;
}

@media (max-width: 640px) {
    .post-content .postx-rotation-brief__grid {
        grid-template-columns: 1fr;
    }
}

.post-content .postx-rotation-brief__card {
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
}

.post-content .postx-rotation-brief__card--flow {
    border-left: 4px solid #2563eb;
}

.post-content .postx-rotation-brief__card--price {
    border-left: 4px solid #f59e0b;
}

.post-content .postx-rotation-brief__label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 0.45rem;
}

.post-content .postx-rotation-brief__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.post-content .postx-rotation-brief__divergence {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.65rem;
}

.post-content .postx-rotation-brief__divergence-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    margin-right: 0.15rem;
}

.post-content .postx-rotation-brief__chip {
    display: inline-block;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.3;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
}

.post-content .postx-rotation-brief__chip--lead {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.post-content .postx-rotation-brief__chip--sync {
    background: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}

.post-content .postx-rotation-brief__chip--warn {
    background: #fff7ed;
    color: #c2410c;
    border-color: #fed7aa;
}

.post-content .postx-rotation-brief__chip--ind {
    background: #fff;
    color: #0f172a;
    border-color: #cbd5e1;
    font-weight: 500;
}

.post-content .postx-rotation-brief__note {
    margin: 0.65rem 0 0;
    font-size: 0.82rem;
    color: #94a3b8;
}

/* PostX — 업종별 수급 flow 시계열 (업종 선택) */
.post-content .postx-flow-ts {
    margin: 1.25rem 0 1.75rem;
    padding: 1rem 1.05rem 0.85rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #fff;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05);
}

.post-content .postx-flow-ts__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-bottom: 0.55rem;
}

.post-content .postx-flow-ts__title {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
}

.post-content .postx-flow-ts__sub {
    display: block;
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 0.15rem;
}

.post-content .postx-flow-ts__style-hint {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.65rem;
    font-size: 0.78rem;
    color: #64748b;
}

.post-content .postx-flow-ts__style--solid::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 0;
    border-top: 2.5px solid #2563eb;
    margin-right: 0.35rem;
    vertical-align: middle;
}

.post-content .postx-flow-ts__style--dash::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 0;
    border-top: 2px dashed #2563eb;
    margin-right: 0.35rem;
    vertical-align: middle;
}

.post-content .postx-flow-ts__count {
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: #f1f5f9;
    font-weight: 600;
    color: #475569;
}

.post-content .postx-flow-ts__hint {
    margin: 0 0 0.65rem;
    font-size: 0.82rem;
    color: #64748b;
}

.post-content .postx-flow-ts__presets-wrap,
.post-content .postx-flow-ts__pickers-wrap {
    margin-bottom: 0.75rem;
}

.post-content .postx-flow-ts__presets-label,
.post-content .postx-flow-ts__pickers-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 0.4rem;
}

.post-content .postx-flow-ts__presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.post-content .postx-flow-ts__preset {
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.34rem 0.7rem;
    border-radius: 8px;
    border: 1.5px solid #dbeafe;
    background: linear-gradient(180deg, #f8fbff 0%, #eff6ff 100%);
    color: #1e40af;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.25;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.post-content .postx-flow-ts__preset:hover:not(:disabled) {
    border-color: #93c5fd;
    background: #fff;
}

.post-content .postx-flow-ts__preset.is-active {
    border-color: #2563eb;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.14);
    color: #1d4ed8;
}

.post-content .postx-flow-ts__preset:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.post-content .postx-flow-ts__preset-n {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 0.25rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    color: #1e40af;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid #bfdbfe;
}

.post-content .postx-flow-ts__preset.is-active .postx-flow-ts__preset-n {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.post-content .postx-flow-ts__pickers {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.15rem;
}

.post-content .postx-flow-ts__pill {
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.32rem 0.65rem;
    border-radius: 999px;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.25;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.post-content .postx-flow-ts__pill:hover {
    border-color: var(--pill-color, #94a3b8);
    background: #fff;
}

.post-content .postx-flow-ts__pill.is-active {
    border-color: var(--pill-color, #2563eb);
    background: #fff;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--pill-color, #2563eb) 18%, transparent);
    color: #0f172a;
}

.post-content .postx-flow-ts__pill-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.15rem;
    height: 1.15rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    color: #fff;
    background: var(--pill-color, #64748b);
}

.post-content .postx-flow-ts__chart {
    width: 100%;
    min-height: 360px;
    margin: 0;
    padding: 0;
}

.post-content .postx-flow-ts__empty {
    margin: 1rem 0;
    color: #94a3b8;
    font-size: 0.9rem;
}

@media (max-width: 767px) {
    .post-content .postx-flow-ts__preset,
    .post-content .postx-flow-ts__pill {
        min-height: 2rem;
        padding: 0.45rem 0.75rem;
        font-size: 0.82rem;
    }

    .post-content .postx-rotation-brief__chip {
        font-size: 0.82rem;
        padding: 0.35rem 0.65rem;
    }
}

.post-content blockquote {
    /* 요청하신 > 인용 스타일 */
    border: none;
    border-left: 5px solid #3abdfe; /* 고급스러운 골드/오렌지 강조선 */
    background-color: #fcfcfc;
    padding: 5px 10px;
    margin: 30px 0;
    color: #5d6d7e;
    font-style: italic;
    font-size: 0.95em;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); /* 은은한 그림자로 깊이감 */
}

/* 6. 코드 (Code) - 전문적인 느낌 */
.post-content code {
    /* 인라인 코드 */
    background-color: #fff3cd; /* LightGoldenrodYellow 또는 */
    /* background-color: #fcf67f; /* 좀 더 진한 노란색을 원하면 이 코드를 사용 */
    color: #212529; /* 거의 검정에 가까운 색 */
    padding: 3px 6px;
    border-radius: 4px;
    font-family: 'D2 Coding', 'Consolas', monospace;
    font-size: 0.95em;
    /*font-weight: bold;*/
}

.post-content pre {
    /* 1. 배경 및 폰트 */
    /* Pygments 스타일에서 폰트 색상을 정의하므로, 여기서는 배경색과 레이아웃만 집중 */
    background-color: #fcfcfc; /* 매우 밝은 회색 배경 (종이 느낌) */

    /* 2. 레이아웃 및 강조 */
    padding: 20px 25px;
    margin: 30px 0;
    overflow-x: auto;
    border-radius: 8px; /* 부드러운 모서리 */
    /* box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); /* 연한 그림자로 섹션만 분리 */
    border: 1px solid #eee; /* 아주 옅은 테두리로 영역 표시 */

    /* 3. 폰트 및 가독성 */
    line-height: 1.65;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    color: #333333; /* 기본 텍스트 색상 (짙은 회색) */
}

/*==========================================================*/
/* 2. 줄 번호 테이블 구조 스타일 (라인 제거 및 배경 통일) */
/*==========================================================*/
.post-content .codehilite table {
    border-collapse: collapse;
    margin: 0;
    width: auto;
    background-color: #f7f7f7; /* 줄 번호 배경도 통일 */
}
/* 줄 번호 셀 (td.linenos) 스타일 */
.post-content .codehilite td.linenos {
    padding-right: 15px !important;
    color: #aaaaaa; /* 줄 번호 색상을 매우 흐리게 */
    border-right: none; /* <--- 라인(분리선) 제거 */
    user-select: none;
}
/* 실제 코드 셀 (td) 스타일 */
.post-content .codehilite td {
    padding-left: 15px !important;
    border: none; /* <--- 라인 제거 */
    background-color: #f7f7f7; /* 배경색 통일 */
    color: #333333; /* 폰트 색상 */
}

/*==========================================================*/
/* 3. 코드 블록 내부 <code> 초기화 스타일 */
/*==========================================================*/
.post-content pre code {
    /* 인라인 스타일 무효화 및 <pre>의 스타일 상속 */
    background-color: transparent;
    color: inherit;
    padding: 0;
    border-radius: 0;
    font-family: inherit;
    font-size: 1em;
}

/* 7. 링크 (Links) */
.post-content a {
    color: #3498db;
    text-decoration: none;
    /* 호버 시 부드럽게 색상 변경 */
    transition: color 0.3s ease;
}

.post-content a:hover {
    color: #2980b9;
    text-decoration: underline;
    text-decoration-color: #2980b950;
}

.post-content table:not(.postx-datatable):not(.tb-blog-datatable) {
    /* 1. 테이블 전체 레이아웃 (DataTables 제외) */
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.95em;
}

/* 2. 셀(th, td)의 기본 스타일 (가장 중요한 테두리) */
.post-content th,
.post-content td {
    border-bottom: solid 1px #E5E7E9;
    padding: 12px 10px;
    text-align: left;
    vertical-align: top;
}

/* postx: 마크다운 테이블 (DataTables 아님) */
.post-content .postx-md-table-wrap {
    overflow-x: auto;
    margin: 20px 0;
    -webkit-overflow-scrolling: touch;
}

/* postx DataTables → static/css/postx-datatable.css */

.post-content .table-responsive td:first-child,
.post-content .table-responsive th:first-child,
.post-content .tb-blog-datatable td.text-nowrap,
.post-content .tb-blog-datatable th.text-nowrap {
    white-space: nowrap;
}

.post-content .postx-echart {
    width: 100%;
    max-width: 100%;
    min-height: 320px;
    margin: 24px 0;
    padding: 0;
    overflow: visible;
}

.post-content .postx-mermaid-card {
    margin: 24px 0;
    padding: 0;
    background: #fff;
    border: 1px solid var(--tb-border-light, #e5e7eb);
    border-radius: 6px;
    box-shadow: var(--tb-card-shadow, 4px 4px 0 rgba(0, 0, 0, 0.05));
    overflow: hidden;
}

.post-content .postx-mermaid-caption {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 10px 14px;
    font-family: var(--tb-font, 'Pretendard', sans-serif);
    font-size: var(--tb-fs-subtitle, 0.9375rem);
    font-weight: 600;
    line-height: 1.35;
    color: var(--tb-black, #111);
    background: var(--tb-bg-soft, #f8fafc);
    border-bottom: 1px solid var(--tb-line, #e2e8f0);
}

.post-content .postx-mermaid-caption::before {
    content: '';
    width: 4px;
    height: 1.05em;
    background: var(--tb-accent, #fd7e14);
    border-radius: 1px;
    flex-shrink: 0;
}

.post-content .postx-mermaid-wrap {
    margin: 0;
    padding: 18px 12px 22px;
    overflow-x: auto;
    text-align: center;
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
    border: none;
    border-radius: 0;
}

.post-content .postx-mermaid-wrap .mermaid {
    display: block;
    width: 100%;
    min-width: 100%;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    font-family: var(--tb-font, 'Pretendard', sans-serif);
    font-size: 12px;
    line-height: 1.45;
    text-align: center;
}

.post-content .postx-mermaid-wrap svg {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

.post-content .postx-mermaid-wrap .node rect,
.post-content .postx-mermaid-wrap .node polygon,
.post-content .postx-mermaid-wrap .node circle {
    filter: drop-shadow(0 1px 2px rgba(15, 23, 42, 0.08));
}

.post-content .postx-mermaid-wrap .edgeLabel .label {
    padding: 2px 6px;
    border-radius: 4px;
    background: #fff !important;
    border: 1px solid var(--tb-line, #e2e8f0);
    color: var(--tb-text-light, #475569) !important;
    font-size: 12px;
}

.post-content .postx-mermaid-wrap .cluster rect {
    fill: rgba(248, 250, 252, 0.85) !important;
    stroke: var(--tb-line, #e2e8f0) !important;
    stroke-dasharray: 4 3;
    rx: 8;
    ry: 8;
}

.post-content .postx-mermaid-wrap .cluster .nodeLabel {
    color: var(--tb-muted, #94a3b8) !important;
    font-size: 11px !important;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.post-content hr {
    border: none;
    border-top: 1px dashed #cbd5e1;
    margin: 32px 0;
}

.post-content .math-block {
    overflow-x: auto;
    margin: 24px 0;
    padding: 12px 0;
    text-align: center;
}