/* ============================================================
   print.css — 印刷 / PDF保存用（A4横・1セクション＝1ページ）
   ブラウザの印刷ダイアログで
   「用紙: A4」「向き: 横」「余白: なし」「背景のグラフィック: オン」
   ============================================================ */

@page {
  size: A4 landscape;
  margin: 0;                 /* 余白はページ内側 .pad で確保する */
}

@media print {
  html, body { background: #fff !important; }

  /* 画面専用UIは印刷しない */
  .topbar, .progress { display: none !important; }

  /* 背景色・背景画像を確実に印刷する */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .sheet { display: block; padding: 0; gap: 0; }

  /* 1ページ＝A4横。固定寸法を優先し、途中で切れないようにする */
  .page {
    width: 297mm;
    height: 210mm;
    max-width: none;
    aspect-ratio: auto;
    margin: 0;
    box-shadow: none !important;
    overflow: hidden;
    break-inside: avoid;
    break-after: page;
    page-break-inside: avoid;
    page-break-after: always;
  }
  .page:last-child { break-after: auto; page-break-after: auto; }

  /* 要素がページ内で分割されないように */
  .card, .cont, .floor, .wall, .kpi, .jstep, .zitem, .check,
  .day, .sum-cell, .phase > div, .sw { break-inside: avoid; page-break-inside: avoid; }

  /* 濃い面の背景を強制 */
  .page.cover   { background: #0b0d0c !important; }
  .page.dark    { background: #0b0d0c !important; color: #fff !important; }
  .page.concept { background: #0b0d0c !important; color: #fff !important; }
  .cover .split, .cc-split { background: #23694c !important; }
  .bigstate     { background: #0b0d0c !important; color: #fff !important; }
  .answer       { background: #23694c !important; color: #fff !important; }
  .card.ink, .floor .fh, .day .dh, .cont .ch .cf, .jstep .jf { background: #0b0d0c !important; color: #fff !important; }
  .card.gr, .day.d2 .dh, .jstep.on .jf, .tbd { background: #23694c !important; color: #fff !important; }
  .card.fill { background: #f5f5f3 !important; }
  .day .dr.hi { background: #eef4f1 !important; }
  .gantt thead th { background: #f5f5f3 !important; }
  .gantt td.bar span.on  { background: #23694c !important; }
  .gantt td.bar span.on2 { background: #408b6c !important; }
  .gantt td.bar span.on3 { background: #0b0d0c !important; }
  .pin { background: #23694c !important; color: #fff !important; }
  .pin.bk { background: #0b0d0c !important; }
  .zitem .zn { background: #23694c !important; color: #fff !important; }
  .zitem.bk .zn { background: #0b0d0c !important; }
  .sw .chip.gr { background: #23694c !important; }
  .sw .chip.bk { background: #0b0d0c !important; }
  .ph .cap { background: rgba(11,13,12,.78) !important; color: #fff !important; }

  /* 表紙はノンブルを出さない */
  .page.cover .folio { display: none !important; }
  .page.dark .folio, .page.concept .folio { color: rgba(255,255,255,.34) !important; }

  /* リンクのURL自動追記・色変化を止める */
  a[href]::after { content: "" !important; }
  a { color: inherit !important; text-decoration: none !important; }
}
