/*======================================================
  2026-10-15 form-page print fix, version b
  (fix approved by Mark 7:40 PM CT, "That need correcting").
  Version b: Safari printed a blank 2nd page because the form
  picture was sized to almost a full page and Safari's own
  margins plus "Print headers and footers" pushed it over.
  Now the picture is trimmed to the form itself and capped
  well under a page, so it always fits on one sheet.
  Loaded with media="print" ONLY on circumcision.php,
  records-release.php and immunization-schedule.php.
======================================================*/
@page {
  size: letter;
  margin: 0.5in;
}

html,
body {
  background: #fff !important;
  margin: 0 !important;
  padding: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
}

body > *:not(.forms_doc_page),
.forms_doc_inner > *:not(.forms_print_pages),
.header,
.providerpage_image,
.forms_doc_intro,
.forms_doc_actions,
.forms_doc_frame,
.footer_section,
.swipe_hint {
  display: none !important;
}

body::before,
body::after,
.forms_doc_page::before,
.forms_doc_page::after,
.forms_doc_inner::before,
.forms_doc_inner::after {
  content: none !important;
  display: none !important;
}

.forms_doc_page,
.forms_doc_inner {
  display: block !important;
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;
  height: auto !important;
  min-height: 0 !important;
  background: #fff !important;
  border: 0 !important;
  box-shadow: none !important;
}

.forms_print_pages,
.forms_print_pages[hidden] {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  height: auto !important;
}

.forms_print_pages img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 8.5in; /* well under a Letter page, so Safari's margins and header/footer never push it to a 2nd page */
  margin: 0 auto;
  break-inside: avoid;
  page-break-inside: avoid;
  break-after: avoid;
  page-break-after: avoid;
}
