@page {
  size: a4 portrait;
  margin: 25mm 22mm 22mm 22mm;
  padding: 10mm 0 10mm 0;
  border-top: thin solid black;
  border-bottom: thin solid black;
  font: 10pt "Arial", sans-serif;

  @top-left {
    content: url(../35px-Inkscape.logo.svg.png);
    margin: 5mm 0 0 0;  
    padding: 5mm 0 0 0;
    float: left;
    background-repeat: no-repeat;
  }
  @top-right {
    content: string(chaptertitle);
    vertical-align: bottom;
    margin: 0 2px 1mm 0;
    padding: 0 0 3mm 0;
    font-weight: bold;
  }

  @bottom-left {
    vertical-align: top;
    margin: 1.3mm 0 0 0;
    font: 8pt "Arial", sans-serif;
    content: string(FooterContent);
  }

  @bottom-right {
    vertical-align: top;
    margin: 3mm 0 0 0;
    font: 10pt "Arial", sans-serif;
    font-weight: bold;
    content: counter(page);
  }
 }

@page:first {
  border-top: none;
  border-bottom: none;
  margin: 0;
  padding: 0;
    @top { content: normal }
    @bottom-right { content: normal }
}


h1 {
  page-break-before: always;
  string-set: chaptertitle content();
}

div.toc {
    page-break-before: always;
}


div.toc a::after {
  content: leader('.') target-counter(attr(href), page);
  font-style: normal;
}

