/* news.css — 소식 공개 화면(목록 3종·상세) 전용 스타일 (docs/03 §4-8~§4-10, docs/04).
   토큰은 labs.css :root(docs/04 §2)를 참조하되, 병행 개발 중에도 렌더되도록 var() 폴백 병기.
   전 클래스 nw- 접두어 — labs.css·pages.css와 충돌 금지. 그라데이션 금지·네이비+검정 램프만. */

/* ── 레이아웃 골격 ── */
.nw-main { background: var(--bg, #ffffff); }
.nw-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 24px 96px;
}
.nw-container-narrow { max-width: 820px; }

/* ── 빵부스러기 (docs/03 §6-1) ── */
.nw-breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
    font-size: 14px;
    color: var(--ink-500, #6b7280);
}
.nw-breadcrumb li + li::before {
    content: "\203A"; /* › */
    margin-right: 4px;
    color: var(--primary-300, #9aa1d0);
}
.nw-breadcrumb a {
    color: var(--ink-500, #6b7280);
    text-decoration: none;
}
.nw-breadcrumb a:hover { text-decoration: underline; text-decoration-color: var(--primary-600, #1c2a8a); }
.nw-breadcrumb [aria-current="page"] { color: var(--ink-900, #000000); }

/* ── 페이지 헤더 ── */
.nw-header { margin-bottom: 32px; }
.nw-title {
    margin: 0;
    font-size: 40px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: var(--ink-900, #000000);
}

/* ── 섹션 ── */
.nw-section { margin-bottom: 48px; }
.nw-section-title {
    margin: 0 0 24px;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--ink-900, #000000);
}

/* ── 카테고리 탭 — 필터 칩 (docs/04 §5-8) ── */
.nw-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 32px;
}
.nw-tab {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid var(--border, #e3e6f0);
    border-radius: 999px;
    background: var(--bg, #ffffff);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--ink-700, #3a3a3a);
    text-decoration: none;
    transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease;
}
.nw-tab:hover { background: var(--primary-50, #f2f3fa); }
.nw-tab.is-active {
    background: var(--primary, #070f54);
    border-color: var(--primary, #070f54);
    color: var(--on-primary, #ffffff);
}

/* ── 카드 그리드 (docs/04 §4-2: 데스크톱 3열) ── */
.nw-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* ── 소식 카드 (docs/04 §5-4) ── */
.nw-card {
    border: 1px solid var(--border, #e3e6f0);
    border-radius: 12px;
    background: var(--bg, #ffffff);
    overflow: hidden;
    transition: transform 200ms ease, box-shadow 200ms ease;
}
.nw-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(7, 15, 84, 0.10);
}
.nw-card-link {
    display: block;
    height: 100%;
    text-decoration: none;
    color: inherit;
}
.nw-card-thumb {
    aspect-ratio: 16 / 9;
    background: var(--bg-soft, #f2f3fa);
    overflow: hidden;
}
.nw-card-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 200ms ease;
}
.nw-card:hover .nw-card-thumb img { transform: scale(1.03); }
.nw-card-thumb-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--primary-300, #9aa1d0);
}
.nw-card-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 20px;
}
.nw-card-cat {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--primary-50, #f2f3fa);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--ink-700, #3a3a3a);
}
.nw-card-title {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: -0.01em;
    color: var(--ink-900, #000000);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}
.nw-card-date {
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink-500, #6b7280);
}

/* ── 빈 상태 (docs/03 §6-6) ── */
.nw-empty {
    padding: 64px 24px;
    background: var(--bg-soft, #f2f3fa);
    border: 1px solid var(--border, #e3e6f0);
    border-radius: 12px;
    text-align: center;
}
.nw-empty p {
    margin: 0;
    font-size: 16px;
    line-height: 1.7;
    color: var(--ink-700, #3a3a3a);
}

/* ── 페이지네이션 (docs/04 §5-9) ── */
.nw-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 48px;
}
.nw-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    color: var(--ink-700, #3a3a3a);
    text-decoration: none;
    transition: background-color 200ms ease;
}
a.nw-page-btn:hover { background: var(--primary-50, #f2f3fa); }
.nw-page-btn.is-current {
    background: var(--primary, #070f54);
    color: var(--on-primary, #ffffff);
}
.nw-page-nav.is-disabled {
    color: var(--primary-300, #9aa1d0);
    cursor: default;
}

/* ── 미디어 킷 (docs/03 §4-9) ── */
.nw-kit-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.nw-kit-card {
    border: 1px solid var(--border, #e3e6f0);
    border-radius: 12px;
    background: var(--bg, #ffffff);
    overflow: hidden;
}
.nw-kit-thumb {
    aspect-ratio: 16 / 9;
    background: var(--bg-soft, #f2f3fa);
    overflow: hidden;
}
.nw-kit-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.nw-kit-thumb-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 100%;
    color: var(--primary-300, #9aa1d0);
}
.nw-kit-ext {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--ink-500, #6b7280);
}
.nw-kit-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 20px;
}
.nw-kit-name {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: -0.01em;
    color: var(--ink-900, #000000);
}
.nw-kit-meta {
    margin: 0;
    display: flex;
    gap: 6px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink-500, #6b7280);
}
.nw-kit-dl { margin-top: 8px; }
.nw-kit-guide {
    margin: 16px 0 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink-500, #6b7280);
}

/* ── 버튼 (docs/04 §5-3 준용) ── */
.nw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 24px;
    border-radius: 999px;
    font-size: 16px;
    font-weight: 500;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}
.nw-btn-primary {
    background: var(--primary, #070f54);
    border: none;
    color: var(--on-primary, #ffffff);
}
.nw-btn-primary:hover { background: var(--primary-700, #101a6e); }
.nw-btn-primary:active { background: var(--primary-900, #050b40); }
.nw-btn-secondary {
    background: var(--bg, #ffffff);
    border: 1.5px solid var(--primary, #070f54);
    color: var(--ink-900, #000000);
}
.nw-btn-secondary:hover { background: var(--primary-50, #f2f3fa); }
.nw-btn-secondary:active { background: var(--primary-100, #dfe2f2); }

/* ── 칩 (docs/04 §5-8) ── */
.nw-chip {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--primary-50, #f2f3fa);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--ink-700, #3a3a3a);
    text-decoration: none;
}
a.nw-chip-cat { transition: background-color 200ms ease; }
a.nw-chip-cat:hover { background: var(--primary-100, #dfe2f2); }

/* ── 상세 (docs/03 §4-10 카카오 상세 공식) ── */
.nw-detail { margin-bottom: 64px; }
.nw-detail-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin: 16px 0 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border, #e3e6f0);
}
.nw-detail-title {
    margin: 0;
    font-size: 40px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: var(--ink-900, #000000);
}
.nw-detail-date {
    flex: 0 0 auto;
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink-500, #6b7280);
}
.nw-detail-share {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 32px;
}
.nw-detail-figure {
    margin: 0 0 32px;
}
.nw-detail-figure img {
    display: block;
    width: 100%;
    border-radius: 12px;
}
.nw-detail-summary {
    list-style: none;
    margin: 0 0 32px;
    padding: 24px;
    background: var(--bg-soft, #f2f3fa);
    border-radius: 12px;
}
.nw-detail-summary li {
    position: relative;
    padding-left: 16px;
    margin-bottom: 8px;
    font-size: 16px;
    line-height: 1.7;
    color: var(--ink-900, #000000);
}
.nw-detail-summary li:last-child { margin-bottom: 0; }
.nw-detail-summary li::before {
    content: "-";
    position: absolute;
    left: 0;
    color: var(--ink-900, #000000);
}
.nw-detail-body {
    font-size: 16px;
    line-height: 1.7;
    color: var(--ink-700, #3a3a3a);
    margin-bottom: 32px;
}
.nw-detail-body p { margin: 0 0 16px; }
.nw-detail-body h2 {
    margin: 32px 0 16px;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--ink-900, #000000);
}
.nw-detail-body h3 {
    margin: 24px 0 12px;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: -0.01em;
    color: var(--ink-900, #000000);
}
.nw-detail-body img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}
.nw-detail-body a {
    color: var(--ink-900, #000000);
    text-decoration: underline;
    text-decoration-color: var(--primary-600, #1c2a8a);
}
.nw-detail-body ul,
.nw-detail-body ol { margin: 0 0 16px; padding-left: 24px; }
.nw-detail-body blockquote {
    margin: 0 0 16px;
    padding: 12px 0 12px 24px;
    border-left: 4px solid var(--primary, #070f54);
    color: var(--ink-900, #000000);
}
.nw-detail-tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 32px;
    padding: 0;
}
.nw-detail-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding-top: 24px;
    border-top: 1px solid var(--border, #e3e6f0);
}
.nw-recommend { margin-bottom: 0; }

/* ── 홈 최신 소식 섹션 (docs/03 §4-1 ③) ── */
.nw-home-news-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}
.nw-home-news-head .nw-section-title { margin: 0; }

/* ── 공유 토스트 (docs/03 §6-5 — 문구는 서버 렌더 data 속성) ── */
.nw-toast {
    position: fixed;
    left: 50%;
    bottom: 32px;
    transform: translateX(-50%);
    z-index: 1000;
    padding: 12px 24px;
    border-radius: 999px;
    background: var(--primary, #070f54);
    color: var(--on-primary, #ffffff);
    font-size: 14px;
    line-height: 1.5;
    opacity: 0;
    transition: opacity 200ms ease;
}
.nw-toast.is-visible { opacity: 1; }

/* ── 포커스 링 (docs/04 §7) ── */
.nw-card-link:focus-visible,
.nw-tab:focus-visible,
.nw-page-btn:focus-visible,
.nw-btn:focus-visible,
.nw-chip:focus-visible,
.nw-breadcrumb a:focus-visible {
    outline: 2px solid var(--focus-ring, #1c2a8a);
    outline-offset: 2px;
}

/* ── 모션 절제 (docs/04 §6-3) ── */
@media (prefers-reduced-motion: reduce) {
    .nw-card,
    .nw-card-thumb img { transition: none; }
    .nw-card:hover { transform: none; }
    .nw-card:hover .nw-card-thumb img { transform: none; }
}

/* ── 반응형 (docs/04 §8) ── */
@media (min-width: 768px) and (max-width: 1023px) {
    .nw-grid,
    .nw-kit-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
    .nw-container { padding: 32px 16px 64px; }
    .nw-header { margin-bottom: 24px; }
    .nw-title { font-size: 28px; }
    .nw-section { margin-bottom: 32px; }
    .nw-section-title { font-size: 22px; }
    .nw-grid,
    .nw-kit-grid { grid-template-columns: 1fr; gap: 16px; }
    .nw-card-title,
    .nw-kit-name { font-size: 19px; }
    .nw-detail-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .nw-detail-title { font-size: 28px; }
    .nw-detail-foot { flex-wrap: wrap; }
}
