@charset "UTF-8";



/* スマホ用の印刷スタイル（画面幅が768px以上） */
@media print {
  /* 基本設定 */
  html, body {
    margin: 0 20mm 0 0 !important;
    padding: 0;
    height: 266mm !important;
    width: 200mm !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* ページ全体を中央に */
    background-color: #fff;
  }

  body *:not(.print-erea1):not(.print-title):not(.image-grid):not(.image-grid *) {
    visibility: hidden; /* .print-title と .image-grid 以外を非表示 */
  }

  .print-erea1 {
    display: block !important;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
}

.print-title {
  display: block !important;
  margin-top: 29.75pt;
}
.print-erea1 .print-title span{
  display: none;
color: #00FF00;}


  /* 印刷時に表示する要素 */
  .print-erea1,
  .print-title,
  .image-grid,
  .image-grid * {
    visibility: visible !important; /* 強制的に表示 */
  }



  .image-grid {
    position: absolute;
    top: 55pt; /* タイトルの高さを考慮 */
    left: 13pt;
    width: 189mm;
    height: 269.5mm;
    /*max-height: calc(100% - 30px - 30px);  タイトルと下部余白を調整 */
    box-sizing: border-box;
    /*overflow: visible;
    page-break-inside: avoid;
    break-inside: avoid; 全体を表示するために変更 */
    margin: -20pt 0 0 0;
    display: grid;
    grid-template-columns: repeat(7, calc(100% / 7)); /* ピクセルの誤差をなくす */
    grid-template-rows: repeat(10, calc(100% / 10));
    gap: 0; /* 列間・行間の隙間をゼロ */
    /*justify-items: stretch;  セルを完全に引き伸ばす */
    /*align-items: stretch;  セルを完全に引き伸ばす */
    transform: scale(0.95); /* 全体をさらに縮小して10行を収める */
    transform-origin: center;
    border: 2px #000 solid;
     }

  /* 画像やセルのマージン/パディングをリセット */
  .image-grid img,
  .image-grid > * {
    margin: 0;
    padding: 0;
    width: 100%; /* セルの幅いっぱいに */
    height: 100%; /* セルの高さいっぱいに */
    object-fit: fill;
    box-sizing: border-box;

  }

/*  最下行の画像にだけ余白を10px設定
.image-grid img:nth-child(n+64):nth-child(-n+70) {
  margin-bottom: 0pt;
border-bottom: 1px solid #333;
}
*/


  /* ページ設定 */
  @page {
    size: A4 portrait;
    margin: 10mm 10mm 0mm 10mm; /* 下部余白をさらに増やして最下行が切れないように */
  }

  /* ページブレークの制御 */
  body {
    page-break-after: avoid;
    page-break-before: avoid;
    page-break-inside: avoid;
  }

  .print-title {
    display: block !important; /* 強制的に表示 */
    visibility: visible !important; /* 強制的に表示 */
    text-align: center;
    font-size: 13.5pt; /* フォントサイズを小さく */
    font-weight: bold;
    margin-bottom: 0pt; /* マージンを小さく */
    padding: 0;
    width: 100%;
    margin: 10pt 0 -15pt 0;
    }


    .image-grid img {
      width: 100%;
      height: 100%;
      object-fit: cover; /* 画像がセルにフィット */
      display: block; /* 画像の下の隙間対策 */
      border: none; /* 余計な境界線を防ぐ */
  }
}
