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

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

  @page {
    @top-center {
      content:  string(booktitle);
    }

    @bottom-center {
      content:  string(ch1);
    }
  }

  div.booktitle {
    string-set: booktitle content();
  }

  h1 {
    string-set: ch1 content();
  }

  /* -- section: elements' fonts -- */

  :root {
    font-family:
      TeX Gyre Termes, FreeSerif,
      Times New Roman, serif;
  }

  h1, h2, h3, h4, h5, h6 {
    font-family:
      TeX Gyre Heros, FreeSans,
      Helvetica, Arial, sans-serif;
  }

  pre, code, kbd, samp {
    font-family:
      TeX Gyre Cursor, FreeMono,
      Courier New, monospace;
  }

  /* -- begin: paragraph numbering -- */

  body > p, main > p {
    counter-increment:  paragraph-cnt;
    position:           relative;
  }

  body > p::before, main > p::before {
    content:    counter(paragraph-cnt);
    text-align: right;
    display:    block;
    position:   absolute;
    left:       -12mm;
    width:      10mm;
    height:     100%;
  }
}
