/* CalPrintable print stylesheet v2 — prints ONLY the calendar sheet:
   one page, grid fills the sheet, sized by the paper picked in the tool.
   (v1 used visibility:hidden, which left the rest of the page occupying
   space and produced 3 mostly-blank sheets.) */
@media print{
  /* Default page; calendar-tool.js injects a matching @page rule for the
     paper selected in the tool (Letter / A4 / Legal / A5). */
  @page{ size:Letter portrait; margin:10mm; }

  /* Hide everything that is not the calendar sheet (only on tool pages). */
  .site-header, .site-footer, .ad-slot, .cal-note-backdrop{ display:none !important; }
  body:has(#calendar-tool) .breadcrumbs,
  body:has(#calendar-tool) main > h1,
  body:has(#calendar-tool) main > p,
  body:has(#calendar-tool) .format-chips,
  body:has(#calendar-tool) main > section,
  body:has(#calendar-tool) .hero h1,
  body:has(#calendar-tool) .hero .sub{ display:none !important; }

  html, body{ background:#fff !important; height:auto !important; }
  main.wrap, .hero, .hero .wrap{
    max-width:none !important; width:100% !important;
    margin:0 !important; padding:0 !important; background:#fff !important;
  }

  #cal-print-area{ position:static !important; width:100%; margin:0; padding:0; }
  .cal-tool{
    box-shadow:none !important; border:0 !important; border-radius:0 !important;
    padding:0 !important; margin:0 !important; max-width:none !important; background:#fff !important;
  }

  /* Tool chrome never prints. */
  .cal-toolbar, .cal-toggles, .cal-head, .cal-tip{ display:none !important; }

  .cal-print-title{
    display:block !important; text-align:center;
    font-size:24pt; font-weight:700; color:#14243f; margin:0 0 6pt;
  }

  table.cal-grid{ width:100%; border-collapse:separate; border-spacing:3pt; table-layout:fixed; }
  .cal-grid th{
    font-size:10pt; color:#14243f; padding:1pt 0 3pt;
    text-transform:uppercase; letter-spacing:.08em; text-align:center;
  }
  .cal-grid td{
    border:1pt solid #b9c2cc; border-radius:4pt; vertical-align:top;
    padding:4pt 5pt; background:#fff !important; overflow:hidden;
  }
  .cal-grid td.other-month{ border-color:#e6eaee; }
  .cal-grid td .d{ font-size:13pt; font-weight:600; color:#14243f !important; line-height:1.1; }
  .cal-grid td.today .d{ color:#c77400 !important; }
  .cal-grid .hol{ display:block; font-size:7pt; line-height:1.3; color:#8a5a00 !important; margin-top:2pt; }
  .cal-grid td.has-note::after{ display:none; }

  /* Row heights per paper — the grid fills the sheet like it does on screen.
     (6 rows worst case; 5-row months simply end higher.) */
  body[data-paper="letter"] .cal-grid td{ height:33mm; }
  body[data-paper="a4"]     .cal-grid td{ height:36mm; }
  body[data-paper="legal"]  .cal-grid td{ height:46mm; }
  body[data-paper="a5"]     .cal-grid td{ height:23mm; }
  body[data-paper="a5"] .cal-print-title{ font-size:16pt; margin-bottom:4pt; }
  body[data-paper="a5"] .cal-grid th{ font-size:7.5pt; }
  body[data-paper="a5"] .cal-grid td{ padding:2.5pt 3pt; border-radius:3pt; }
  body[data-paper="a5"] .cal-grid td .d{ font-size:10pt; }
  body[data-paper="a5"] .cal-grid .hol{ font-size:5.5pt; }
}
