/* DISCLAIMER : Ce travail s'appuie sur le template bénévolement produit par T. Vroylandt pour les scouts de france et mis à disposition de la communauté (tvroylandt/sgdf_pagedown)
/* Code adapté par D. Carayon (INRAE) */

@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@500&display=swap');

@font-face {
	font-family: "AvenirNext LT Pro Cn";
	src: url('Linotype - Avenir Next LT Pro Condensed.ttf');
}
@font-face {
	font-family: "AvenirNext LT Pro Cn";
	font-style: italic;
	src: url('Linotype - Avenir Next LT Pro Condensed Italic.ttf');
}
@font-face {
	font-family: "AvenirNext LT Pro Cn";
	font-weight: bold;
	src: url('Linotype - Avenir Next LT Pro Bold Condensed.ttf');
}



/* paragaphe et liste */
p, ul {
  color: #000000;
  font-family: "AvenirNext LT Pro Cn";
  text-align: justify;
  font-size: 12pt;
}

/* titres */
h1, h2, h3, h4 {
  color: #00a3a6;
  font-family: "Raleway";
  font-weight: bold;
}

h2 {
  font-size: 36pt;
}

h2 {
  font-size: 18pt;
}

/* tableaux - avec gt */
/* titres */
th {
  background-color: #00a3a6 !important;
  color: #FFFFFF !important;
  font-family: "Calibri" !important;
  font-weight: bold !important;
  text-align: center;
  border-width:1px;
  border-style:solid;
  border-color:black;
  border-collapse:collapse;
  font-size: 10pt;
}

/* colonnes de group */
.gt_group_heading {
  color: #00a3a6 !important;
  font-family: "Calibri" !important;
  font-weight: bold !important;
  border-collapse:collapse;
}


table {
  border-width:1px;
  border-style:solid;
  border-color:black;
  border-collapse:collapse;
  break-inside: avoid;
  }


/* contenu */
td {
  color: #000000;
  font-family: "Calibri";
  border-width:1px;
  border-style:solid;
  text-align: center;
  border-color:black;
  border-collapse:collapse;
  font-size: 10pt;
}

/* eviter les tableaux multipages */
.gt_table{
  break-inside: avoid;
}

/* numerotation pages */
.pagedjs_margin-content{
  color: #275662;
  font-family: "Calibri";
  font-weight: bold;
}


/* ---------------------- */
/* pour l'affichage web - debug*/
/* on def les variables */
:root {
  --background: whitesmoke;
  --pagedjs-width: 210mm;
  --pagedjs-height: 297mm;
  --color-paper: white;
  --color-mbox: rgba(0, 0, 0, 0.2);
  --running-title-width: 2.5in;
  --screen-pages-spacing: 5mm;
}

/* two pages in a row if possible on screen */
@media screen {
  body {
    background-color: var(--background);
    margin: var(--screen-pages-spacing) auto 0 auto;
  }
  .pagedjs_pages {
    display: flex;
    max-width: calc(var(--pagedjs-width) * 2);
    flex: 0;
    flex-wrap: wrap;
    margin: 0 auto;
  }
  .pagedjs_page {
    background-color: var(--color-paper);
    box-shadow: 0 0 0 1px var(--color-mbox);
    flex-shrink: 0;
    flex-grow: 0;
    margin: auto auto var(--screen-pages-spacing) auto;
  }
}

/* when a row can hold two pages, start first page on the right */
@media screen and (min-width: 12.32in) {
  .pagedjs_page {
    margin: auto 0 var(--screen-pages-spacing) 0;
  }
  .pagedjs_first_page {
    margin-left: var(--pagedjs-width);
  }
}

/* ---------------------- */

/* page size */
@page {
  size: 210mm 297mm; /* var(--pagedjs-width) doesn't work in browser when printing */
}

@page :blank {

}

/* compteur de pages */
/* + footer picto */
@page chapter{
  @bottom-center {
    content: counter(page);

    margin: 0 0 0 0;
    background-color: #ffffff;
    background-image: url(footer_picto_inrae.png);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
  }
}



/* Exception H1 pour le titre */
h1.title {
  break-after: avoid;
  color: #284c59;
  text-align: left;
  margin-left: 0cm;
  font-size: 30pt;
}

h2.author {
  margin-block-start: 0cm;
  break-after: avoid;
  color: #00a3a6;
  position: absolute;
  left: -1.75cm;
  bottom: 0cm;
  text-align: left;
  font-size: 12pt;
}

h2.date {
  break-after: avoid;
  color: #00a3a6;
  position: absolute;
  bottom: -0.5cm;
  left: -1.75cm;
  text-align: left;
  font-size: 12pt;
}



/* Page de garde */
@page :first{
  margin: 0 0 0 0;
  background-color: #ffffff;
  background-image: url(page_avant.png);
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-position: center, top, center;
  background-size: 100%, 100%, contain;
}

/* Derniere page */
.pagedjs_page:last-of-type {
  margin: 0 0 0 0;
  background-color: #ffffff;
  background-image: url(page_arriere.png);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}


/* page breaks; aka CSS fragmentation */
.level1 {
  page: chapter;
}

.section > h1, .section > h2, .section > h3, .section > h4, .section > h5, .section > h6 {
  break-after: avoid;
}
.footenotes {
  break-before: always;
  break-after: always;
}
.figure {
  break-inside: avoid;
}

/* reset page numbering for main content */
.main .level1:first-child h1 {
  counter-reset: page;
}

/* do not break captions */
caption {
  break-inside: avoid;
  break-after: avoid;
}

/* misc elements */
.subtitle span {
  font-size: .9em;
}
img {
  max-width: 100%;
}

/* verbatim */
blockquote {
  break-inside: avoid;
  border-style: dashed none;
  border-color: #003a5d;
  margin-left: 0cm;
  margin-right: 0cm;
  margin-block-start: 0cm !important;
}

blockquote > h1{
  margin-block-start : 1cm;
}

/* TOC, LOT, LOF */
.toc ul, .lot ul, .lof ul {
  list-style: none;
  padding-left: 0;
  overflow-x: hidden;
  color: #000000;
  font-size: 15pt;
  line-height: 1.5;
  break-after: avoid;
}
.toc li li {
  padding-left: 1em;
  color: #000000;
  font-size: 15pt;
  line-height: 1.5;
  break-after: avoid;
}
.toc a, .lot a, .lof a {
  text-decoration: none;
  background: white;
  padding-right: .33em;
  color: #000000;
  font-size: 15pt;
  line-height: 1.5;
  break-after: avoid;
}

.toc a::after, .lot a::after, .lof a::after {
  /* content: leader(dotted) target-counter(attr(href), page); */
  content: target-counter(attr(href), page);
  float: right;
  background: white;
  color: #000000;
  break-after: avoid;
}
.toc a.front-matter-ref::after, .lot a.front-matter-ref::after, .lof a.front-matter-ref::after {
  /* content: leader(dotted) target-counter(attr(href), page, lower-roman); */
  content: target-counter(attr(href), page, lower-roman);
  color: #000000;
  break-after: avoid;
}
.toc .leaders::before, .lot .leaders::before, .lof .leaders::before {
  float: left;
  width: 0;
  white-space: nowrap;
  break-after: avoid;
  color: #000000;
  content: ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ";
}
