/**
 * ┌─────────────────────────────────────────────────────────────────────┐
 * │  FILE INDEX — 여수뉴스포털                                          │
 * ├──────────────┬──────────────────────────────────────────────────────┤
 * │  파일명      │  news-list.css                                           │
 * │  위치        │  /news/assets/css/news-list.css                                        │
 * │  생성일      │  2026-05-16                                           │
 * │  수정일      │  2026-06-02                                           │
 * │  버전        │  v1.0                                                 │
 * ├──────────────┼──────────────────────────────────────────────────────┤
 * │  기능/역할   │  스타일시트 — 포털·컴포넌트별 규칙 적용               │
 * ├──────────────┼──────────────────────────────────────────────────────┤
 * │  레이아웃    │  기준 너비: 1200px (전역·포털 변수와 연동)            │
 * │  섹터 구조   │  .sector-wrap width:100% — 다열은 .sector-inner (원칙2) │
 * │  폰트 기준   │  최소 14px (--fs-base 등 변수 연동)                 │
 * ├──────────────┼──────────────────────────────────────────────────────┤
 * │  연관 파일   │  load-by  : header.php·포털 레이아웃 (상이)            │
 * │              │  변수 주입: echoLayoutVars()·포털 CSS (해당 시)       │
 * ├──────────────┼──────────────────────────────────────────────────────┤
 * │  참조 사항   │  /docs/PROJECT_RULES.md 원칙8·포털 CSS 접두 규칙       │
 * ├──────────────┼──────────────────────────────────────────────────────┤
 * │  변경 이력   │  2026-05-16 v1.0 - FILE INDEX 일괄 부여                     │
 * └──────────────┴──────────────────────────────────────────────────────┘
 */

:root {

  /* ── 타이포그래피 스케일 (PROJECT_RULES.md 원칙3 / layout.css --fs-* 공통 참조) ── */
  --np-fs-xs: var(--fs-xs, 12px);   /* 12px — 배지 전용 */
  --np-fs-sm: var(--fs-sm, 14px);   /* 14px — 메타·날짜·보조텍스트 최솟값 */
  --np-fs-base: var(--fs-base, 16px);   /* 16px — 본문 기본 */
  --np-fs-md: var(--fs-md, 17px);   /* 17px — 강조 본문·버튼·폼 */
  --np-fs-lg: var(--fs-lg, 18px);   /* 18px — 카드 제목·섹션명 */
  --np-fs-xl: var(--fs-xl, 20px);   /* 20px — 서브 헤더 */
  --np-fs-2xl: var(--fs-2xl, 24px);   /* 24px — 페이지 제목 */
  --np-fs-3xl: var(--fs-3xl, 28px);   /* 28px — 섹션 대제목 */
  --np-fs-hero: var(--fs-hero, 32px);   /* 32px — 히어로 제목 */
}

/* ═══════════════════════════════════════════════════════════════
   여수뉴스포털 — 뉴스 섹션 전용 CSS
   섹터5 본문 대개편: 좌측/상단/우측 메뉴 삭제, 전체 너비 레이아웃
   Pretendard 폰트, 뉴스포털 스타일
   ─ 폰트·크기·색상 전 페이지 통일 (index / list / detail)
   ═══════════════════════════════════════════════════════════════ */

/* ──────────────────────────────────────────────────────────────
   0. Pretendard 웹폰트
──────────────────────────────────────────────────────────────── */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable.min.css');

/* ──────────────────────────────────────────────────────────────
   0-1. 뉴스 페이지 전역 오버플로우 차단
──────────────────────────────────────────────────────────────── */
.ni-wrap {
  overflow-x: hidden;
  max-width: 100%;
  box-sizing: border-box;
}

/* ──────────────────────────────────────────────────────────────
   1. 전역 폰트 — ni-wrap 범위 내 모든 요소에 강제 적용
──────────────────────────────────────────────────────────────── */
.ni-wrap,
.ni-wrap * {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont,
               'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', '나눔고딕',
               NanumGothic, 'Malgun Gothic', '맑은 고딕', sans-serif !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  box-sizing: border-box;
}

/* ──────────────────────────────────────────────────────────────
   2. CSS 변수 — 컬러 & 타이포 시스템 (단일 소스)
   북마크됨 이 변수만 수정하면 3개 페이지 전체에 반영됩니다.
──────────────────────────────────────────────────────────────── */
.ni-wrap {
  /* ── 강조색 ── */
  --ni-red:          #d0021b;
  --ni-red-dark:     #a80016;
  --ni-red-light:    #fff0f1;
  --ni-blue:         var(--portal-primary, #1a5fa8);

  /* ── 그레이 스케일 ── */
  --ni-gray-900:     #111111;   /* 제목, 최고 강조 */
  --ni-gray-800:     #222222;   /* 서브 제목 */
  --ni-gray-700:     #333333;   /* 본문 텍스트 */
  --ni-gray-600:     #555555;   /* 보조 텍스트 */
  --ni-gray-500:     #666666;   /* 요약·설명 */
  --ni-gray-400:     #888888;   /* 메타, 날짜, 아이콘 */
  --ni-gray-300:     #aaaaaa;   /* 구분선·비활성 */
  --ni-gray-200:     #cccccc;   /* 구분자 "|" */
  --ni-gray-100:     #eeeeee;   /* 배경 플레이스홀더 */
  --ni-gray-50:      #f8f8f8;   /* 호버 배경 */

  /* ── 보더 & 배경 ── */
  --ni-border:       #e5e5e5;
  --ni-border-h:     #cccccc;
  --ni-bg-white:     #ffffff;
  --ni-bg-section:   #f9f9f9;

  /* ── 폰트 크기: 전역 9단계 SSOT(layout.css :root)를 그대로 따른다 ── */
  --ni-fs-xs:   var(--fs-xs);
  --ni-fs-sm:   var(--fs-sm);
  --ni-fs-base: var(--fs-base);
  --ni-fs-md:   var(--fs-md);
  --ni-fs-lg:   var(--fs-lg);
  --ni-fs-xl:   var(--fs-xl);
  --ni-fs-2xl:  var(--fs-2xl);
  --ni-fs-3xl:  var(--fs-3xl);
  --ni-fs-hero: var(--fs-hero);

  /* ── 폰트 웨이트 ── */
  --fw-normal:  400;
  --fw-medium:  500;
  --fw-semi:    600;
  --fw-bold:    700;
  --fw-xbold:   800;

  /* ── 줄간격 — 연합뉴스 기준 ── */
  --lh-tight:  1.4;
  --lh-base:   1.6;
  --lh-body:   1.5;    /* 연합뉴스 데스크톱 1.5 */

  /* ── 자간 — 연합뉴스 기준 ── */
  --ls-title:  -0.5px;
  --ls-body:   -0.3px;
  --ls-xs:     -0.2px;

  /* ── 레이아웃 — 연합뉴스 컨테이너 720px ── */
  --ni-max-w:  1200px;
  --ni-art-w:   720px;   /* 연합뉴스 기사 영역 720px */
}

/* ──────────────────────────────────────────────────────────────
   3. 최상위 래퍼
──────────────────────────────────────────────────────────────── */
.ni-wrap {
  /* 폭·여백 SSOT 는 assets/css/layout.css 의 .x-wrap-ssot 통합 규칙이 책임진다 (헤더 .l14-inner / .ntb-inner 동일). */
  width: 100%;
  padding-bottom: 60px;
  font-size: var(--fs-md);           /* 기본 16px */
  font-weight: var(--fw-normal);
  color: var(--ni-gray-700);
  line-height: var(--lh-base);
  letter-spacing: var(--ls-body);
}

.ni-wrap a          { color: inherit; text-decoration: none; }
/* 프리셋 link_hover_color 반영: --link-hover 우선, 없으면 --primary, 없으면 --ni-red */
.ni-wrap a:hover    { color: var(--link-hover, var(--primary, var(--ni-red))); }
.ni-wrap img        { display: block; max-width: 100%; height: auto; }

/* ──────────────────────────────────────────────────────────────
   4. (상단 탭 바 삭제됨)
──────────────────────────────────────────────────────────────── */

/* ──────────────────────────────────────────────────────────────
   5. 뱃지
──────────────────────────────────────────────────────────────── */
.ni-badge {
  display: inline-block;
  font-size: var(--fs-xs);           /* 10px */
  font-weight: var(--fw-bold);
  padding: 2px 6px;
  border-radius: 2px;
  letter-spacing: .3px;
  vertical-align: middle;
  line-height: 1.4;
}
.ni-badge.breaking,
.ni-badge.ni-badge-break  { background: var(--badge-breaking, var(--ni-red));  color: #fff; }
.ni-badge.major,
.ni-badge.ni-badge-top    { background: var(--ni-blue); color: #fff; }
.ni-breaking-txt    { color: var(--badge-breaking, var(--ni-red)); margin-right: 3px; }

/* 지역명 배지 – 제목 앞 [여수] [순천] 등 */
.ni-region-badge {
  display: inline;
  font-size: .78em;
  font-weight: 700;
  letter-spacing: -.2px;
  vertical-align: baseline;
  white-space: nowrap;
  margin-right: 3px;
}
.ni-region-badge.ni-badge-region  { color: #1565c0; }
.ni-region-badge.ni-badge-breaking { color: var(--badge-breaking, #c62828); }
.ni-region-badge.ni-badge-etc      { color: #6a1b9a; }

/* ══════════════════════════════════════════════════════════════
   6. 헤드라인 블록 (index.php 상단)
      ┌──────────────────────────┬────────┬────────┐
      │  [이미지]                │[서브1] │[서브2] │
      │  카테고리                │ img    │ img    │
      │  H2 큰 제목              │ 제목   │ 제목   │
      │  • 불릿 요약             │ • 불릿 │ • 불릿 ├─
      │  기자명 | 시간           ├────────┼────────┤
      └──────────────────────────┴────────┴────────┘
══════════════════════════════════════════════════════════════ */
.ni-headline {
  display: grid;
  grid-template-columns: 1fr 440px;  /* 우측 서브 컬럼 440px */
  gap: 0;
  margin-bottom: 28px;               /* 헤드라인↔섹션 그리드 사이 여백 */
  border: 1px solid var(--ni-border);
  border-top: none;
}

/* 좌측: 메인 대형 기사 */
.ni-hl-main {
  border-right: 1px solid var(--ni-border);
  display: flex;
  flex-direction: column;
}
.ni-hl-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
}

/* 이미지 */
.ni-hl-img-wrap  { position: relative; overflow: hidden; flex-shrink: 0; }
.ni-hl-img {
  width: 100%;
  height: 290px;                     /* 메인 이미지 높이 290px (img.php 크롭 크기와 일치) */
  object-fit: cover;                 /* img.php cover 크롭과 일치 — 회색 여백 제거 */
  object-position: center top;       /* 미디어 상단 기준 크롭 */
  display: block;
  transition: transform .35s ease;
  background-color: var(--ni-gray-100);
}
.ni-hl-link:hover .ni-hl-img { transform: scale(1.02); }
.ni-hl-img-ph {
  width: 100%;
  height: 290px;
  background: var(--ni-gray-100);
  display: flex; align-items: center; justify-content: center;
  color: var(--ni-gray-300);
  font-size: 32px;
}

/* 이미지 아래 본문 */
.ni-hl-body {
  flex: 1;
  padding: 14px 18px 16px;   /* 상14 좌우18 하16 — 레퍼런스 기준 */
  display: flex;
  flex-direction: column;
}

/* 카테고리 레이블 */
.ni-hl-cat {
  display: inline-block;
  font-size: var(--fs-xs);           /* 10px */
  font-weight: var(--fw-bold);
  color: var(--ni-red);
  letter-spacing: .5px;
  margin-bottom: 7px;                /* 이미지↔제목 사이 호흡 최소화 */
  text-transform: uppercase;
}

/* 메인 제목 ── 24px / 800 / #111 */
.ni-hl-title {
  font-size: var(--fs-3xl);          /* 24px */
  font-weight: var(--fw-xbold);      /* 800 */
  color: var(--ni-gray-900);         /* #111 */
  line-height: 1.38;                 /* 레퍼런스: 약 1.38 */
  margin: 0 0 10px;
  letter-spacing: var(--ls-title);   /* -0.8px */
  word-break: keep-all;
  display: -webkit-box;
  -webkit-line-clamp: 4;             /* 레퍼런스: 3~4줄 허용 */
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .12s;
}
.ni-hl-link:hover .ni-hl-title { color: var(--ni-red); }

/* 불릿 요약 ── 13px / #555 */
.ni-hl-bullets { list-style: none; margin: 0 0 10px; padding: 0; flex: 1; }
.ni-hl-bullets li {
  position: relative;
  padding-left: 13px;                /* 레퍼런스: 불릿 들여쓰기 ~13px */
  font-size: var(--fs-base);         /* 13px */
  font-weight: var(--fw-normal);
  color: var(--ni-gray-600);         /* #555 */
  line-height: 1.55;                 /* 레퍼런스: 불릿 줄간격 1.55 */
  margin-bottom: 4px;                /* 불릿 항목 간격 4px */
  letter-spacing: var(--ls-xs);
  word-break: keep-all;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ni-hl-bullets li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--ni-gray-400);
  font-size: var(--np-fs-base);
  line-height: 1.55;
  top: 0;
}

/* 일반 요약 텍스트 */
.ni-hl-summary {
  font-size: var(--fs-base);         /* 13px */
  color: var(--ni-gray-600);
  line-height: var(--lh-base);
  margin: 0 0 12px;
  flex: 1;
  word-break: keep-all;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 메타 ── 11px / #888 */
.ni-hl-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-sm);           /* 11px */
  color: var(--ni-gray-400);
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid #f0f0f0;
}
.ni-hl-reporter { color: var(--ni-gray-600); font-weight: var(--fw-medium); }
.ni-hl-time     { color: var(--ni-gray-400); }
.ni-hl-reporter + .ni-hl-time::before {
  content: '|';
  margin-right: 8px;
  color: var(--ni-gray-200);
}

/* 우측: 서브기사 2×2 */
.ni-hl-subs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 0;
}
.ni-hl-sub-item {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--ni-border);
  border-right: 1px solid var(--ni-border);
  text-decoration: none;
  transition: background .12s;
  overflow: hidden;
}
.ni-hl-sub-item:nth-child(2n)  { border-right: none; }
.ni-hl-sub-item:nth-child(n+3) { border-bottom: none; }
.ni-hl-sub-item:hover          { background: var(--ni-gray-50); }

/* 서브 이미지 */
.ni-hl-sub-img-wrap { overflow: hidden; flex-shrink: 0; }
.ni-hl-sub-thumb {
  width: 100%;
  height: 130px;                     /* 서브 이미지 130px (img.php 크롭 크기와 일치) */
  object-fit: cover;                 /* img.php cover 크롭과 일치 — 회색 여백 제거 */
  object-position: center top;
  display: block;
  transition: transform .3s ease;
  background-color: var(--ni-gray-100);
}
.ni-hl-sub-item:hover .ni-hl-sub-thumb { transform: scale(1.04); }
.ni-hl-sub-thumb-ph {
  width: 100%; height: 130px;
  background: var(--ni-gray-100);
  display: flex; align-items: center; justify-content: center;
  color: var(--ni-gray-300); font-size: var(--np-fs-xl);
}

/* 서브 본문 */
.ni-hl-sub-body {
  padding: 9px 12px 10px;            /* 상9 좌우12 하10 — 컴팩트 */
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* 서브 제목 ── 13px / 700 / #111 */
.ni-hl-sub-tit {
  font-size: var(--fs-base);         /* 13px */
  font-weight: var(--fw-bold);       /* 700 */
  color: var(--ni-gray-900);         /* #111 */
  line-height: 1.42;                 /* 레퍼런스: 서브 제목 줄간격 */
  letter-spacing: var(--ls-body);
  word-break: keep-all;
  margin: 0 0 5px;                   /* 제목↔불릿 간격 5px */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .12s;
  flex: 1;
}
.ni-hl-sub-item:hover .ni-hl-sub-tit { color: var(--ni-red); }

/* 서브 불릿 ── 11px / #666 */
.ni-hl-sub-bullets { list-style: none; margin: 0 0 4px; padding: 0; }
.ni-hl-sub-bullets li {
  position: relative;
  padding-left: 10px;                /* 불릿 들여쓰기 10px */
  font-size: var(--fs-sm);           /* 11px */
  color: var(--ni-gray-500);         /* #666 */
  line-height: 1.5;
  margin-bottom: 2px;                /* 항목 간 2px */
  letter-spacing: var(--ls-xs);
  word-break: keep-all;
  display: -webkit-box;
  -webkit-line-clamp: 2;             /* 서브 불릿: 최대 2줄 */
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ni-hl-sub-bullets li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--ni-gray-300);
  font-size: var(--fs-sm);
  line-height: 1.5;
  top: 0;
}

/* 서브 날짜 ── 10px / #aaa */
.ni-hl-sub-time {
  font-size: var(--fs-xs);           /* 10px */
  color: var(--ni-gray-300);
  margin-top: auto;
  display: block;
}

/* ══════════════════════════════════════════════════════════════
   7. 카테고리 섹션 그리드 (index.php 본문) — 3열
══════════════════════════════════════════════════════════════ */
.ni-sections {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;                          /* 섹션 카드 사이 간격 */
  border: none;                       /* gap 사용 시 외곽 border 제거 */
  margin-top: 0;
}
.ni-section {
  border: 1px solid var(--ni-border); /* 각 카드에 테두리 */
  border-radius: 4px;
  overflow: hidden;
}

/* 섹션 헤더 */
.ni-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px 10px;
  border-bottom: 2px solid var(--ni-gray-900);
}

/* 섹션 타이틀 ── 16px / 800 / #111 */
.ni-sec-title {
  font-size: var(--fs-lg);           /* 16px */
  font-weight: var(--fw-xbold);      /* 800 */
  color: var(--ni-gray-900);
  letter-spacing: -0.6px;
  text-decoration: none;
}
.ni-sec-title:hover { color: var(--ni-red); }

/* 더보기 ── 11px / #888 */
.ni-sec-more {
  font-size: var(--fs-sm);           /* 11px */
  color: var(--ni-gray-400);
  text-decoration: none;
  display: flex; align-items: center; gap: 1px;
  transition: color .12s;
}
.ni-sec-more:hover  { color: var(--ni-red); }
.ni-sec-more span   { font-size: var(--fs-md); }

/* 빈 상태 */
.ni-sec-empty {
  padding: 28px 14px;
  text-align: center;
  color: var(--ni-gray-300);
  font-size: var(--np-fs-base);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.ni-sec-empty i { font-size: var(--np-fs-2xl); color: #ddd; }

/* 대표 기사 */
.ni-sec-top {
  display: block;
  text-decoration: none;
  transition: background .12s;
  position: relative;
}
.ni-sec-top:hover                  { background: var(--ni-gray-50); }
.ni-sec-top:hover .ni-sec-top-tit  { color: var(--ni-red); }

.ni-sec-top-img-wrap { position: relative; overflow: hidden; }
.ni-sec-top-img {
  width: 100%; height: 150px;
  object-fit: cover;                 /* img.php cover 크롭과 일치 — 회색 여백 제거 */
  object-position: center top;
  display: block;
  transition: transform .3s ease;
  background-color: var(--ni-gray-100);
}
.ni-sec-top:hover .ni-sec-top-img { transform: scale(1.03); }
.ni-sec-top-img-ph {
  width: 100%; height: 150px;
  background: var(--ni-gray-100);
  display: flex; align-items: center; justify-content: center;
  color: var(--ni-gray-300); font-size: var(--np-fs-3xl);
}

/* 대표 기사 제목 ── 14px / 700 / #222 */
.ni-sec-top-tit {
  font-size: var(--fs-md);           /* 14px */
  font-weight: var(--fw-bold);       /* 700 */
  color: var(--ni-gray-800);         /* #222 */
  line-height: 1.5;
  letter-spacing: -0.4px;
  word-break: keep-all;
  transition: color .12s;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 10px 14px 4px;
}

/* 대표 기사 날짜 ── 11px / #aaa */
.ni-sec-top-time {
  font-size: var(--fs-sm);           /* 11px */
  color: var(--ni-gray-300);
  display: block;
  padding: 0 14px 11px;
}

/* 나머지 기사 리스트 */
.ni-sec-list { list-style: none; margin: 0; padding: 0; }
.ni-sec-item { border-top: 1px solid #f0f0f0; }

.ni-sec-link {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 14px;                /* 기사 행 상하 여백 9→11px */
  text-decoration: none;
  transition: background .12s;
}
.ni-sec-link:hover                   { background: var(--ni-gray-50); }
.ni-sec-link:hover .ni-sec-item-tit  { color: var(--ni-red); }

.ni-sec-item-thumb {
  flex: 0 0 64px; height: 44px;
  object-fit: cover;
  background-color: var(--ni-gray-100);
}
.ni-sec-item-thumb-ph {
  flex: 0 0 64px; height: 44px;
  background: var(--ni-gray-100);
  display: flex; align-items: center; justify-content: center;
  color: var(--ni-gray-300); font-size: var(--np-fs-base);
}

.ni-sec-item-body { flex: 1; min-width: 0; }

/* 리스트 기사 제목 ── 12px / 500 / #222 */
.ni-sec-item-tit {
  font-size: var(--np-fs-base);                    /* 섹션 리스트는 컴팩트 12px 유지 */
  font-weight: var(--fw-medium);      /* 500 */
  color: var(--ni-gray-800);          /* #222 */
  line-height: 1.45;
  letter-spacing: var(--ls-body);
  word-break: keep-all;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .12s;
}

/* 리스트 날짜 ── 10px / #aaa */
.ni-sec-item-time {
  font-size: var(--fs-xs);           /* 10px */
  color: var(--ni-gray-300);
  margin-top: 3px;
  display: block;
}

/* ──────────────────────────────────────────────────────────────
   8. 목록 페이지 헤더 (_list_common.php)
──────────────────────────────────────────────────────────────── */
.ni-list-content { padding: 0; }

.ni-list-header {
  margin: 20px 0 14px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--ni-gray-900);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

/* 목록 페이지 카테고리 제목 ── 20px / 800 / #111 */
.ni-list-title {
  font-size: var(--fs-2xl);          /* 20px */
  font-weight: var(--fw-xbold);      /* 800 */
  color: var(--ni-gray-900);         /* #111 */
  letter-spacing: -0.6px;
}

/* 건수 ── 12px / #888 */
.ni-list-count {
  font-size: var(--np-fs-base);
  color: var(--ni-gray-400);
  font-weight: var(--fw-normal);
}
.ni-list-count strong { color: var(--ni-gray-700); }

/* 빈 상태 */
.ni-empty {
  padding: 70px 0;
  text-align: center;
  color: var(--ni-gray-300);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.ni-empty i { font-size: 32px; color: #ddd; }
.ni-empty p { font-size: var(--fs-md); color: var(--ni-gray-400); margin: 0; }
.ni-empty a { font-size: var(--fs-base); color: var(--ni-gray-400); text-decoration: underline; }

/* ──────────────────────────────────────────────────────────────
   9. 상단 헤드라인 2단 그리드 (목록 페이지)
──────────────────────────────────────────────────────────────── */
.ni-top-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--ni-border);
  margin-bottom: 0;
}
.ni-top-item { overflow: hidden; }
.ni-top-item:first-child { border-right: 1px solid var(--ni-border); }

.ni-top-link {
  display: block;
  text-decoration: none;
  transition: background .12s;
}
.ni-top-link:hover                  { background: var(--ni-gray-50); }
.ni-top-link:hover .ni-top-tit      { color: var(--ni-red); }

.ni-top-img-wrap { position: relative; overflow: hidden; }
.ni-top-img {
  width: 100%; height: 200px;
  object-fit: cover;                 /* img.php cover 크롭과 일치 — 회색 여백 제거 */
  object-position: center top;
  display: block;
  transition: transform .3s ease;
  background-color: var(--ni-gray-100);
}
.ni-top-link:hover .ni-top-img { transform: scale(1.03); }
.ni-top-img-ph {
  width: 100%; height: 200px;
  background: var(--ni-gray-100);
  display: flex; align-items: center; justify-content: center;
  color: var(--ni-gray-300); font-size: 32px;
}

.ni-top-body { padding: 14px 16px 16px; }

/* 헤드라인 기사 제목 ── 16px / 700 / #111 */
.ni-top-tit {
  font-size: var(--fs-lg);           /* 16px */
  font-weight: var(--fw-bold);       /* 700 */
  color: var(--ni-gray-900);         /* #111 */
  line-height: 1.5;
  letter-spacing: -0.5px;
  word-break: keep-all;
  transition: color .12s;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 7px;
}

/* 헤드라인 요약 ── 12px / #666 */
.ni-top-summary {
  font-size: var(--np-fs-base);
  color: var(--ni-gray-500);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 7px;
}

/* 헤드라인 날짜 ── 11px / #aaa */
.ni-top-time {
  font-size: var(--fs-sm);           /* 11px */
  color: var(--ni-gray-300);
  display: block;
}

/* ──────────────────────────────────────────────────────────────
   10. 기사 리스트 (목록 페이지)
──────────────────────────────────────────────────────────────── */
.ni-list-wrap            { border-top: 1px solid var(--ni-border); }
.ni-list-wrap.no-top-border { border-top: none; }
.ni-top-grid + .ni-list-wrap { border-top: none; }

.ni-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid #f0f0f0;
  text-decoration: none;
  transition: background .12s;
}
.ni-item:hover                  { background: var(--ni-gray-50); }
.ni-item:hover .ni-item-tit     { color: var(--ni-red); }

/* 썸네일 — 프리셋 list_thumbnail_size 반영 (--thumb-w / --thumb-h) */
.ni-item-thumb-wrap { flex: 0 0 var(--thumb-w, 140px); }
.ni-item-thumb {
  width: var(--thumb-w, 140px); height: var(--thumb-h, 94px);
  object-fit: cover; display: block;
  background-color: var(--ni-gray-100);
}
.ni-item-thumb-ph {
  width: var(--thumb-w, 140px); height: var(--thumb-h, 94px);
  background: var(--ni-gray-100);
  display: flex; align-items: center; justify-content: center;
  color: var(--ni-gray-300); font-size: 28px;
}

.ni-item-body { flex: 1; min-width: 0; }
.ni-item-meta {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 6px;
}

/* 기사 목록 제목 ── 17px / 700 / #111 */
.ni-item-tit {
  font-size: var(--fs-xl);           /* 17px */
  font-weight: var(--fw-bold);       /* 700 */
  color: var(--ni-gray-900);         /* #111 */
  line-height: 1.5;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
  word-break: keep-all;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .12s;
}

/* 기사 목록 요약 ── 13px / #666 */
.ni-item-summary {
  font-size: var(--fs-base);         /* 13px */
  color: var(--ni-gray-500);
  line-height: 1.55;
  margin-bottom: 8px;
  word-break: keep-all;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 기사 목록 하단 정보 ── 11px / #888 */
.ni-item-foot {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--fs-sm);           /* 11px */
  color: var(--ni-gray-400);
}
.ni-item-foot .sep { color: var(--ni-gray-200); }

/* ──────────────────────────────────────────────────────────────
   11. 페이지네이션
──────────────────────────────────────────────────────────────── */
.ni-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2px;
  padding: 28px 0 8px;
  flex-wrap: wrap;
}

/* 페이지 버튼 ── 13px / #555 */
.ni-pag-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 6px;
  font-size: var(--fs-base);         /* 13px */
  font-weight: var(--fw-normal);
  color: var(--ni-gray-600);
  background: #fff;
  border: 1px solid var(--ni-border);
  text-decoration: none;
  border-radius: 2px;
  transition: background .1s, color .1s, border-color .1s;
  cursor: pointer;
  line-height: 1;
}
.ni-pag-btn:hover {
  background: var(--ni-gray-50);
  border-color: var(--ni-border-h);
  color: var(--ni-gray-800);
}
.ni-pag-btn.active {
  background: var(--ni-red);
  border-color: var(--ni-red);
  color: #fff;
  font-weight: var(--fw-bold);
  cursor: default;
}
.ni-pag-btn.disabled { color: var(--ni-gray-200); cursor: default; }
.ni-pag-btn.disabled:hover {
  background: #fff;
  border-color: var(--ni-border);
  color: var(--ni-gray-200);
}

/* ══════════════════════════════════════════════════════════════
   12. 기사 상세 (detail.php) — 중앙 단일 컬럼
══════════════════════════════════════════════════════════════ */

/* 기사 컨테이너 */
.ni-art-container {
  max-width: var(--ni-art-w);        /* 720px — 연합뉴스 동일 */
  margin: 0 auto;
  padding: 28px 40px 80px;           /* 연합뉴스 좌우여백 40px */
}

/* ══════════════════════════════════════════════════════════════
   브레드크럼 — 단계별 시각화 v2
   홈 → 뉴스 → 카테고리 → 현재기사(말줄임)
══════════════════════════════════════════════════════════════ */
/* 브레드크럼 — 연합뉴스: 배지 없이 텍스트 링크만 */
.ni-breadcrumb { margin-bottom: 16px; }
.ni-bc-list {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 0; list-style: none; margin: 0; padding: 0;
  background: none; border-radius: 0; border: none;
  overflow: hidden;
}
.ni-bc-item { display: flex; align-items: center; gap: 0; min-width: 0; }
.ni-bc-arrow {
  font-size: var(--np-fs-base); color: #b0b8c4; margin: 0 5px; flex-shrink: 0;
  font-style: normal;
}
.ni-bc-arrow::before { content: '>'; }
.ni-bc-icon  { display: none; }  /* 연합뉴스는 아이콘 없음 */
.ni-bc-link {
  display: inline-block;
  font-size: var(--np-fs-base); color: #888 !important; text-decoration: none;
  padding: 0; border-radius: 0;
  transition: color 0.12s; white-space: nowrap;
}
.ni-bc-link:hover { background: none; color: var(--ni-red) !important; text-decoration: underline; }
.ni-bc-link:hover .ni-bc-icon { color: var(--ni-red); }
/* 현재 단계 */
.ni-bc-current .ni-bc-now {
  display: inline-block;
  font-size: var(--np-fs-base); font-weight: var(--fw-normal); color: #555;
  padding: 0; background: none; border: none; border-radius: 0;
  max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ni-bc-current .ni-bc-icon { display: none; }
/* 다크모드 */
html[data-theme="dark"] .ni-bc-list { background: none; border-color: transparent; }
html[data-theme="dark"] .ni-bc-link { color: #7a8ba0 !important; }
html[data-theme="dark"] .ni-bc-link:hover { background: none; color: #adbfd0 !important; }
html[data-theme="dark"] .ni-bc-current .ni-bc-now { background: none; border: none; color: #8a9ab0; }
html[data-theme="dark"] .ni-bc-arrow { color: #4a5a6e; }

/* ── 기사 헤더 — 연합뉴스 스타일 ── */
.ni-art-header {
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 2px solid #222;   /* 연합뉴스: 진한 하단 선 */
}
.ni-art-header-top {
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}

/* 카테고리 레이블 ── 연합뉴스: 12px / 700 / red */
.ni-art-category {
  display: inline-block;
  font-size: var(--np-fs-base);
  font-weight: var(--fw-bold);
  color: var(--ni-red) !important;
  letter-spacing: .5px;
  text-decoration: none;
  text-transform: uppercase;
}
.ni-art-category:hover { text-decoration: underline; }

/* 기사 제목 ── 32px / 700 / #111 — 연합뉴스 기준 */
.ni-art-title {
  font-size: var(--fs-4xl);          /* 32px — 연합뉴스 ~32px */
  font-weight: var(--fw-bold);       /* 700 — 연합뉴스는 700 사용 */
  color: var(--ni-gray-900);         /* #111 */
  line-height: 1.45;
  letter-spacing: var(--ls-title);   /* -0.5px */
  margin: 0 0 14px;
  word-break: keep-all;
}

/* 부제 ── 18px / 600 / #444 — 연합뉴스 18px/600 */
.ni-art-subtitle {
  font-size: var(--fs-xl);           /* 18px — 연합뉴스 기준 */
  font-weight: var(--fw-semi);       /* 600 — 연합뉴스 600 */
  color: #444;                       /* 연합뉴스는 진하게 표시 */
  line-height: 1.5;          /* 연합뉴스 1.5 */
  margin: 0 0 36px;          /* 연합뉴스 40px 근사 */
  letter-spacing: var(--ls-body);
  word-break: break-word;    /* 연합뉴스: break-word */
}

/* ══════════════════════════════════════════════════════════════
   메타 칩 영역 (지역·기자·날짜·조회수)
══════════════════════════════════════════════════════════════ */
/* 메타 영역 — 연합뉴스: 배지 없는 심플 텍스트 스타일 */
.ni-art-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 16px;
  padding: 10px 0;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
}
.ni-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--np-fs-base);        /* 연합뉴스 메타 13px */
  font-weight: 400;
  padding: 0 12px 0 0;
  border-radius: 0;
  border: none;
  white-space: nowrap;
  line-height: 1.6;
  color: #666;
  background: none;
}
.ni-meta-chip i { font-size: var(--np-fs-base); color: #999; }
/* 첫 번째 칩(기자명)은 좌측 패딩 없음 */
.ni-meta-chip:first-child { padding-left: 0; }
.ni-chip-reporter { color: #333; font-weight: 500; }
.ni-chip-date     { color: #666; }
.ni-chip-send-label {
  font-size: var(--np-fs-base);
  color: #999;
  font-weight: 400;
  margin-right: 4px;
  letter-spacing: 0;
}
.ni-chip-view     { color: #888; }
html[data-theme="dark"] .ni-art-meta-row { border-color: #2d3650; }
html[data-theme="dark"] .ni-meta-chip { background: none; border: none; }
html[data-theme="dark"] .ni-chip-reporter { color: #c8d4de; }
html[data-theme="dark"] .ni-chip-date,
html[data-theme="dark"] .ni-chip-view     { color: #7a8ba0; }

/* ══════════════════════════════════════════════════════════════
   편의 툴바 (공유·글자크기·인쇄)
══════════════════════════════════════════════════════════════ */
.ni-art-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 0;
  background: none;         /* 연합뉴스: 배경 없음 */
  border: none;             /* 연합뉴스: 테두리 없음 */
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
  border-radius: 0;
  margin-bottom: 24px;
}
.ni-toolbar-group { display: flex; align-items: center; gap: 4px; }
.ni-toolbar-label {
  font-size: var(--np-fs-base); color: #9ea8b4; font-weight: 600;
  letter-spacing: 0.3px; margin-right: 2px; white-space: nowrap;
}
.ni-toolbar-divider { width:1px; height:20px; background:#e0e4ea; margin:0 4px; flex-shrink:0; }

/* 공통 툴 버튼 */
.ni-tool-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.4em; width: auto; height: 30px; padding: 0 8px;
  border-radius: 6px;
  border: 1px solid #dde2ea;
  background: #fff;
  color: #5a6578;
  font-size: var(--np-fs-base);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s, color 0.12s, border-color 0.12s, transform 0.08s;
  flex-shrink: 0;
}
.ni-tool-btn:hover { background:#eef2f8; color:#1a3a6e; border-color:#b8c8de; transform:translateY(-1px); }
.ni-tool-btn:active { transform:translateY(0); }
/* 소셜 */
.ni-tool-fb { border-color:#c8dbf8; color:#1877f2; background:#eef4ff; }
.ni-tool-fb:hover { background:#deeaff; color:#0d5dbf; border-color:#a8c4f0; }
.ni-tool-tw { border-color:#b8e4fb; color:#1da1f2; background:#edf8ff; }
.ni-tool-tw:hover { background:#d6f0ff; color:#0c86d4; border-color:#88cef0; }
.ni-tool-kakao { border-color:#f0d860; color:#3c1e1e; background:#fef8c8; }
.ni-tool-kakao:hover { background:#fef0a0; border-color:#e0c840; }
.ni-tool-copy { border-color:#d8dde6; color:#5a6578; }
.ni-tool-copy:hover { background:#eef2f8; color:#2c3a4a; }
.ni-tool-print { border-color:#d8dde6; color:#5a6578; }
.ni-tool-print:hover { background:#eef2f8; color:#2c3a4a; }
/* 폰트 버튼 활성 */
.ni-font-btn.ni-font-active {
  background: #1a5fa8 !important; color:#fff !important; border-color:#1a5fa8 !important;
}
.ni-font-btn.ni-font-active:hover { background:#134d8a !important; transform:none; }
/* 다크모드 툴바 */
html[data-theme="dark"] .ni-art-toolbar  { background:#1e2535; border-color:#2d3650; }
html[data-theme="dark"] .ni-toolbar-divider { background:#2d3650; }
html[data-theme="dark"] .ni-tool-btn    { background:#252f42; border-color:#354358; color:#8a9ab2; }
html[data-theme="dark"] .ni-tool-btn:hover { background:#2d3c58; color:#bfd3ec; border-color:#4a5e7a; }
html[data-theme="dark"] .ni-font-btn.ni-font-active { background:#2563a8 !important; border-color:#2563a8 !important; }

/* ── 기자 정보 ── 13px / 600 / #222 */
/* 기자 정보 — 연합뉴스: 아바타 없이 이름+역할만 1줄 */
.ni-art-writer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0 14px;
  border-bottom: 1px solid var(--ni-border);
  margin-bottom: 20px;
}
.ni-art-writer-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--ni-red);    /* 연합뉴스식 레드 아바타 */
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.ni-art-writer-avatar img {
  width: 100%; height: 100%;
  object-fit: cover; border-radius: 50%;
}
/* 이니셜 아바타 (프로필 이미지 없을 때) */
.ni-writer-initial {
  font-size: var(--np-fs-base);
  font-weight: 700;
  color: #fff;
  line-height: 1;
  font-family: var(--ni-font);
}
.ni-art-writer-name {
  font-size: var(--np-fs-base);   /* 연합뉴스 기자명 14px */
  font-weight: var(--fw-semi);
  color: #333;
}
.ni-art-writer-name span {
  font-weight: var(--fw-normal);
  color: #888;
  margin-left: 4px;
}

/* ── 대표 이미지 ── */
/* 대표 이미지 — 연합뉴스: 풀-블리드 + 원본 비율 유지 */
.ni-art-figure {
  margin: 0 -40px 28px;   /* 컨테이너 패딩 40px 상쇄 → 풀-블리드 */
  overflow: hidden;
  border-radius: 0;        /* 풀-블리드는 radius 없음 */
}
.ni-art-img {
  width: 100%;
  height: auto;            /* 원본 비율 유지 */
  max-height: 550px;       /* 연합뉴스 image-zone0 기준 550px */
  object-fit: contain;     /* 비율 유지, 왜곡 없음 */
  display: block;
  background-color: var(--ni-gray-100);
}

/* 캡션 ── 연합뉴스: 14px / #666, 좌우 16px 여백 */
.ni-art-caption {
  font-size: var(--np-fs-base);           /* 연합뉴스 캡션 ~13px */
  color: #666;
  padding: 10px 16px 6px;   /* 연합뉴스: 좌우 16px */
  line-height: 1.6;
  background: none;
  border-top: none;
}

/* ── 기사 본문 ── 17px / 400 / #333 / 행간 1.95 */
.ni-art-body {
  font-size: var(--fs-xl);           /* 18px — 연합뉴스 18px */
  font-weight: var(--fw-normal);
  color: var(--ni-gray-700);         /* #333 */
  line-height: var(--lh-body);       /* 1.5 — 연합뉴스 데스크톱 1.5 */
  letter-spacing: var(--ls-xs);      /* -0.2px */
  word-break: break-word;   /* 연합뉴스: break-word */
  overflow-wrap: break-word;
  word-wrap: break-word;
  margin-bottom: 24px;
  padding-top: 8px;
  overflow-x: hidden;
}
.ni-art-body p              { margin: 0 0 24px; }   /* 단락 기본 간격 24px — 연합뉴스 article-font1 기준 */
.ni-art-body p:last-child   { margin-bottom: 0; }
.ni-art-body strong         { font-weight: var(--fw-bold); color: var(--ni-gray-900); }
.ni-art-body a              { color: #0055a4; text-decoration: none; border-bottom: 1px solid #b3ccef; }   /* 연합뉴스 링크 스타일 */
/* 본문 내 미디어 요소 반응형 봉인 (외부 콘텐츠 삽입 대비) */
.ni-art-body img,
.ni-art-body video,
.ni-art-body iframe,
.ni-art-body embed,
.ni-art-body object {
  max-width: 100% !important;
  height: auto;
}
.ni-art-body table {
  width: 100%;
  max-width: 100%;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-collapse: collapse;
}
/* 리드 문장 (-, ·, ○ 등으로 시작) */
.ni-art-body p.ni-art-lead {
  color: var(--ni-gray-600);
  font-size: calc(var(--fs-xl) - 1px);
  font-weight: var(--fw-medium, 500);
  border-left: 3px solid var(--ni-blue, #2563eb);
  padding-left: 12px;
  margin-bottom: 16px;
  line-height: 1.75;
}

/* ── 공지 단락 (※ 로 시작 — 광양 단문 공지 특화) ── */
.ni-art-body p.ni-art-notice {
  color: #3d4f6a;
  font-size: calc(var(--fs-xl) - 1px);
  font-weight: var(--fw-medium, 500);
  background: #f0f4ff;
  border-left: 3px solid #4e88e6;
  border-radius: 0 5px 5px 0;
  padding: 10px 14px;
  margin-bottom: 6px;
  line-height: 1.75;
}

/* 공지 단락 하위 — (첨부파일 참고) 같은 괄호 안내 */
.ni-art-body p.ni-art-note-sub {
  font-size: var(--np-fs-base);
  color: #8a97aa;
  margin-bottom: 4px;
  padding-left: 6px;
  line-height: 1.6;
}
.ni-art-body p.ni-art-note-attach {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f3f5f8;
  border: 1px dashed #cdd3dc;
  border-radius: 4px;
  padding: 3px 10px;
  font-size: var(--np-fs-base);
  color: #8a97aa;
  margin-bottom: 6px;
}
/* 들여쓰기된 - 항목 (공지 하위) */
.ni-art-body p.ni-art-lead.ni-art-note-indent {
  border-left-color: #a0b4d0;
  background: #f7f9fc;
  padding: 7px 12px;
  font-size: var(--np-fs-base);
  color: #5a6e88;
  margin-bottom: 4px;
  border-radius: 0 4px 4px 0;
}

/* ══════════════════════════════════════════════════════
   참조 정보 블록 — 전남도청 담당자·첨부파일 안내
   (본문 하단 구분선 이하 회색 약한 영역으로 표시)
══════════════════════════════════════════════════════ */
.ni-art-ref-block {
  margin-top: 28px;
  border-top: 1px dashed #dde1e7;
  padding-top: 0;
}

/* 구분선 라벨 */
.ni-art-ref-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  position: relative;
  top: -10px;
}
.ni-art-ref-divider::before {
  content: '';
  flex: 1;
  height: 1px;
  background: transparent;
}
.ni-art-ref-divider-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--np-fs-base);
  font-weight: 600;
  color: #9ea8b3;
  background: #fff;
  padding: 2px 10px 2px 8px;
  border: 1px solid #e2e6ea;
  border-radius: 20px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  white-space: nowrap;
}
.ni-art-ref-divider-label i {
  font-size: var(--np-fs-base);
  color: #b0bac5;
}

/* 참조 목록 */
.ni-art-ref-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.ni-art-ref-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: var(--np-fs-base);
  line-height: 1.6;
  color: #8c97a5;
  padding: 7px 12px;
  background: #f8f9fb;
  border-radius: 6px;
  border: 1px solid #ebeef2;
  transition: background 0.15s;
}
.ni-art-ref-item:hover { background: #f2f4f8; }

/* 태그 배지 (담당 / 첨부) */
.ni-ref-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  font-size: var(--np-fs-base);
  font-weight: 700;
  letter-spacing: 0.2px;
  padding: 2px 7px;
  border-radius: 4px;
  margin-top: 1px;
  line-height: 1.4;
  white-space: nowrap;
}
.ni-ref-tag i { font-size: var(--np-fs-base); }

/* 담당 태그 — 파란 계열 연하게 */
.ni-ref-tag-contact {
  color: #4e88e6;
  background: #e8f0ff;
  border: 1px solid #c9d9f8;
}

/* 첨부 태그 — 회색 계열 */
.ni-ref-tag-attach {
  color: #7a8899;
  background: #edf0f4;
  border: 1px solid #dce1e8;
}

/* 참조 내용 텍스트 */
.ni-ref-content {
  color: #8c97a5;
  flex: 1;
  line-height: 1.65;
}

/* 담당자 개별 span */
.ni-ref-person {
  color: #7a8d9f;
  font-weight: 500;
}
.ni-ref-sep {
  color: #c5cbd3;
  margin: 0 4px;
  font-size: var(--np-fs-base);
}

/* 기타 참조 줄 */
.ni-art-ref-etc .ni-ref-content {
  color: #9ea8b3;
  font-style: italic;
}

/* 모바일 대응 */
@media (max-width: 480px) {
  .ni-art-ref-item  { flex-direction: column; gap: 4px; padding: 8px 10px; }
  .ni-ref-tag       { font-size: var(--np-fs-base); }
  .ni-art-ref-divider-label { font-size: var(--np-fs-base); }
}

/* ── 태그 ── 12px / #555 */
.ni-art-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 24px 0;
  padding-top: 18px;
  border-top: 1px solid var(--ni-border);
}
.ni-art-tag {
  font-size: var(--np-fs-base);
  color: var(--ni-gray-600);
  background: var(--ni-gray-50);
  border: 1px solid var(--ni-border);
  border-radius: 14px;
  padding: 4px 12px;
  text-decoration: none;
  transition: background .1s, color .1s, border-color .1s;
}
.ni-art-tag:hover {
  background: var(--ni-red-light);
  color: var(--ni-red);
  border-color: var(--ni-red);
}

/* ── 이전·다음 네비 ── */
.ni-art-nav {
  margin: 24px 0;
  border: 1px solid var(--ni-border);
}
.ni-art-nav-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.ni-nav-prev,
.ni-nav-next {
  display: block;
  padding: 16px 18px;
  text-decoration: none;
  transition: background .12s;
}
.ni-nav-prev                { border-right: 1px solid var(--ni-border); }
.ni-nav-prev:hover,
.ni-nav-next:hover          { background: var(--ni-gray-50); }
.ni-nav-disabled            { opacity: .38; cursor: default; }

/* 네비 레이블 ── 11px / #aaa */
.ni-nav-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-sm);           /* 11px */
  color: var(--ni-gray-300);
  margin-bottom: 5px;
}
.ni-nav-next .ni-nav-label { justify-content: flex-end; }

/* 네비 제목 ── 13px / 500 / #333 */
.ni-nav-tit {
  font-size: var(--fs-base);         /* 13px */
  font-weight: var(--fw-medium);     /* 500 */
  color: var(--ni-gray-700);         /* #333 */
  line-height: 1.4;
  letter-spacing: var(--ls-body);
  word-break: keep-all;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .12s;
}
.ni-nav-next .ni-nav-tit { text-align: right; }
.ni-nav-prev:hover .ni-nav-tit,
.ni-nav-next:hover .ni-nav-tit { color: var(--ni-red); }

/* ── 연관기사 ── */
.ni-related {
  margin: 24px 0;
  padding-top: 18px;
  border-top: 2px solid var(--ni-gray-900);
}

/* 연관기사 헤드 ── 16px / 700 / #111 */
.ni-related-head {
  font-size: var(--fs-lg);           /* 16px */
  font-weight: var(--fw-bold);       /* 700 */
  color: var(--ni-gray-900);
  margin-bottom: 14px;
  letter-spacing: -0.5px;
}

.ni-related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--ni-border);
}
.ni-related-item          { border-right: 1px solid var(--ni-border); }
.ni-related-item:last-child { border-right: none; }
.ni-related-link {
  display: block;
  padding: 13px;
  text-decoration: none;
  transition: background .12s;
}
.ni-related-link:hover               { background: var(--ni-gray-50); }
.ni-related-link:hover .ni-related-tit { color: var(--ni-red); }

.ni-related-thumb {
  width: 100%; height: 90px;
  object-fit: cover;                    /* img.php cover 크롭과 일치 — 회색 여백 제거 */
  object-position: center top;
  display: block;
  margin-bottom: 9px;
  background-color: var(--ni-gray-100);
}
.ni-related-thumb-ph {
  width: 100%; height: 90px;
  background: var(--ni-gray-100);
  display: flex; align-items: center; justify-content: center;
  color: var(--ni-gray-300); font-size: var(--np-fs-xl);
  margin-bottom: 9px;
}

/* 연관기사 카테고리 ── 10px / red */
.ni-related-cat {
  font-size: var(--fs-xs);           /* 10px */
  color: var(--ni-red);
  font-weight: var(--fw-bold);
  margin-bottom: 4px;
  display: block;
}

/* 연관기사 제목 ── 12px / 500 / #222 */
.ni-related-tit {
  font-size: var(--np-fs-base);
  font-weight: var(--fw-medium);     /* 500 */
  color: var(--ni-gray-800);         /* #222 */
  line-height: 1.45;
  letter-spacing: var(--ls-body);
  word-break: keep-all;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .12s;
}

/* 연관기사 날짜 ── 10px / #aaa */
.ni-related-time {
  font-size: var(--fs-xs);           /* 10px */
  color: var(--ni-gray-300);
  margin-top: 5px;
  display: block;
}

/* ──────────────────────────────────────────────────────────────
   13. 반응형
──────────────────────────────────────────────────────────────── */

/* 1100px 이하 */
@media (max-width: 1100px) {
  .ni-sections  { grid-template-columns: repeat(2, 1fr); }
  .ni-headline  { grid-template-columns: 1fr 360px; }
}

/* 900px 이하 */
@media (max-width: 900px) {
  .ni-headline             { grid-template-columns: 1fr; }
  .ni-hl-main              { border-right: none; border-bottom: 1px solid var(--ni-border); }
  .ni-hl-subs              { grid-template-columns: 1fr 1fr; border-top: none; }
  .ni-hl-img               { height: 220px; }
  .ni-hl-img-ph            { height: 220px; }
  .ni-hl-title             { font-size: var(--np-fs-xl); }   /* 24→20 */
  .ni-hl-sub-thumb         { height: 110px; }
  .ni-hl-sub-thumb-ph      { height: 110px; }
  .ni-hl-sub-item:nth-child(2n)  { border-right: none; }
  .ni-hl-sub-item:nth-child(n+3) { border-bottom: none; }

  .ni-sections             { grid-template-columns: 1fr; gap: 14px; }
  .ni-section              { border: 1px solid var(--ni-border); }

  .ni-top-grid             { grid-template-columns: 1fr; }
  .ni-top-item:first-child { border-right: none; border-bottom: 1px solid var(--ni-border); }
  .ni-top-img              { height: 210px; }
  .ni-top-img-ph           { height: 210px; }

  .ni-related-grid         { grid-template-columns: 1fr 1fr; }
  .ni-related-item:nth-child(even)  { border-right: none; }
  .ni-related-item:nth-child(n+3)   { border-top: 1px solid var(--ni-border); }

  .ni-art-nav-inner        { grid-template-columns: 1fr; }
  .ni-nav-prev             { border-right: none; border-bottom: 1px solid var(--ni-border); }
  .ni-nav-next .ni-nav-label { justify-content: flex-start; }
  .ni-nav-next .ni-nav-tit   { text-align: left; }
  .ni-nav-disabled .ni-nav-tit { text-align: left; }

  .ni-art-title            { font-size: 28px; }   /* 32→26 (태블릿) */
  .ni-art-container        { padding: 20px 24px 50px; }   /* 태블릿 여백 */
  .ni-art-body             { font-size: var(--np-fs-lg); line-height: 1.7; }   /* 연합뉴스: 태블릿도 18px */
  .ni-art-figure           { margin: 0 -24px 24px; }   /* 태블릿 풀-블리드 24px 상쇄 */
}

/* 600px 이하 — 모바일 */
@media (max-width: 600px) {

  /* ── 전체 래퍼 패딩 ── */
  .ni-wrap                 { padding-bottom: 40px; }   /* 좌우 패딩 SSOT 는 layout.css 통합 규칙 */

  /* ── 목록 헤더 ── */
  .ni-list-header          { margin: 14px 10px 10px; }
  .ni-list-title           { font-size: var(--np-fs-md); }

  /* ── 상단 헤드라인 2단 → 1단 세로 전환 ── */
  .ni-top-grid             { grid-template-columns: 1fr; border: none; gap: 0; }
  .ni-top-item             { border: none; border-bottom: 6px solid #f1f5f9; }
  .ni-top-item:first-child { border-right: none; border-bottom: 6px solid #f1f5f9; }
  .ni-top-img-wrap         { position: relative; overflow: hidden; }
  .ni-top-img {
    width: 100%;
    height: 200px;           /* 모바일 헤드라인 이미지 충분한 높이 */
    object-fit: cover;
    object-position: center top;
    display: block;
    border-radius: 0;
  }
  .ni-top-img-ph           { height: 180px; font-size: var(--np-fs-hero); }
  .ni-top-body             { padding: 12px 12px 14px; }
  .ni-top-tit              { font-size: var(--np-fs-base); line-height: 1.5; -webkit-line-clamp: 3; }
  .ni-top-summary          { display: none; }   /* 모바일에서 요약 숨김 */
  .ni-top-time             { font-size: var(--np-fs-base); }

  /* ── 뉴스 목록 아이템: 좌측 썸네일 + 우측 텍스트 ── */
  .ni-item                 { gap: 12px; padding: 14px 10px; align-items: center; }
  .ni-item-thumb-wrap      { flex: 0 0 110px; }  /* 96→110px (더 크게) */
  .ni-item-thumb {
    width: 110px;
    height: 76px;            /* 4:3 비율 유지 */
    object-fit: cover;
    object-position: center;
    border-radius: 4px;
    background-color: #f1f5f9;
  }
  .ni-item-thumb-ph {
    width: 110px;
    height: 76px;
    border-radius: 4px;
    font-size: 24px;
  }
  .ni-item-tit             { font-size: var(--np-fs-base); line-height: 1.5; -webkit-line-clamp: 3; margin-bottom: 4px; }
  .ni-item-summary         { display: none; }   /* 요약 숨김 */
  .ni-item-foot            { font-size: var(--np-fs-base); gap: 5px; }
  .ni-item-meta            { margin-bottom: 4px; }

  /* ── 홈 헤드라인 블록 ── */
  .ni-headline             { grid-template-columns: 1fr; border: none; }
  .ni-hl-main              { border-right: none; border-bottom: 6px solid #f1f5f9; }
  .ni-hl-img {
    width: 100%;
    height: 220px;
    object-fit: cover;                 /* 모바일도 cover 유지 — 회색 여백 제거 */
    object-position: center top;
  }
  .ni-hl-img-ph            { height: 220px; font-size: 32px; }
  .ni-hl-body              { padding: 12px 12px 14px; }
  .ni-hl-title             { font-size: var(--np-fs-md); line-height: 1.45; -webkit-line-clamp: 3; }
  .ni-hl-bullets           { display: none; }   /* 불릿 숨김 */
  .ni-hl-subs              { grid-template-columns: 1fr 1fr; }
  .ni-hl-sub-thumb         { height: 100px; }
  .ni-hl-sub-thumb-ph      { height: 100px; }
  .ni-hl-sub-tit           { font-size: var(--np-fs-base); -webkit-line-clamp: 2; }
  .ni-hl-sub-bullets       { display: none; }

  /* ── 섹션 그리드 ── */
  .ni-sections             { grid-template-columns: 1fr; gap: 12px; }
  .ni-section              { border: 1px solid var(--ni-border); }
  .ni-sec-top-img          { height: 140px; }   /* 160→140px */
  .ni-sec-top-img-ph       { height: 140px; }

  /* ── 기사 상세 — 연합뉴스 모바일 스타일 ── */
  .ni-art-title            { font-size: 24px; line-height: 1.45; }  /* 연합뉴스 모바일 약 22px */
  .ni-art-subtitle         { font-size: var(--np-fs-base); }
  .ni-art-body             { font-size: var(--np-fs-lg); line-height: 1.7; }   /* 연합뉴스 모바일: 18px / 1.7 */
  .ni-art-container        { padding: 14px 16px 50px; }   /* 연합뉴스 모바일 16px 여백 */
  /* 대표 이미지 모바일 — 연합뉴스: 원본 비율 유지 */
  .ni-art-figure           { margin: 0 -16px 20px; border-radius: 0; }
  .ni-art-img {
    width: 100% !important;
    height: auto !important;
    max-height: none;       /* 연합뉴스: 모바일도 크롭 없음 */
    object-fit: contain;    /* 비율 유지, 왜곡 없음 */
    border-radius: 0;
    display: block;
  }
  .ni-art-body p           { margin: 0 0 24px; }   /* 연합뉴스 모바일: article-font1 24px */

  /* ── 연관 기사 ── */
  .ni-related-grid         { grid-template-columns: 1fr 1fr; }

  /* ── 페이지네이션 ── */
  .ni-pag-btn              { min-width: 30px; height: 30px; font-size: var(--np-fs-base); }
  .ni-pagination           { padding: 20px 0 6px; gap: 3px; }
}

/* 480px 이하 — 소형 모바일 추가 최적화 */
@media (max-width: 480px) {
  .ni-top-img              { height: 185px; }
  .ni-top-tit              { font-size: var(--np-fs-base); }

  .ni-item                 { gap: 10px; padding: 12px 8px; }
  .ni-item-thumb-wrap      { flex: 0 0 96px; }
  .ni-item-thumb           { width: 96px; height: 66px; border-radius: 3px; }
  .ni-item-thumb-ph        { width: 96px; height: 66px; }
  .ni-item-tit             { font-size: var(--np-fs-base); }

  .ni-hl-img               { height: 190px; }
  .ni-hl-title             { font-size: var(--np-fs-base); }

  .ni-hl-sub-thumb         { height: 85px; }
  .ni-hl-sub-tit           { font-size: var(--np-fs-base); }

  .ni-art-title            { font-size: var(--np-fs-xl); }   /* 연합뉴스 소형 모바일 20px */
  .ni-art-body             { font-size: var(--np-fs-lg); }   /* 연합뉴스: 모바일도 18px 유지 */

  /* ─── 기사 상세 대표이미지: 480px 이하 — 연합뉴스: 크롭 없음 ─── */
  .ni-art-figure           { margin: 0 -16px 16px; border-radius: 0; }
  .ni-art-img {
    width: 100% !important;
    height: auto !important;
    max-height: none;       /* 크롭 없음 */
    object-fit: contain;    /* 비율 유지, 왜곡 없음 */
    display: block;
    border-radius: 0;
  }
}

/* ──────────────────────────────────────────────────────────────
   14. 유틸리티 클래스 (inline style 제거 → 클래스화)
──────────────────────────────────────────────────────────────── */

/* 뱃지 — 이미지 위 절대 위치 */
.ni-badge-abs {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
}

/* 아이콘 소형 (10px) */
.ni-icon-xs  { font-size: var(--np-fs-base); }
.ni-icon-mr  { margin-right: 4px; }

/* 이전·다음 네비 우측 정렬 제목 */
.ni-nav-tit-right { text-align: right; }

/* ──────────────────────────────────────────────────────────────
   15. 기존 yna-* 클래스 호환 (하위 호환)
──────────────────────────────────────────────────────────────── */
/* ni-* 클래스가 우선 적용되며, yna-* 는 필요 시 별도 파일에서 관리 */

/* ══════════════════════════════════════════════════════════════
   16. 기사 상세 — 사이드바 레이아웃 (방안 C)
   · nd-single    : 단일 컬럼 (기존)
   · nd-sidebar-r : 본문(좌) + 사이드바(우)
   · nd-sidebar-l : 사이드바(좌) + 본문(우)
══════════════════════════════════════════════════════════════ */

/* ── 레이아웃 래퍼 ── */
.nd-layout-wrap {
  display: block;
  width: 100%;
  box-sizing: border-box;
}

/* 사이드바 있는 레이아웃: flex */
.nd-sidebar-r,
.nd-sidebar-l {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  padding: 0;
}

/* ── 단일 컬럼 ── */
.nd-single .nd-article-col {
  width: 100%;
}
.nd-single .ni-wrap {
  max-width: var(--ni-art-w, 820px);
  margin: 0 auto;
}

/* ── 우측 사이드바 (sidebar-r) ── */
.nd-sidebar-r .nd-article-col {
  flex: 1 1 0;
  min-width: 0;
}
.nd-sidebar-r .nd-sidebar-col {
  flex: 0 0 var(--detail-side-w, 300px);
  width: var(--detail-side-w, 300px);
  min-width: 200px;
}
.nd-sidebar-r .ni-wrap {
  max-width: 100%;
  margin: 0;
}
.nd-sidebar-r .ni-art-container {
  max-width: var(--detail-art-w, 820px);
  margin: 0;
  padding-right: 0;
}

/* ── 좌측 사이드바 (sidebar-l) ── */
.nd-sidebar-l .nd-sidebar-col {
  flex: 0 0 var(--detail-side-w, 300px);
  width: var(--detail-side-w, 300px);
  min-width: 200px;
  order: -1;
}
.nd-sidebar-l .nd-article-col {
  flex: 1 1 0;
  min-width: 0;
}
.nd-sidebar-l .ni-wrap {
  max-width: 100%;
  margin: 0;
}
.nd-sidebar-l .ni-art-container {
  max-width: var(--detail-art-w, 820px);
  margin: 0 0 0 auto;
  padding-left: 0;
}

/* ── 사이드바 컨테이너 ── */
.nd-sidebar-inner {
  position: sticky;
  top: 80px;           /* 헤더 높이에 맞게 조정 */
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px 0;
}

/* ══════════════════════════════════════════════════════════════
   17. 사이드바 위젯 공통
══════════════════════════════════════════════════════════════ */
.nd-side-widget {
  background: var(--ni-bg-white, #fff);
  border: 1px solid var(--ni-border, #e5e5e5);
  border-radius: 8px;
  overflow: hidden;
}

.nd-side-widget-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 14px;
  font-size: var(--np-fs-base);
  font-weight: 700;
  color: var(--ni-gray-900, #111);
  border-bottom: 1px solid var(--ni-border, #e5e5e5);
  background: var(--ni-bg-section, #f9f9f9);
}
.nd-side-widget-head i {
  font-size: var(--np-fs-base);
  color: var(--ni-red, #d0021b);
}

/* ══════════════════════════════════════════════════════════════
   18. 인기기사 위젯
══════════════════════════════════════════════════════════════ */
.nd-popular-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.nd-popular-item {
  border-bottom: 1px solid var(--ni-border, #e5e5e5);
}
.nd-popular-item:last-child { border-bottom: none; }

.nd-popular-link {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  text-decoration: none;
  color: inherit;
  transition: background .15s;
}
.nd-popular-link:hover { background: var(--ni-gray-50, #f8f8f8); }

.nd-popular-rank {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  font-size: var(--np-fs-base);
  font-weight: 700;
  border-radius: 50%;
  background: var(--ni-gray-100, #eee);
  color: var(--ni-gray-600, #555);
}
.nd-popular-item:nth-child(1) .nd-popular-rank { background: var(--ni-red, #d0021b); color: #fff; }
.nd-popular-item:nth-child(2) .nd-popular-rank { background: #ff6b35; color: #fff; }
.nd-popular-item:nth-child(3) .nd-popular-rank { background: #ffa500; color: #fff; }

.nd-popular-active .nd-popular-link {
  background: var(--ni-red-light, #fff0f1);
}
.nd-popular-active .nd-popular-tit { color: var(--ni-red, #d0021b) !important; }

.nd-popular-thumb {
  flex-shrink: 0;
  width: 56px;
  height: 42px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}
.nd-popular-info { flex: 1; min-width: 0; }
.nd-popular-tit {
  font-size: var(--np-fs-base);
  font-weight: 600;
  color: var(--ni-gray-800, #222);
  line-height: 1.5;
  margin: 0 0 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.nd-popular-meta {
  font-size: var(--np-fs-base);
  color: var(--ni-gray-400, #888);
  display: flex;
  align-items: center;
  gap: 3px;
}
.nd-popular-meta i { font-size: var(--np-fs-base); }

/* ══════════════════════════════════════════════════════════════
   19. 카테고리 위젯
══════════════════════════════════════════════════════════════ */
.nd-cat-list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
}
.nd-cat-item { border-bottom: 1px solid var(--ni-border, #e5e5e5); }
.nd-cat-item:last-child { border-bottom: none; }

.nd-cat-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  text-decoration: none;
  color: var(--ni-gray-700, #333);
  font-size: var(--np-fs-base);
  transition: background .15s, color .15s;
}
.nd-cat-link:hover { background: var(--ni-gray-50, #f8f8f8); color: var(--ni-red, #d0021b); }

.nd-cat-active .nd-cat-link {
  background: var(--ni-red-light, #fff0f1);
  color: var(--ni-red, #d0021b);
  font-weight: 700;
}
.nd-cat-name { flex: 1; }
.nd-cat-cnt {
  flex-shrink: 0;
  font-size: var(--np-fs-base);
  color: var(--ni-gray-400, #888);
  background: var(--ni-gray-100, #eee);
  padding: 1px 6px;
  border-radius: 10px;
}
.nd-cat-active .nd-cat-cnt { background: var(--ni-red-light, #fff0f1); color: var(--ni-red, #d0021b); }

/* ══════════════════════════════════════════════════════════════
   20. 연관기사 위젯 (사이드바)
══════════════════════════════════════════════════════════════ */
.nd-rel-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.nd-rel-item { border-bottom: 1px solid var(--ni-border, #e5e5e5); }
.nd-rel-item:last-child { border-bottom: none; }

.nd-rel-link {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 14px;
  text-decoration: none;
  color: inherit;
  transition: background .15s;
}
.nd-rel-link:hover { background: var(--ni-gray-50, #f8f8f8); }
.nd-rel-link:hover .nd-rel-tit { color: var(--ni-red, #d0021b); }

.nd-rel-tit {
  font-size: var(--np-fs-base);
  font-weight: 600;
  color: var(--ni-gray-800, #222);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.nd-rel-date {
  font-size: var(--np-fs-base);
  color: var(--ni-gray-400, #888);
}

/* ══════════════════════════════════════════════════════════════
   21. 광고 위젯
══════════════════════════════════════════════════════════════ */
.nd-side-ad { border: none; background: transparent; }
.nd-ad-box {
  min-height: 250px;
  background: rgba(0,0,0,.04);
  border: 1px dashed #ccc;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  font-size: var(--np-fs-base);
}

/* ══════════════════════════════════════════════════════════════
   22. 반응형 — 태블릿·모바일 상세 페이지 레이아웃
══════════════════════════════════════════════════════════════ */

/* ── 900px 이하: 사이드바 세로 전환 ── */
@media (max-width: 900px) {

  /* ─ 레이아웃 래퍼: 가로폭 봉인 ─ */
  .nd-layout-wrap {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;      /* ← 오버플로우 차단 핵심 */
  }

  /* ─ 사이드바 레이아웃 → 세로 스택 ─ */
  .nd-sidebar-r,
  .nd-sidebar-l {
    flex-direction: column !important;
    gap: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

  /* ─ 사이드바 컬럼: 전체폭, 본문 아래 ─ */
  .nd-sidebar-r .nd-sidebar-col,
  .nd-sidebar-l .nd-sidebar-col {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;           /* ← min-width 200px 제거 */
    flex: none !important;
    order: 2;
    border-top: 1px solid var(--ni-border, #e5e5e5);
  }
  .nd-sidebar-l .nd-sidebar-col { order: 2; }

  /* ─ 기사 컬럼: 전체폭 ─ */
  .nd-sidebar-r .nd-article-col,
  .nd-sidebar-l .nd-article-col {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
    order: 1;
  }

  /* ─ 기사 컨테이너 패딩 정상화 ─ */
  .nd-sidebar-r .ni-art-container,
  .nd-sidebar-l .ni-art-container {
    max-width: 100% !important;
    padding: 16px 0 40px !important;
  }

  /* ─ 사이드바 내부: 가로 그리드 → 세로 ─ */
  .nd-sidebar-inner {
    position: static !important;
    padding: 20px 0 !important;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
  }
  .nd-side-widget { flex: 1 1 280px; }
}

/* ── 600px 이하: 완전 모바일 ── */
@media (max-width: 600px) {

  /* ─ 레이아웃 래퍼 ─ */
  .nd-layout-wrap {
    padding: 0 !important;
  }

  /* ─ 사이드바 컬럼 ─ */
  .nd-sidebar-r .nd-sidebar-col,
  .nd-sidebar-l .nd-sidebar-col {
    min-width: 0 !important;
  }

  /* ─ 기사 컨테이너 ─ */
  .nd-sidebar-r .ni-art-container,
  .nd-sidebar-l .ni-art-container,
  .nd-single .ni-art-container,
  .ni-art-container {
    padding: 12px 0 40px !important;
    max-width: 100% !important;
  }

  /* ─ 사이드바 내부 ─ */
  .nd-sidebar-inner {
    flex-direction: column !important;
    padding: 16px 0 !important;
    gap: 12px !important;
  }
  .nd-side-widget {
    flex: none !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  /* ─ 기사 본문 이미지 봉인 ─ */
  .ni-art-body img,
  .ni-art-body figure img,
  .ni-art-body table {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
  }
  .ni-art-body table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* ─ 연관 기사 그리드 ─ */
  .ni-related-grid { grid-template-columns: 1fr !important; }
  .ni-related-item { border-right: none !important; }

  /* ─ 이전/다음 기사 ─ */
  .ni-art-nav-inner { grid-template-columns: 1fr !important; }
  .ni-nav-prev { border-right: none !important; border-bottom: 1px solid var(--ni-border, #e5e5e5) !important; }
}

/* ═══════════════════════════════════════════════════
   뉴스포털 다크 모드 스타일 (news-list.css)
   html[data-theme="dark"] 선택자로 전용 적용
═══════════════════════════════════════════════════ */

/* 뉴스 리스트 카드 */
html[data-theme="dark"] .nl-item,
html[data-theme="dark"] .nl-card,
html[data-theme="dark"] .news-card-item {
  background: var(--dark-card-bg, #2a2a2a) !important;
  border-color: var(--dark-card-border, #333333) !important;
  box-shadow: 0 1px 4px rgba(0,0,0,.4) !important;
}

html[data-theme="dark"] .nl-title,
html[data-theme="dark"] .nl-headline,
html[data-theme="dark"] .card-title a {
  color: var(--dark-text-color, #e0e0e0) !important;
}

html[data-theme="dark"] .nl-summary,
html[data-theme="dark"] .nl-desc,
html[data-theme="dark"] .card-desc {
  color: rgba(224,224,224,.65) !important;
}

html[data-theme="dark"] .nl-meta,
html[data-theme="dark"] .nl-category,
html[data-theme="dark"] .card-meta {
  color: rgba(224,224,224,.5) !important;
}

/* 뉴스 썸네일 */
html[data-theme="dark"] .nl-thumb,
html[data-theme="dark"] .card-thumb {
  filter: brightness(0.85) !important;
}

/* 헤드라인 영역 */
html[data-theme="dark"] .nl-headline-wrap,
html[data-theme="dark"] .headline-section {
  background: var(--dark-s5-bg, #181818) !important;
  border-color: var(--dark-card-border, #333) !important;
}

/* 뉴스 리스트 레이아웃 */
html[data-theme="dark"] .nl-layout {
  background: var(--dark-body-bg, #121212) !important;
}

html[data-theme="dark"] .nl-sidebar {
  background: var(--dark-s2-bg, #1e1e1e) !important;
  border-color: var(--dark-card-border, #333) !important;
}

/* 뉴스 상세 */
html[data-theme="dark"] .nd-article-wrap,
html[data-theme="dark"] .article-body {
  background: var(--dark-card-bg, #2a2a2a) !important;
  color: var(--dark-text-color, #e0e0e0) !important;
  border-color: var(--dark-card-border, #333) !important;
}

html[data-theme="dark"] .nd-article-wrap p,
html[data-theme="dark"] .article-body p {
  color: rgba(224,224,224,.85) !important;
}

html[data-theme="dark"] .nd-article-title,
html[data-theme="dark"] .article-title {
  color: var(--dark-text-color, #e0e0e0) !important;
}

html[data-theme="dark"] .nd-article-wrap blockquote,
html[data-theme="dark"] .article-body blockquote {
  background: var(--dark-s5-bg, #181818) !important;
  border-left-color: var(--primary-color, #c0392b) !important;
  color: rgba(224,224,224,.7) !important;
}

/* 뉴스 사이드바 위젯 */
html[data-theme="dark"] .nd-side-widget {
  background: var(--dark-card-bg, #2a2a2a) !important;
  border-color: var(--dark-card-border, #333) !important;
}

html[data-theme="dark"] .nd-side-widget-header,
html[data-theme="dark"] .nd-widget-title {
  background: var(--dark-s2-bg, #1e1e1e) !important;
  color: var(--dark-text-color, #e0e0e0) !important;
  border-color: var(--dark-card-border, #333) !important;
}

html[data-theme="dark"] .nd-related-item,
html[data-theme="dark"] .nd-popular-item {
  border-color: var(--dark-card-border, #333333) !important;
  color: var(--dark-text-color, #e0e0e0) !important;
}

html[data-theme="dark"] .nd-related-item:hover,
html[data-theme="dark"] .nd-popular-item:hover {
  background: var(--dark-s5-bg, #181818) !important;
}

/* 검색 폼 다크 */
html[data-theme="dark"] .nl-search-wrap input {
  background: var(--dark-card-bg, #2a2a2a) !important;
  color: var(--dark-text-color, #e0e0e0) !important;
  border-color: var(--dark-card-border, #333) !important;
}

/* 페이지네이션 다크 */
html[data-theme="dark"] .pagination a,
html[data-theme="dark"] .page-link {
  background: var(--dark-card-bg, #2a2a2a) !important;
  color: var(--dark-text-color, #e0e0e0) !important;
  border-color: var(--dark-card-border, #333) !important;
}

html[data-theme="dark"] .pagination .active a,
html[data-theme="dark"] .page-link.active {
  background: var(--primary-color, #c0392b) !important;
  color: #fff !important;
}

/* 브레이킹 뉴스 배지 */
html[data-theme="dark"] .badge-breaking {
  background: var(--badge-breaking, #c0392b) !important;
  filter: brightness(0.9) !important;
}

/* 카테고리 탭 다크 */
html[data-theme="dark"] .category-tabs,
html[data-theme="dark"] .nl-category-bar {
  background: var(--dark-s2-bg, #1e1e1e) !important;
  border-color: var(--dark-card-border, #333) !important;
}

html[data-theme="dark"] .category-tab-item,
html[data-theme="dark"] .nl-cat-link {
  color: rgba(224,224,224,.7) !important;
}

html[data-theme="dark"] .category-tab-item.active,
html[data-theme="dark"] .nl-cat-link.active {
  color: var(--primary-color, #c0392b) !important;
  border-color: var(--primary-color, #c0392b) !important;
}

/* 웹진형 위젯 다크 */
html[data-theme="dark"] .webzine-card,
html[data-theme="dark"] .webzine-item {
  background: var(--dark-card-bg, #2a2a2a) !important;
  border-color: var(--dark-card-border, #333) !important;
}

html[data-theme="dark"] .webzine-card:hover,
html[data-theme="dark"] .webzine-item:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.5) !important;
}

/* ── 라이트/다크 부드러운 전환 ── */
.nl-item, .nl-card, .news-card-item,
.nd-article-wrap, .nd-side-widget,
.nl-layout, .nl-sidebar, .nl-search-wrap input {
  transition: background-color .25s ease, color .25s ease, border-color .2s ease;
}

/* ══════════════════════════════════════════════════════════════
   첨부파일 카드 섹션  — ni-attach v2
   ─ 파일타입별 색상 아이콘, 미리보기/다운로드 버튼, 반응형
   ─ 서버에 파일 저장 없음: 원본 URL 직접 사용
   ─ 깨진 링크 없음: JS API 검증 후 렌더
══════════════════════════════════════════════════════════════ */
.ni-attach-section {
  margin: 24px 0 20px;
  border: 1px solid #e8ebf0;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

/* 헤더 */
.ni-attach-header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 16px 10px;
  background: #f5f7fa;
  border-bottom: 1px solid #e8ebf0;
}
.ni-attach-hd-icon {
  color: #6c7a8e;
  font-size: var(--np-fs-base);
}
.ni-attach-hd-text {
  font-size: var(--np-fs-base);
  font-weight: 700;
  color: #5a6578;
  letter-spacing: 0.2px;
}
.ni-attach-hd-count {
  font-size: var(--np-fs-base);
  color: #9ea8b3;
  font-weight: 500;
}

/* 카드 목록 컨테이너 */
.ni-attach-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* 개별 카드 */
.ni-attach-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #f0f2f5;
  transition: background 0.12s ease;
}
.ni-attach-card:last-child {
  border-bottom: none;
}
.ni-attach-card:hover {
  background: #f8f9fb;
}

/* 파일 타입 아이콘 박스 */
.ni-attach-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 8px;
  font-size: var(--np-fs-md);
}

/* 카드 본문 */
.ni-attach-card-body {
  flex: 1;
  min-width: 0;
}
.ni-attach-name {
  font-size: var(--np-fs-base);
  font-weight: 500;
  color: #2c3a4a;
  line-height: 1.45;
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ni-attach-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* 파일 타입 배지 */
.ni-attach-type-badge {
  display: inline-block;
  font-size: var(--np-fs-base);
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid transparent;
  line-height: 1.6;
}

/* 파일 크기 */
.ni-attach-size {
  font-size: var(--np-fs-base);
  color: #9ea8b3;
}

/* 액션 버튼 영역 */
.ni-attach-card-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  align-items: center;
}

/* 공통 버튼 */
.ni-attach-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--np-fs-base);
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 5px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  line-height: 1;
  white-space: nowrap;
}
.ni-attach-btn i { font-size: var(--np-fs-base); }

/* 미리보기 버튼 — 아웃라인 파란 */
.ni-attach-btn-preview {
  color: #3a7bd5;
  background: #eef4ff;
  border-color: #c4d8f8;
}
.ni-attach-btn-preview:hover {
  background: #ddeaff;
  border-color: #9abbf5;
  color: #2563bb;
}

/* 다운로드 버튼 — 아웃라인 그레이 */
.ni-attach-btn-dl {
  color: #5a6578;
  background: #f3f5f8;
  border-color: #dde1e8;
}
.ni-attach-btn-dl:hover {
  background: #e9ecf1;
  border-color: #c4cad4;
  color: #2c3a4a;
}

/* ── 이미지 미리보기 모달 ── */
.ni-img-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ni-img-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(3px);
  cursor: pointer;
}
.ni-img-modal-box {
  position: relative;
  z-index: 1;
  max-width: min(90vw, 860px);
  max-height: 90vh;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.ni-img-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: var(--np-fs-base);
  transition: background 0.12s;
}
.ni-img-modal-close:hover { background: rgba(0,0,0,0.8); }
.ni-img-modal-inner {
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.ni-img-modal-img {
  max-width: 100%;
  max-height: 72vh;
  border-radius: 6px;
  object-fit: contain;
  display: block;
}
.ni-img-modal-name {
  font-size: var(--np-fs-base);
  color: #7a8899;
  text-align: center;
  margin: 0;
  word-break: break-all;
}

/* ── 반응형 — 모바일 ── */
@media (max-width: 560px) {
  .ni-attach-card {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
  }
  .ni-attach-card-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .ni-attach-name {
    font-size: var(--np-fs-base);
    white-space: normal;
    overflow: visible;
    text-overflow: initial;
  }
  .ni-attach-btn {
    font-size: var(--np-fs-base);
    padding: 5px 9px;
  }
}

/* ── 다크모드 ── */
html[data-theme="dark"] .ni-attach-section {
  background: #1e2432;
  border-color: #2e3547;
}
html[data-theme="dark"] .ni-attach-header {
  background: #252d3d;
  border-color: #2e3547;
}
html[data-theme="dark"] .ni-attach-hd-text  { color: #a0aab8; }
html[data-theme="dark"] .ni-attach-card     { border-color: #2a3244; }
html[data-theme="dark"] .ni-attach-card:hover { background: #242c3c; }
html[data-theme="dark"] .ni-attach-name     { color: #cdd5df; }
html[data-theme="dark"] .ni-attach-size     { color: #6a7585; }
html[data-theme="dark"] .ni-attach-btn-dl {
  color: #8c99aa;
  background: #262e3e;
  border-color: #3a4458;
}
html[data-theme="dark"] .ni-attach-btn-dl:hover {
  background: #2e3750;
  color: #cdd5df;
}
html[data-theme="dark"] .ni-attach-btn-preview {
  background: #1a2540;
  border-color: #2d4470;
  color: #6fa3ea;
}
html[data-theme="dark"] .ni-attach-btn-preview:hover {
  background: #1f2e52;
  color: #90baf0;
}
html[data-theme="dark"] .ni-img-modal-box {
  background: #1e2432;
}
html[data-theme="dark"] .ni-img-modal-name { color: #6a7585; }

/* 참조 블록 [첨부] 인라인 다운로드 링크 */
.ni-ref-attach-dl {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: var(--np-fs-base);
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid #dce1e8;
  background: #f3f5f8;
  color: #5a6578;
  text-decoration: none;
  margin-left: 6px;
  transition: background 0.12s, color 0.12s;
  vertical-align: middle;
}
.ni-ref-attach-dl i { font-size: var(--np-fs-base); }
.ni-ref-attach-dl:hover {
  background: #e9ecf1;
  color: #2c3a4a;
  border-color: #b8c0cc;
}
html[data-theme="dark"] .ni-ref-attach-dl {
  background: #262e3e;
  border-color: #3a4458;
  color: #8c99aa;
}
html[data-theme="dark"] .ni-ref-attach-dl:hover {
  background: #2e3750;
  color: #cdd5df;
}

/* ══════════════════════════════════════════════════════════════
   본문 가로 오버플로우 스크롤 래퍼
   table, pre, .wide 요소가 컨테이너 너비를 초과할 때 적용
══════════════════════════════════════════════════════════════ */
.ni-art-body .ni-scroll-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 0 20px;
  border-radius: 4px;
  border: 1px solid #e8ebf0;
  background: #fafbfc;
}
.ni-art-body .ni-scroll-x::-webkit-scrollbar { height: 5px; }
.ni-art-body .ni-scroll-x::-webkit-scrollbar-track { background: #f0f2f5; }
.ni-art-body .ni-scroll-x::-webkit-scrollbar-thumb { background: #c8cdd6; border-radius: 3px; }
.ni-art-body .ni-scroll-x table { margin: 0; border: none; min-width: 480px; }
.ni-art-body .ni-scroll-x pre   { margin: 0; padding: 16px; min-width: 320px; }
/* 다크모드 */
html[data-theme="dark"] .ni-art-body .ni-scroll-x {
  background: #1a2130; border-color: #2d3650;
}
html[data-theme="dark"] .ni-art-body .ni-scroll-x::-webkit-scrollbar-track { background: #1e2535; }
html[data-theme="dark"] .ni-art-body .ni-scroll-x::-webkit-scrollbar-thumb { background: #3a4a62; }

/* ══════════════════════════════════════════════════════════════
   플로팅 스크롤 내비게이터 (처음·위·아래·끝)
   - 기사가 충분히 길 때(.ni-snav-visible)만 표시
   - 우측 하단 고정 배치
══════════════════════════════════════════════════════════════ */
.ni-scroll-nav {
  position: fixed;
  right: 20px;
  bottom: 28px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.ni-scroll-nav.ni-snav-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}
.ni-snav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  width: auto;
  height: 36px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid #d8dde8;
  background: rgba(255,255,255,0.92);
  color: #4a5568;
  font-size: var(--np-fs-base);
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  transition: background 0.12s, color 0.12s, box-shadow 0.12s, transform 0.08s;
  -webkit-tap-highlight-color: transparent;
}
.ni-snav-btn:hover {
  background: #1a5fa8;
  color: #fff;
  border-color: #1a5fa8;
  box-shadow: 0 4px 14px rgba(26,95,168,0.28);
  transform: scale(1.06);
}
.ni-snav-btn:disabled {
  opacity: 0.28;
  cursor: default;
  pointer-events: none;
}
/* 다크모드 */
html[data-theme="dark"] .ni-snav-btn {
  background: rgba(30,37,53,0.92);
  border-color: #3a4c66;
  color: #8a9ab8;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}
html[data-theme="dark"] .ni-snav-btn:hover {
  background: #2563a8;
  color: #fff;
  border-color: #2563a8;
}
/* 모바일: 더 작게 */
@media (max-width: 640px) {
  .ni-scroll-nav { right: 12px; bottom: 20px; gap: 3px; }
  .ni-snav-btn   { min-width: 32px; width: auto; height: 32px; padding: 0 6px; font-size: var(--np-fs-base); border-radius: 6px; }
}

/* ══════════════════════════════════════════════════════════════
   링크 복사 토스트 메시지
══════════════════════════════════════════════════════════════ */
.ni-copy-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: rgba(30,42,60,0.92);
  color: #fff;
  font-size: var(--np-fs-base);
  font-weight: 500;
  padding: 9px 20px;
  border-radius: 24px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.22);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 99998;
  white-space: nowrap;
}
.ni-copy-toast.ni-toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ══════════════════════════════════════════════════════════════
   인쇄 스타일
══════════════════════════════════════════════════════════════ */
@media print {
  .ni-breadcrumb,
  .ni-art-toolbar,
  .ni-art-share,
  .ni-scroll-nav,
  .ni-attach-section,
  .ni-art-tags,
  .ni-art-nav,
  .ni-related,
  .nd-sidebar-col,
  header, footer,
  /* .ni-art-writer-avatar: 기자 프로필 이미지 표시 (연합뉴스 스타일) */

  .ni-art-body {
    font-size: 14pt !important;
    line-height: 1.8 !important;
    color: #000 !important;
  }
  .ni-art-title { font-size: 20pt !important; color: #000 !important; }
  .ni-art-meta-row { margin-bottom: 12pt; }
  .ni-meta-chip {
    background: none !important;
    border: 1px solid #ccc !important;
    color: #444 !important;
  }
  .ni-art-body a { color: #000 !important; text-decoration: underline; }
  .ni-art-body .ni-scroll-x { overflow: visible !important; border: none !important; }
  .ni-art-body table { min-width: 0 !important; font-size: 10pt; }
  .ni-art-ref-block { border-top: 1px solid #ccc; }
}

/* 640px 미디어쿼리는 하단 연합뉴스 개편 블록으로 통합됨 */

/* ══════════════════════════════════════════════════════════════
   연합뉴스 스타일 전면 개편 — 보완 및 추가 스타일
   적용: 2025 기준 연합뉴스 article.css 분석 기반
══════════════════════════════════════════════════════════════ */

/* ── 기사 본문 폰트 조절 5단계 (연합뉴스 article-font1~5 대응) ── */
.ni-wrap[data-art-font="s"] .ni-art-body { font-size: var(--np-fs-base); line-height: 1.55; }
.ni-wrap[data-art-font="m"] .ni-art-body { font-size: var(--np-fs-lg); line-height: 1.5; }    /* 연합뉴스 M단계 기준 */
.ni-wrap[data-art-font="l"] .ni-art-body { font-size: var(--np-fs-xl); line-height: 1.7; }
.ni-wrap[data-art-font="xl"] .ni-art-body { font-size: 24px; line-height: 1.75; }
/* 폰트 단계별 단락 간격 — 연합뉴스 article-font1~5 완전 대응 */
.ni-wrap[data-art-font="xs"] .ni-art-body p { margin-bottom: 20px; }   /* S- */
.ni-wrap[data-art-font="s"] .ni-art-body p  { margin-bottom: 24px; }   /* 연합 font1 */
.ni-wrap[data-art-font="m"] .ni-art-body p  { margin-bottom: 28px; }   /* 연합 font2 */
.ni-wrap[data-art-font="l"] .ni-art-body p  { margin-bottom: 32px; }   /* 연합 font3 */
.ni-wrap[data-art-font="xl"] .ni-art-body p { margin-bottom: 36px; }   /* 연합 font4 */
/* 캡션 간격도 단계 연동 */
.ni-wrap[data-art-font="s"] .ni-art-caption  { padding-top: 8px; padding-bottom: 8px; }
.ni-wrap[data-art-font="m"] .ni-art-caption  { padding-top: 10px; padding-bottom: 10px; }
.ni-wrap[data-art-font="l"] .ni-art-caption  { padding-top: 12px; padding-bottom: 12px; }
.ni-wrap[data-art-font="xl"] .ni-art-caption { padding-top: 14px; padding-bottom: 14px; }

/* ── 연합뉴스식 기사 본문 내 이미지 박스 ── */
.ni-art-body figure,
.ni-art-body .image-zone {
  margin: 24px 0 28px;
  text-align: center;
}
.ni-art-body figure img,
.ni-art-body .image-zone img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}
.ni-art-body figcaption,
.ni-art-body .tit-cap {
  font-size: var(--np-fs-base);
  color: #777;
  line-height: 1.6;
  margin-top: 8px;
  text-align: left;
  padding: 0 4px;
}

/* ── 연합뉴스식 인용 블록 ── */
.ni-art-body blockquote {
  margin: 24px 0;
  padding: 16px 20px;
  border-left: 4px solid var(--ni-red);
  background: #fafafa;
  font-size: var(--np-fs-md);
  color: #444;
  line-height: 1.7;
}

/* ── 연합뉴스식 본문 링크 ── */
.ni-art-body a {
  color: #0055a4;   /* 연합뉴스 링크 색상 */
  text-decoration: none;
  border-bottom: 1px solid #b3ccef;
}
.ni-art-body a:hover {
  color: var(--ni-red);
  border-bottom-color: var(--ni-red);
}

/* ── 기사 하단 태그 영역 ── */
.ni-art-tags {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid #eee;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.ni-art-tag {
  display: inline-block;
  font-size: var(--np-fs-base);
  color: #555;
  background: #f5f7fa;
  border: 1px solid #e0e4ea;
  border-radius: 3px;
  padding: 4px 10px;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.ni-art-tag:hover {
  background: #eef2f8;
  color: var(--ni-red);
  border-color: #d0d8e8;
}

/* ── 연합뉴스식 기사 헤더 구분선 강화 ── */
.ni-art-header {
  border-bottom-width: 2px !important;
  border-bottom-color: #1a1a1a !important;
}

/* ── 연합뉴스식 섹션 타이틀 강조 ── */
.ni-art-body h2 {
  font-size: var(--np-fs-xl);
  font-weight: 700;
  color: #111;
  margin: 32px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #222;
  line-height: 1.4;
  letter-spacing: -0.3px;
}
.ni-art-body h3 {
  font-size: var(--np-fs-lg);
  font-weight: 700;
  color: #222;
  margin: 28px 0 12px;
  line-height: 1.45;
}
.ni-art-body h4 {
  font-size: var(--np-fs-base);
  font-weight: 600;
  color: #333;
  margin: 20px 0 10px;
}

/* ── 연합뉴스식 표 스타일 ── */
.ni-art-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0 28px;
  font-size: var(--np-fs-base);
}
.ni-art-body table th {
  background: #333;
  color: #fff;
  font-weight: 600;
  padding: 10px 12px;
  text-align: left;
  border: 1px solid #444;
}
.ni-art-body table td {
  padding: 9px 12px;
  border: 1px solid #ddd;
  color: #333;
  vertical-align: top;
  line-height: 1.6;
}
.ni-art-body table tr:nth-child(even) td {
  background: #f8f9fa;
}

/* ── 툴바 640px 이하 패딩 수정 ── */
@media (max-width: 640px) {
  .ni-bc-list { padding: 0; gap: 2px; }
  .ni-bc-current .ni-bc-now { max-width: 140px; }
  .ni-art-toolbar { padding: 7px 0; gap: 3px; }
  .ni-tool-btn { width: auto; min-width: 2.4em; height: 28px; padding: 0 6px; font-size: var(--np-fs-base); }
  .ni-toolbar-label { display: inline; font-size: 14px; font-weight: 700; }
  .ni-toolbar-divider { margin: 0 2px; }
  .ni-art-meta-row { gap: 2px; }
  .ni-meta-chip { font-size: var(--np-fs-base); padding: 0 10px 0 0; }
}

/* ── 다크모드 보완 ── */
html[data-theme="dark"] .ni-art-header {
  border-bottom-color: #ccc !important;
}
html[data-theme="dark"] .ni-art-body blockquote {
  background: #1e2535;
  color: #c8d4de;
  border-left-color: var(--ni-red);
}
html[data-theme="dark"] .ni-art-body h2 {
  color: #e0e8f0;
  border-bottom-color: #8a9ab0;
}
html[data-theme="dark"] .ni-art-body h3,
html[data-theme="dark"] .ni-art-body h4 {
  color: #c8d4de;
}
html[data-theme="dark"] .ni-art-body table th {
  background: #2d3c58;
  border-color: #3a4e6a;
}
html[data-theme="dark"] .ni-art-body table td {
  border-color: #2d3650;
  color: #b8c8d8;
}
html[data-theme="dark"] .ni-art-body table tr:nth-child(even) td {
  background: #1e2535;
}
html[data-theme="dark"] .ni-art-tag {
  background: #1e2535;
  color: #8a9ab0;
  border-color: #2d3650;
}
html[data-theme="dark"] .ni-art-tag:hover {
  background: #252f42;
  color: #adbfd0;
}

/* ══════════════════════════════════════════════════════════════
   기사 상세 레이아웃 래퍼 — nd-layout-wrap / nd-article-col / nd-sidebar-col
   detail.php: sector-center.nd-layout-wrap > nd-article-col + nd-sidebar-col
══════════════════════════════════════════════════════════════ */

/* ── 공통 래퍼: 최대폭 + 중앙 정렬 ── */
.nd-layout-wrap {
  display: flex;
  align-items: flex-start;
  gap: 32px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 0 60px;
  box-sizing: border-box;
}

/* ── 단독 레이아웃 (사이드바 없음) ── */
.nd-layout-wrap.nd-single {
  max-width: 760px;   /* 기사 본문 단독 컬럼 */
  display: block;
  padding: 20px 0 60px;
}

/* ── 본문 컬럼 ── */
.nd-article-col {
  flex: 1 1 0;
  min-width: 0;
}

/* ── 사이드바 컬럼 ── */
.nd-sidebar-col {
  flex: 0 0 300px;
  width: 300px;
  min-width: 0;
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}
.nd-sidebar-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── sidebar-l: 사이드바가 왼쪽 ── */
.nd-sidebar-l .nd-sidebar-col { order: -1; }
.nd-sidebar-l .nd-article-col { order: 0; }

/* ── 반응형: 태블릿(≤960px) 사이드바 숨김 ── */
@media (max-width: 960px) {
  .nd-layout-wrap {
    display: block;
    padding: 16px 0 40px;
  }
  .nd-sidebar-col {
    display: none;
  }
  .nd-article-col {
    width: 100%;
  }
}

/* ── 반응형: 모바일(≤600px) ── */
@media (max-width: 600px) {
  .nd-layout-wrap {
    padding: 10px 0 32px;
  }
}

/* ══════════════════════════════════════════════════
   섹터 8 – 참조영역 (S8 Reference)
   · .s8-related : 관련기사 블록
══════════════════════════════════════════════════ */

/* S8 섹터 래퍼 */
.sector-wrap.s8 {
  background: var(--s8-bg, #0f172a);
}
.sector-wrap.s8 .sector-main {
  max-width: var(--dw, 1200px);
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

/* 관련기사 블록 */
.s8-related {
  padding: 32px 0 24px;
}
.s8-related-title {
  font-size: var(--np-fs-base);
  font-weight: 700;
  color: rgba(255,255,255,.75);
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: .02em;
}
.s8-related-title .fas {
  color: var(--primary-color, #3381ff);
  font-size: var(--np-fs-base);
}

/* 리스트 */
.s8-related-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px 20px;
}
.s8-related-item {
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255,255,255,.04);
  transition: background .15s;
}
.s8-related-item:hover {
  background: rgba(255,255,255,.08);
}
.s8-related-link {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  text-decoration: none;
  color: inherit;
}
.s8-rel-thumb {
  flex-shrink: 0;
  width: 80px;
  height: 54px;
  border-radius: 5px;
  overflow: hidden;
  background: rgba(255,255,255,.06);
}
.s8-rel-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.s8-rel-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.s8-rel-cat {
  font-size: var(--np-fs-base);
  color: var(--primary-color, #3381ff);
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.s8-rel-title {
  font-size: var(--np-fs-base);
  line-height: 1.45;
  color: rgba(255,255,255,.8);
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.s8-related-item:hover .s8-rel-title {
  color: #fff;
}
.s8-rel-date {
  font-size: var(--np-fs-base);
  color: rgba(255,255,255,.35);
}

/* ── 반응형 ── */
@media (max-width: 768px) {
  .s8-related {
    padding: 20px 0 16px;
  }
  .s8-related-list {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .s8-rel-thumb {
    width: 64px;
    height: 44px;
  }
}

/* ══════════════════════════════════════════════════
   뉴스 리스트 전용: S6 타이틀 섹터 오버라이드
   · 타이틀을 좌측 정렬, 콤팩트 패딩
   · 기사 수(subtitle)를 타이틀 오른쪽에 작게 표시
══════════════════════════════════════════════════ */
#wrap-s6 .sector-full {
  display: flex;
  align-items: stretch;
}
#wrap-s6 .s6-title-block {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0 6px;
  border-bottom: 2px solid var(--portal-primary, #c0392b);
  width: 100%;
  flex-wrap: nowrap;
}
#wrap-s6 .s6-title-icon {
  font-size: 16px;
  color: var(--portal-primary, #c0392b);
}
#wrap-s6 .s6-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  white-space: nowrap;
}
#wrap-s6 .s6-subtitle {
  font-size: 15px;
  color: #94a3b8;
  margin: 0 0 0 auto;  /* 오른쪽으로 밀기 */
  white-space: nowrap;
  font-weight: 400;
  align-self: flex-end;
  padding-bottom: 2px;
}
/* S6 섹터: 좌상단 정렬 강제 + 패딩 최소화
   (layout_core.php 동적 CSS의 center !important 덮어씀) */
#wrap-s6 .sector-inner {
  padding: 0 !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  text-align: left !important;
}
#wrap-s6 .sector-full {
  width: 100% !important;
  text-align: left !important;
}
#wrap-s6 .sector-main {
  padding-bottom: 0 !important;
}

/* ══════════════════════════════════════════════════════
   nl-cat-tabs — 카테고리 탭 네비 (nl-body-col 상단)
   데스크톱: 트리 옆 콘텐츠 상단에 인라인 배치
   모바일 : 전체 너비 가로 스크롤
══════════════════════════════════════════════════════ */
.nl-cat-tabs {
  background    : #fff;
  border-bottom : 2px solid #e8eaed;
  margin-bottom : 0;
}
.nl-cat-tabs-inner {
  display       : flex;
  gap           : 2px;
  overflow-x    : auto;
  padding       : 6px 8px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.nl-cat-tabs-inner::-webkit-scrollbar { display: none; }

.nl-cat-tab-item {
  display       : inline-flex;
  align-items   : center;
  padding       : 5px 14px;
  border-radius : 20px;
  font-size     : 15px;
  font-weight   : 600;
  color         : #64748b;
  text-decoration: none;
  white-space   : nowrap;
  flex-shrink   : 0;
  border        : 1.5px solid transparent;
  transition    : all .15s;
}
.nl-cat-tab-item:hover {
  background    : #f1f5f9;
  color         : #1e293b;
  border-color  : #e2e8f0;
}
.nl-cat-tab-item.active {
  background    : #f0fdf4;
  color         : #03c75a;
  border-color  : rgba(3,199,90,.3);
  font-weight   : 700;
}

/* 다크 테마 */
html[data-theme="dark"] .nl-cat-tabs {
  background    : #1e293b;
  border-color  : #334155;
}
html[data-theme="dark"] .nl-cat-tab-item {
  color         : #94a3b8;
}
html[data-theme="dark"] .nl-cat-tab-item:hover {
  background    : #293548;
  color         : #e2e8f0;
  border-color  : #475569;
}
html[data-theme="dark"] .nl-cat-tab-item.active {
  background    : rgba(3,199,90,.12);
  color         : #03c75a;
  border-color  : rgba(3,199,90,.35);
}

/* ── B-pattern list 헤더 (placard 동형 — pub-page-header + ev-search-wrap) ── */
.nl-list-wrap .nl-bp-list-stack {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  padding: 14px 0 0;
}
.nl-list-wrap .nl-bp-list-stack.pub-wrap {
  margin: 0;
  padding-left: 0;
  padding-right: 0;
}
.nl-list-wrap .nl-bp-main-col {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.nl-list-wrap .nl-bp-page-header {
  margin-bottom: 0;
}
.nl-list-wrap .nl-bp-search-wrap {
  margin: 16px 0 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
}
.nl-list-wrap .nl-bp-search-wrap .ev-basic-search {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
}
.nl-list-wrap .nl-bp-search-wrap .ev-search-box {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}
.nl-list-wrap .nl-bp-search-wrap .ev-search-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 36px 10px 12px;
  outline: none;
  font-size: var(--np-fs-base, 16px);
}
.nl-list-wrap .nl-bp-search-wrap .ev-search-input:focus {
  border-color: var(--pub-accent, #0a4d8c);
}
.nl-list-wrap .nl-bp-search-wrap .ev-kw-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  color: #64748b;
  cursor: pointer;
  padding: 2px 6px;
  font-size: var(--np-fs-sm, 14px);
}
.nl-list-wrap .nl-bp-search-wrap .ev-search-btn-main {
  flex-shrink: 0;
  background: var(--pub-accent, #0a4d8c);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  font-size: var(--np-fs-md, 17px);
}
.nl-list-wrap .nl-bp-search-wrap .ev-detail-toggle,
.pbl-wrap .nl-bp-search-wrap .ev-detail-toggle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  border-radius: 8px;
  padding: 9px 14px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
  font-size: var(--np-fs-sm, 15px);
}
.nl-list-wrap .nl-bp-search-wrap .ev-detail-toggle[aria-expanded="true"],
.pbl-wrap .nl-bp-search-wrap .ev-detail-toggle[aria-expanded="true"] {
  background: var(--pub-accent, #0a4d8c);
  color: #fff;
  border-color: var(--pub-accent, #0a4d8c);
}
.nl-list-wrap .nl-bp-search-wrap .ev-detail-badge,
.pbl-wrap .nl-bp-search-wrap .ev-detail-badge {
  background: var(--pub-accent, #0a4d8c);
  color: #fff;
  border-radius: 99px;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
  font-size: var(--np-fs-xs, 14px);
}
.nl-list-wrap .nl-bp-search-wrap .ev-detail-search,
.pbl-wrap .nl-bp-search-wrap .ev-detail-search {
  margin-top: 12px;
  border-top: 1px solid #f1f5f9;
  padding-top: 14px;
}
.nl-list-wrap .nl-bp-search-wrap .ev-detail-toggle--reset {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  border-radius: 8px;
  padding: 9px 14px;
  font-weight: 600;
  color: #475569;
  text-decoration: none;
  font-size: var(--np-fs-sm, 15px);
}
@media (max-width: 768px) {
  .pub-list-page .pub-body-col,
  .pub-list-page .pub-wrap,
  .pub-list-page .pub-content-wrap,
  .pub-list-page .pub-main-col,
  .nl-list-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: clip;
    box-sizing: border-box;
  }
  .nl-list-wrap .nl-bp-list-stack,
  .nl-list-wrap .nl-bp-main-col,
  .nl-list-wrap .nl-bp-search-wrap,
  .nl-list-wrap .nl-sec2,
  .nl-list-wrap .nl-sec3,
  .nl-list-wrap .nl-sec4 {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  body:not([data-menu="publicity"]) .nl-list-wrap .pub-page-header-inner {
    flex-direction: column;
    align-items: stretch;
  }
  body:not([data-menu="publicity"]) .nl-list-wrap .pub-page-header-right {
    width: 100%;
    justify-content: flex-start;
  }
  .nl-list-wrap .nl-bp-search-wrap .ev-basic-search {
    flex-wrap: wrap;
  }
  .nl-list-wrap .nl-bp-search-wrap .ev-search-box {
    flex: 1 1 100%;
    width: 100%;
  }
  .nl-list-wrap .nl-bp-search-wrap .ev-search-btn-main,
  .nl-list-wrap .nl-bp-search-wrap .ev-detail-toggle,
  .nl-list-wrap .nl-bp-search-wrap .ev-detail-toggle--reset {
    min-height: 44px;
  }
}
.nl-list-wrap .nl-bp-search-wrap .ev-detail-toggle {
  flex-shrink: 0;
}
.nl-list-wrap .nl-bp-search-wrap .ev-detail-search .nl-detail-active-chips {
  margin-top: 10px;
}
