:root {
  --body-font-size: 8.75pt;
  --line-height: 1.07;
  --margin-font-size: 6pt;
  --europe-font-family: "EUAlbertina", "DejaVu Serif", "Times New Roman";
}

@page {
  size: A5;
  margin-top: 15mm;
  margin-bottom: 10mm;
  margin-inside: 10mm;
  margin-outside: 7mm;
  -prince-page-fill: prefer-balance; /* see https://www.princexml.com/doc/prince-for-books/#the-property--prince-page-fill */

  @top-left {
    border-bottom: solid 1px black;
    margin-bottom: 3mm;
    padding-bottom: 1mm;
    vertical-align: bottom;
  }

  @top-right {
    border-bottom: solid 1px black;
    font-size: x-small;
    margin-bottom: 3mm;
    padding-bottom: 1mm;
    vertical-align: bottom;
  }

  @bottom-left {
    font-size: var(--margin-font-size);
    vertical-align: top;
    margin-top: 2mm;
    font-family: var(--europe-font-family), serif;
  }

  @bottom-right {
    font-size: var(--margin-font-size);
    vertical-align: top;
    margin-top: 2mm;
    font-family: var(--europe-font-family), serif;
  }

  @footnote {
    border-top: dotted black thin;
    border-clip: 3cm;
    margin: 2mm 2mm 2mm 3mm;
    padding-top: 2mm;
  }
}

@page:verso {
  @bottom-left {
    content: counter(page);
  }
}

@page:recto {
  @bottom-right {
    content: counter(page);
  }
}

@page:first {
  @bottom-left {
    content: none;
  }
  @bottom-right {
    content: none;
  }
}

@page:nth(2) {
  @bottom-left {
    content: none;
  }
  @bottom-right {
    content: none;
  }
}

@page preamble {
  margin-outside: 8mm;
}

body {
  font-family: var(--europe-font-family), serif;
  font-size: var(--body-font-size);
  letter-spacing: 0.002em;
  line-height: var(--line-height);
  margin: initial;
  max-width: unset;
  padding: initial;
  text-align: justify;
}

i {
  margin-left: -9mm;
  position: absolute;
  text-align: right;
  width: 8mm;
}

h1 {
  -prince-bookmark-level: 1;
}

h2 {
  -prince-bookmark-level: 2;
}

h3 {
  -prince-bookmark-level: 3;
}

h2, h3, hgroup {
  -prince-bookmark-state: closed;
  break-after: avoid;
}

p {
  margin: 0 0 0.5lh;
  orphans: 2, -prince-prefer 3; /* see https://www.princexml.com/doc/prince-for-books/#pagination-goals */
  widows: 2, -prince-prefer 3;
}

section.example::before {
  margin-right: 1mm;
}

.lettered-subsection {
  margin-left: 6mm;
}

.preamble {
  break-before: recto;
  page: preamble;
  -prince-bookmark-level: 1;
  -prince-bookmark-label: attr(title);
}

header, #recitals {
  -prince-bookmark-level: 1;
  -prince-bookmark-label: attr(title);
}

#recitals i, .lettered-subsection i {
  letter-spacing: initial;
}

.footnote {
  float: footnote;
  line-height: inherit;
}

#toc > h2::after {
  content: 'Page';
  float: right;
  font-size: 10pt;
  font-weight: normal;
  text-align: right;
}

#toc a[href]::after {
  content: leader(dotted) target-counter(attr(href), page);
}

#colophon {
  break-before: page;
  display: block;
}

#colophon h1 {
  -prince-bookmark-level: 1;
}

#colophon h2 {
  -prince-bookmark-level: 2;
}

.annex {
  padding-bottom: 0;
  border-bottom: none;
}

.annex::after {
  width: 3cm;
  display: block;
  height: 0;
  border-bottom: dotted black thin;
  content: '';
  padding-top: 2mm;
  margin: 0 auto;
  break-before: avoid;
}

.annex h3 {
  font-size: var(--body-font-size);
}
