/* ---------------------------------------------------------
 * /css/print.css
 * A4向け・記事ページ印刷最適化（Tailwind CDN 併用）
 * --------------------------------------------------------- */

@page {
  size: A4;
  margin: 18mm 15mm;
}

/* ---------------------------------------------------------
 * 印刷スタイル
 * --------------------------------------------------------- */
@media print {

  * {
    box-shadow: none !important;
    text-shadow: none !important;
  }

  html,
  body {
    background: #ffffff !important;
    color: #000000 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body {
    font-size: 12pt !important;
    line-height: 1.6 !important;
  }

  /* Tailwind の max-width を解除して紙面をフルに使う */
  main,
  .max-w-7xl,
  .max-w-6xl,
  .max-w-5xl,
  .max-w-4xl,
  .max-w-3xl,
  .max-w-2xl {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .px-5,
  .px-6,
  .px-8,
  .py-6,
  .py-8,
  .py-10,
  .mx-auto {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* -------------------------------------------------------
   * 画面専用 UI を非表示（※ header 全体は隠さない）
   * ------------------------------------------------------- */
  .no-print,
  .print-hidden,
  .article-views,
  .cta-floating,
  .floating-cta,
  .floating-banner,
  .cookie-banner,
  .screen-only {
    display: none !important;
    visibility: hidden !important;
  }

  /* 共通フッターだけ隠す（記事本文の下の footer） */
  footer,
  .site-footer,
  #site-footer {
    display: none !important;
    visibility: hidden !important;
  }

  /* -------------------------------------------------------
   * 見出しまわり
   * ------------------------------------------------------- */
  h1 {
    font-size: 20pt !important;
    line-height: 1.3 !important;
    margin-top: 0 !important;
    margin-bottom: 10pt !important;
    page-break-after: avoid;
  }

  h2 {
    font-size: 16pt !important;
    margin-top: 16pt !important;
    margin-bottom: 6pt !important;
    page-break-after: avoid;
  }

  h3 {
    font-size: 13pt !important;
    margin-top: 14pt !important;
    margin-bottom: 4pt !important;
    page-break-after: avoid;
  }

  /* -------------------------------------------------------
   * 段落・リスト
   * ------------------------------------------------------- */
  p,
  ul,
  ol {
    margin-top: 0.3em !important;
    margin-bottom: 0.3em !important;
  }

  ul,
  ol {
    padding-left: 1.3em !important;
  }

  /* -------------------------------------------------------
   * 画像・図版
   * ------------------------------------------------------- */
  img {
    max-width: 100% !important;
    height: auto !important;
    page-break-inside: avoid;
  }

  figure {
    page-break-inside: avoid;
    margin-top: 12pt !important;
    margin-bottom: 12pt !important;
  }

  figcaption {
    font-size: 9pt !important;
    color: #444 !important;
  }

  /* -------------------------------------------------------
   * ボックス類
   * ------------------------------------------------------- */
  .shadow,
  .shadow-md,
  .shadow-lg,
  .rounded,
  .rounded-xl,
  .rounded-2xl,
  .border,
  .border-slate-200,
  .border-gray-200,
  .border-gray-300 {
    box-shadow: none !important;
    border-color: #ccc !important;
  }

  /* -------------------------------------------------------
   * FAQ（details）は全展開
   * ------------------------------------------------------- */
  details {
    display: block !important;
  }

  details > summary {
    font-weight: bold !important;
  }

  /* -------------------------------------------------------
   * ボタン → プレーンリンク化
   * ------------------------------------------------------- */
  a,
  a:visited {
    text-decoration: underline !important;
    color: #000 !important;
  }

  .inline-flex,
  .btn,
  .button {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
  }

  /* -------------------------------------------------------
   * ユーティリティ
   * ------------------------------------------------------- */
  .print-avoid-break {
    page-break-inside: avoid !important;
  }

  .print-hidden {
    display: none !important;
  }

  /* グロッサリー丸タグ → 普通のリンクへ */
  a[href*="/glossary/"] {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    color: #000 !important;
    text-decoration: underline !important;
  }
}
