/* 印刷（PDF化）時に #header 内のロゴと #left_contents 内のみを出力する */
@media print {

  /* 背景画像・背景色は印刷時に省略されることが多いため、強制的に印刷する
     （h2見出しのアイコン background-image を表示させるために必要） */
  * {
    -webkit-print-color-adjust: exact !important;
    color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* 一旦すべて非表示にする */
  body * {
    visibility: hidden;
  }

  /* #header 内のロゴ（h1とその中身）だけ表示する */
  #header h1,
  #header h1 * {
    visibility: visible;
  }

  /* #left_contents とその中身だけ表示する */
  #left_contents,
  #left_contents * {
    visibility: visible;
  }

  /* パンくず・ナビ・サイドバー・フッターなどは印刷しない */
  #pankz,
  #navi,
  #sidebar,
  #right_contents,
  #footer {
    display: none !important;
  }

  /* ロゴ（h1）を用紙の先頭・左端に配置し直す */
  #header h1 {
    position: absolute;
    top: 0;
    left: 0;
    margin: 0;
    z-index: 9999;
  }

  #contents {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* 印刷時に文字が小さいため、全体を1.4倍に拡大する
     （下層の要素は多くが%指定なので連動して拡大される） */
  #contents {
    font-size: 1.2em !important;
  }

  /* 元CSSの「#contents #left_contents { width:720px; float:left; }」を上書き */
  #contents #left_contents {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    position: static !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }

  /* layout.css の「#contents #left_contents .section { width:680px; float:left; }」も
     固定幅の原因になっているため、あわせて幅100%に上書きする */
  #contents #left_contents .section,
  #contents #left_contents .section02 {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    box-sizing: border-box !important;
  }

  /* contents.css の「#contents h2 { width:680px; height:40px; line-height:30px; ... }」も
     幅100%に合わせる。文字が1.4倍に拡大されて height:40px / line-height:30px に
     収まらなくなるため、高さと行の高さも拡大しておく（アイコン背景サイズはそのまま） */
  #contents h2 {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    visibility: visible !important;
    height: 56px !important;
    line-height: 56px !important;
  }

  /* ロゴの高さ分だけ本文の上に余白を作る場合はここで調整してください */
  #contents #left_contents {
    margin-top: 0px !important;
  }

  /* 余白調整（必要に応じて数値を調整してください） */
  @page {
    margin: 15mm;
  }
}
