@media print {
  :root {
    --inner-width: calc(var(--pagedjs-width) - 2.8rem - 2.8rem);
  }
  @page :first {
    @top-center {
      content: "rapport d’activité 2022";
      /* content: string(section); */
    }
    @bottom-right {
      content: "";
    }
  }
  @page {
    size: A4;
    /* margin: 2.7rem; */
    margin: 2.8rem;

    /* --square (1.7rem) + 5mm */
    @top-left {
      content: "terraforma corp";
    }

    @top-center {
      /* content: "rapport d’activité 2022"; */
      content: string(section);
    }

    @bottom-right {
      content: counter(page) "/" counter(pages);
      padding-right: calc(var(--square)/2);
    }

    @bottom-left-corner {
      content: " ";
      /* background: black; */
      width: 1.7rem;
      height: 1.7rem;
    }

    @top-right-corner {
      content: " ";
      /* background: black; */
      width: 1.7rem;
      height: 1.7rem;
    }

    @bottom-right-corner {
      content: " ";
      /* background: black; */
      width: 1.7rem;
      height: 1.7rem;
    }
  }

  body {
    font-size: 0.92em;
    line-height: 1.2;
  }

  .pagedjs_margin-top {
    display: flex;
    padding-top: 1.1rem;
    font-family: 'Bai Jamjuree';
    text-transform: uppercase;
    font-weight: 600;
    font-size: 0.7em;
  }

  .pagedjs_first_page .pagedjs_page_content {
    border-left: unset;
    border-right: unset;
    border-bottom: unset;
  }

  .pagedjs_first_page .pagedjs_margin-top>div {
    border-bottom: unset;
  }

  .pagedjs_first_page .pagedjs_margin-top>div:nth-child(2) {
    border-right: unset;
  }

  .pagedjs_page_content {
    border-left: solid var(--border-width) black;
    border-right: solid var(--border-width) black;
    border-bottom: solid var(--border-width) black;
  }

  .pagedjs_margin-bottom {
    padding-bottom: 1.1rem;
    font-family: 'Bai Jamjuree';
    text-transform: uppercase;
    font-weight: 600;
    font-size: 0.7em;
  }

  .pagedjs_margin-top>div {
    padding: 0 var(--square);
    border-bottom: solid var(--border-width) black;
  }

  .pagedjs_margin-top>div:nth-child(2) {
    border-right: solid var(--border-width) black;
  }

  .pagedjs_margin-top-right-corner-holder {
    align-items: end;
  }

  .pagedjs_margin-bottom-left-corner-holder {
    justify-content: end;
  }

  .text-content {
    min-height: unset;
    padding: unset;
  }

  .text-content>* {
    padding-right: unset;
  }

  .section-revue>div:first-child {
    margin-top: var(--square) !important;
  }

  .section-revue>div {
    position: relative;
  }

  .text-content.revue, .text-content>.revue {
    padding-left: var(--square);
  }

  .section-revue>div:first-child::before {
    content: " " !important;
    width: calc(100% + calc(var(--square)*4));
    border-top: solid var(--border-width) black;
    display: inline-block;
    position: relative;
    left: calc(var(--square) * -2);
    height: var(--square);
  }

  .text-content figure {
    position: relative;
    width: 100%;
    max-height: calc(var(--pagedjs-pagebox-height)/2);
    display: table;
  }

  .text-content figure figcaption {
    display: table-caption;
    caption-side: bottom;
    margin-left: auto;
    margin-right: auto;
  }

  .text-content figure img {
    max-width: 100%;
    max-height: inherit;
    width: auto;
    margin-left: auto;
    margin-right: auto;
  }

  .section-revue>h1+div {
    margin-top: unset !important;
  }

  .section-revue>h1+div::before {
    height: 0px !important;
  }

  .section-revue>div>:first-child {
    margin-top: unset;
  }

  .text-content .section-revue>div>* {
    margin-right: unset;
  }

  h1, .section-revue.sommaire-detaille h1:not(.meta){
    color: unset!important;
    background-color: unset!important;
    position: relative;
    width: calc(var(--inner-width) + var(--square)*2);
    left: calc(var(--square) * -2);
    border-bottom: solid var(--border-width) black;
    margin-bottom: calc(var(--square) / 2);
  }

  h1.filler {
    display: none;
  }

  .section-revue>h1 p {
    margin-left: calc(var(--square)*2);
  }

  .section-revue>h1.meta {
    font-size: 1.4rem;
  }

  .text-content figure {
    break-inside: avoid;
  }

  .text-content .section-revue>div>h2 {
    padding-top: unset;
  }

  .section-revue::after {
    content: unset;
  }

  table {
    border: var(--border-width) solid black;
    /* break-before: always; */
    /* break-inside: avoid-column; */
    /* font-size: 0.4em; */
    /* display: none; */
  }

  table tr {
    break-inside: avoid;
  }

  ul {
    break-before: avoid;
    break-inside: avoid;
  }

  .section-revue {}

  .section-revue {
    break-before: always;
    padding-left: var(--square);
  }

  .footnotes li {
    break-inside: avoid;
  }

  .footnotes .footnote-backref::before {
    content: "";
  }

  h1, h2, h3 {
    break-inside: avoid;
    break-after: avoid;
  }

  .section-revue>h1 {
    string-set: section content(text);
  }

  .section-revue.revue>div>h2 {
    break-before: page;
  }

  .section-revue.revue>h1+div>h2 {
    break-before: unset !important;
  }

  .section-revue.ours .equipe_part1{
    margin-top: var(--square);
    margin-bottom: var(--square);

  }

  .section-revue.ours figure {
    max-width: 20%;
    margin-left: auto;
    margin-right: auto!important;
  }

  .section-revue.ours .equipe_part2{
    text-align: right;
  }

  /* .text-content .print, .text-content .print * {
    display: block !important;
  }

  .text-content *, section:not(.web2print), section.web2print .side-content-header, section.web2print .side-content {
    display: none;
  } */

  .section-revue.couv{
    display: block;
    display: block;
    position: absolute;
    bottom: var(--square);
    counter-reset: page;

  }
}

@media screen {
  .text-content.hidden {
    display: none;
  }

  iframe#printf {
    visibility: hidden;
    /* display: none; */
    /* display none doesnt work when printing */
    /* height: 0px;
    width: 0px; */
    position: absolute;
    /* border: none;*/
    /* position: relative; */
    /* width: 100%; */
    /* height: 100%; */
    /* display: none;
    visibility: hidden; */
    /* width: 100%;
    height: 100%; */
  }
}
