/* 인쇄 · PDF 저장 전용.
 *
 * **별도 파일인 이유 — 여기가 함정이다.** site-mobile.css는 `(max-width: 767px)`,
 * site-desktop.css는 `(min-width: 768px)`로 걸려 있다. 미디어 타입을 안 적은
 * 미디어 쿼리는 `all`이라 **인쇄에도 평가되고**, 기준이 되는 폭은 화면이 아니라
 * 용지다. A4는 96dpi에서 약 794px이므로 인쇄하면 데스크톱 CSS가 붙는다.
 * 그런데 site-base.css는 그보다 앞에 오므로, base 안에 @media print를 적으면
 * 같은 특이도에서 데스크톱 규칙에 진다. 이 저장소에서 카드 접기가 정확히 그렇게
 * 무력화된 적이 있다.
 *
 * 그래서 `media="print"`로 **가장 마지막에** 붙인다. 순서로 이기므로 !important를
 * 뿌릴 필요가 없고, 화면에서는 아예 적용되지 않아 다른 페이지에 영향이 없다.
 *
 * 대상은 월간 리포트다(PRODUCT.md §4 ② — "인쇄/PDF 저장 시 레이아웃 유지").
 * 다만 규칙 대부분이 공통 크롬이라 다른 페이지를 인쇄해도 함께 좋아진다.
 */

/* ---------- 화면 전용 요소는 종이에 남기지 않는다 ----------
   상단 바·언어 안내·맨 위로 버튼·테마 토글은 종이에서 아무 일도 하지 않으면서
   자리만 차지한다. 특히 sticky 요소는 인쇄에서 첫 페이지에 박제되어 본문을 가린다. */
.utility-bar,
.lang-suggest,
.nav-drawer,
.nav-toggle,
.skip-link,
#scroll-top,
.side-rail,
.subscribe-box,
.share-wrap,
.print-button,
.article-copy,
.date-bar,
.footer-links {
  display: none;
}

/* ---------- 종이에 맞춘 기본값 ---------- */
@page {
  margin: 18mm 16mm;
}

html, body {
  background: #ffffff;
  color: #000000;
  font-size: 10.5pt;
  line-height: 1.5;
}

/* 화면에서 가운데 정렬된 720px 칼럼은 종이에서 여백을 두 번 먹는다.
   @page가 이미 여백을 주므로 본문은 폭을 다 쓴다. */
.content,
.content.report {
  max-width: none;
  width: auto;
  margin: 0;
  padding: 0;
}

.site-header {
  border: none;
  padding: 0;
}

/* 머리글은 남기되 작게. 어느 사이트에서 나온 문서인지가 종이에서 더 중요하다. */
.header-inner h1 { font-size: 14pt; margin: 0 0 2mm; }
.header-inner h1 a { color: #000000; text-decoration: none; }
.tagline { font-size: 9pt; color: #333333; margin: 0; }

a { color: #000000; text-decoration: none; }

/* ---------- 월간 리포트 ---------- */
.report-title { font-size: 18pt; margin: 6mm 0 2mm; }
.report-range { font-size: 9pt; color: #333333; margin: 0 0 4mm; }
.report-lede { font-size: 11.5pt; margin: 0 0 6mm; }
.report-heading { font-size: 12pt; margin: 0 0 3mm; }

/* 절이 페이지 경계에서 쪼개지면 표 머리글만 앞장에 남는 식이 된다.
   break-inside는 신형, page-break-inside는 구형 뷰어용이라 둘 다 적는다. */
.report-section,
.report-axis,
.report-story,
.report-table-wrap,
.report-cite {
  break-inside: avoid;
  page-break-inside: avoid;
}
.report-section { margin: 0 0 7mm; }

/* 제목만 남고 내용이 다음 장으로 넘어가는 것을 막는다. */
.report-heading,
.report-axis-name,
.report-story-title {
  break-after: avoid;
  page-break-after: avoid;
}

/* ---------- 표 ----------
   화면에서는 가로 스크롤 상자 안에 있지만 종이에는 스크롤이 없다. 상자를 풀고
   글자를 줄여 폭 안에 넣는다. 넘치면 잘려 나가고, 잘린 표는 근거가 못 된다. */
.report-table-wrap,
.note-table-wrap {
  overflow: visible;
}
.report-table,
.note-table {
  width: 100%;
  font-size: 9.5pt;
  border-collapse: collapse;
}
.report-table th,
.report-table td,
.note-table th,
.note-table td {
  border-bottom: 0.3pt solid #999999;
  padding: 1.5mm 2mm;
  white-space: normal;   /* 화면의 nowrap을 푼다 — 종이에서는 접혀야 들어간다 */
}
.report-table caption,
.note-table-caption {
  font-size: 8.5pt;
  color: #333333;
  text-align: left;
  padding-bottom: 1.5mm;
}
/* 표 머리글은 여러 장에 걸칠 때 매 장에 다시 찍힌다. */
.report-table thead { display: table-header-group; }
.report-table tr, .note-table tr { break-inside: avoid; page-break-inside: avoid; }

/* ---------- 근거 목록 ---------- */
.report-evidence { margin: 2mm 0 0; padding-left: 5mm; }
.report-evidence li { margin-bottom: 1.5mm; }
.report-evidence-links { color: #333333; font-size: 9pt; }
.report-axis-count { color: #333333; font-size: 9pt; font-weight: 400; }
.report-axis-question { font-style: italic; margin: 0 0 1.5mm; }

/* ---------- 인용 줄 ----------
   종이에서는 링크를 누를 수 없다. 옮겨 적을 수 있도록 주소를 글자로 남긴다 —
   이 한 줄이 이 페이지가 보고 자료로 돌아다닐 때의 유일한 출처 표시다. */
.report-cite {
  border-top: 0.5pt solid #000000;
  padding-top: 3mm;
  margin-top: 8mm;
}
.report-cite-line {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 9pt;
  word-break: break-all;
}

/* ---------- 코드블록(/notes) ----------
   화면에서는 가로 스크롤에 맡기지만 종이에서는 접어야 한다. 접힌 정규식은
   읽기 나쁘지만, 잘려 사라지는 것보다는 낫다. */
.note-code { overflow: visible; border: 0.3pt solid #999999; }
.note-code code { white-space: pre-wrap; word-break: break-all; font-size: 8.5pt; }

.site-footer { border-top: 0.3pt solid #999999; padding-top: 2mm; font-size: 8pt; color: #333333; }

/* 진행 중 표시는 종이에서 더 중요하다. 인쇄물은 날짜가 지나도 그대로 돌아다닌다. */
.report-progress {
  border-left: 1.5pt solid #000000;
  padding: 2mm 0 2mm 3mm;
  margin: 0 0 5mm;
  font-size: 9.5pt;
  break-inside: avoid;
  page-break-inside: avoid;
}
