/* survivologie.org — v0.1
   Refonte mai 2026
   Esprit davidmanise.com (Courier Prime + DM Sans) adapté lecture longue académique
*/

/* === Variables === */
:root {
  --papier: #f5f1ea;
  --encre:  #2a2620;
  --noir:   #0a0807;
  --pale:   #8a8478;
  --rule:   #d8d2c5;
  --T: 'DM Sans', system-ui, -apple-system, sans-serif;
  --C: 'Courier Prime', 'Courier New', monospace;
  --col: 38rem; /* largeur de colonne de lecture ~65ch */
}
@media (prefers-color-scheme: dark) {
  :root {
    --papier: #0e0c0a;
    --encre:  #d8d2c5;
    --noir:   #f0eadd;
    --pale:   #7a7468;
    --rule:   #3a342e;
  }
}

/* === Reset minimal === */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
img, svg { max-width: 100%; height: auto; display: block; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 3rem 0; }

/* === Base === */
html, body { background: var(--papier); }
body {
  font-family: var(--C);
  font-size: 17px;
  line-height: 1.75;
  color: var(--encre);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--noir); color: var(--papier); }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--pale);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color .15s;
}
a:hover { text-decoration-color: var(--noir); color: var(--noir); }

/* === Layout === */
.wrap {
  max-width: var(--col);
  margin: 0 auto;
  padding: 2rem 1.5rem 6rem;
}
.wrap-wide { max-width: 56rem; }

/* === Header === */
.site-header {
  border-bottom: 1px solid var(--rule);
  padding: 1.25rem 1.5rem;
  margin-bottom: 3rem;
}
.site-header-inner {
  max-width: 56rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem 2rem;
}
.site-logo {
  font-family: var(--T);
  font-weight: 500;
  font-size: 1.1rem;
  color: var(--noir);
  letter-spacing: -0.01em;
}
.site-logo a { text-decoration: none; }
.site-logo .tag {
  display: block;
  font-family: var(--C);
  font-weight: 400;
  font-size: .8rem;
  color: var(--pale);
  letter-spacing: 0;
  margin-top: .15rem;
}
.site-nav {
  display: flex;
  gap: 1.75rem;
  font-family: var(--T);
  font-size: .95rem;
}
.site-nav a {
  text-decoration: none;
  color: var(--pale);
}
.site-nav a:hover, .site-nav a.on { color: var(--noir); }

/* === Headings === */
h1, h2, h3, h4 {
  font-family: var(--T);
  color: var(--noir);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.2;
}
h1 {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  margin: 0 0 .5rem;
  letter-spacing: -0.025em;
  font-weight: 500;
}
h2 {
  font-size: 1.6rem;
  margin: 3rem 0 1rem;
  padding-top: .5rem;
  font-weight: 500;
}
h3 { font-size: 1.25rem; margin: 2rem 0 .75rem; font-weight: 500; }
h4 { font-size: 1.05rem; margin: 1.5rem 0 .5rem; font-weight: 500; }

/* === Texte === */
p { margin: 0 0 1.1em; }

blockquote {
  margin: 1.5rem 0;
  padding: .25rem 0 .25rem 1.25rem;
  border-left: 2px solid var(--rule);
  color: var(--pale);
  font-style: italic;
}
blockquote p:last-child { margin-bottom: 0; }

ul, ol {
  padding-left: 1.5rem;
  margin: 0 0 1.1em;
}
li { margin: .35em 0; }
li::marker { color: var(--pale); }

code {
  font-family: var(--C);
  background: var(--rule);
  padding: .1em .35em;
  border-radius: 2px;
  font-size: .9em;
}

/* === Méta article === */
.essai-meta {
  font-family: var(--T);
  font-size: .9rem;
  color: var(--pale);
  margin: 0 0 2.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}
.essai-meta time, .essai-meta .meta-item {
  display: inline-block;
}
.essai-kicker {
  font-family: var(--T);
  font-size: .85rem;
  color: var(--pale);
  text-transform: uppercase;
  letter-spacing: .12em;
  margin: 0 0 .5rem;
}
.essai-sub {
  font-family: var(--T);
  font-weight: 400;
  color: var(--encre);
  font-size: 1.15rem;
  line-height: 1.5;
  margin: 0 0 2rem;
  max-width: 32rem;
}

/* === Footnotes === */
.footnote-ref {
  font-family: var(--T);
  font-size: .75em;
  color: var(--pale);
  text-decoration: none;
  padding: 0 .1em;
  vertical-align: super;
  line-height: 0;
}
.footnote-ref:hover { color: var(--noir); }
.footnote-ref:target,
.footnote-back:target { background: var(--rule); }

.footnotes {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: .9rem;
  color: var(--pale);
}
.footnotes ol { padding-left: 1.5rem; }
.footnotes li { margin-bottom: .75rem; }
.footnotes a { color: inherit; }

.bibliographie {
  margin-top: 3rem;
  font-size: .9rem;
}
.bibliographie h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--pale);
  font-weight: 500;
  margin-bottom: 1rem;
}
.bibliographie ul { list-style: none; padding: 0; }
.bibliographie li {
  margin-bottom: .75rem;
  padding-left: 1.5rem;
  text-indent: -1.5rem;
  color: var(--pale);
}

/* === Listes d'essais (homepage / index) === */
.essais-liste {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
}
.essais-liste > li {
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--rule);
}
.essais-liste > li:first-child { padding-top: 0; }
.essais-liste > li:last-child { border-bottom: none; }
.essais-liste .titre {
  font-family: var(--T);
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.25;
  margin: 0 0 .35rem;
  color: var(--noir);
  letter-spacing: -0.01em;
}
.essais-liste .titre a { text-decoration: none; }
.essais-liste .titre a:hover { text-decoration: underline; text-decoration-color: var(--pale); }
.essais-liste .meta-line {
  font-family: var(--T);
  font-size: .82rem;
  color: var(--pale);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin: 0 0 .65rem;
}
.essais-liste .lead {
  margin: .35rem 0 0;
  color: var(--encre);
  font-size: .98rem;
}

/* === Section titre (homepage) === */
.section-titre {
  font-family: var(--T);
  font-size: .85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--pale);
  margin: 4rem 0 1.5rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--rule);
}

/* === Manifeste / accueil === */
.manifeste {
  margin: 2rem 0;
}
.manifeste p:first-of-type {
  font-size: 1.15rem;
  line-height: 1.6;
}

/* === Footer === */
.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: 5rem;
  padding: 2rem 1.5rem 3rem;
  font-family: var(--T);
  font-size: .85rem;
  color: var(--pale);
}
.site-footer-inner {
  max-width: 56rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
}
.site-footer a { color: inherit; }

/* === Print === */
@media print {
  :root { --papier: white; --encre: #111; --noir: black; --pale: #555; --rule: #ccc; }
  body { font-size: 11pt; line-height: 1.55; }
  .site-header, .site-footer, .site-nav { display: none; }
  .wrap { max-width: none; padding: 0; }
  h1 { font-size: 22pt; }
  h2 { font-size: 16pt; page-break-after: avoid; }
  h3 { font-size: 13pt; page-break-after: avoid; }
  a { color: black; text-decoration: none; }
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #666;
  }
  .footnotes { page-break-before: auto; }
  blockquote, .bibliographie { page-break-inside: avoid; }
}

/* === Responsive léger === */
@media (max-width: 540px) {
  body { font-size: 16px; }
  h1 { font-size: 2rem; }
  .site-nav { gap: 1rem; font-size: .85rem; }
  .wrap { padding: 1.5rem 1.25rem 4rem; }
}
