/* 西暦・和暦・年齢早見表(/nenrei-hayami/ja) — 표·검색 강조·출력 구간·인쇄. style.css + calendar.css 위에 얹는다.
 *
 * calendar.css에서 그대로 쓰는 것: 일본어 글꼴 스택(html[lang="ja"])·.vh·.cal-controls·.cal-legend·.notice,
 * 인쇄 시트 전환(body.has-sheet — 시트가 있으면 시트만, 없으면 정적 페이지 그대로).
 * 여기서 바꾸는 것: 용지는 A4 세로·여러 쪽(달력의 가로 1장·고정 치수·넘침 측정은 쓰지 않는다).
 * 표 행은 쪽 경계에서 나뉘지 않고, 기준연도 캡션과 4열 헤더는 thead라서 쪽마다 반복된다.
 */

/* ── 표 ── */
.nn-base { font-size: 16px; line-height: 26px; font-weight: 600; color: var(--ink); margin: 0 0 4px; }
.nn-range { font-size: 14px; line-height: 22px; color: var(--ink-soft); margin: 0; }
.nn-table caption { text-align: left; font-size: 14px; line-height: 22px; font-weight: 600; color: var(--ink-soft); padding: 0 0 6px; }
.nn-table th, .nn-table td { white-space: nowrap; }
.nn-table th[scope="row"] { color: var(--ink); }
.nn-table td:nth-child(2), .nn-table thead th:nth-child(1), .nn-table thead th:nth-child(2) { text-align: left; }   /* 西暦·和暦 열은 글자라 왼쪽 정렬(머리글도 같이) */
.nn-era { display: block; }
/* 검색 일치행 — 배경 + 텍스트 표식(색만으로 구분하지 않는다) */
.nn-table tr.nn-hit th, .nn-table tr.nn-hit td { background: var(--accent-bg); }
.nn-mark { display: inline-block; margin-left: 6px; padding: 0 6px; font-size: 12px; line-height: 18px; font-weight: 600;
  color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; vertical-align: 1px; }
.nn-notes { margin-top: 12px; }
.nn-notes p { font-size: 14px; line-height: 22px; color: var(--ink-soft); margin: 0 0 8px; }
.nn-sources { margin: 0 0 12px; padding-left: 20px; font-size: 14px; line-height: 22px; }
.nn-sources li { margin: 4px 0; }

/* ── 조작 ── */
.nn-controls .field { margin-bottom: 12px; }
.nn-controls .statusline { margin: 4px 0 0; }
#nn-search-error { color: var(--warn); }
#nn-output fieldset { border: 0; padding: 0; margin: 0 0 12px; min-width: 0; }
#nn-output legend { padding: 0; margin-bottom: 6px; font-size: 14px; line-height: 22px; font-weight: 600; color: var(--ink); }
#nn-output .row .field { margin-bottom: 0; }
#nn-output .copyrow { margin-top: 12px; }

/* 인쇄 때만 보이는 경고(정본 데이터를 확인하지 못한 채 브라우저 자체 인쇄) */
.print-only { display: none; }

/* ── 인쇄 시트(A4 세로·여러 쪽) — 화면에서는 밖에 두고 높이 0으로 잘라 둔다(재지 않으므로 스크롤 높이에 보태지 않는다).
 *    인쇄 때는 calendar.css의 body.has-sheet 규칙이 정적 배치·자동 높이로 되돌린다. ── */
.print-sheet { width: 186mm; height: 0; overflow: hidden; font-size: 10pt; line-height: 1.4; }
.print-sheet .nn-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.print-sheet .nn-table th, .print-sheet .nn-table td { border: 0.2mm solid #888; padding: 1mm 2mm; text-align: right; white-space: nowrap; }
.print-sheet .nn-table th { font-weight: 600; }
.print-sheet .nn-table th[scope="row"], .print-sheet .nn-table td:nth-child(2), .print-sheet .nn-table thead th:nth-child(1), .print-sheet .nn-table thead th:nth-child(2) { text-align: left; }
.print-sheet .nn-table .ps-cap { text-align: left; font-weight: 700; border: 0; padding: 0 0 1.5mm; }
.print-sheet .nn-table thead { display: table-header-group; }
.print-sheet .nn-table tr { break-inside: avoid; page-break-inside: avoid; }
.print-sheet .nn-era { display: block; }
.ps-warn { font-size: 10pt; font-weight: 700; margin: 0 0 2mm; color: #000; }
.ps-rules, .ps-src { font-size: 8.5pt; margin: 3mm 0 0; color: #000; }
/* 출력 각주의 출처 링크 — 종이에서도 원문 위치가 읽히도록 URL 문자열을 라벨 옆에 함께 찍는다 */
.ps-links { margin: 1.5mm 0 0; padding-left: 5mm; font-size: 8.5pt; color: #000; }
.ps-links li { margin: 0.5mm 0; }
.ps-links a { color: #000; text-decoration: none; }
.ps-url { overflow-wrap: anywhere; }

@page { size: A4 portrait; margin: 12mm; }
@media print {
  /* 정적 페이지 그대로 인쇄될 때(JS·데이터 없음): 조작·규칙·FAQ·privacy·푸터는 뺀다. 표·안내·출처는 남는다. */
  .nn-controls, #nn-output, #nn-rules, .faq, #privacy, footer, #nn-data-notice { display: none !important; }
  .print-only { display: block; }
  .nn-table thead { display: table-header-group; }
  .nn-table tr { break-inside: avoid; page-break-inside: avoid; }
  .nn-table tr.nn-hit th, .nn-table tr.nn-hit td { background: none; }
  .nn-mark { display: none; }
}
