/* print.css : 印刷時のみ適用される想定（<link media="print"> もしくは @media print） */
@page {
  margin: 12mm;
}
@media print {
  body {
    /* 標準が16px程度なので、90%〜95%くらいにすると「気持ち小さい」感じになります */
    font-size: 9pt !important;
    line-height: 1.5 !important; /* 行間も少し詰めるとスッキリします */
  }

  /* もし見出しが大きすぎると感じる場合は、個別に調整します */
  h1 {
    font-size: 3rem !important;
  }
  h2 {
    font-size: 3rem !important;
  }
  .disclaimer h2 {
    font-size: 2rem !important;
  }
  h3 {
    font-size: 2rem !important;
  }
  p {
    margin-bottom: 0.5em !important;
  }
}
@media print {
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  body {
    background: none !important;
  }

  /* 装飾と不要ブロックを切る */

  #side-box,
  .button-toggle,
  .bnr-nav,
  .sns_link,
  .to_top,
  .back {
    display: none !important;
  }

  /* レイアウトを1カラムに寄せる */
  .main,
  .wrap {
    width: 100% !important;
    margin: 0 !important;
  }

  /* ここがポイント：空ページ用の高さを印刷では無効化 */
  .wrap {
    min-height: 0 !important; /* 1000pxを打ち消す */
    height: auto !important; /* 念のため */
  }

  /* もう1つのポイント：リンク後ろのURL追記を消す */
  a[href]::after {
    content: none !important; /* ""よりnoneが確実 */
  }

  /* SP側のバナーは印刷しない（重複防止） */
  .not-pc {
    display: none !important;
  }

  /* PCバナーを3列で印刷（縦1列化を防ぐ） */
  .flex_bnr {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
  }

  .flex_bnr div {
    flex: 0 0 calc((100% - 24px) / 4) !important; /* 4列：gap 8px × 3 = 24px */
    max-width: calc((100% - 24px) / 4) !important;
    margin: 0 !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  .flex_bnr img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    box-shadow: 0px 0px 4px 0 rgba(0, 0, 0, 0.2);
  }
  .footer-links {
    display: none;
  }
  .registration table {
    width: 99%;
  }
  /* 表・帯などの背景は出す */
  table,
  th,
  td,
  .btn {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .program .btn .p_btn,
  .abstract .btn .p_btn,
  .btn {
    font-size: 1.5rem;
  }
}
