/* ── RESET & VARIABLES ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #fafaf8;
  --text: #1a1a18;
  --muted: #6b6b65;
  --accent: #c8401a;
  --border: #d4d2cc;
  --serif: 'Georgia', 'Palatino Linotype', serif;
  --mono: ui-monospace, 'Cascadia Code', 'Menlo', 'Consolas', monospace;
  --w: 740px;
  --pad: 2rem;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

/* ── LAYOUT ── */
header { border-bottom: 1px solid var(--border); background: var(--bg); }

nav {
  max-width: var(--w); margin: 0 auto; padding: 0 var(--pad);
  display: flex; align-items: stretch; justify-content: space-between; gap: 2rem;
}

nav a { position: relative; display: flex; align-items: center; padding: .9rem 0; transition: color .15s, opacity .15s; }
nav a:not([aria-current]) { opacity: .65; }
nav a:hover, nav a:focus-visible { opacity: 1; }
nav a[aria-current]::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--text);
}

.nav-logo { font-family: var(--mono); font-size: .85rem; font-weight: 500; text-decoration: none; letter-spacing: .02em; }
.nav-logo:hover { color: var(--accent); }

.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links li { display: flex; }
.nav-links a { font-family: var(--mono); font-size: .8rem; text-decoration: none; letter-spacing: .03em; }
.nav-links a:hover { color: var(--accent); }

main { max-width: var(--w); margin: 0 auto; padding: 0 var(--pad); }

section { padding: 3.5rem 0; border-bottom: 1px solid var(--border); }
section:last-child { border-bottom: none; }
.listing-section { padding-top: 3rem; }

footer {
  border-top: 1px solid var(--border);
  width: 100%; padding: 1.5rem max(var(--pad), calc((100% - var(--w)) / 2 + var(--pad)));
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono); font-size: .72rem; color: var(--muted);
}
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--text); }

/* ── TYPOGRAPHIE GLOBALE ── */
.page-heading {
  font-family: var(--serif);
  font-size: 2.2rem;
  font-weight: 700;
  font-style: normal;
  line-height: 1.35;
  letter-spacing: 0;
}
@media screen and (max-width: 600px) {
  .page-heading { font-size: 1.6rem; }
}

h2, .content-body .section-heading {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 700;
  font-style: normal;
  line-height: 1.4;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
}
h2 { margin-bottom: 2rem; }
h3 { font-size: 1.05rem; font-weight: 400; line-height: 1.5; margin-bottom: .3rem; }
h3 a { text-decoration: none; }
h3 a:hover { text-decoration: underline; color: var(--accent); }

.label { font-family: var(--mono); font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: 2rem 0 1rem; }
.intro { font-size: 1rem; line-height: 1.75; margin-bottom: 2rem; }

/* ── ACCUEIL ── */
.section-cta {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  font-family: var(--mono);
  font-size: .9rem;
  font-weight: 700;
  text-align: right;
  text-decoration: none;
}
.section-cta:hover { text-decoration: underline; }
.section-cta span[aria-hidden] { flex-shrink: 0; font-weight: 400; }
.section-cta:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.hero { padding: 3rem 0; border-bottom: 1px solid var(--border); }
.hero h1 { margin-bottom: 1.8rem; max-width: 600px; }
.hero p { font-size: 1rem; line-height: 1.75; max-width: 620px; }
.hero p + p { margin-top: 1rem; }
.hero .hero__tagline { font-size: 1.05rem; line-height: 1.7; margin: 1.7em 0; }

.pub-list { list-style: none; }
.pub-item { padding: 1.1rem 0; border-top: 1px solid var(--border); }
.pub-item h4 { font-size: .7rem; font-weight: 400; line-height: 1.55; margin-bottom: .3rem; }
.pub-item h4 a { text-decoration: none; }
.pub-item h4 a:hover { text-decoration: underline; color: var(--accent); }
.pub-source { font-family: var(--mono); font-size: .6rem; color: var(--muted); }
.pub-source em { font-style: normal; }

.simple-list { list-style: none; }
.simple-list li { padding: .8rem 0; border-top: 1px solid var(--border); font-family: var(--mono); font-size: .8rem; color: var(--muted); }

/* ── CARTES (articles + projets partagent les mêmes classes) ── */
.content-list { list-style: none; padding: 2.5rem 0 0; }

.card {
  display: grid; grid-template-columns: 160px 1fr; gap: 1.6rem;
  padding: 2rem 0; border-top: 1px solid var(--border);
  text-decoration: none; color: inherit; cursor: pointer;
}
.card--text-only { grid-template-columns: 1fr; }
.card:hover .card__title { color: var(--accent); }

.card__img { width: 160px; height: 110px; object-fit: cover; display: block; filter: grayscale(20%); transition: filter .2s; }
.card:hover .card__img { filter: grayscale(0%); }

.card__body { display: flex; flex-direction: column; justify-content: center; gap: .4rem; }

.card__meta { font-family: var(--mono); font-size: .65rem; color: var(--muted); letter-spacing: .04em; display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.card__meta span + span::before { content: "·"; margin-right: .6rem; }

.card__title { font-family: var(--serif); font-size: 1rem; font-weight: 400; line-height: 1.45; transition: color .15s; }
.card__excerpt { font-size: .85rem; color: var(--muted); line-height: 1.6; margin-top: .2rem; }

/* ── FILTRES PROJETS ── */
.research-publications { padding: 3.5rem 0; overflow-wrap: anywhere; }
.research-publications .subsection-heading { margin-top: 0; }
.research-publications .pub-item { padding: .8rem 0; }
.research-publications .pub-item h3 { font-size: .7rem; line-height: 1.5; }
.research-publications .pub-source { font-size: .6rem; line-height: 1.5; }

@media screen and (min-width: 1280px) {
  .research-page {
    display: grid;
    grid-template-columns: 100% min(320px, calc(50vw - 394px));
    gap: 1.5rem;
    align-items: start;
  }
  .research-content { min-width: 0; }
  .research-publications { padding-top: 4.75rem; }
  .home-page { row-gap: 0; }
  .home-page > .hero { grid-column: 1; }
  .home-page > .research-content { grid-column: 1; grid-row: 2; }
  .home-page > .research-publications {
    grid-column: 2;
    grid-row: 2;
    padding-top: 3.5rem;
  }
}

.filters { display: flex; gap: .8rem; flex-wrap: wrap; margin-bottom: .5rem; }
.filter-btn { font-family: var(--mono); font-size: .68rem; letter-spacing: .04em; color: var(--muted); background: none; border: 1px solid var(--border); padding: .25rem .7rem; cursor: pointer; transition: color .15s, border-color .15s; }
.filter-btn:hover, .filter-btn.active { color: var(--text); border-color: var(--text); }

/* ── PAGE CONTENU (article + projet partagent les mêmes classes) ── */
.content-back { font-family: var(--mono); font-size: .72rem; color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; margin-bottom: 2rem; padding-top: 2rem; }
.content-back:hover { color: var(--accent); }

.content-header { padding: 3rem 0 2.5rem; }

.hero-img { width: 100%; max-height: none; object-fit: cover; display: block; margin-bottom: 2rem; filter: grayscale(15%); }

.content-header__meta { font-family: var(--mono); font-size: .68rem; color: var(--muted); letter-spacing: .04em; display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1.2rem; }
.content-header__meta span + span::before { content: "·"; margin-right: .6rem; }

.content-header__title { font-family: var(--serif); font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 300; font-style: normal; line-height: 1.3; letter-spacing: -.01em; max-width: 600px; margin-bottom: 1.2rem; }

.content-body { padding: 2.5rem 0 3rem; }
.content-body p { font-size: 1rem; line-height: 1.8; margin-bottom: 1.4rem; max-width: 640px; }
.content-body img { width: 100%; max-width: 640px; display: block; margin: 1.8rem 0; }
.content-body .section-heading { margin: 2.8rem 0 1rem; }
.subsection-heading { font-family: var(--mono); font-size: .75rem; font-weight: 500; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 2rem 0 .8rem; }
.content-body blockquote { border-left: 2px solid var(--accent); padding-left: 1.2rem; margin: 2rem 0; font-style: italic; font-size: 1rem; color: var(--muted); line-height: 1.7; }

/* ── FICHE PROJET ── */
.fiche { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; border-top: 1px solid var(--border); margin-top: 1.5rem; }
.fiche__item { padding: .8rem 0; border-bottom: 1px solid var(--border); }
.fiche__item:nth-child(odd) { padding-right: 2rem; border-right: 1px solid var(--border); }
.fiche__item:nth-child(even) { padding-left: 2rem; }
.fiche__label { font-family: var(--mono); font-size: .62rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .2rem; }
.fiche__value { font-family: var(--serif); font-size: .92rem; }

/* ── ENCADRÉS (callouts dans le corps d'un article) ── */
.encadre { border-left: 2px solid var(--accent); background: rgba(200,64,26,.04); padding: 1.4rem 1.6rem; margin: 2.2rem 0; max-width: 640px; }
.encadre__title { font-family: var(--mono); font-size: .68rem; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin-bottom: .8rem; }
.encadre p { font-size: .92rem; line-height: 1.7; max-width: 100%; margin-bottom: 0; }
.encadre p + p { margin-top: 1rem; }

/* ── FIGURES ── */
.content-body figure { margin: 2.2rem 0; max-width: 640px; }
.figure-pdf { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; border: 0; }
.figure-pdf-link { display: inline-block; margin-top: .6rem; font-family: var(--mono); font-size: .72rem; }
.content-body figcaption { font-family: var(--mono); font-size: .7rem; color: var(--muted); line-height: 1.6; margin-top: .8rem; }

/* Notes des articles */
.content-body .footnotes ol { font-size: .85rem; line-height: 1.6; }

@media screen and (min-width: 1200px) {
  .content-body {
    --sidenotes-enabled: 1;
    position: relative;
  }
  .sidenote {
    position: absolute;
    left: calc(100% + 1.5rem);
    width: min(320px, calc(50vw - 394px));
    font-size: .85rem;
    line-height: 1.6;
    overflow-wrap: anywhere;
  }
  .sidenote ol { padding-left: 1.2rem; }
  .sidenote li:target { outline: 1px solid var(--border); outline-offset: 4px; }
}

/* Bibliographie et citations */
.citation { text-decoration-style: dotted; }
.citation:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.content-body .bibliography {
  max-width: 640px;
  margin-top: 3rem;
  padding: 2rem 0 0;
  border-top: 1px solid var(--border);
  border-bottom: none;
}

.bibliography__list { list-style: none; padding: 0; }
.bibliography__entry {
  padding-left: 1.27cm;
  text-indent: -1.27cm;
  font-size: .92rem;
  line-height: 2;
  overflow-wrap: anywhere;
  scroll-margin-top: 2rem;
}
.bibliography__entry:target {
  background: rgba(200,64,26,.06);
  outline: 1px solid var(--border);
  outline-offset: 4px;
}
.bibliography__entry:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

@media (prefers-reduced-motion: reduce) {
  html:has(.bibliography) { scroll-behavior: auto; }
}

/* ── MENTIONS LÉGALES ── */
.mentions-page { padding: 3rem 0 4rem; }
.mentions-title { margin-bottom: 2.5rem; }
.mentions-decoration { margin-top: 1.7em; }

/* CV: styles limites a cette page. */
.cv-page { font-size: .85rem; line-height: 1.55; overflow-wrap: anywhere; }
.cv-page .cv-profile {
  position: relative;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: stretch;
  padding: 3rem 0 1.5rem;
}
.cv-portrait { position: relative; min-height: 96px; overflow: hidden; border-radius: 4px; }
.cv-profile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cv-download {
  position: absolute;
  top: 3rem;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  text-decoration: none;
}
.cv-download:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.cv-page .hero h1 { font-size: 1.8rem; margin-bottom: .6rem; padding-right: 3rem; }
.cv-page .hero p { font-size: .85rem; line-height: 1.55; margin: 0 0 .5rem; }
.cv-page .hero p:last-child { margin-bottom: 0; }
.cv-page section { padding: 1.5rem 0; }
.cv-page .cv-profile,
.cv-page section[aria-labelledby="cv-experiences"],
.cv-page section[aria-labelledby="cv-formation"],
.cv-page .cv-details section { border-bottom: none; }
.cv-page h2 { font-size: 1.2rem; color: var(--accent); margin-bottom: 1rem; }
.cv-page h3 { font-size: .9rem; line-height: 1.45; margin-bottom: .4rem; }
.cv-page .content-body p { font-size: .85rem; line-height: 1.55; margin-bottom: .5rem; }
.cv-page .pub-item { padding: .85rem 0; }
.cv-page .pub-item:first-of-type { border-top: none; padding-top: 0; }
.cv-page .pub-item:last-child { padding-bottom: 0; }
.cv-page .pub-item p:last-child { margin-bottom: 0; }
.cv-page .content-header__meta { font-size: .65rem; margin-bottom: .35rem; gap: .35rem .6rem; }
.cv-page .simple-list li { font-family: var(--serif); font-size: .85rem; padding: .4rem 0; }
.cv-page .simple-list li:first-child { border-top: none; padding-top: 0; }
.cv-page .cv-details h3 { font-size: .85rem; }
.cv-page .cv-details .content-body p { color: var(--muted); }
.cv-page section[aria-labelledby="cv-publications"] .pub-item { padding: .6rem 0; }
.cv-page section[aria-labelledby="cv-publications"] h3 { font-size: .68rem; line-height: 1.45; margin-bottom: .2rem; }
.cv-page section[aria-labelledby="cv-publications"] .pub-source { font-size: .6rem; line-height: 1.4; margin-bottom: 0; }
@media screen and (min-width: 1280px) {
  .cv-columns { display: grid; grid-template-columns: 100% min(320px, calc(50vw - 394px)); gap: 1.5rem; align-items: start; }
  .cv-history, .cv-details { min-width: 0; }
}
@media screen and (max-width: 420px) {
  .cv-page .cv-profile { grid-template-columns: 64px minmax(0, 1fr); gap: .75rem; }
  .cv-portrait { min-height: 64px; }
  .cv-page .hero h1 { font-size: 1.5rem; }
}
.mentions-block { margin-bottom: 2.5rem; }
.mentions-text { font-size: .95rem; line-height: 1.75; margin-bottom: .8rem; max-width: 620px; }
