/* ============================================
   A5カタログ印刷専用CSS（@media print）
   2026-05-27 確定
   - 全HTMLページのHEADに <link rel="stylesheet" media="print" href="../_shared_css/print_a5.css"> を追加
   - WEB表示には一切影響なし
   - Playwright/Chromium のPDF出力時に自動適用
   ============================================ */

@page {
  size: A5 portrait;
  margin: 8mm 10mm;
}

@media print {

  /* ========== 印刷時に非表示にする要素 ========== */
  nav,
  header nav,
  .nav-back,
  .nav-links,
  .shop-link,
  .insta-link,
  .footer-sns,
  .footer-links,
  .foot-links,
  .foot-sublinks,
  .skip-link,
  button:not(.print-show),
  .base-cta,
  .bottom-cta a,
  .cta-section a,
  .product-footer button,
  iframe,
  video,
  .read-more {
    display: none !important;
  }

  /* ========== ベース設定 ========== */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  html, body {
    background: #FFFDF5 !important;
    color: #2C2C2C !important;
    font-size: 10pt;
    line-height: 1.7;
  }

  body > section, body > main > section, main > section, section {
    page-break-inside: avoid;
    break-inside: avoid;
    padding: 10pt 0 !important;
    margin: 0 !important;
  }

  /* ========== 見出し ========== */
  h1 {
    font-size: 22pt !important;
    line-height: 1.4 !important;
    margin: 8pt 0 6pt !important;
    page-break-after: avoid;
    break-after: avoid;
  }

  h2 {
    font-size: 16pt !important;
    line-height: 1.5 !important;
    margin: 12pt 0 6pt !important;
    page-break-after: avoid;
    break-after: avoid;
  }

  h3 {
    font-size: 13pt !important;
    line-height: 1.5 !important;
    margin: 8pt 0 4pt !important;
    page-break-after: avoid;
    break-after: avoid;
  }

  h4, h5, h6 {
    font-size: 11pt !important;
    margin: 6pt 0 4pt !important;
    page-break-after: avoid;
  }

  p, li, dd, dt {
    font-size: 10pt !important;
    line-height: 1.7 !important;
    margin: 4pt 0 !important;
    orphans: 3;
    widows: 3;
  }

  /* ========== 区切らせたくないブロック（最小限） ========== */
  .timeline-item,
  blockquote,
  table tr,
  figure,
  h1, h2, h3, h4, h5, h6 {
    page-break-inside: avoid;
    break-inside: avoid;
  }
  /* カード系は分割許可（要素大きいため・A5に収まらない） */
  .product-card,
  .navigator-card,
  .culture-card,
  .profile-card,
  .recipe-card {
    page-break-inside: auto;
    break-inside: auto;
    margin-bottom: 6pt !important;
  }

  /* ========== 画像サイズ調整 ========== */
  img {
    max-width: 100% !important;
    height: auto !important;
    page-break-inside: avoid;
  }

  .hero img, .page-hero img {
    max-height: 120pt !important;
    object-fit: cover;
  }

  .profile-img img, .navigator-img img {
    max-height: 80pt !important;
  }

  .culture-card-image, .navigator-img {
    height: 80pt !important;
  }

  /* ========== レイアウト調整 ========== */
  .products-grid, .cultures-grid, .navigators-grid {
    display: block !important;
  }

  .product-card, .culture-card, .navigator-card {
    display: block !important;
    margin: 0 0 10pt 0 !important;
    padding: 8pt !important;
    border: 0.5pt solid #E2E6E0 !important;
    box-shadow: none !important;
  }

  /* グリッド系を縦並びに */
  .grid-3, .grid-2, [style*="grid"] {
    display: block !important;
  }

  /* ========== リンク色（印刷時は黒に） ========== */
  a {
    color: #2C2C2C !important;
    text-decoration: none !important;
  }

  a[href^="http"]::after {
    content: "" !important;
  }

  /* ========== 背景画像/グラデーション削除 ========== */
  .hero, .page-hero, .bottom-cta, .cta-section, footer {
    background-image: none !important;
    background: #FFFDF5 !important;
    color: #2C2C2C !important;
    padding: 12pt !important;
    min-height: auto !important;
  }

  .bottom-cta, .cta-section {
    background: #F5F0E8 !important;
    text-align: center;
  }

  /* ========== Footer ========== */
  footer {
    border-top: 0.5pt solid #E2E6E0 !important;
    padding: 8pt 0 !important;
    font-size: 8pt !important;
  }

  footer * {
    color: #7A7A7A !important;
  }

  /* ========== 余白圧縮 ========== */
  .hero, .page-hero {
    min-height: auto !important;
    padding: 16pt 0 !important;
  }

  .chapter, .chapter-inner {
    padding: 10pt 0 !important;
  }

  /* ========== カード内余白 ========== */
  .culture-card-content, .navigator-content, .profile-info {
    padding: 6pt 8pt !important;
  }

  /* ========== 色保持の重要要素 ========== */
  .gold-accent, .region-tag, .product-sub, .navigator-num, .profile-num {
    color: #C9A84C !important;
  }

  .product-price, strong {
    color: #2C2C2C !important;
  }
}
