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

:root{
	--page-width: 14.8cm;
	--page-height: 21cm;
	--back-width : 4mm;
	--bleeds : 6mm;
	--color1: pink;
	--color2: green;
	--font1: "terminal", sans-serif;
	--font2: "alegreya", serif;
	--textsize: 11.5pt;
	--leftmargin: 22mm;
	--baseline: 20px;
}

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

@page :left {
	margin: 16mm 25mm 10mm 10mm;
	@top-left-corner {
		content: counter(page);
		font-size: 7pt;
		text-align: center;
		color: var(--color1);
		font-family: var(--font1);
		margin-top: -3pt;
 	}
 	@top-center{
    content: string(title);
    font-size: 7pt;
    text-align: center;
    text-transform: uppercase;
    width: 105%;
    margin-left: 0%;
    color: var(--color1);
    font-family: var(--font1);
  }
}

@page :right {
	margin: 16mm 10mm 10mm 25mm;
	@top-right-corner {
		content: counter(page);
		font-size: 7pt;
		text-align: center;
		color: var(--color1);
		font-family: var(--font1);
		margin-top: -3pt;
 	}
 	@top-center{
    content: string(title);
    font-size: 7pt;
    text-align: center;
    text-transform: uppercase;
    width: 105%;
    margin-left: -9%;
    color: var(--color1);
    font-family: var(--font1);
  }
}


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

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

/*figure {
   background: #00c2ff;
}*/

figure img {
  mix-blend-mode: screen;
  -webkit-filter: grayscale(100%) contrast(200%);
  filter: grayscale(100%) contrast(200%);
  opacity: 1;
  vertical-align: top;
}

img{width: 100%;}

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

h2, h3{
	font-weight: normal;
	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;
}

p 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;
  table-layout: fixed;
  margin-top: 2em;
}

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

body[data-lang="hi"] th, 
body[data-lang="hi"] td{
	word-wrap: break-word;
  word-break: break-word;
  white-space: normal;
  hyphens: auto;
}

th, td {
/*  border: 1px solid var(--yellow);*/
  padding: 12px 8px;
  padding-bottom: 12px !important;
  border-right: 1px solid lightgrey;
}



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

tr:last-child{
	border: none;
}


tr:nth-child(even) {
/*  background: lightgrey;*/
}

tr > th:first-child, 
tr > th:nth-child(2){
	width:20%;
}

tr > td:first-child, 
tr > td:nth-child(2){
	width:20%;
}

td:last-child{
	display: none;
}

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

.content .big-text p{
	font-size: 26pt;
	line-height: 1.2;
	text-align: left;
	hyphens: none;
}

/* ------- C O L O R S ---------- */
.color1{ color: var(--color1); }
.color2{ color: var(--color2); }
figure.color1{ background: var(--color1); }
figure.color2{ background: var(--color2); }

/* ------- F O N T S ---------- */
.font1{ font-family: var(--font1); }
.font2{ font-family: var(--font2); }

/* L A Y E R S    E X P O R T   F O R    R I S O */
.layer1,
.layer2{
	filter: grayscale(1);
}

.layer1 figure,
.layer2 figure{
	background: #000;
}

.layer1 .color1,
.layer2 .color2{
	color: #000;
}

.layer1 .color2{
	opacity: 0;
}

.layer2 .color1{
	opacity: 0;
}

.layer1 #list-toc-generated .color1 a{
	color: #000;
	opacity: 1;
}

.layer1 .pagedjs_page.pagedjs_left_page .pagedjs_margin-top-center,
.layer1 .pagedjs_page.pagedjs_right_page .pagedjs_margin-top-center,
.layer1 .pagedjs_page.pagedjs_left_page .pagedjs_margin-top-left,
.layer1 .pagedjs_page.pagedjs_right_page .pagedjs_margin-top-left{
	color: #000 !important;
}

.layer2 .pagedjs_page.pagedjs_left_page .pagedjs_margin-top-center,
.layer2 .pagedjs_page.pagedjs_right_page .pagedjs_margin-top-center,
.layer2 .pagedjs_page.pagedjs_left_page .pagedjs_margin-top-left-corner,
.layer2 .pagedjs_page.pagedjs_right_page .pagedjs_margin-top-right-corner{
	opacity: 0;
}


/* --------- Couverture ---------- */
.cover{
	height: var(--pagedjs-height);
	display: grid;
  place-items: center
}

.cover figure{
	width: 106%;
	height: 104%;
	position: absolute;
	top: -2%; 
	left: -3%;
}

.cover figure img{
	/*width:103%;*/
  position: relative;
  vertical-align: top;
  object-fit: cover;
  max-width: none;
  width: 100%;
  height: 100%;
}

.cover #book-title_wrapper{
	mix-blend-mode: multiply;
}

.cover h1{
	text-align: center;
	font-size: 60pt;
	line-height: 1.2;
}

.cover h2{
	font-size: 25px;
	text-align: center;
	line-height: 1.2;
}

/* Couverture styles print */
.cover{
	page: couverture;
}

@page couverture{
	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;}
}

/* --------- 4ème de couverture -------- */
.backcover{
	height: var(--page-height);
}

.backcover .backcover-summary{
  position: absolute;
  width: 80%;
  left: 50%;
  transform: translateX(-50%);
  top: 1.5cm;
}

.backcover .backcover-summary p{
	font-size: 16px;
	text-align: left;
	line-height: 1.4;
	hyphens: none;
}

.backcover .barcode-wrapper{
	position: absolute;
	bottom: 10mm;
	right: 8%;
}

.backcover .backcover-bottom{
	position: absolute;
	bottom: 10mm;
	right: 10%;
}

.backcover .backcover-bottom a,
.backcover .backcover-bottom p{
	margin: 0;
	font-size: var(--textsize);
}

.backcover .backcover-bottom .logo-wrapper{
	width: 40mm;
	margin-top: 2mm;
	margin-left: -2mm;
}

/* backcover styles print */
.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-break-before: always;
	page-break-after: always;*/
	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;
/*	margin-top: -1cm;*/
}

@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-break-before: always;
	page-break-after: always;*/
	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%;
}

.title-page h1 span{
	/*color: var(--green);*/
}

@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: 35pt;
	line-height: 1.3;
	margin-top: 1cm;
	margin-bottom: 1cm;;
	text-align: center;
}

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

.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;
	/*color: var(--green);*/
}

.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{
	/*break-before: right;*/
	margin-top: 1cm !important;
	break-after: always;
/*	counter-reset: footnote 0;*/
}

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


.chapter h1{
	margin:0;
	font-size: 26pt;
	text-transform: none;
	line-height: 1.2;
}



.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 .simple-image figure,
.chapter .images-gallery figure{
	margin-bottom: 0;
}

.chapter .simple-image,
.chapter .images-gallery{
	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;
}

.chapter .label{
	font-size: 12pt; 
	color: #7E7E7E;
	text-transform: uppercase;
	margin-top: 1mm;
	margin-bottom: 0;
}

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

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

.images-staggered {
	margin-left: 1cm;
	width: 100%;

}

.images-staggered ul li{
	margin:0;
	padding:0;
	list-style: none;
	margin-bottom: 2em;
	width: calc(100% - 1cm);
}

.images-staggered ul li:nth-child(odd){
	margin-left: 1cm;
}

.images-staggered ul li:nth-child(even){
	margin-left: -1cm;
}

/*.images-staggered figcaption{
	margin-top:2px;
}*/

.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;
	color: var(--grey);
	word-spacing: -0.7px;
  letter-spacing: 0.02em;
  margin-bottom: 0.8mm;
}

.footnote a{
	color: var(--grey);
}

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

::footnote-call {
/*  content: counter(footnote, loweralpha);*/
  line-height: 0;
  font-size: 8pt;
/*  font-weight: bold;*/
  vertical-align: middle;
  position: relative;
  top: -2px;
}

::footnote-marker {
/*  content: counter(footnote, loweralpha) "     ";*/
  font-size: 7pt;
  color: var(--grey);
  line-height: 0;
}

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

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

figure{
	page-break-inside: avoid;
}

figcaption p, figcaption{
	text-align : left;
	font-size: 7pt !important; 
	line-height: 1.45; 
	hyphens:none; 
	background: #fff;
	padding-top: 2mm;
}

figcaption p{
	padding-top: 0;
	margin:0;
}

/* ------- D E F A U L T   P A G E ------------ */
.default-page h2,
.default-page h3{
	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;
    /*color: var(--green); */
    line-height: 1.2;
    text-align: left;
/*    font-weight: bold;*/
}

#table-of-contents li a{
	display: inline-block;
	/*color: var(--green); */
	max-width: 80%;
/*	margin-left: -0.5cm;*/
}

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

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

#list-toc-generated a.color2{
	color: var(--color1);
}

#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-1::before{ 
    content: counter(counterTocLevel1) ". ";
    padding-right: 5px;
}*/

#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;
}

/* ------- AUTHORS PAGE --------- */

.author-page .content h2, .author-page .content h3{
	margin: 0;
	text-transform: none; 

}

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

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





