/* --------- Variable ---------- */

:root{
--back-width : 2cm; /*taille du dos*/
--titlefont: "AUTHENTIC Sans", sans-serif;
--textfont: "Marr", serif;
--textsize: 10.5pt;
--leftmargin: 22mm;
--baseline: 20px;
}

/* --------- Paramètres de base ---------- */
@page{
	size: A4;
	margin: 14mm;
/*	bleed: 6mm; 
  marks: crop;*/
}

@page :left {
/*	margin: 16mm 25mm 10mm 10mm;*/
	/*@top-left-corner {
		content: counter(page);
		font-size: 8pt;
		text-align: center;
		font-family: var(--textfont);
 	}
 	@top-center{
    content: string(title);
    font-size: 8pt;
    text-align: center;
    text-transform: uppercase;
  }*/
}

@page :right {
/*	margin: 16mm 10mm 10mm 25mm;*/
	/*@top-right-corner {
		content: counter(page);
		font-size: 8pt;
		text-align: center;
		font-family: var(--textfont);
 	}
 	@top-center{
    content: string(title);
    font-size: 8pt;
    text-align: center;
    text-transform: uppercase;
  }*/
}


* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body{
	font-size: 16px; 
	font-family: var(--textfont);
	margin:0;
}

img{
	width: 100%;
}

h1{
	font-family: var(--titlefont);
	font-weight: normal;
	font-size: 3em;
	margin-top: 0;
	text-transform: uppercase;
	margin-bottom: 0;
	string-set: title content(text);
}

h2, h3{
/*	font-family: var(--titlefont);*/
	font-weight: normal;
	text-align: center;
/*	text-transform: uppercase;*/
}

p, li{
	text-align: justify;
	hyphens: auto;
	line-height: 1.45;
/*	text-align-last: left;*/
  -webkit-hyphens: auto;
  -moz-hyphens: auto;
  -ms-hyphens: auto;
  hyphens: auto;
  -webkit-hyphenate-limit-before: 3;
  -webkit-hyphenate-limit-after: 4;
  -ms-hyphenate-limit-chars: 7 3 4;
  hyphenate-limit-chars: 7 3 4;
  word-wrap: break-word;
  overflow-wrap: break-word;
  /* veuves et orphelines (bancal) */
  widows: 3;
  orphans: 3;
}

a{
	white-space: pre-wrap; /* CSS3 */    
	white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
	white-space: -pre-wrap; /* Opera 4-6 */    
	white-space: -o-pre-wrap; /* Opera 7 */    
	word-wrap: break-word; /* Internet Explorer 5.5+ */
}


ul, figure, ol{
	margin: 0;
	padding: 0
}

.pagedjs_page_content table{ 
	column-width:auto!important; 
}

table {
  border-collapse: collapse;
  width: 100%;
  border: 1px solid grey;
  font-size: 12px;
}

th {
  font-weight: bold;
  text-align: left;
  border-bottom: 1px solid grey;
}

th, td {
  padding: 12px 8px;
  padding-bottom: 12px !important;
  border-right: 1px solid lightgrey;
}

tr{
	border-bottom: 1px solid lightgrey;
}

tr:last-child{
	border: none;
}

td:last-child{
	display: none;
}

.chapter .invisible{
	display: none !important;
}



/* --------- Couverture ---------- */
.cover h1{
	position: absolute;
	z-index: 20;
	top:4cm;
	left:50%;
	transform: translateX(-50%);
	text-align: center;
	font-size: 35pt;
	line-height: 2;
	width: 95%;
}

.cover h1 span{
	background: #FFF;
	border-radius: 50px;
	padding: 10px 30px;
}


.cover h2{
	font-size: 25px;
	position: absolute; 
	top: 0.5cm;
	z-index: 10;
}

.cover .text-couv{
	position: absolute;
	bottom: 2cm;
	left: 50%;
	transform: translateX(-50%);
	z-index: 100;
	width: 80%;
	padding: 0mm 5mm 0mm 5mm;
  border-radius: 35px;
  text-align: center;
  font-size: var(--textsize);
  background: white;
}

.backcover{
	page: backcover;
}

@page backcover{
	margin:0;
	@top-left-corner {content: none;}
	@top-left {content: none;}
	@top-center {content: none;}
	@top-right {content: none;}
	@top-right-corner {content: none;}
	@left-top {content: none;}
	@left-middle {content: none;}
	@left-bottom {content: none;}
	@right-top {content: none;}
	@right-middle {content: none;}
	@right-bottom {content: none;}
	@bottom-left-corner {content: none;}
	@bottom-left {content: none;}
	@bottom-center {content: none;}
	@bottom-right {content: none;}
	@bottom-right-corner {content: none;}
}

/* --------- Pages blanches --------- */

.white-page{
	page: whitepage;
}

@page whitepage{
	@top-left-corner {content: none;}
	@top-left {content: none;}
	@top-center {content: none;}
	@top-right {content: none;}
	@top-right-corner {content: none;}
	@left-top {content: none;}
	@left-middle {content: none;}
	@left-bottom {content: none;}
	@right-top {content: none;}
	@right-middle {content: none;}
	@right-bottom {content: none;}
	@bottom-left-corner {content: none;}
	@bottom-left {content: none;}
	@bottom-center {content: none;}
	@bottom-right {content: none;}
	@bottom-right-corner {content: none;}
}

.pagedjs_page.pagedjs_right_page.pagedjs_blank_page .pagedjs_margin-top-center > .pagedjs_margin-content::after,
.pagedjs_page.pagedjs_right_page.pagedjs_blank_page .pagedjs_margin-top-right-corner > .pagedjs_margin-content::after{
	content: none;
}

.entrance{
	page: entrance;
}

@page entrance{
	margin: 10mm 10mm 10mm 10mm;
	@top-left-corner {content: none;}
	@top-left {content: none;}
	@top-center {content: none;}
	@top-right {content: none;}
	@top-right-corner {content: none;}
	@left-top {content: none;}
	@left-middle {content: none;}
	@left-bottom {content: none;}
	@right-top {content: none;}
	@right-middle {content: none;}
	@right-bottom {content: none;}
	@bottom-left-corner {content: none;}
	@bottom-left {content: none;}
	@bottom-center {content: none;}
	@bottom-right {content: none;}
	@bottom-right-corner {content: none;}
}

.title-page {
	page: titlepage;
}

.title-page h1{
	position: absolute;
	z-index: 20;
	top:50%;
	left:50%;
	transform: translate(-50%, -50%);
	text-align: center;
	font-size: 35pt;
	line-height: 2;
	width: 95%;
}

@page titlepage{
	margin:0;
	@top-left-corner {content: none;}
	@top-left {content: none;}
	@top-center {content: none;}
	@top-right {content: none;}
	@top-right-corner {content: none;}
	@left-top {content: none;}
	@left-middle {content: none;}
	@left-bottom {content: none;}
	@right-top {content: none;}
	@right-middle {content: none;}
	@right-bottom {content: none;}
	@bottom-left-corner {content: none;}
	@bottom-left {content: none;}
	@bottom-center {content: none;}
	@bottom-right {content: none;}
	@bottom-right-corner {content: none;}
}

.title-page-small{
	page: titlepagesmall;
}

.title-page-small h1{
	font-size: 26pt;
	margin-top: 1cm;
	margin-bottom: 1cm;;
}

.title-page-small p, 
.title-page-small h2{
	text-align: left;
}

.title-page-small_logo-wrapper{
	display: flex;
	position: absolute;
	bottom: 0.6cm;
	left: -0.2cm;
}

.title-page-small_logo-wrapper figure{
	max-width: 5cm;
	margin-right: 0.2cm;
}

.title-page-small .image-cover_caption{
	position: absolute;
	bottom: 0.1cm;
}

@page titlepagesmall{
	@top-left-corner {content: none;}
	@top-left {content: none;}
	@top-center {content: none;}
	@top-right {content: none;}
	@top-right-corner {content: none;}
	@left-top {content: none;}
	@left-middle {content: none;}
	@left-bottom {content: none;}
	@right-top {content: none;}
	@right-middle {content: none;}
	@right-bottom {content: none;}
	@bottom-left-corner {content: none;}
	@bottom-left {content: none;}
	@bottom-center {content: none;}
	@bottom-right {content: none;}
	@bottom-right-corner {content: none;}
}

.copyright-page{
	font-size: 7pt;
	position: absolute;
	bottom: 0.5cm;
}

.toc-legende{
	margin-top: 1cm;
}

.toc-legende li{
	list-style: none;
}

.toc-left-page{
	page: nocontent
}

@page nocontent{
	@top-left-corner {content: none;}
	@top-left {content: none;}
	@top-center {content: none;}
	@top-right {content: none;}
	@top-right-corner {content: none;}
	@left-top {content: none;}
	@left-middle {content: none;}
	@left-bottom {content: none;}
	@right-top {content: none;}
	@right-middle {content: none;}
	@right-bottom {content: none;}
	@bottom-left-corner {content: none;}
	@bottom-left {content: none;}
	@bottom-center {content: none;}
	@bottom-right {content: none;}
	@bottom-right-corner {content: none;}
}

/* --------- Pages intérieures ---------- */
.chapter-left-page {
  break-before: left;
  page: chapterleft;	
}

@page chapterleft{
	@top-left-corner {content: none;}
	@top-left {content: none;}
	@top-center {content: none;}
	@top-right {content: none;}
	@top-right-corner {content: none;}
	@left-top {content: none;}
	@left-middle {content: none;}
	@left-bottom {content: none;}
	@right-top {content: none;}
	@right-middle {content: none;}
	@right-bottom {content: none;}
	@bottom-left-corner {content: none;}
	@bottom-left {content: none;}
	@bottom-center {content: none;}
	@bottom-right {content: none;}
	@bottom-right-corner {content: none;}
}

.chapter{
/*	margin-top: 1cm !important;*/
	break-after: always;
}

.chapter-title-wrapper{
	margin-left: 0.8cm;
}

#book-title{
	string-set: title content(text);
}


.chapter h1{
	margin:0;
	font-size: 23pt;
	text-transform: none;
	font-family: var(--textfont);
	line-height: 1.2;
	text-align: center;
}



.summary{
	position: relative;
}

.summary ol{
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	justify-content: flex-end;
}

.summary li{
	list-style: none;
	position: relative;
	border: 1px solid #000;
	padding: 0.2cm 0.2cm;
	flex-grow: 1;
	margin-left: -1px;
	margin-top: -1px;

}

.chapter .content{
	margin-top: 3cm;
}

.chapter .content h2 {
	margin-top: 48px;
}

.chapter .content h3 {
	margin-top: 32px;
	line-height: 1.4;
	letter-spacing: 1px;
}

.chapter .content h3 b{
	font-weight: normal;
}

.chapter .content h3 strong{
	color: rgb(50, 50, 50);
}

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

.chapter .content h2 strong{
	font-weight: normal;
}

.chapter .content figure, 
.chapter .entrance figure{
	margin-top: 2em;
	margin-bottom: 1.5em;
}

.chapter .content h2:first-child, 
.chapter .content h3:first-child,
.chapter .content figure:first-child,
.chapter .entrance figure:first-child{
	margin-top: 0;
}

.chapter .content ul,
.chapter .content ol{
	margin-left: 1cm;
}

.chapter .content.alignment-left,
.chapter .content.alignment-left p,
.chapter .content.alignment-left li{
	text-align: left;
	hyphens: none;
}

.chapter .content.alignment-center,
.chapter .content.alignment-center p,
.chapter .content.alignment-center li{
	text-align: center;
	hyphens: none;
}

.chapter .content.alignment-right,
.chapter .content.alignment-right p,
.chapter .content.alignment-right li{
	text-align: right;
	hyphens: none;
}

.chapter .content.alignment-justify,
.chapter .content.alignment-justify p,
.chapter .content.alignment-justify li{
	text-align: justify;
}

.images-gallery ul{
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.images-gallery ul li{
	padding-right: 0.5cm;
}

.chapter .content .images-gallery ul{
	position: relative;
	margin:0;
}

.images-gallery ul li{
	width: 100%;
	margin: 0;
	margin-top: 0.5cm;
	list-style: none;

}

.images-gallery ul li img{
	max-width: 100%;
}

/* ----------- FOOTNOTES ----------- */
.pagedjs_footnote_area{
	margin-top: calc(var(--margin) *2);
}


.footnote {
  float: footnote;
  word-break: break-word;
	line-height: 1.45;
	font-size: 7pt;
	text-align: left;
	hyphens: none;
	word-spacing: -0.7px;
  letter-spacing: 0.02em;
  margin-bottom: 0.8mm;
}

@page {
  @footnote {
    float: bottom;
  }
}

::footnote-call {
  line-height: 0;
  font-size: 8pt;
  vertical-align: middle;
  position: relative;
  top: -2px;
}

::footnote-marker {
  font-size: 7pt;
  line-height: 0;
}

/* ------- D E F A U L T  ---------- */

.content p, 
.content li{
	font-size: var(--textsize);
	margin-bottom: 1mm;
	margin-top: 1mm;
	/*margin-left: var(--leftmargin);*/
}

figure{
	page-break-inside: avoid;
}

figcaption{
	margin-top: calc(var(--baseline) / 4);
}

figcaption p, figcaption{
	text-align : left;
	font-size: 7pt !important; 
	line-height: 1.45; 
	hyphens:none; 
  word-spacing: -0.7px;
  letter-spacing: 0.02em;
}

/* ------- D E F A U L T   P A G E ------------ */
.default-page h2{
	margin:0;
	text-transform: none;
}

/* ------- TABLE OF CONTENTS --------- */
.toc-page{
  page: toc;
}

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

.toc-page h1{
  margin-top: 1cm;
  margin-left: 0cm;
  font-size: 26pt;
}

#table-of-contents{
	margin-top: 2.5cm;
	position: relative;
}

#table-of-contents ul{
    padding:0;
    margin-left: 13mm;
}

#table-of-contents li{
    margin-bottom: 4mm;
    font-size: 14pt;
    line-height: 1.2;
    text-align: left;
}

#table-of-contents li a{
	display: inline-block;
	max-width: 80%;
}

#list-toc-generated .toc-element .chapter-number{
	margin-left: -12.5mm;
}

#list-toc-generated .toc-element .chapter-title{
	margin-left: 3mm;
	hyphens: none;
	line-height: 1.4;
	font-size: 16px;
}

#list-toc-generated .toc-element .location{
	margin:0;
  font-size: 7pt;
  line-height: 1.4;
  text-align: left;
}


#list-toc-generated{ 
	list-style: none;
	overflow-x: visible !important;
}

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

#list-toc-generated .toc-element a::after{
    content: target-counter(attr(href), page);
    position: absolute;
    right:0;
    top:0;
    font-size: 16px;
}

#list-toc-generated .toc-element-level-1{
	position: relative;
}

#list-toc-generated .toc-element-level-2{
    margin-left: 25px;
}


/* target-text(attr(href), before) doesn't work for now, replace with counters (see below)*/
/* #list-toc-generated .toc-element a::before{
    content: target-text(attr(href), before);
} */

/* counters */

#list-toc-generated{ 
    counter-reset: counterTocLevel1; 
}

#list-toc-generated .toc-element-level-1{ 
    counter-increment: counterTocLevel1; 
    counter-reset: counterTocLevel2; 
}

#list-toc-generated .toc-element-level-2{ 
    counter-increment: counterTocLevel2; 
}

#list-toc-generated .toc-element-level-2::before{ 
    content: counter(counterTocLevel1) ". " counter(counterTocLevel2) ". ";
    padding-right: 5px;
}

/*  leader() doesn't work for now, replace with the hack bellow */
/* #list-toc-generated .toc-element a::after{
    content: leader('.') " p. " target-counter(attr(href), page);
    float: right;
} */

/* hack for leaders */

#list-toc-generated{
    overflow-x: hidden;
}

/* ------- CREDITS PAGE --------- */

.credits .content p{
	text-align: left;
	hyphens: none;
}





