/* ─────────────────────────────────────────────────────────────
   분석글 단건 페이지 — 본문(좌) + 책 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, #e8eaef);
    font-family: 'Noto Serif KR', Georgia, serif;
    font-size: 18px;
    line-height: 1.85;
    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, #1F2027);
    border-bottom: 1px solid var(--border-light, #2F3540);
    font-family: 'Pretendard', sans-serif;
    font-size: 14px;
    color: var(--text-tertiary, #9098a8);
}
.nd-page__back,
.nd-page__crumb-link {
    color: var(--text-tertiary, #9098a8);
    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, #5e6677); }

/* 헤더 */
.nd-page__header {
    padding-bottom: 2rem;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--border-subtle, #2a2c38);
}
.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, #9098a8);
    margin-bottom: 1rem;
    letter-spacing: 0;
}
.nd-page__ticker {
    color: var(--text-secondary, #c8d0da);
    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, #9098a8);
    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, #5e6677);
    margin-right: 0.2rem;
}
.nd-page__time { color: var(--text-tertiary, #9098a8); }

.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, #e8eaef);
}
.nd-page__lede {
    font-family: 'Noto Serif KR', Georgia, serif;
    font-style: italic;
    color: var(--text-secondary, #c8d0da);
    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, #2F3540);
}
.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, #2F3540);
    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, #E6EDF3);
    letter-spacing: -0.01em;
}

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

/* 원문 출처 */
.nd-page__source {
    font-family: 'Pretendard', sans-serif;
    font-size: 13px;
    color: var(--text-tertiary, #9098a8);
    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, #2a2c38);
    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, #9098a8);
    font-family: 'JetBrains Mono', monospace;
    width: 44px;
}
.nd-related__title {
    flex: 1;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-secondary, #c8d0da);
    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(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 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, #E6EDF3);
}
.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, #E6EDF3);
    font-size: 16px;
    margin: 1.2rem 0 0.4rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light, #2F3540);
}
.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, #c8d0da);
    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(255, 255, 255, 0.02);
    border: 1px solid var(--border-light, #2F3540);
    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: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary, #6E7681);
    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, #C8D0DA);
    white-space: nowrap;
}
.nd-disclaimer__list dd {
    margin: 0;
    color: var(--text-secondary, #9AA3AE);
}
.nd-disclaimer__list dd strong {
    color: var(--text-primary, #C8D0DA);
    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;
    }
}
