/* ================================================================
   StrongHearts Home Health Agency — PRINT additions for official
   forms (v2)
   File: v2-full/css/print-official-v2.css
   Theme copy: wp-theme/stronghearts-v2/print-official-v2.css
   ------------------------------------------------------------
   LOAD ORDER (coordinator): link this file AFTER print-v2.css so
   its rules win any specificity tie:
     <link rel="stylesheet" href="css/print-v2.css">
     <link rel="stylesheet" href="css/print-official-v2.css">
   ------------------------------------------------------------
   WHAT IT DOES:
   1. Prints the institutional header (.sh-form-official) at the
      top of every official form page — clean black-on-white,
      ink-friendly, with a double rule beneath it.
   2. Kills the generic print-v2.css fallback header
      (body:not(:has(.print-header))::before) on pages that carry
      the official header, so it never prints twice. Uses the
      higher-specificity selector  html body:has(.sh-form-official)
      (0,1,3) to beat print-v2.css's body:not(...)::before (0,1,2).
   3. Prints the signature line as handwriting lines.
   4. Keeps everything ink-friendly: no backgrounds, no shadows.
   Screen behaviour: NOTHING — every rule is inside @media print.
   ================================================================ */

@media print {

  /* ---------- Suppress the generic fallback header ---------- */
  html body:has(.sh-form-official)::before {
    content: none !important;
  }

  /* ---------- Official header: clean institutional print ---------- */
  body .sh-form-official {
    display: block !important;
    border: 0 !important;
    border-bottom: 3pt double #000 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    max-width: 100% !important;
    margin: 0 0 12pt !important;
    padding: 0 0 8pt !important;
    page-break-after: avoid !important;
    page-break-inside: avoid !important;
  }
  body .sh-form-official .sh-fo-brand {
    display: block !important;
    margin-bottom: 4pt !important;
  }
  body .sh-form-official .sh-fo-logo {
    display: block !important;
    margin-bottom: 6pt !important;
  }
  body .sh-form-official .sh-fo-logo img {
    display: block !important;
    width: 180pt !important;               /* print-friendly logo size */
    max-width: 180pt !important;
    height: auto !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  body .sh-form-official .sh-fo-legal {
    font-size: 17pt !important;
    font-weight: 700 !important;
    color: #000 !important;
    line-height: 1.2 !important;
  }
  body .sh-form-official .sh-fo-medicare {
    font-size: 10pt !important;
    font-weight: 700 !important;
    color: #000 !important;
    letter-spacing: 0.4pt !important;
  }
  body .sh-form-official .sh-fo-licenses {
    font-size: 9pt !important;
    font-weight: 400 !important;
    color: #000 !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 3pt 0 !important;
    line-height: 1.35 !important;
  }
  body .sh-form-official .sh-fo-contact {
    font-size: 9.5pt !important;
    color: #000 !important;
    line-height: 1.4 !important;
  }
  body .sh-form-official .sh-fo-phones {
    font-weight: 700 !important;
  }
  body .sh-form-official a.sh-fo-email {
    color: #000 !important;
    text-decoration: none !important;
  }

  /* ---------- Form furniture in print ---------- */
  body .sh-form-titleblock {
    max-width: 100% !important;
    margin: 0 0 10pt !important;
    text-align: center !important;
  }
  body .sh-form-title {
    font-size: 15pt !important;
    color: #000 !important;
    margin: 0 0 4pt !important;
  }
  body .sh-form-ref {
    font-size: 9pt !important;
    color: #000 !important;
    border: 1pt solid #000 !important;
    background: transparent !important;
    border-radius: 0 !important;
    padding: 2pt 10pt !important;
  }
  body .sh-form-daterow {
    max-width: 100% !important;
    margin: 6pt 0 0 !important;
    text-align: right !important;
    font-size: 10pt !important;
    color: #000 !important;
  }

  /* ---------- Signature line: handwriting lines on paper ---------- */
  body .sh-sig-line {
    max-width: 100% !important;
    margin: 22pt 0 0 !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 24pt !important;
    padding: 10pt 0 0 !important;
    border-top: 1pt solid #000 !important;
    font-size: 10pt !important;
    color: #000 !important;
    page-break-inside: avoid !important;
  }
  body .sh-sig-line span {
    flex: 1 1 0 !important;
    border-bottom: 1pt solid #000 !important;
    padding-bottom: 16pt !important;        /* room to sign with a pen */
    min-height: 28pt !important;
  }
}
