
/* =========================================================
   VARIABLES
   ========================================================= */

:root {
  --page-bg: #f1f0ec;
  --paper-bg: #ffffff;
  --text: #252525;
  --muted: #6c6a66;
  --accent: #2f5363;
  --accent-dark: #24424f;
  --accent-soft: #e5ecef;
  --rule: #d8d6d0;
  --box-bg: #f1f2f2;
  --example-bg: #f7f3eb;
  --example-accent: #a58c66;
  --link: #2e6278;
}

/* =========================================================
   PAGE
   ========================================================= */

html {
  background: var(--page-bg);
  color: var(--text);
}

body {
  max-width: 50rem;
  margin: 3rem auto;
  padding: 2.8rem 4rem 3.2rem;
  background: var(--paper-bg);
  color: var(--text);

  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 1.03rem;
  line-height: 1.68;

  box-shadow: 0 2px 14px rgba(0,0,0,0.05);

  hyphens: auto;
  overflow-wrap: break-word;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
}

p {
  margin: 0.9rem 0;
}

strong {
  font-weight: 650;
}

/* =========================================================
   HEADER
   ========================================================= */

.book-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;

  margin: -2.8rem -4rem 2.8rem;
  padding: 1.15rem 4rem;

  background: #e7e7e4;
  border-bottom: 1px solid #cfcec9;

  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue",
               Arial, sans-serif;
  line-height: 1.3;
}

.book-header-author {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-dark);
  white-space: nowrap;
}

.book-header-title {
  text-align: right;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #2f2f2d;
}

/* =========================================================
   TITRES
   ========================================================= */

h1, h2, h3, h4, h5, h6 {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue",
               Arial, sans-serif;
  color: var(--accent);
  line-height: 1.22;
  hyphens: none;
}

h1 {
  font-size: 2.1rem;
  font-weight: 650;
  letter-spacing: -0.02em;

  margin: 0 0 2.8rem;
  padding-bottom: 0.8rem;

  border-bottom: 2px solid var(--accent);
}

h2 {
  font-size: 1.75rem;
  font-weight: 650;
  letter-spacing: -0.015em;

  margin: 0 0 2.35rem;
  padding-bottom: 0.7rem;

  border-bottom: 1px solid var(--rule);
}

h3 {
  font-size: 1.30rem;
  font-weight: 650;

  margin-top: 2.7rem;
  margin-bottom: 0.9rem;
}

h4 {
  font-size: 1.08rem;
  font-weight: 700;

  margin-top: 2rem;
  margin-bottom: 0.7rem;

  color: #3f3f3c;
}

h5, h6 {
  font-size: 1rem;
  margin-top: 1.7rem;
  color: #4f4e4a;
}

h6 {
  font-weight: 500;
  font-style: italic;
}

/* =========================================================
   NAVIGATION PANDOC
   ========================================================= */

nav#sitenav {
  margin-bottom: 2.4rem;
  padding: 0.75rem 0 1.1rem;

  border-bottom: 1px solid var(--rule);

  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue",
               Arial, sans-serif;
  font-size: 0.8rem;
  line-height: 1.35;

  color: var(--muted);
}

div.sitenav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 0.15rem 0;
}

span.navlink {
  flex: 1 1 14rem;
}

span.navlink-label {
  display: inline-block;
  min-width: 4em;
  color: #93918c;
}

nav#sitenav a {
  text-decoration: none;
}

/* =========================================================
   LIENS
   ========================================================= */

a {
  color: var(--link);
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.12em;
}

a:hover {
  text-decoration-thickness: 0.11em;
}

/* =========================================================
   NUMEROS DE PARAGRAPHE
   ========================================================= */

span[data-custom-style="Randnummer"] {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue",
               Arial, sans-serif;

  font-size: 0.86em;
  font-weight: 700;
  color: var(--accent);

  margin-right: 0.32em;
  white-space: nowrap;
}

/* =========================================================
   ENCADRES — EXCURS
   ========================================================= */

div[data-custom-style="Excurs"] {
  background: var(--box-bg);

  margin: 0;
  padding: 0.12rem 1.35rem;

  border-left: 4px solid #788c95;

  font-size: 0.93em;
  line-height: 1.56;
}

div[data-custom-style="Excurs"] p {
  margin: 0.62rem 0;
}

div[data-custom-style="Excurs"] + div[data-custom-style="Excurs"] {
  padding-top: 0.03rem;
}

div[data-custom-style="Excurs"]:not(:has(+ div[data-custom-style="Excurs"])) {
  padding-bottom: 1rem;
  margin-bottom: 1.7rem;
}

:not(div[data-custom-style="Excurs"]) + div[data-custom-style="Excurs"],
body > div[data-custom-style="Excurs"]:first-child {
  padding-top: 0.95rem;
  margin-top: 1.55rem;
}

/* =========================================================
   EXEMPLES
   ========================================================= */

div[data-custom-style="Exemple"] {
  background: var(--example-bg);

  margin: 0;
  padding: 0.12rem 1.35rem;

  border-left: 4px solid var(--example-accent);

  font-size: 0.94em;
  line-height: 1.58;
}

div[data-custom-style="Exemple"] p {
  margin: 0.62rem 0;
}

div[data-custom-style="Exemple"] + div[data-custom-style="Exemple"] {
  padding-top: 0.03rem;
}

div[data-custom-style="Exemple"]:not(:has(+ div[data-custom-style="Exemple"])) {
  padding-bottom: 1rem;
  margin-bottom: 1.7rem;
}

:not(div[data-custom-style="Exemple"]) + div[data-custom-style="Exemple"],
body > div[data-custom-style="Exemple"]:first-child {
  padding-top: 0.95rem;
  margin-top: 1.55rem;
}

/* =========================================================
   LISTES
   ========================================================= */

ul, ol {
  margin: 1rem 0 1.2rem;
  padding-left: 1.55rem;
}

li {
  margin: 0.35rem 0;
}

li > div[data-custom-style="List Paragraph"] p {
  margin: 0.3rem 0;
}

/* =========================================================
   TABLEAUX
   ========================================================= */

table {
  width: 100%;
  margin: 1.7rem 0 2rem;

  border-collapse: collapse;

  font-size: 0.9em;
  line-height: 1.45;
}

table[data-custom-style="Grilledutableau"] {
  border: 1px solid #c8c6c1;
}

table th,
table td {
  vertical-align: top;
  padding: 0.62rem 0.72rem;
  border: 1px solid #d0cec9;
}

table tr:first-child td,
table th {
  background: #eef2f3;

  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue",
               Arial, sans-serif;
  font-weight: 650;

  color: #303d43;
}

table p {
  margin: 0.3rem 0;
}

/* =========================================================
   CITATIONS
   ========================================================= */

blockquote {
  margin: 1.6rem 0;
  padding: 0.3rem 0 0.3rem 1.2rem;

  border-left: 3px solid #c9c6bf;

  color: #4d4b47;
  font-size: 0.96em;
}

/* =========================================================
   NOTES
   ========================================================= */

.footnotes {
  margin-top: 3.5rem;
  padding-top: 1.4rem;

  border-top: 1px solid var(--rule);

  font-size: 0.82em;
  line-height: 1.48;
  color: #4f4d49;
}

.footnotes ol {
  padding-left: 1.4rem;
}

.footnotes li {
  margin-bottom: 0.7rem;
}

.footnote-ref {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue",
               Arial, sans-serif;
  font-size: 0.8em;
  text-decoration: none;
}

.footnote-back {
  text-decoration: none;
  color: #88857e;
}

/* =========================================================
   TABLE DES MATIERES
   ========================================================= */

#TOC {
  margin: 2rem 0 3rem;
  padding: 1.25rem 1.4rem;

  border: 1px solid var(--rule);
  background: #faf9f6;

  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue",
               Arial, sans-serif;
  font-size: 0.9em;
}

#TOC ul {
  margin: 0.25rem 0;
  padding-left: 1.1rem;
}

#TOC li {
  list-style: none;
  margin: 0.28rem 0;
}

#TOC a {
  text-decoration: none;
}

/* =========================================================
   FOOTER
   ========================================================= */

.book-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;

  margin-top: 4.2rem;
  padding-top: 1.05rem;

  border-top: 1px solid var(--rule);

  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue",
               Arial, sans-serif;
  font-size: 0.74rem;
  line-height: 1.4;

  color: #85827c;
}

.book-footer-pdf {
  text-align: right;
}

.book-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.book-footer a:hover {
  text-decoration: underline;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 760px) {

  html {
    background: #ffffff;
  }

  body {
    margin: 0;
    padding: 1.4rem 1.15rem 2.4rem;

    box-shadow: none;

    font-size: 1rem;
  }

  .book-header,
  .book-footer {
    display: block;
  }

  .book-header {
    margin: -1.4rem -1.15rem 2rem;
    padding: 1rem 1.15rem;
  }

  .book-header-title {
    margin-top: 0.3rem;
    text-align: left;
  }

  .book-footer-pdf {
    margin-top: 0.3rem;
    text-align: left;
  }

  .book-footer > div + div {
    margin-top: 0.3rem;
  }

  h1 {
    font-size: 1.7rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.18rem;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: normal;
  }
}

/* =========================================================
   IMPRESSION
   ========================================================= */

@media print {

  html,
  body {
    background: #ffffff;
  }

  body {
    max-width: none;
    margin: 0;
    padding: 0;

    box-shadow: none;

    font-size: 10.5pt;
    line-height: 1.45;
  }

  nav#sitenav {
    display: none;
  }

  .book-header,
  .book-footer {
    color: #666;
  }

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

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

  table,
  blockquote,
  div[data-custom-style="Excurs"],
  div[data-custom-style="Exemple"] {
    break-inside: avoid;
  }
}
