/* =========================================================
   FUBUKI 印刷用CSS（全ページ共通・A4縦）
   置き場所: ファイルマネージャー /fubukiblocks/print/print.css
   読み込み: サイト共通HTML（右下CTAと同じ場所）に
     <link rel="stylesheet" href="https://www.fubuki.com/hubfs/fubukiblocks/print/print.css?v=5" media="print">
   ※ブラウザが最大14日間キャッシュするため、CSSを更新したら ?v= の数字を1つ上げる
   v5 2026-12-02
   ========================================================= */
@media print {

  @page { size: A4 portrait; margin: 12mm 10mm; }

  /* 背景色・背景画像をデザイン通りに出す（濃色帯の白文字が消えるのを防ぐ） */
  html, body, * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* アニメーション・スクロール演出を止める（途中の状態で印刷されないように） */
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  [data-reveal], [data-fbk-reveal],
  .js .manifesto .line > span,
  .js .giant .ch {
    opacity: 1 !important;
    transform: none !important;
  }
  /* 段々（pixels）の帯：スクロールしなくても完成形の高さで出す */
  .js .pixels:not(.is-in) i { height: calc(var(--h) * 5vw) !important; }
  .js .pixels[style*="--from:var(--bg)"]:not(.is-in) i { height: calc((2 - var(--h)) * 5vw) !important; }
  .fbk-js .fbk-pixels:not(.is-in) i { height: calc(var(--h) * 3vw) !important; }
  .fbk-js .fbk-pixels[data-from=paper]:not(.is-in) i { height: calc((2 - var(--h)) * 3vw) !important; }

  /* 印刷に不要な浮遊物・操作部品を消す */
  .skip-link,
  .frame-marks,
  .fbk-cta, .fbk-cta-close,
  .motion-button, .assembly-tag,
  #hubspot-messages-iframe-container,
  [id^="hs-web-interactives"],
  #hs-interactives-modal-overlay,
  #hs-eu-cookie-confirmation,
  .hs-tools-menu,
  .p-hdr_nav_global__child, .p-hdr_nav_child__grandchild,
  iframe[src*="googletagmanager"] {
    display: none !important;
  }

  /* フッター簡易版：大きな FUBUKI. ロゴとコピーライトだけ残す
     （締めのCTA枠・フブキのこと・ページ先頭ボタン・サイトマップは紙では押せないので出さない） */
  .fbk-closing__frame,
  .fbk-sitemap {
    display: none !important;
  }
  .fbk-closing { padding-top: 24px !important; padding-bottom: 0 !important; }
  .fbk-closing .fbk-wordmark { margin-top: 0 !important; break-inside: avoid; }
  .fbk-closing .fbk-footer { break-before: avoid; }

  /* 下層ヘッダー：テーマのPC用メニュー指定が「画面のときだけ」なので、印刷では
     メニューが縦に崩れる。メニューとハンバーガーは印刷しない（ロゴとお問い合わせは残す） */
  html body #header .p-header .p-header__nav,
  html body #header .p-header .p-header__menu {
    display: none !important;
  }
  /* ロゴの大きさ指定も「画面のときだけ」のテーマがあり、印刷で巨大化するため上限を付ける */
  #header .p-hdr_logos img {
    width: auto !important;
    height: auto !important;
    max-height: 22px !important; /* 画面と同じ高さ */
    max-width: 200px !important;
  }

  /* BLOCKSテーマのヒーロー：高さ指定が「画面のときだけ」で印刷では高さ0になり、
     見出しが下の本文に重なるため、中身の高さで組む */
  .p-hero { height: auto !important; min-height: 0 !important; }
  .p-hero__contents, .p-hero__layout {
    position: relative !important;
    inset: auto !important;
    height: auto !important;
  }
  .p-hero__layout { padding: 32px 0 !important; }

  /* 固定ヘッダー・追従要素は通常配置に（全ページで重なって出るのを防ぐ） */
  #header, .site-header,
  .fbk-chapter__head, .fbkb-post__aside {
    position: static !important;
    top: auto !important;
  }

  /* 改ページで切れにくくする */
  img, svg, figure, tr, blockquote, pre, li {
    break-inside: avoid;
  }
  .giant, .manifesto, .hero-word, .sec-head, .fbk-wordmark,
  h1, h2, h3, h4 {
    /* break-after: avoid は2カラムのグリッドで大きな空白を生むので付けない */
    break-inside: avoid;
  }
  p { orphans: 3; widows: 3; }
  /* 下層ヒーロー（写真つき）：グリッドのままだと見出しごと次ページへ送られ1ページ目が空になるため縦積みに */
  /* （display:block だと見出し・本文の間の gap 余白が消えるので、gapが効く縦並びflexにする） */
  /* （/stance など写真が右上に乗る通常ヒーローはグリッドのままでよいので、インタビュー型 --photo だけに限定） */
  .fbk-hero__grid--photo { display: flex !important; flex-direction: column !important; align-items: stretch !important; }
  img { max-width: 100% !important; }

  /* ---------------------------------------------------------
     トップページ：MVはスクリーンショット画像に差し替える
     （.hero-loop を持つ .hero はトップページだけ）
     MVのデザインを変えたら mv-print.jpg を撮り直して同名で上書き
     --------------------------------------------------------- */
  .hero:has(.hero-loop) {
    content: url("https://www.fubuki.com/hubfs/fubukiblocks/print/mv-print.jpg");
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
  }
  /* ヘッダーはスクリーンショットに含まれているので二重に出さない */
  html:has(.hero-loop) .site-header { display: none !important; }
}
