@import url('vars.css');
@import url('pages.css');
@import url('keywords.css');


body {
    margin: 0;
    font-family: var(--font-text);
    font-size: var(--font-size);
    color: var(--dark-grey);
    font-weight: 500;
    font-style: normal;
    /* line-height: 1.5; */
    /* --paged-layout: booklet; */
}

.in-cover {
    page: in-cover;
    counter-reset: page 1;
}

section {
    break-after: page;
    break-before: right;
    text-wrap: pretty;
    width: 125mm;
}

section.preface {
    page-break-before: right;
}

/* ----- TITLES ----- */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Libertine';
    font-weight: 500;
    font-style: normal;
    line-height: 1.2;
    color: black;
    margin: 0;
    height: fit-content;
    break-after: avoid;
    break-inside: avoid;
    text-align: left;
}

.in-cover h2 {
    font-size: 1.8em;
    padding-bottom: 1mm;
    border-bottom: solid 1px var(--dark-grey);
}

.title-it {
    letter-spacing: .07em;
}

#c {
    letter-spacing: -.02em;
}

.in-cover h3 {
    margin-top: 2mm;
    font-size: 11pt;
    border: none;
}

h3 {
    font-size: 14pt;
    padding-bottom: .5mm;
    border-bottom: solid 1px var(--dark-grey);
}

h3 span {
    font-style: italic;
}

h4 {
    font-size: 9.5pt;
    border-bottom: .5px solid var(--light-grey);
    padding-bottom: 0.8mm;
    margin-top: 2.8mm;
    margin-bottom: 2mm;
}

h4+h5 {
    break-after: avoid;
    margin-top: -0.5mm;
}

h5 {
    font-size: 8pt;
    border-bottom: .5px dotted var(--light-grey);
    padding-bottom: 0.8mm;
    margin-top: 2.6mm;
    margin-bottom: 2mm;
    font-weight: 800;
    font-family: 'Fungal';
}

h6 {
    margin-bottom: 1mm;
    font-size: 8pt;
}

h6 a {
    font-size: inherit;
    line-height: 0;
}


/* ----- GENERAL TEXT FEATURES ----- */
/* ----- General looks of the paragraphs ----- */
p {
    text-indent: 6mm;
    margin: 0;
    orphans: 2;
    widows: 2;
    /* word-spacing: -0.5pt; */
}

.text {
    line-height: var(--pagedjs-baseline);
}

.text[data-split-from] {
    margin-top: 0;
}

.text[data-split-to] {
    margin-top: 0;
}

.text :first-child {
    margin-top: 0;
}

/* ----- Specific paragraphs, spans and styling inside paragraphs ----- */
#serif {
    font-family: 'Libertine';
    font-size: 9pt;
}

.txt-info p,
li p,
.preface p,
.refs,
.link {
    text-indent: unset;
}

.preface>h3 {
    margin-bottom: 2.5mm;
}

.preface>p {
    margin-bottom: 2.5mm;
}

i {
    font-style: italic;
    font-weight: 500;
}

b {
    font-weight: 800;
    font-style: normal;
}

u {
    text-decoration: underline;
    text-underline-offset: .5mm;
    text-decoration-thickness: .5mm;
}

p>u {
    text-decoration-thickness: .1mm;
}

sup {
    font-size: 6pt;
    line-height: 0;
}

.extrait {
    font-style: italic;
    padding: 2.5mm 10mm;
    text-indent: unset;
    text-align-last: left;
}

.description {
    text-indent: unset;
    margin-bottom: 2mm;
}

/* ----- List elements ----- */

p+ul {
    margin-top: 4pt;
}

ul {
    padding-left: 5mm;
}

li {
    margin-bottom: 3pt;
}

li::marker {
    content: "→ ";
}

li[data-split-from]::marker {
    content: none;
}

li p {
    padding-left: 4pt;
}

/* ----- LINKS ----- */
a {
    font-size: 6pt;
    line-height: 1;
    color: #3366cc;
}

.main-text a {
    font-size: unset;
    line-height: unset;
}

a:visited {
    color: #3366cc;
}

/* ----- SOMMAIRE ----- */
div.txt-info,
div.contents {
    background-color: #f9f9f9;
    border: .5px solid #aaa;
}

div.contents {
    width:
        /*calc(var(--page-inner-width) - 8mm)*/
        var(--page-inner-width);
    color: var(--blue);
    margin-top: 0;
    margin-left: 0;
    padding: 5mm 5mm 2.5mm 5mm;
    line-height: 1.3em;
}

div.contents h6 {
    font-size: 1.1em;
    margin-bottom: 3.5mm;
    font-weight: 800;
    font-family: var(--font-text);
    text-align: center;
}

div.contents li::marker {
    content: none;
}

div.contents li,
div.contents li>p,
div.contents ul {
    margin-left: 0;
    padding: 0;
    text-align: left;
}

div.contents li {
    margin-bottom: 2.5mm;
}

span.toc-number {
    color: var(--dark-grey);
}

/* ----- TEXT INFO ----- */
div.txt-info {
    padding: 2.2mm;
    margin: 4mm 0mm 3mm;
    width: var(--page-inner-width);
    clear: right;
}

.txt-info p {
    font-size: 0.8em;
    line-height: 1.5;
}

.txt-info a {
    text-decoration: none;
    color: #3366cc;
    background: none;
    line-height: 0.5;
}

.txt-info i,
.txt-info u,
.txt-info b,
.txt-info p>a {
    font-size: 1em;
}


/* ----- INDEXING ----- */
.keywords {
    text-decoration: none;
    color: #3366cc;
    background: none;
    font-family: 'Fungi';
    font-weight: 500;
    font-style: normal;
    font-size: var(--font-size);
    margin: 0;
    padding: 0;
    display: inline;
}

.not-index {
    font-family: 'Fungal';
    color: black;
}

a.not-index {
    color: #3366cc;
}

/* ----- Quotes in the last text ----- */
.big {
    font-size: 1.15em;
    font-weight: 800;
    line-height: 1.2;
    font-family: 'Libertine';
    text-align: center;
    padding: 2.5mm 5.5mm;
    break-inside: avoid;
}

.big .not-index {
    font-size: inherit;
    font-family: inherit;
    font-weight: inherit;
}


/* ----- REFERENCES ----- */

h6.refs {
    font-size: .9em;
    margin-top: 4mm;
    margin-bottom: 1.5mm;
    font-weight: 800;
    font-family: 'Fungal';
}

p.link,
p.link a {
    font-size: 6.5pt;
    line-height: 1.2;
    margin-bottom: 4pt;
}


/* ----- IMAGES ----- */

.img-medium {
    width: calc(var(--page-inner-width) - 26mm);
    margin-left: 13mm;
}

.img-large {
    width: calc(var(--page-inner-width) - 3mm);
    margin-left: 1.5mm;
}

.img-not-large {
    width: calc(var(--page-inner-width) - 8mm);
    margin-left: 2.5mm;
    margin-bottom: 3mm;
}

figure {
    margin: 0;
    margin-bottom: 4mm;
    margin-top: 2mm;
    border: 1px solid #c8ccd1;
    background-color: #f8f9fa;
    padding: 1.5mm;
    text-align: center;
    break-inside: avoid;
    width: var(--page-inner-width);
}

figure.float-right {
    float: right;
    margin: 0;
    margin-left: 5mm;
    width: 50%;
}

img {
    width: 100%;
}

figure:empty {
    display: none;
}

figcaption {
    font-family: 'Libertine';
    font-style: italic;
    font-size: 6.2pt;
    line-height: 1.15;
    text-align: center;
    text-align-last: center;
}