/* 印刷用の HTML（site/<言語>/print.html）。manual.css に重ねる。ページは縦長で小さめ、文字は大きめ。 */
@page {
  size: A5 portrait;
  margin: 14mm 12mm 16mm;
  @bottom-left { content: "© 2026 KIRA Ryouta"; font-size: 8pt; color: #5f6368; }
  @bottom-right { content: counter(page); font-size: 9pt; color: #5f6368; }
}
@page :first { @bottom-right { content: none; } }

/* 著作権表示は、ページの下の余白に出す（本文の最後の footer は画面で見るときだけ） */
@media print { body.print footer.copyright { display: none; } }

html { font-size: 10.5pt; }
body.print { line-height: 1.6; }
body.print main { display: block; max-width: none; margin: 0; padding: 0; }

/* 画面で見るときも、ページの幅に近づける */
@media screen {
  body.print { max-width: 40rem; margin: 0 auto; padding: 2rem 1.5rem; }
  body.print main.chapter, body.print .part-title { border-top: 1px solid var(--line); margin-top: 3rem; padding-top: 2rem; }
}

/* 表紙と目次 */
main.cover h1 { font-size: 2rem; margin-top: 3rem; }
main.cover .chapters a { padding: .5rem .9rem; }
main.cover .chapters li { margin: .5rem 0; break-inside: avoid; }

/* 部の扉と章は、新しいページから */
.part-title, main.chapter { break-before: page; }
.part-title { display: flex; align-items: center; min-height: 60vh; }
.part-title h1 { font-size: 1.8rem; color: var(--accent-dark); border-bottom: 3px solid var(--accent); padding-bottom: .4rem; margin: 0; }
@media screen { .part-title { min-height: 0; } }

/* 途中で切らない */
h1, h2, h3, .chapter-no { break-after: avoid; }
figure, .note, .trouble, .summary, .platform, table.items tr, ol.steps > li, .see-also { break-inside: avoid; }
p, li { orphans: 2; widows: 2; }

/* 色は印刷でも残す */
* { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
a { text-decoration: none; }
figure img { max-width: 100%; height: auto; }
