@page {
  size: var(--page-size);

  margin-top: calc(var(--page-margin-top) * 1mm);

  margin-left: calc(var(--page-margin-left) * 1mm);

  margin-right: calc(var(--page-margin-right) * 1mm);

  margin-bottom: calc(var(--page-margin-bottom) * 1mm);

  @bottom-center {
    content: counter(page) " / " counter(pages);
  }
}

.force-new-page {
  page-break-before: always;
}

.no-break {
  page-break-inside: avoid;
  -moz-column-break-inside: avoid;
       break-inside: avoid;
}

/* Wrapper per la cover */

.cover-page-wrapper {
  /* Questo compensa gli spacer di header e footer per riempire la pagina */
  margin-top: calc(var(--header-height) * -1px + var(--page-margin-top) * -1mm - 10mm);
  margin-bottom: calc(var(--footer-height) * -1px + var(--page-margin-bottom) * -1mm);
}

/* Cover page */

.cover-page {
  position: relative;
  height: 297mm;
  width: 100%;
  overflow: hidden;
}

/* Rettangolo bianco */

.cover-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: white;
  z-index: 1000;
}

/* Immagine cover */

.cover-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  -o-object-fit: cover;
     object-fit: cover;
  z-index: 1001;
}

body.print-all .header-spacer {
  height: calc(var(--header-height) * 1px);
}

body.print-all .header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

.position-end {
  position: absolute;
  bottom: 0;
  margin-bottom: calc(var(--footer-height) * 1px + 1rem);
}

.content {
  margin-bottom: calc(var(--footer-height) * 1px);
}

.footer-spacer {
  height: calc(var(--footer-height) * 1px);
}

.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
}
