|
471 | 471 | /* ======================= |
472 | 472 | PRINT STYLES |
473 | 473 | ======================= */ |
| 474 | + /* Tell the browser exactly how big the page is and the margins to use */ |
| 475 | + @page { |
| 476 | + size: Letter portrait; /* use A4 if you prefer */ |
| 477 | + margin: 0.5in; /* adjust to taste */ |
| 478 | + } |
| 479 | + |
474 | 480 | @media print { |
475 | 481 | body { |
476 | 482 | background: white !important; |
477 | 483 | color: black !important; |
478 | 484 | padding-top: 0; |
479 | 485 | } |
480 | 486 |
|
| 487 | + /* Remove everything except the print cards */ |
481 | 488 | #navbar-placeholder, |
482 | | - .nav-home, |
| 489 | + .page-header, /* hide the big header so only cards print */ |
483 | 490 | .legend, |
484 | | - .table-container { |
| 491 | + .table-container, |
| 492 | + .nav-home { |
485 | 493 | display: none !important; |
486 | 494 | } |
487 | 495 |
|
488 | | - .header-card { |
489 | | - box-shadow: none !important; |
490 | | - border: 1px solid #bfbfbf !important; |
491 | | - page-break-inside: avoid; |
492 | | - margin-bottom: 1.5rem; |
| 496 | + /* Make the printable area fit inside margins and center it */ |
| 497 | + html, body { |
| 498 | + width: 8.5in; |
493 | 499 | } |
494 | 500 |
|
495 | | - /* Show print cards */ |
| 501 | + .container { |
| 502 | + max-width: none !important; |
| 503 | + padding: 0 !important; |
| 504 | + } |
| 505 | + |
| 506 | + /* Use inches so it reliably fits inside Letter (7.5in printable width with 0.5in margins) */ |
496 | 507 | .print-cards { |
497 | 508 | display: block !important; |
498 | | - max-width: 800px; |
499 | | - margin: 0 auto; |
| 509 | + width: 7.25in; /* comfortably inside 7.5in printable area */ |
| 510 | + margin: 0 auto; /* centers on the page */ |
500 | 511 | } |
501 | 512 |
|
| 513 | + /* Let cards break across pages so space is used more evenly */ |
502 | 514 | .scenario-card { |
503 | | - border: 2px solid #000; |
504 | | - border-radius: 8px; |
505 | | - margin-bottom: 1.5rem; |
506 | | - page-break-inside: avoid; |
507 | | - overflow: hidden; |
| 515 | + border: 1px solid #000; |
| 516 | + margin-bottom: 0.5rem; |
| 517 | + page-break-inside: auto; /* was avoid */ |
| 518 | + break-inside: auto; |
| 519 | + box-shadow: none !important; |
508 | 520 | -webkit-print-color-adjust: exact !important; |
509 | 521 | print-color-adjust: exact !important; |
510 | 522 | } |
511 | 523 |
|
| 524 | + /* Keep the header with at least the first row, but allow body to flow */ |
512 | 525 | .scenario-card-header { |
513 | 526 | background: #111 !important; |
514 | 527 | color: #fff !important; |
515 | | - padding: 0.75rem 1rem; |
| 528 | + padding: 8pt 10pt; |
516 | 529 | font-weight: 700; |
517 | | - font-size: 1.1rem; |
| 530 | + font-size: 12pt; |
518 | 531 | border-bottom: 2px solid #000; |
| 532 | + break-after: avoid; |
519 | 533 | -webkit-print-color-adjust: exact !important; |
520 | 534 | print-color-adjust: exact !important; |
521 | 535 | } |
|
528 | 542 | .document-item { |
529 | 543 | display: flex; |
530 | 544 | justify-content: space-between; |
531 | | - padding: 0.4rem 0; |
| 545 | + padding: 4pt 0; |
532 | 546 | border-bottom: 1px dotted #ccc; |
533 | | - font-size: 0.95rem; |
| 547 | + font-size: 10pt; |
| 548 | + page-break-inside: avoid; |
| 549 | + break-inside: avoid; |
534 | 550 | } |
535 | 551 |
|
536 | 552 | .document-item:last-child { |
|
0 commit comments