@page {
  size: A5;
  margin-top: 10mm;
  margin-right: 10mm;
  margin-bottom: 10mm;
  margin-left: 10mm;

  @footnote {
    float: bottom;
  }
}

@page :left {
  @bottom-left {
    content: counter(page);
    text-align: left;
  }
  @bottom-right {
    content: string(title);
    text-align: right;
  }
}

@page :right {
  @bottom-left {
    content: string(title);
  }
  @bottom-right {
    content: counter(page);
    text-align: right;
  }
}

@page :first {
  margin: 0;

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

[counter],
[header] {
  display: none;
}

:root {
  --text-base: 12pt;
  --text-align: left;

  --text-caption: calc(var(--text-base) * 0.75);
  --text-caption--line-height: 1.1;

  --text-paragraph: calc(var(--text-base) * 1);
  --text-paragraph--line-height: 1.1;
  --text-paragraph--indent: 3em;

  --text-list: calc(var(--text-base) * 1.5);
  --text-list--line-height: 1.1;

  --text-heading-1: calc(var(--text-base) * 3);
  --text-heading-1--line-height: 0.9;
  --text-heading-2: calc(var(--text-base) * 3);
  --text-heading-2--line-height: 0.9;

  --text-title: calc(var(--text-base) * 3);
  --text-title--line-height: 1;

  --spacing-cover: 10mm;
  --spacing-indent: 10mm;
}

/* .pagedjs_pages {
  font-family: monospace;
} */

/* Page Number */
.pagedjs_margin-content {
  font-size: var(--text-caption);
  line-height: var(--text-caption--line-height);
}

#cover {
  font-size: var(--text-heading-1);
  line-height: var(--text-heading-1--line-height);

  height: var(--pagedjs-pagebox-height);
  width: var(--pagedjs-pagebox-width);
  padding: var(--spacing-cover);

  display: flex;
  flex-direction: column;
  justify-content: space-between;

  page-break-after: always;
}

/* #cover h1 {
  margin-bottom: 1em;
} */

/*
* Details
* Excerpt
*/
#details {
  font-size: var(--text-caption);
  line-height: var(--text-caption--line-height);
}
#details {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

#details p {
  width: 100%;
  max-width: 260pt;
}

#details,
#excerpt {
  page-break-after: always;
}

/*
* Table of content
*/

#table-of-content {
  page-break-after: always;
}

#table-of-content .heading {
  font-size: var(--text-heading-2);
  line-height: var(--text-heading-2--line-height);
}

#table-of-content .wrapper {
  font-size: var(--text-list);
  line-height: var(--text-list--line-height);
  display: flex;
  justify-content: space-between;
}

#table-of-content .wrapper a {
  text-decoration: none;
}

#table-of-content > ul {
  border-top: 1px solid black;
}

#table-of-content li.heading-h2 {
  border-bottom: 1px solid black;
  /* padding: 0.05em 0; */
}

#table-of-content li.heading-h3 {
  margin-left: 3em;
}

#image-directory {
  p:first-of-type {
    border-top: 1px solid black;
  }
  p {
    border-bottom: 1px solid black;
    font-size: var(--text-caption);
    line-height: var(--text-caption--line-height);
  }
}

/* imprint */
#imprint {
  page-break-after: always;
  font-size: var(--text-caption);
  line-height: var(--text-caption--line-height);
}

#image-directory h2,
#imprint h2 {
  font-size: var(--text-heading-1);
  line-height: var(--text-heading-1--line-height);
}

/*
* Blocks
*/
#image-directory h2,
#imprint h2,
.block-type-heading h2 {
  string-set: title content(text);
}
.block-type-heading h1 {
  font-size: var(--text-heading-1);
  line-height: var(--text-heading-1--line-height);
}

.block-type-heading h2 {
  font-size: var(--text-heading-2);
  line-height: var(--text-heading-2--line-height);

  page-break-before: always;
}

.block-type-text p {
  font-size: var(--text-paragraph);
  line-height: var(--text-paragraph--line-height);
  text-align: var(--text-align);
}

.block-type-text + .block-type-text p,
.block-type-text p + p {
  text-indent: var(--text-paragraph--indent);
}

.block-type-list ul,
.block-type-list ol {
  li {
    font-size: var(--text-list);
    line-height: var(--text-list--line-height);
  }
}

.block-type-list ul {
  list-style-type: disc;
  padding-left: 3em;
}

.block-type-list ol {
  list-style-type: decimal;
  padding-left: 3em;
}

.block-type-image {
  margin-bottom: 10mm;
}

.block-type-image img {
  max-height: calc(var(--pagedjs-height) * 0.8);
  margin: 0 auto;
}

.block-type-image figcaption {
  font-size: var(--text-caption);
  line-height: var(--text-caption--line-height);
  padding-top: 1em;
  padding-left: 50%;
}

.block-type-image .fig-number {
  font-size: var(--text-caption);
  line-height: var(--text-caption--line-height);
  text-align: right;
  padding-top: 1em;
}

/*
* 
*/
.block-type-page-break {
  page-break-after: always;
}

/*
* Footnotes
*/
span.footnote {
  float: footnote;
}

.footnote {
  font-size: var(--text-caption);
  line-height: var(--text-caption--line-height);
}

.footnote::footnote-call {
  content: '(' counter(footnote) ') ';
  vertical-align: top;
}

.footnote::footnote-marker {
  content: '(' counter(footnote-marker) ') ';
}
