/* Sheet rules for both the browser's print and Paged.js. Keep this file flat
   (no nesting): Paged.js parses it with a CSS parser that predates nesting.
   @page can't read custom properties: keep in sync with --paper-* in paper.css
   and --font-sans in base.css */
@page {
  size: A4;
  margin: 25mm;

  @top-center {
    color: #777;
    content: string(book-title);
    font-family: system-ui, sans-serif;
    font-size: 9pt;
  }

  @bottom-center {
    color: #777;
    content: counter(page);
    font-family: system-ui, sans-serif;
    font-size: 9pt;
  }
}

/* Cover and title page: no running header or page number */
@page :first {
  @top-center { content: none; }
  @bottom-center { content: none; }
}

@page title {
  @top-center { content: none; }
  @bottom-center { content: none; }
}

/* The cover fills the whole sheet, edge to edge */
@page cover {
  margin: 0;

  @top-center { content: none; }
  @bottom-center { content: none; }
}

.print__cover {
  page: cover;
}

.print__title-page {
  page: title;
}

/* Running header: string-set only works under Paged.js, browsers ignore it */
.print__book-title {
  string-set: book-title content(text);
}

.print__leaf {
  break-before: page;
}

.paper img,
.paper figure,
.paper pre,
.paper table,
.paper blockquote {
  break-inside: avoid;
}
