@import url("./modules/_reset.css");
@import url("./modules/_variables.css");
@import url("./modules/_text.css");
@import url("./modules/_images.css");
@import url("./modules/_layout.css");

:root{
  --color-theme:  rgb(255, 39, 77);
}

@page {
  size: A5;
  /* size: 108mm 175mm; */
  margin-top: 20mm;
  margin-bottom: 20mm;

  bleed: 0;
  marks: none;
}

@page:left {
  margin-right: 18mm;
  margin-left: 22mm;
  @bottom-left-corner {
    content: counter(page);
  }

  @top-left {
    content: "Working Group Reports – WKD23";
    font-size: 0.9em;
    font-weight: normal;
    font-variant: all-small-caps;
  }
}

@page:right {
  
  margin-right: 22mm;
  margin-left: 18mm;
  @bottom-right-corner {
    content: counter(page);
  }

  @top-right {
    content: string(chaptertitle);
    font-size: 0.9em;
    font-weight: normal;
    font-variant: all-small-caps;
  }
}


/* Contenur HTML de la page */
.chapter {
  page: chapter; 
  break-before: left;  
  color:black;
} 

.chapter h1{
  color:white;
}

/* Ca c'est la page */
@page chapter:first {
  background-color:var(--color-theme); 
 
  @bottom-left-corner {
    color:white;
  }
  @top-left {
    color:white;
  }
  @top-right-corner {
    content: none;
  }
  @bottom-right {
    content: none;
  }
}

.fullpic {
  page: fullpic;
}

@page fullpic:first {
  margin:10mm 5mm 0 5mm;

  @top-left {
    content: none;
  }

  @top-right {
    content: none;
  }

  @bottom-left-corner {
    content: none;
  }
  
  @bottom-right-corner {
    content: none;
  }
}

@page {
  @footnote {
    /* float: bottom; */
    border: 1px solid lightgray;
    border-image-slice: 1;
    border-width: 1px;
    margin-top: 1em;
    padding-top:.2em;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }
}

@page:blank {
  background-color: #FFEBE7;
  @top-left {
    content: none;
  }

  @bottom-left-corner {
    content: none;
  }
  @top-right {
    content: none;
  }

  @bottom-right-corner {
    content: none;
  }
}

@page page-credits {
  @top-left {
    content: none;
  }

  @bottom-left-corner {
    content: none;
  }

  @top-right {
    content: none;
  }

  @bottom-right-corner {
    content: none;
  }
} 

/* Styles généraux */

body {
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 13px;
  line-height: 1.3;
}

body p {
  text-align: justify;
  hyphens: auto;
  /* orphans: 3; */
}

body a {
  color:black;
  text-decoration: none;
}

body p:first-child {
  margin-top: 0;
}

/* .chapter{
  break-before: left;
} */



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

h1{
  font-size: 2.7em;
  font-weight: 600;
  color: var(--color-theme);
}

/* Détermine en-tête */

h1.chap-title {
  string-set: chaptertitle content(text);
  margin-top: 2.5em;
  margin-bottom: 1.5em;
  letter-spacing: 0.05ch;
}

/* h2 {
  font-size: 1.2em;
  margin-top: 1.2em;
  margin-bottom: -0.4em;
  letter-spacing: 0.05ch;
}

h2.title-element:first-child {
  margin-top: 0;
} */

h3{
  margin:2em 0 1em;
}

h3:first-child{
  margin-top:0;
}

/* ------------------------------------------- */
/* Premières pages cover + halftitle + credits */
/* ------------------------------------------- */



.cover, .page-title, .intro{
  /* saute jusqu'à la prochaine page */
  break-before: right;
}

.cover {
  page: cover; 
  text-align: center;
}

@page cover {  
  margin-left: 10mm;
  margin-right: 10mm;
  margin-bottom: 15mm;
  background-color: var(--color-theme);
  
  @bottom-right-corner {
    content: none;
  }
}

.cover .logo img{
  width: 50%;
}

.cover .logo {
  text-align: center;
}

.cover .logo img:first-child{
  width: 28%;
  margin-right: 2em;
}

.intro{
  page:intro;
}

@page intro:first {

  @top-left {
    content: none;
  }

  @bottom-left-corner {
    content: none;
  }

  @top-right {
    content: none;
  }

  /* @bottom-right-corner {
    content: none;
  } */
}

.page-title{
  page:title;
}

@page title {

  @top-left {
    content: none;
  }

  @bottom-left-corner {
    content: none;
  }
  @top-right {
    content: none;
  }

  @bottom-right-corner {
    content: none;
  }

} 

.page-title .unige{
  margin-left: 5.7em;
}

.page-title .unige h2{
  font-size: 1.7em;
  color: var(--color-theme);
}

.page-title img{
  margin-bottom: .5em;
}

.unige p:first-child{
  color:var(--color-theme);
  font-size:1.7em;
  font-weight: 500;
  /* margin-left:3.4em; */
}


.smallcaps {
  text-transform: uppercase;
}

/* ------------------------------------------- */
/* ------------ Contenu du livre ------------- */
/* ------------------------------------------- */

/* Titres */

#chap1 .chap-title::before {
  font-family: "IBM Plex Mono", monospace;
  content: "Group 1 ";
  display: block;
  font-size: .8em;
}

#chap2 .chap-title::before {
  font-family: "IBM Plex Mono", monospace;
  content: "Group 2 ";
  display: block;
  font-size: .8em;
}

#chap3 .chap-title::before {
  font-family: "IBM Plex Mono", monospace;
  content: "Group 3 ";
  display: block;
  font-size: .8em;
}

#chap4 .chap-title::before {
  font-family: "IBM Plex Mono", monospace;
  content: "Group 4 ";
  display: block;
  font-size: .8em;
}

/* Citations */
blockquote {
  font-size: 0.9em;
  margin-right: 0;
}

/* Images */
img {
  width: 100%;
  /* display: none; */
}

figure {
  break-inside: avoid;
}

figcaption {
  font-size: 0.9em;
  margin-top: 0.5em;
  text-align: center;
}

figcaption span {
  font-variant-caps: small-caps;
}

/* Appel notes */
.pagedjs-end-to-footnote {
  float: footnote;
  color: black;
  font-size: .8em;
}

sup {
  line-height: 0;
}

.pagedjs-end-to-footnote:after {
  font-size: 65%;
  vertical-align: super;
  font-variant-position: super;
}

::footnote-marker {
  font-size: 65%;
  vertical-align: super;
}

/* ------------------------------------------- */
/* ------------ Table des matières ------------- */
/* ------------------------------------------- */

.toc{
  page:toc;
}

@page toc {  
  
  @top-left {
    content: none;
  }
  @bottom-left-corner {
    content: none;
  }
}

#toc {
  break-before: right;
}

#list-toc-generated {
  list-style: none;
  line-height: 2;
  padding-left: 0;
}

#list-toc-generated a {
  color: black;
  text-decoration: none;
}

/* #list-toc-generated .toc-element-level-2 a[href="#title-element-2"]::before {
  font-family: sans-serif;
  display: inline-block;
  content: "Group 1. ";
  margin-right: 0.3em;
  color: red;
}

#list-toc-generated .toc-element-level-2 a[href="#title-element-3"]::before {
  display: inline-block;
  content: "Group 2. ";
  margin-right: 0.3em;
}

#list-toc-generated .toc-element-level-2 a[href="#title-element-4"]::before {
  display: inline-block;
  content: "Group 3. ";
  margin-right: 0.3em;
}

#list-toc-generated .toc-element-level-2 a[href="#title-element-5"]::before {
  display: inline-block;
  content: "Group 4. ";
  margin-right: 0.3em;
} */

#list-toc-generated a::after {
  content: target-counter(attr(href url), page);
  float: right;
}

/* .title-element::marker{
    vertical-align: super;
    font-size: 65%;
    line-height: normal;
    content: counter(footnote);
    color: red;
}

#list-toc-generated a {
  text-decoration: none;
  color: var(--base);
}


.toc-element-level-2 {
  font-size: 1.1em;
  font-weight: bold;
  margin-top: 0.5em;
}

.toc-element-level-3 {
  text-indent: 2em;
}

/* ------------------------------------------- */
/* ------------ Que pour ce livre ------------ */
/* ------------------------------------------- */

.names{
  font-size: 1.3em;
  font-weight: 500;
  line-height: 1.6;
}

.role{
  font-weight: normal;
}

strong{
  font-weight: 500;
}

.list{
  margin:1.5em 0 -.5em;
}

ol li p{
  margin-bottom:.84em;
}

.page-credits{
  page: page-credits;
  font-size: .9em;
  position: absolute;
  bottom:0;
}

.page-credits p{
  hyphens: none;
  width: 51ch;
}

.page-credits img{
  width: 30%;
}

.page-credits .signature{
  width: 3%;
  vertical-align: bottom;
  margin-bottom: .1em;
}

.author{
  text-transform: capitalize;
}

.smallcaps {
  font-variant: small-caps;
}

.nohyphen {
  hyphens: none;
}

:root {
  --entete: "chapitre 1. ";
}

#chap2 {
  --entete: "chapitre 2. ";
}

.hidden {
  display: none;
}

.url {
  overflow-wrap: anywhere;
  /* color: red; */
}