/* ─────────────────────────────────────────────────────────────
   분석글 단건 페이지 — 본문(좌) + 책 CTA sticky(우) 2단 grid (PC)
   타이포그래피: libretto.co.kr 인사이트 페이지 (Noto Serif KR 18px, line 1.85, letter -0.01em)
   ───────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+KR:wght@400;500;600;700&display=swap');

.news-detail-page {
    /* main(1100) 안에서 100% 채움 — 사이트 기본 폭 통일 (2026-05-24) */
    max-width: 100%;
    margin: 0 auto;
    padding: 1.5rem 0 5rem;
    color: var(--text-primary, var(--text-primary));
    /* 이 면이 사이트 읽기 규격의 기준이다. 값은 _variables.css 의 --reading-* 에 산다
       (2026-08-27) — 여기 숫자를 직접 고치면 다른 읽기 면과 갈라진다. */
    font-family: var(--reading-font);
    font-size: var(--reading-fs);
    line-height: var(--reading-lh);
    letter-spacing: -0.01em;

    /* 2단 grid (PC) — 좌측 본문, 우측 관련 분석 + 광고 sticky */
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    column-gap: var(--space-xl);
    align-items: start;
}
/* 본문 영역 모든 자식은 좌측 컬럼에 배치 */
.news-detail-page > .nd-page__breadcrumb,
.news-detail-page > .nd-page__header,
.news-detail-page > .nd-page__summary,
.news-detail-page > .nd-page__content,
.news-detail-page > .nd-page__analysis,
.news-detail-page > .ad-slot {
    grid-column: 1;
    min-width: 0;     /* grid 셀에서 텍스트 줄바꿈 안정 */
}

/* 우측 sticky aside (PC) — 관련 다른 분석 + 광고 (2026-05-24) */
.news-detail-page > .nd-page__right {
    grid-column: 2;
    grid-row: 1 / span 100;
    position: sticky;
    top: calc(var(--header-height) + var(--space-md));
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    max-height: calc(100vh - var(--header-height) - 2 * var(--space-md));
    overflow-y: auto;
    scrollbar-width: thin;
}

/* 모바일·태블릿 — 단일 컬럼, 본문 끝 자연 흐름 */
@media (max-width: 880px) {
    .news-detail-page > .nd-page__right {
        grid-column: 1;
        grid-row: auto;        /* PC 의 grid-row: 1 / span 100 리셋 — 본문 아래로 (2026-05-25) */
        position: static;
        max-height: none;
        overflow-y: visible;
        margin-top: var(--space-xl);
    }
}

/* 브레드크럼 — 헤더 바로 아래 sticky (스크롤 시 상단 고정) */
.nd-page__breadcrumb {
    grid-column: 1 / -1;     /* 2단 grid 전체 너비 */
    position: sticky;
    top: 56px;                /* 글로벌 헤더 height */
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 0;
    margin-bottom: 1.5rem;
    background: var(--bg-primary, var(--bg-primary));
    border-bottom: 1px solid var(--border-light, var(--border-light));
    font-family: 'Pretendard', sans-serif;
    font-size: 14px;
    color: var(--text-tertiary, var(--text-secondary));
}
.nd-page__back,
.nd-page__crumb-link {
    color: var(--text-tertiary, var(--text-secondary));
    text-decoration: none;
    transition: color 0.15s;
}
.nd-page__back:hover,
.nd-page__crumb-link:hover { color: var(--accent); }
.nd-page__crumb-sep { color: var(--text-tertiary, var(--text-tertiary)); }

/* 헤더 */
.nd-page__header {
    padding-bottom: 2rem;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--border-subtle, var(--border));
}
.nd-page__meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-family: 'Pretendard', sans-serif;
    font-size: 14px;
    color: var(--text-tertiary, var(--text-secondary));
    margin-bottom: 1rem;
    letter-spacing: 0;
}
.nd-page__ticker {
    color: var(--text-secondary, var(--accent));
    font-weight: 700;
    letter-spacing: 0.04em;
    text-decoration: none;
    transition: color 0.15s;
}
.nd-page__ticker:hover { color: var(--accent); }
.nd-page__category,
.nd-page__score {
    color: var(--text-tertiary, var(--text-secondary));
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.nd-page__category::before,
.nd-page__score::before,
.nd-page__time::before {
    content: '· ';
    color: var(--text-tertiary, var(--text-tertiary));
    margin-right: 0.2rem;
}
.nd-page__time { color: var(--text-tertiary, var(--text-secondary)); }

.nd-page__title {
    font-family: 'Pretendard', sans-serif;
    font-size: 30px;
    line-height: 1.3;
    letter-spacing: -0.025em;
    margin: 0 0 0.8rem;
    font-weight: 700;
    color: var(--text-primary, var(--text-primary));
}
.nd-page__lede {
    font-family: 'Noto Serif KR', Georgia, serif;
    font-style: italic;
    color: var(--text-secondary, var(--accent));
    font-size: 19px;
    line-height: 1.55;
    margin: 0;
    font-weight: 400;
}

/* 섹션 제목 — 각 영역의 한국어 소제목. 블록 구분 X, 제목으로 구분 */
.nd-page__section-title {
    font-family: 'Pretendard', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.02em;
    margin: 0 0 0.8rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border-light, var(--border-light));
}
.nd-page__section-title--analysis {
    color: var(--blue, #58A6FF);
}

/* 한 호흡 요약 — 유일하게 박스(투명 배경 + 고딕). 핵심 강조 위치 */
.nd-page__summary {
    background: rgba(200, 208, 218, 0.04);     /* silver-tint 4% */
    border: 1px solid var(--border-light, var(--border-light));
    border-radius: 8px;
    padding: 1.2rem 1.4rem;
    margin: 0 0 2.5rem;
}
.nd-page__summary p {
    margin: 0;
    font-family: 'Pretendard', sans-serif;     /* 고딕 — 본문 serif 와 대비 */
    font-size: 17px;
    line-height: 1.7;
    color: var(--text-primary, var(--text-primary));
    letter-spacing: -0.01em;
}

/* 본문 (기사 핵심 + 분석) */
.nd-page__content,
.nd-page__analysis {
    margin: 0 0 3rem;
}
.nd-page__content-body,
.nd-page__analysis-body {
    font-size: var(--reading-fs);
    line-height: var(--reading-lh);
    letter-spacing: -0.01em;
    color: var(--text-primary, var(--text-primary));
}

/* 원문 출처 */
.nd-page__source {
    font-family: 'Pretendard', sans-serif;
    font-size: 13px;
    color: var(--text-tertiary, var(--text-secondary));
    margin: 1rem 0 0;
}
.nd-page__source a {
    color: var(--accent);
    text-decoration: none;
}
.nd-page__source a:hover { text-decoration: underline; }

/* 관련 분석 */
.nd-related {
    margin: 0 0 3rem;
    font-family: 'Pretendard', sans-serif;
}
.nd-related__grid {
    display: flex;
    flex-direction: column;
}
.nd-related__card {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding: 1rem 0;
    text-decoration: none;
    border-bottom: 1px solid var(--border-subtle, var(--border));
    transition: padding 0.15s;
}
.nd-related__card:last-child { border-bottom: 0; }
.nd-related__card:hover { padding-left: 0.4rem; }
.nd-related__time {
    flex-shrink: 0;
    font-size: 13px;
    color: var(--text-tertiary, var(--text-secondary));
    font-family: 'JetBrains Mono', monospace;
    width: 44px;
}
.nd-related__title {
    flex: 1;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-secondary, var(--accent));
    transition: color 0.15s;
}
.nd-related__card:hover .nd-related__title { color: var(--accent); }

/* 광고 슬롯 — INS 태그가 들어왔을 때만 표시 (승인+slot ID 채워질 때까지 숨김) */
.ad-slot {
    display: none;
    margin: 2.5rem 0;
    position: relative;
}
.ad-slot:has(ins.adsbygoogle) {
    display: block;
    padding: 1.25rem;
    background: rgba(26, 24, 20, 0.02);
    border: 1px solid rgba(26, 24, 20, 0.06);
    border-radius: 8px;
    min-height: 90px;
}
.ad-slot__label {
    display: block;
    font-size: 0.7rem;
    color: rgba(200, 208, 218, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
    font-weight: 500;
}
@media (max-width: 640px) {
    .ad-slot { margin: 1.75rem 0; }
    .ad-slot:has(ins.adsbygoogle) { padding: 1rem; }
}

/* ── 반응형 — 모바일·태블릿에선 단일 컬럼만, 시각 패턴은 PC 와 동일 ─── */
@media (max-width: 880px) {
    .news-detail-page {
        grid-template-columns: 1fr;
        column-gap: 0;
    }
    /* 브레드크럼 sticky 는 모바일에서도 유지 */
}

/* 좁은 모바일 — 폰트 크기 조정. 좌우 패딩은 부모 .main 이 이미 줄였으므로 0 */
@media (max-width: 640px) {
    .news-detail-page {
        font-size: 17px;
        padding-left: 0;
        padding-right: 0;
    }
    .nd-page__title { font-size: 24px; }
    .nd-page__lede { font-size: 17px; }
    .nd-page__content-body,
    .nd-page__analysis-body { font-size: 17px; }
    .nd-page__summary p { font-size: 17px; }
}

/* ── TL;DR · FAQ · 마지막 검토일 (Phase 3 SEO/GEO) ─────── */
.nd-page__tldr {
    grid-column: 1;
    background: rgba(110, 168, 255, 0.05);
    border-left: 3px solid var(--blue, #58A6FF);
    padding: 1.2rem 1.4rem;
    margin: 0 0 2.5rem;
    font-family: 'Pretendard', sans-serif;
}
.nd-page__tldr ul {
    margin: 0;
    padding-left: 1.2rem;
    list-style: disc;
}
.nd-page__tldr li {
    margin-bottom: 0.55rem;
    line-height: 1.65;
    font-size: 16px;
    color: var(--text-primary, var(--text-primary));
}
.nd-page__tldr li:last-child { margin-bottom: 0; }

.nd-page__faq {
    grid-column: 1;
    margin: 2.5rem 0;
    font-family: 'Pretendard', sans-serif;
}
.nd-page__faq dl { margin: 0; }
.nd-page__faq dt {
    font-weight: 700;
    color: var(--text-primary, var(--text-primary));
    font-size: 16px;
    margin: 1.2rem 0 0.4rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light, var(--border-light));
}
.nd-page__faq dt:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.nd-page__faq dd {
    margin: 0 0 0.5rem;
    color: var(--text-secondary, var(--accent));
    line-height: 1.7;
    font-size: 15.5px;
}

/* ── 고지 사항 (YMYL 면책 + 1차 출처 + AI 공개) ─────────────────── */
.nd-disclaimer {
    grid-column: 1;
    margin: 1.75rem 0 0;
    padding: 1.25rem 1.5rem;
    background: rgba(26, 24, 20, 0.02);
    border: 1px solid var(--border-light, var(--border-light));
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-secondary, #9AA3AE);
}
.nd-disclaimer__title {
    font-family: 'Pretendard', sans-serif;
    font-size: var(--fs-2xs);
    font-weight: 600;
    color: var(--text-tertiary, var(--text-tertiary));
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0 0 0.875rem;
}
.nd-disclaimer__list {
    margin: 0;
    display: grid;
    grid-template-columns: max-content 1fr;
    column-gap: 1.25rem;
    row-gap: 0.625rem;
    align-items: start;
}
.nd-disclaimer__list dt {
    font-weight: 600;
    color: var(--text-primary, var(--accent));
    white-space: nowrap;
}
.nd-disclaimer__list dd {
    margin: 0;
    color: var(--text-secondary, #9AA3AE);
}
.nd-disclaimer__list dd strong {
    color: var(--text-primary, var(--accent));
    font-weight: 600;
}
.nd-disclaimer__source {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px dotted rgba(var(--accent-rgb), 0.4);
    transition: border-color 0.15s;
}
.nd-disclaimer__source:hover {
    border-bottom-color: var(--accent);
}
@media (max-width: 640px) {
    .nd-disclaimer {
        padding: 1rem;
        font-size: 12.5px;
    }
    .nd-disclaimer__list {
        grid-template-columns: 1fr;
        row-gap: 0.25rem;
    }
    .nd-disclaimer__list dt {
        margin-top: 0.625rem;
    }
}

/* ── 자체 해석 카드 (2026-08-17 주인님 정정 — 본문 요약과 형태로 구분) ── */

.nd-analysis-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 22px 22px;
    margin: 28px 0;
}
.nd-analysis-card__head {
    border-bottom: 1px solid var(--border);
    padding-bottom: 13px;
    margin-bottom: 16px;
}
.nd-analysis-card__eyebrow {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--fs-3xs);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 5px;
}
.nd-analysis-card__title {
    font-size: var(--fs-lg);
    font-weight: 700;
    letter-spacing: -.01em;
    margin: 0;
    line-height: 1.4;
}
.nd-analysis-card__note {
    display: block;
    font-size: var(--fs-2xs);
    color: var(--text-tertiary);
    margin-top: 5px;
}
/* 소제목에 mono 번호 — 해설의 골격이 훑어진다 */
.nd-analysis-card .nd-page__analysis-body { counter-reset: ndh; }
.nd-analysis-card .nd-page__analysis-body h3::before,
.nd-analysis-card .nd-page__analysis-body h4::before {
    counter-increment: ndh;
    content: counter(ndh, decimal-leading-zero);
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--fs-2xs);
    font-weight: 500;
    color: var(--accent);
    margin-right: 9px;
}

/* ── 분석 본문 마크다운 헤딩 (2026-08-17 — ### 소제목 체계) ─────── */

.nd-page__analysis-body h3,
.nd-page__analysis-body h4 {
    font-size: var(--fs-md);
    font-weight: 700;
    letter-spacing: -.01em;
    margin: 24px 0 8px;
}
.nd-page__analysis-body h3:first-child,
.nd-page__analysis-body h4:first-child { margin-top: 0; }
.nd-page__analysis-body p { margin: 0 0 14px; line-height: 1.8; }
.nd-page__analysis-body p:last-child { margin-bottom: 0; }

/* ── 흐름 · 전망 · 성적표 (2026-08-17) ─────────────────────────── */

.nd-page__flow {
    margin: 22px 0;
    padding: 16px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.nd-page__flow-body {
    line-height: 1.75;
    color: var(--text-secondary);
}

.nd-outlook {
    margin: 26px 0;
    padding: 18px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.nd-outlook__expected {
    font-weight: 600;
    line-height: 1.7;
    margin-bottom: 12px;
}
.nd-outlook__meta {
    display: grid;
    gap: 6px;
    font-size: var(--fs-sm);
    margin: 0;
}
.nd-outlook__meta > div { display: flex; gap: 10px; }
.nd-outlook__meta dt { flex: 0 0 76px; color: var(--text-tertiary); }
.nd-outlook__meta dd { margin: 0; color: var(--text-secondary); line-height: 1.6; }

.nd-track { margin: 26px 0; }
.nd-track__stats {
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--fs-2xs);
    color: var(--text-tertiary);
    margin-bottom: 10px;
}
.nd-track__list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.nd-track__item {
    display: flex;
    gap: 10px;
    align-items: baseline;
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: var(--fs-sm);
}
.nd-track__date {
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--fs-2xs);
    color: var(--text-tertiary);
    flex: 0 0 auto;
}
.nd-track__body { line-height: 1.6; color: var(--text-secondary); }
.nd-track__verdict { font-style: normal; color: var(--text-tertiary); }

/* 판정 배지 — 색이 아니라 선 스타일로 구분 (색각 배제 규율) */
.nd-pred-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 5px;
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--fs-2xs);
    color: var(--text-secondary);
    border: 1px solid var(--text-tertiary);
    white-space: nowrap;
}
.nd-pred-badge--confirmed { border-style: solid; border-width: 2px; }
.nd-pred-badge--partial   { border-style: dashed; }
.nd-pred-badge--refuted   { border-style: double; border-width: 3px; }
.nd-pred-badge--open      { border-style: dotted; }
.nd-pred-badge--expired   { border-style: dotted; opacity: 0.55; }
