/* Livingstone : feuille de style unique, sans dépendance externe.
   Palette reprise du thème d'origine du wiki (cyan, acier, encre bleue),
   lui-même accordé au bandeau tiré d'Elephants Dream. */

:root {
  --fond: #fdfdfb;
  --fond-bloc: #eef4f6;
  --fond-creux: #e2ecef;
  --texte: #1b1f24;
  --doux: #59636b;
  --lien: #12557f;
  --lien-visite: #5a3a80;
  --trait: #cfdbe0;
  --trait-fort: #9db4bd;
  --accent: #0f7f9c;
  --accent-chaud: #9a6212;
  --largeur: 46rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fond: #12171a;
    --fond-bloc: #1a2226;
    --fond-creux: #202b30;
    --texte: #e4e7e6;
    --doux: #9aa5ab;
    --lien: #7fc0e0;
    --lien-visite: #c1a3e0;
    --trait: #2a363c;
    --trait-fort: #46565e;
    --accent: #57c2dc;
    --accent-chaud: #d9a44a;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.65;
}

/* ---------------------------------------------------------------- bandeau */
.bandeau-site {
  position: relative;
  background: #0e2b33 url("../fonds/bandeau-elephants-dream.jpg") center 32% / cover no-repeat;
  border-bottom: 1px solid var(--trait-fort);
}
.bandeau-site::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to right, rgba(6,24,30,.82), rgba(6,24,30,.35) 55%, rgba(6,24,30,.78));
}
.bandeau-interieur {
  position: relative; z-index: 1;
  max-width: var(--largeur);
  margin: 0 auto;
  padding: 1.5rem 1.2rem 1.2rem;
}
.titre-site {
  margin: 0;
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.1;
}
.titre-site a { color: #f2fbff; text-decoration: none; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.titre-site a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.sous-titre-site {
  margin: .15rem 0 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: .85rem;
  color: #bfe0ea;
  text-shadow: 0 1px 3px rgba(0,0,0,.7);
}
.menu-site {
  position: relative; z-index: 1;
  max-width: var(--largeur);
  margin: 0 auto;
  padding: 0 1.2rem 1rem;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: .85rem;
  display: flex; flex-wrap: wrap; gap: .2rem 1rem;
}
.menu-site a { color: #d8eef5; text-decoration: none; border-bottom: 1px solid rgba(216,238,245,.35); }
.menu-site a:hover, .menu-site a[aria-current="page"] { color: #fff; border-bottom-color: #fff; }

/* --------------------------------------------------------------- structure */
main {
  max-width: var(--largeur);
  margin: 0 auto;
  padding: 1.6rem 1.2rem 3rem;
  background: url("../fonds/haut-de-page-elephants-dream.jpg") center -6rem / 100% auto no-repeat;
}
@media (prefers-color-scheme: dark) {
  main { background-image: none; }
}
article, .page-simple { position: relative; }

footer.pied {
  border-top: 1px solid var(--trait);
  background: var(--fond-bloc);
}
.pied-interieur {
  max-width: var(--largeur);
  margin: 0 auto;
  padding: 1.2rem 1.2rem 2.5rem;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: .78rem;
  color: var(--doux);
}
.pied-interieur p { margin: .35rem 0; }
.pied-interieur a { color: var(--lien); }

/* ------------------------------------------------------------ typographie */
a { color: var(--lien); text-decoration-thickness: 1px; text-underline-offset: .15em; }
a:visited { color: var(--lien-visite); }
a.zola-anchor { color: var(--trait-fort); text-decoration: none; padding-left: .3em; font-size: .8em; }
a.zola-anchor:hover { color: var(--accent); }

h1 {
  font-size: 1.95rem; line-height: 1.2; margin: .1rem 0 .3rem; font-weight: 600;
}
h2 {
  font-size: 1.32rem; margin: 2.1rem 0 .5rem; font-weight: 600;
  border-bottom: 1px solid var(--trait); padding-bottom: .2rem;
}
h3 { font-size: 1.12rem; margin: 1.5rem 0 .35rem; font-weight: 600; }
h4 { font-size: 1rem; margin: 1.2rem 0 .3rem; font-weight: 600; color: var(--doux); }
p { margin: .7rem 0; }
blockquote {
  margin: 1rem 0 1rem .6rem; padding: .1rem 0 .1rem 1rem;
  border-left: 3px solid var(--trait-fort); color: var(--doux);
}
hr { border: 0; border-top: 1px solid var(--trait); margin: 1.6rem 0; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .88em; }
pre {
  background: var(--fond-creux); border: 1px solid var(--trait);
  padding: .7rem .9rem; overflow-x: auto;
}
img { max-width: 100%; height: auto; }

/* ---------------------------------------------------------------- repères */
.type-page {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: .72rem; letter-spacing: .09em; text-transform: uppercase;
  color: var(--doux); margin: 0;
}
.meta-page {
  margin: 1.8rem 0 0; padding-top: .6rem; border-top: 1px solid var(--trait);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: .8rem; color: var(--doux);
}
.meta-page a { color: var(--lien); }
.cats-page {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: .84rem; margin: 1.4rem 0 0;
}
.cats-page .etiquette {
  display: inline-block; padding: .1rem .5rem; margin: 0 .25rem .3rem 0;
  background: var(--fond-bloc); border: 1px solid var(--trait);
  border-radius: 1em; text-decoration: none; color: var(--lien);
}
.cats-page .etiquette:hover { border-color: var(--accent); }

nav.sommaire {
  background: var(--fond-bloc); border: 1px solid var(--trait);
  padding: .7rem 1rem; margin: 1.3rem 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: .88rem; display: table; min-width: 15rem; max-width: 100%;
}
nav.sommaire p { margin: 0 0 .3rem; font-weight: 600; }
nav.sommaire ol { list-style: none; margin: 0; padding: 0; }
nav.sommaire ol ol { padding-left: 1.1rem; }
nav.sommaire li { padding: .05rem 0; }

.lien-absent {
  color: var(--doux); text-decoration: line-through;
  text-decoration-thickness: 1px; cursor: help;
}

/* ----------------------------------------------------------------- listes */
ul.liste-pages { list-style: none; padding: 0; margin: .4rem 0 1.2rem; }
ul.liste-pages li {
  padding: .1rem 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: .95rem;
}
ul.liste-pages .annexe { color: var(--doux); font-size: .85em; }
.alphabet {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  letter-spacing: .1em; margin: 1rem 0 1.5rem;
}
.alphabet a { display: inline-block; padding: 0 .15rem; }
.compte { color: var(--doux); font-weight: 400; font-size: .85em; }

.cartes {
  display: grid; gap: .7rem; margin: 1.5rem 0;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}
.carte {
  display: block; padding: .8rem 1rem; text-decoration: none;
  background: var(--fond-bloc); border: 1px solid var(--trait); color: var(--texte);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.carte:hover { border-color: var(--accent); }
.carte strong { display: block; font-size: 1rem; color: var(--lien); }
.carte span { display: block; font-size: .82rem; color: var(--doux); }

/* --------------------------------------------------------------- tableaux */
table { border-collapse: collapse; max-width: 100%; margin: 1rem 0; }
.cadre-tableau { overflow-x: auto; }
table.wikitable, table.tableau-wiki {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: .9rem;
}
table.wikitable th, table.wikitable td,
table.tableau-wiki th, table.tableau-wiki td {
  border: 1px solid var(--trait); padding: .3rem .55rem; vertical-align: top;
}
table.wikitable th, table.tableau-wiki th { background: var(--fond-bloc); text-align: left; }
caption { caption-side: top; text-align: left; color: var(--doux); font-size: .85rem; padding-bottom: .3rem; }

/* ----------------------------------------------------------------- images */
figure.illustration { margin: 1.2rem 0; }
figure.illustration img { border: 1px solid var(--trait); background: var(--fond-bloc); }
figure.illustration figcaption {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: .82rem; color: var(--doux); padding-top: .3rem;
}
figure.illustration.align-right { float: right; margin: .2rem 0 1rem 1.2rem; max-width: 45%; }
figure.illustration.align-left { float: left; margin: .2rem 1.2rem 1rem 0; max-width: 45%; }
figure.illustration.align-center { margin-left: auto; margin-right: auto; text-align: center; }
@media (max-width: 36rem) {
  figure.illustration.align-right, figure.illustration.align-left {
    float: none; margin: 1.2rem 0; max-width: 100%;
  }
}
.fiche-fichier img { max-width: 100%; border: 1px solid var(--trait); }

/* ------------------------------------------------------------- bandeaux du wiki
   Les modèles du wiki portaient leur mise en forme en style « inline » ; elle a
   été conservée à l'identique. Les classes ci-dessous n'ajustent que ce qui
   gênait la lecture : largeur, marges, et lisibilité du texte en petites capitales. */
.grand { font-size: 1.15em; }
main div[style] { max-width: 100%; }
main div[style] a { color: inherit; text-decoration: underline; }

/* --------------------------------------------------------------- recherche */
input[type="search"] {
  width: 100%; padding: .6rem .8rem; font-size: 1rem;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--fond); color: var(--texte); border: 1px solid var(--trait-fort);
}
input[type="search"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
#resultats ul { list-style: none; padding: 0; }
#resultats li { margin: .7rem 0; }
#resultats .extrait {
  display: block; color: var(--doux); font-size: .85rem; line-height: 1.45;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
#resultats mark { background: #ffe9a8; color: #2a2a2a; }
@media (prefers-color-scheme: dark) { #resultats mark { background: #6b5a1f; color: #f5eeda; } }
.note {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: .85rem; color: var(--doux);
}
