/* =========================================================
   variables
========================================================= */
:root{
  --maxwidth: 60rem;

  /* fontes variables */
  --font-wght: 350;
  --font-wdth: 100;

  /* lecture (lisibilité) */
  --reading-width: 40rem;  /* 38–42rem = super lisible */
  --reading-pad: 1.75rem;
}

/* =========================================================
   base
========================================================= */
html{
  -webkit-text-size-adjust: 100%;
}

body{
  background: var(--backgroundcolor);
  color: var(--textcolor);
  font-family: "Montserrat", sans-serif;
  margin: 0;
  line-height: 1.6;
}

*,
*::before,
*::after{
  box-sizing: border-box;
  font-variation-settings:
    "wght" var(--font-wght, 400),
    "wdth" var(--font-wdth, 112.5);
}

a{
  color: currentColor;
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
}

/* =========================================================
   couleurs
========================================================= */
:root,
:root[data-force-color-mode="light"]{
  color-scheme: light dark;
  --backgroundcolor: #ffffff;
  --textcolor: #1a0bfa;
  --bordercolor: #9ea4c9;
  --accentcolor: #1a0bfa;
  --font-wght: 350;
  --font-wdth: 700;
}

@media (prefers-color-scheme: dark){
  :root{
    --backgroundcolor: #05004f;
    --textcolor: #ffffff;
    --bordercolor: #d0d4ff;
    --accentcolor: #ebfd00;
    --font-wght: 380;
    --font-wdth: 100;
  }
}

:root[data-force-color-mode="dark"]{
  --backgroundcolor: #05004f;
  --textcolor: #ffffff;
  --bordercolor: #ebfd00;
  --accentcolor: #ebfd00;
  --font-wght: 380;
  --font-wdth: 100;
}

/* =========================================================
   titres + texte
========================================================= */
h1{
  font-size: 3.10rem;
  line-height: 1.15;
  text-wrap: balance;
  font-family: "Montserrat", sans-serif;
  font-weight: normal;
  --font-wght: 400;
  --font-wdth: 90;
  margin: 0;
}

h2, h3{
  font-size: 1.90rem;
  line-height: 1.25;
  text-wrap: balance;
  --font-wght: 400;
  margin: 0;
}

p{
  margin: 0 0 1.55em 0;
}

/* =========================================================
   listes
========================================================= */
ul{
  padding: 0;
  list-style-type: none;
  margin: 0;
}
ul li::before{
  content: "— ";
}

/* =========================================================
   top nav
========================================================= */
.top-nav{
  border-bottom: 1px solid var(--bordercolor);
  padding: 1em;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  background: var(--backgroundcolor);
  z-index: 10;
}
.top-nav a{
  text-decoration: none;
  letter-spacing: .05em;
}

/* =========================================================
   layout
========================================================= */
main > *{
  padding: 1rem;
}

header{
  border-bottom: 1px solid var(--bordercolor);
  padding: 4rem 1rem 1rem;
}

header h1 strong{
  display: block;
  font-weight: inherit;
}

.authors{
  text-transform: uppercase;
  letter-spacing: .02em;
}

/* =========================================================
   texte article : lisibilité ++
========================================================= */
body.article .text{
  /* bloc centré */
  max-width: var(--reading-width);
  margin: 0 auto;
  padding: 2rem var(--reading-pad);

  /* lecture */
  font-size: clamp(1rem, 0.45vw + 0.95rem, 1.12rem);
  line-height: 1.85;

  letter-spacing: 0.01em;
  word-spacing: 0.02em;

  hyphens: auto;
  overflow-wrap: break-word;
  text-rendering: optimizeLegibility;

  /* garder ton style */
  color: var(--textcolor);
  display: block;
}

body.article .text p{
  margin: 0 0 1.55em 0;
  text-align: left;
}

/* option "livre" (tu peux enlever si tu veux) */
body.article .text p + p{
  text-indent: 0.8em;
}

/* citations */
.epigraphe,
body.article .text .quote{
  --font-wght: 900;
  max-width: max(75%, 23em);
  margin-left: auto;
  font-size: 1.05em;
  line-height: 1.7;
}

/* liens dans texte */
body.article .text a{
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
}

/* mobile */
@media (max-width: 700px){
  body.article .text{
    max-width: 100%;
    padding: 1.5rem 1.1rem;
    line-height: 1.8;
  }
  body.article .text p + p{
    text-indent: 0; /* sur mobile c’est mieux sans indent */
  }
}

/* =========================================================
   h1 avec image en background (ton JS)
========================================================= */
body.article h1{
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;

  min-height: 420px;
  padding: 2rem var(--reading-pad);

  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  border-bottom: 1px solid var(--bordercolor);
  overflow: hidden;
}

/* voile pour texte lisible */
body.article h1::before{
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.55),
    rgba(0,0,0,0.10)
  );
}

body.article h1 span{
  position: relative;
  z-index: 1;
}

@media (max-width: 700px){
  body.article h1{
    min-height: 280px;
    padding: 1.5rem 1rem;
  }
}

/* =========================================================
   sections (readmore, bio, footnotes)
========================================================= */
.readmore,
.biography,
.footnotes{
  border-top: 1px solid var(--bordercolor);
  border-bottom: 1px solid var(--bordercolor);
}

.readmore > *,
.biography > *,
.footnotes > *{
  margin-inline: auto;
  max-width: var(--maxwidth);
  padding: 1.6em var(--reading-pad);
}

.footnotes ol{
  padding: 0;
  list-style-position: inside;
}
.footnotes li{
  text-indent: -2em;
  padding-left: 2em;
}

/* =========================================================
   tableaux
========================================================= */
table{
  border-collapse: collapse;
  width: 100%;
}
th{ --font-wght: 600; }
td, th{
  padding-block: .5em;
  vertical-align: top;
  text-align: left;
  border-bottom: 1px solid var(--bordercolor);
}
td:not(:first-child),
th:not(:first-child){
  padding-left: .5em;
  border-left: 1px solid var(--bordercolor);
}
td:not(:last-child),
th:not(:last-child){
  padding-right: .5em;
  border-right: 1px solid var(--bordercolor);
}
tbody tr:last-child td,
tbody tr:last-child th{
  border-bottom: none;
}

/* =========================================================
   footer
========================================================= */
#footer{
  display: flex;
  flex-direction: column;
}
#footer > *{
  padding: 1.6em 1em;
}
.articles-prev-next{
  display: flex;
  gap: 1em;
  justify-content: space-between;
  border-bottom: 1px solid var(--bordercolor);
}

/* =========================================================
   index (ta mise en page)
========================================================= */
body.index{
  max-width: 60rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  font-family: "Montserrat", sans-serif;
}

body.index > header{
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--bordercolor);
}

body.index > header h1{
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  line-height: 1.1;
  margin: 0 0 1rem 0;
}

body.index > header h1 strong{
  display: block;
  --font-wght: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body.index > header .subtitle{
  display: block;
  font-size: 0.95rem;
  margin-top: 0.4rem;
  text-transform: none;
  letter-spacing: 0.06em;
}

body.index > header .authors{
  margin-top: 1.5rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

body.index > header p{
  margin: 0.4rem 0;
  font-size: 0.92rem;
}

body.index .declaration{
  margin-bottom: 3rem;
  font-size: 0.98rem;
  line-height: 1.7;
}

body.index .declaration blockquote{
  margin: 0 0 1.5rem 0;
  padding-left: 1rem;
  border-left: 3px solid var(--bordercolor);
}

body.index .declaration blockquote p{
  margin: 0 0 0.8rem 0;
}

body.index .declaration blockquote footer{
  font-size: 0.85rem;
  margin-top: 0.8rem;
  font-style: normal;
  opacity: 0.8;
}

body.index .declaration > p{
  margin-top: 1.5rem;
}

@media (min-width: 900px){
  body.index{
    padding-top: 3.5rem;
  }

  body.index > header{
    display: grid;
    grid-template-columns: 2fr 1fr;
    column-gap: 3rem;
    align-items: flex-start;
  }

  body.index > header h1{
    margin-bottom: 0;
  }

  body.index > header p{
    margin-top: 0.2rem;
  }
}

