/* Legal document layout, used for both the on-screen preview and printing. */
.legal-doc {
  font-family: 'Times New Roman', Times, 'Liberation Serif', 'Vazirmatn', serif;
  font-size: 12pt;
  line-height: 1.4;
  color: #000;
  counter-reset: clause;
  text-align: justify;
}
.legal-doc p { margin: 0 0 .55em; }
.legal-doc .doc-title { font-size: 15pt; text-align: center; font-weight: bold; margin: 0 0 .6em; line-height: 1.3; }
.legal-doc .doc-subtitle { text-align: center; font-weight: bold; margin-bottom: 1.4em; }
.legal-doc .clause { counter-increment: clause; margin-top: 1.1em; }
.legal-doc .clause h2 {
  font-size: 12pt; font-weight: bold; text-transform: uppercase; margin: 0 0 .45em; break-after: avoid;
}
.legal-doc .clause h2::before { content: counter(clause) ".\00a0\00a0"; }
.legal-doc .declaration h2 { font-size: 15pt; text-align: center; margin: 0 0 1em; }
.legal-doc .sub h3 { font-size: 12pt; font-weight: bold; font-style: italic; margin: .7em 0 .25em; break-after: avoid; }
.legal-doc ol, .legal-doc ul { margin: .2em 0 .5em; padding-left: 2.4em; }
.legal-doc li { margin-bottom: .25em; }
.legal-doc ol.alpha { list-style: none; counter-reset: alpha; }
.legal-doc ol.alpha > li { counter-increment: alpha; position: relative; }
.legal-doc ol.alpha > li::before { content: "(" counter(alpha, lower-alpha) ")"; position: absolute; left: -2.2em; }
.legal-doc ol.roman { list-style: none; counter-reset: roman; }
.legal-doc ol.roman > li { counter-increment: roman; position: relative; }
.legal-doc ol.roman > li::before { content: "(" counter(roman, lower-roman) ")"; position: absolute; left: -2.4em; }
.legal-doc ul.bullets { list-style: disc; }

.legal-doc .fill { display: inline-block; border-bottom: 1px solid #000; height: 1em; vertical-align: baseline; max-width: 100%; }

.legal-doc .execution { margin-top: 2em; break-inside: avoid; text-align: left; }
.legal-doc .sig-block { display: flex; gap: 2em; margin: 2em 0 1.5em; break-inside: avoid; }
.legal-doc .sig-left { flex: 0 0 55%; }
.legal-doc .sig-left .addr { margin-top: 2em; }
.legal-doc .sig-right { flex: 1; display: flex; flex-direction: column; justify-content: flex-start; padding-top: 2.5em; }
.legal-doc .sig-line { border-bottom: 1px solid #000; height: 2.2em; }
.legal-doc .sig-label { font-size: 10.5pt; margin-top: .2em; }
.legal-doc .witnesses { display: flex; gap: 2.5em; margin: 1em 0; break-inside: avoid; }
.legal-doc .witnesses .sig-cell { flex: 1; }
.legal-doc .witnesses .sig-cell p { margin-top: .9em; }
.legal-doc .reps { margin-top: 2.5em; flex-wrap: wrap; }
.legal-doc .reps .sig-cell { flex: 1 1 40%; }
.legal-doc .declared { margin-top: 1.5em; }
.legal-doc .page-break { border-top: 1px dashed #bbb; margin: 2em 0; }

@media print {
  @page {
    size: letter;
    margin: 1in 1in 1in 1in;
    @bottom-left { content: counter(page) " of " counter(pages); font: 10pt 'Times New Roman', serif; }
  }
  /* Initials of the signer and witnesses are required on every page of the three legal documents. */
  .legal-doc[data-doc='will'] { page: will; }
  .legal-doc[data-doc='epoa'] { page: epoa; }
  .legal-doc[data-doc='epoa-officer'] { page: epoa-officer; }
  .legal-doc[data-doc='ra'] { page: ra; }
  .legal-doc[data-doc='assets'] { page: assets; }
  @page will {
    @bottom-right { content: "Initials:\2003 Testator _______\2003 Witness 1 _______\2003 Witness 2 _______"; font: 9pt 'Times New Roman', serif; }
  }
  @page epoa {
    @bottom-right { content: "Initials:\2003 Donor _______\2003 Witness 1 _______\2003 Witness 2 _______"; font: 9pt 'Times New Roman', serif; }
  }
  @page epoa-officer {
    @bottom-right { content: "Initials:\2003 Donor _______\2003 Lawyer/Notary _______"; font: 9pt 'Times New Roman', serif; }
  }
  @page ra {
    @bottom-right { content: "Initials:\2003 Adult _______\2003 Witness 1 _______\2003 Witness 2 _______"; font: 9pt 'Times New Roman', serif; }
  }
  @page assets {
    @bottom-right { content: "Information only. Not part of my Will."; font: 9pt 'Times New Roman', serif; }
  }
  .legal-doc .page-break { border: 0; margin: 0; break-after: page; }
  .legal-doc .declaration { break-before: page; break-inside: avoid; page: sworn; border: 0; margin: 0; padding: 0; }
  @page sworn {
    @bottom-right { content: none; }
  }
}

.legal-doc .declaration { font-size: 11pt; line-height: 1.3; border-top: 1px dashed #bbb; margin-top: 2em; padding-top: 2em; }
.legal-doc .declaration h2 { margin-bottom: .6em; }
.legal-doc .declaration li { margin-bottom: .15em; }
.legal-doc .declaration .declared { margin-top: .8em; }
.legal-doc .declaration .witnesses { margin-top: .4em; }

.legal-doc .stamp {
  height: 6em; border: 1px dashed #999; display: flex; align-items: center; justify-content: center;
  color: #777; font-size: 10pt; margin-top: .4em;
}
.legal-doc .form-note { font-style: italic; font-size: 10pt; text-align: center; margin: -.4em 0 1em; }

.legal-doc .asset-table { width: 100%; border-collapse: collapse; margin-top: 1em; font-size: 11pt; text-align: left; }
.legal-doc .asset-table th, .legal-doc .asset-table td { border: 1px solid #000; padding: .35em .5em; vertical-align: top; }
.legal-doc .asset-table th { font-weight: bold; }
.legal-doc .asset-table th:first-child { width: 34%; }
.legal-doc .asset-table .num { width: 5.5em; text-align: center; }
.legal-doc .asset-table tr { break-inside: avoid; }
.legal-doc .asset-table tr.blank td { height: 2.2em; }
.legal-doc .printed-name { border-bottom: 1px solid #000; padding: 0 .3em; }

/* Fallback footer for browsers without page-margin boxes (see printDoc in ui.js). */
.pf-frame { padding-bottom: .45in; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.pf-foot { position: fixed; bottom: 0; right: 0; font: 9pt 'Times New Roman', serif; white-space: pre; }
