* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

@page {
  size: 148mm 210mm;
  margin: 10mm 15mm;

  @bottom-center {
    content: counter(page);
    writing-mode: horizontal-tb;
  }
}

@page :left {
  margin-right: 25mm;

  @top-left {
    content: env(doc-title);
  }
}

@page :right {
  margin-left: 25mm;
}

@page :first {
  counter-reset: chapter;
}

@page :nth(1) {
  counter-increment: chapter;
}

body {
  break-before: right;
  counter-reset: section;
}

html {
  font-size: 10pt;
  widows: 1;
  orphans: 1;
  text-align: justify;
  text-spacing-trim: trim-start;
  hanging-punctuation: allow-end;
}

ruby > rt {
  font-size: 0.5rem;
}

p {
  line-height: 1.5;
  text-indent: 1em;
}

h1 {
  counter-increment: section;
}

h1::before {
  content: '§' counter(chapter) '.' counter(section) ' ';
}
