/* ==========================================================================
   Benoit Liquet — feuille de style unique du site.
   Sobre, sans dépendance externe, clair + sombre automatique.
   Pour changer la couleur d'accent du site, modifier --accent ci-dessous.
   ========================================================================== */

:root {
  --bg:        #ffffff;
  --surface:   #f7f7f5;
  --text:      #1c1c1a;
  --muted:     #62625d;
  --line:      #e2e2dd;
  --accent:    #7a2f2f;   /* bordeaux discret */
  --accent-bg: #f6eeee;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --measure: 46rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #161614;
    --surface:   #201f1c;
    --text:      #e8e6e0;
    --muted:     #a3a099;
    --line:      #333029;
    --accent:    #d99a9a;
    --accent-bg: #2a2020;
  }
}

/* Le sélecteur de thème du navigateur doit pouvoir forcer l'un ou l'autre. */
:root[data-theme="dark"] {
  --bg: #161614; --surface: #201f1c; --text: #e8e6e0;
  --muted: #a3a099; --line: #333029; --accent: #d99a9a; --accent-bg: #2a2020;
}
:root[data-theme="light"] {
  --bg: #ffffff; --surface: #f7f7f5; --text: #1c1c1a;
  --muted: #62625d; --line: #e2e2dd; --accent: #7a2f2f; --accent-bg: #f6eeee;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ------------------------------------------------------------------ nav --- */

.site-head {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.site-head .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 1.5rem;
  padding-top: 1.4rem;
  padding-bottom: 1.1rem;
}

.brand {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.brand:hover { color: var(--accent); }

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.1rem;
  margin-left: auto;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.93rem;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

nav a:hover { color: var(--text); }

nav a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* ---------------------------------------------------------------- texte --- */

main { padding: 2.75rem 0 1rem; }

h1 {
  font-family: var(--serif);
  font-size: 2rem;
  line-height: 1.2;
  font-weight: 600;
  margin: 0 0 0.3rem;
  letter-spacing: -0.01em;
}

h2 {
  font-family: var(--serif);
  font-size: 1.32rem;
  font-weight: 600;
  margin: 2.75rem 0 0.9rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--line);
}

h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.8rem 0 0.4rem;
}

p { margin: 0 0 1rem; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

.lead {
  font-size: 1.06rem;
  color: var(--muted);
}

.subtitle {
  font-family: var(--serif);
  font-size: 1.08rem;
  color: var(--accent);
  margin: 0 0 1.4rem;
}

.note {
  font-size: 0.9rem;
  color: var(--muted);
}

/* --------------------------------------------------------------- entête --- */

.hero {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.hero-text { flex: 1 1 20rem; min-width: 0; }

.hero img {
  width: 150px;
  height: 150px;
  object-fit: cover;
  object-position: center top;
  border-radius: 3px;
  flex: none;
  border: 1px solid var(--line);
}

@media (max-width: 34rem) {
  .hero { flex-direction: column-reverse; gap: 1.25rem; }
  .hero img { width: 120px; height: 120px; }
  h1 { font-size: 1.7rem; }
  body { font-size: 16px; }
}

/* --------------------------------------------------------------- listes --- */

ul.plain, ul.refs {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

ul.plain li {
  padding-left: 1.1rem;
  position: relative;
  margin-bottom: 0.45rem;
}

ul.plain li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--muted);
}

/* Listes de publications : référence en marge sur grand écran. */
ul.refs li {
  position: relative;
  padding-left: 4.2rem;
  margin-bottom: 0.85rem;
  font-size: 0.95rem;
}

ul.refs .ref {
  position: absolute;
  left: 0;
  top: 0.1rem;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--accent-bg);
  border-radius: 3px;
  padding: 0.1rem 0.4rem;
}

@media (max-width: 34rem) {
  ul.refs li { padding-left: 0; }
  ul.refs .ref { position: static; display: inline-block; margin-right: 0.4rem; }
}

/* Listes à libellé long (projets, encadrement) : titre au-dessus du texte. */
ul.entries {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

ul.entries li {
  margin-bottom: 1.15rem;
  padding-left: 0.9rem;
  border-left: 2px solid var(--line);
  font-size: 0.95rem;
}

ul.entries .lbl {
  display: block;
  font-weight: 600;
  color: var(--accent);
  font-size: 0.9rem;
  margin-bottom: 0.1rem;
}

/* ------------------------------------------------------------ définitions -- */

dl.facts {
  margin: 0 0 1rem;
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 0.3rem 1rem;
}

dl.facts dt {
  color: var(--muted);
  font-size: 0.9rem;
}

dl.facts dd { margin: 0; }

@media (max-width: 34rem) {
  dl.facts { grid-template-columns: 1fr; gap: 0 0; }
  dl.facts dt { margin-top: 0.7rem; }
}

/* --------------------------------------------------------------- blocs ---- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.1rem 1.25rem;
  margin: 1.25rem 0;
}

.card h3 { margin-top: 0; }
.card :last-child { margin-bottom: 0; }

/* Fiche avec visuel à gauche (couverture de livre, etc.) */
.card-media {
  display: flex;
  gap: 1.35rem;
  align-items: flex-start;
}

/* Fond clair conservé quel que soit le thème : une couverture de livre
   se lit mal détourée sur fond sombre. */
.card-media .media-img {
  flex: none;
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.4rem;
  line-height: 0;
}

.card-media .media-img img {
  display: block;
  width: 112px;
  height: auto;
}

.card-media .media-body { min-width: 0; }
.card-media .media-body > :last-child { margin-bottom: 0; }

@media (max-width: 34rem) {
  .card-media { flex-direction: column; gap: 1rem; }
  .card-media .media-img { align-self: flex-start; }
}

/* Chiffres clés */
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem;
  margin: 1.75rem 0;
  padding: 1.1rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stats div { flex: 0 0 auto; }

.stats b {
  display: block;
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.1;
}

.stats span {
  font-size: 0.82rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Entrée datée (projets, enseignement, exposés) */
.entry {
  margin-bottom: 1.35rem;
  padding-left: 0.9rem;
  border-left: 2px solid var(--line);
}

.entry .when {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.15rem;
}

.entry .what { font-weight: 600; }
.entry p { margin: 0.2rem 0 0; font-size: 0.95rem; }

/* Bouton discret */
.btn {
  display: inline-block;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 4px;
  padding: 0.5rem 0.95rem;
  font-size: 0.92rem;
  text-decoration: none;
  margin: 0.25rem 0.4rem 0.25rem 0;
}

.btn:hover { border-color: var(--accent); color: var(--accent); }

/* Repli/dépli natif pour les longues listes */
details {
  border-top: 1px solid var(--line);
  padding-top: 0.9rem;
  margin-top: 1.25rem;
}

details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent);
  font-size: 0.95rem;
  list-style: none;
}

details summary::-webkit-details-marker { display: none; }
details summary::before { content: "▸ "; }
details[open] summary::before { content: "▾ "; }
details summary:hover { text-decoration: underline; }
details > *:not(summary) { margin-top: 1rem; }

/* ---------------------------------------------------------------- pied ---- */

.site-foot {
  border-top: 1px solid var(--line);
  margin-top: 3.5rem;
  padding: 1.4rem 0 2.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.site-foot a { color: var(--muted); }
.site-foot a:hover { color: var(--accent); }
