/* =========================================
   PRINT BOOK MODE
   A4 academic / book style
========================================= */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@300;400;500;700&display=swap');

@media print {

  @page {
    size: A4;
    margin: 22mm 18mm 24mm 18mm;
  }

  html,
  body {
    background: #fff !important;
    color: #111 !important;

    font-family:
      "Noto Serif JP",
      "Yu Mincho",
      "Hiragino Mincho ProN",
      serif;

    font-size: 11.5pt;
    line-height: 1.9;

    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body {
    margin: 0;
    padding: 0;
  }

  /* Layout */

  .wrap {
    display: block !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  main {
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
  }

  /* Hide UI */

  .site-nav,
  .site-footer,
  .MenuButton,
  .HicDialog,
  .HicDialogHead {
    display: none !important;
  }

  /* Typography */

  h1,
  h2,
  h3,
  h4 {
    color: #000 !important;
    break-after: avoid;
    page-break-after: avoid;
    page-break-inside: avoid;

    font-family:
      "Noto Serif JP",
      serif;
  }

  h1 {
    font-size: 24pt;
    line-height: 1.2;
    margin-top: 0;

    padding-top: 0;

    page-break-before: always;
    break-before: page;
  }

  h1:first-child {
    page-break-before: auto;
    break-before: auto;
  }

  h2 {
    font-size: 17pt;
    margin-top: 2.2em;
  }

  h3 {
    font-size: 14pt;
    margin-top: 1.8em;
  }

  p,
  li,
  blockquote,
  td,
  th {
    orphans: 3;
    widows: 3;
  }

  p {
    margin: 0 0 1.2em;
    text-align: justify;
  }

  /* Images */

  img {
    max-width: 100% !important;
    height: auto !important;

    page-break-inside: avoid;
    break-inside: avoid;

    border-radius: 0 !important;
    box-shadow: none !important;
  }

  figure {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* Tables */

  table {
    width: 100%;
    border-collapse: collapse;
    margin: 2em 0;

    font-size: 10pt;

    page-break-inside: avoid;
    break-inside: avoid;
  }

  th,
  td {
    border: 1px solid #bbb;
    padding: 8px 10px;
    vertical-align: top;
  }

  th {
    background: #f2f2f2 !important;
  }

  /* Links */

  a {
    color: #000 !important;
    text-decoration: none !important;
  }

  a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #666;
  }

  /* Code */

  pre,
  code {
    font-family: "Courier New", monospace;
    font-size: 9pt;
    white-space: pre-wrap;
    word-break: break-word;
  }

  pre {
    border: 1px solid #ccc;
    padding: 12px;
  }

  /* Horizontal rule */

hr {
  border: 0;
  height: 1px;
  margin: 3rem 0;

  background: linear-gradient(
    to right,
    transparent,
    rgba(0,0,0,.12),
    transparent
  );
}

  /* Blockquote */

  blockquote {
    border-left: 3px solid #999;
    padding-left: 1em;
    color: #444;
    margin-left: 0;
  }

}