@media print {
  /* 1. 背景と文字色をリセット（インク節約と可読性） */
  body, h1, h2, h3, h4, h5, h6, p, span, div {
    color: #000 !important;
    background: transparent !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  /* 2. レイアウト崩れの主犯（Flex/Grid）を解除して縦積みに */
  body, main, article, #wrapper, .container, .row {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    min-width: 100% !important;
  }

  /* 3. 印刷に不要な要素をまとめて消す（ナビ、フッター、ボタン等） */
  header, footer, nav, aside, 
  .header, .footer, .nav, .sidebar, 
  .menu, .ad, .popup, .modal, .fixed-button,
  button, iframe, video {
    display: none !important;
  }

  /* 4. リンク先URLを印刷時に表示する（オプション） */
  a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    word-wrap: break-word;
  }
  
  /* 5. ページ送りの制御（画像の途中で切れないようにする） */
  img, tr, blockquote {
    page-break-inside: avoid;
  }

  /* 固有の不要要素を消す */
  #header, 
  #footer, 
  .p-hamburger, /* ハンバーガーメニュー */
  .c-pagetop,   /* ページトップボタン */
  .p-fv__scroll /* スクロールしてくださいの表示 */ {
    display: none !important;
  }

  /* コンテンツ幅を強制的に100%にする */
  .l-container, .l-main {
    width: 100% !important;
    max-width: none !important;
    overflow: visible !important;
  }

  /* FV（トップ画像エリア）の高さ制限を解除し、コンテンツを表示させる */
  .p-fv {
    height: auto !important;
    min-height: 0 !important;
    position: static !important; /* position: absolute/fixedによる重なり回避 */
  }
  
  /* 背景画像などを印刷したい場合のみ有効化（通常は消えます） */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}