/* =========================================================
   Feuille de style — l'esprit du gabarit « 08 » (rouge, encadrés gris),
   en plus léger : le rouge devient une couleur d'accent.
   Pour changer l'allure du site, modifiez les variables ci-dessous.
   ========================================================= */

:root {
  --rouge: #E03131;        /* accent : titres, menu actif, filets */
  --rouge-lien: #B42318;   /* liens (plus foncé, plus lisible)    */
  --rouge-pale: #FBE4E4;
  --encre: #23263A;        /* texte                               */
  --ardoise: #474C64;      /* texte secondaire, nom               */
  --discret: #7D8296;
  --fond: #FFFFFF;
  --postit: #F6F6F7;       /* fond des encadrés                   */
  --filet: #E3E3E8;
  --puce: #FFFFFF;
  --largeur: 1000px;

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

/* Mode sombre : suit automatiquement le réglage du visiteur */
@media (prefers-color-scheme: dark) {
  :root {
    --rouge: #FF6B6B;
    --rouge-lien: #FF8A80;
    --rouge-pale: #3A2326;
    --encre: #E6E7EC;
    --ardoise: #C3C6D4;
    --discret: #8D92A6;
    --fond: #16171D;
    --postit: #1F2028;
    --filet: #2E3040;
    --puce: #272935;
  }
  #entete::after { opacity: .55; }
  .photo, .logo-institut { filter: brightness(.92); }
}

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

body {
  margin: 0;
  padding: 28px 16px 40px;
  background: var(--fond);
  color: var(--encre);
  font: 17px/1.6 var(--serif);
}

a { color: var(--rouge-lien); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover, a:focus { color: var(--rouge); }

#global { max-width: var(--largeur); margin: 0 auto; }

/* --- En-tête : photo, nom, poste, liens + motif de courbe ----------- */
#entete {
  position: relative;
  display: flex; align-items: center; gap: 20px;
  padding-bottom: 18px;
}
#entete::after {                      /* courbe algébrique décorative */
  content: ""; position: absolute; right: 0; top: -8px;
  width: 360px; height: 120px;
  background: url(courbe.svg) no-repeat right center / contain;
  pointer-events: none; z-index: -1; opacity: .75;
}
#entete .photo {
  flex: none; width: 84px; height: 104px; object-fit: cover;
  border-radius: 4px; background: var(--postit);
}
#entete h1 {
  margin: 0; font: 700 2.1rem/1.15 var(--sans); letter-spacing: -.015em;
}
#entete h1 a { color: var(--encre); text-decoration: none; }
#entete .sous-titre { margin: 4px 0 8px; font-family: var(--sans); font-size: .95rem; color: var(--discret); }

.liens { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; font-family: var(--sans); }
.liens li { margin: 0; }
.liens a {
  display: inline-block; padding: 1px 10px; font-size: .8rem;
  color: var(--ardoise); text-decoration: none;
  border: 1px solid var(--filet); border-radius: 999px; background: var(--fond);
}
.liens a:hover { color: var(--rouge); border-color: var(--rouge); }

/* --- Menu : fond clair, filet rouge, page courante soulignée -------- */
#navigation { border-top: 1px solid var(--filet); border-bottom: 2px solid var(--rouge); font-family: var(--sans); }
#navigation ul { display: flex; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
#navigation li { margin: 0; }
#navigation li:not(.droite) + li.droite { margin-left: auto; }
#navigation a {
  display: block; padding: 9px 14px 7px;
  color: var(--ardoise); text-decoration: none; font-size: .95rem;
  border-bottom: 3px solid transparent; margin-bottom: -2px;
}
#navigation a:hover, #navigation a:focus { color: var(--rouge); }
#navigation li.actif a { color: var(--rouge); border-bottom-color: var(--rouge); font-weight: 600; }
#navigation li.droite a { font-size: .85rem; color: var(--discret); }
#navigation li.droite a::after { content: " ↗"; font-size: .8em; }

/* --- Colonnes ------------------------------------------------------- */
#centre { margin-top: 24px; }
#centre.avec-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 28px; align-items: start; }
#principal > * + * { margin-top: 18px; }
.intro > * + * { margin-top: 18px; }

/* --- Encadrés (« postit ») ---------------------------------------- */
.postit {
  background: var(--postit);
  padding: 16px 20px;
  border-left: 3px solid var(--rouge);
  overflow-wrap: anywhere;
}
.postit > :first-child, #secondaire > :first-child { margin-top: 0; }
.postit > :last-child { margin-bottom: 0; }

h2, h3, h4 { font-family: var(--sans); line-height: 1.3; }
.postit h2 {
  display: flex; align-items: baseline; gap: 10px;
  margin: 0 0 12px; font-size: 1.12rem; color: var(--rouge);
}
.postit h3 { font-size: .98rem; color: var(--rouge); margin: 18px 0 6px; }
.nb {
  font-size: .75rem; font-weight: 600; color: var(--discret);
  padding: 0 8px; border: 1px solid var(--filet); border-radius: 999px; background: var(--puce);
}

/* --- Colonne de droite -------------------------------------------- */
#secondaire { font-family: var(--sans); font-size: .9rem; padding-top: 4px; }
#secondaire h3 { font-size: .9rem; margin: 22px 0 8px; }
#secondaire h3 a { color: var(--ardoise); text-decoration: none; }
#secondaire h3 a:hover { color: var(--rouge); }
#secondaire p { margin: 0; }
#secondaire img {
  max-width: 100%; height: auto; vertical-align: middle;
  filter: grayscale(1); opacity: .75; transition: filter .2s, opacity .2s;
}
#secondaire img:hover { filter: none; opacity: 1; }
#secondaire .logos { display: flex; align-items: center; gap: 12px; }
#secondaire > h3 + p { padding-bottom: 18px; border-bottom: 1px solid var(--filet); }
#secondaire > h3:first-child { margin-top: 0; }

/* --- Éléments courants -------------------------------------------- */
ul, ol { padding-left: 1.3em; }
li { margin: 4px 0; }
img { max-width: 100%; height: auto; }
code { font-size: .88em; background: var(--filet); padding: 1px 4px; border-radius: 3px; }
pre { background: var(--filet); padding: 10px 12px; overflow-x: auto; }
pre code { background: none; padding: 0; }
blockquote { margin: 0; padding-left: 14px; border-left: 3px solid var(--rouge); color: var(--ardoise); }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--filet); vertical-align: top; }

.colonnes ul { columns: 2; column-gap: 32px; margin: 0; }
.colonnes li { break-inside: avoid; }

/* --- Carte d'identité (accueil) ------------------------------------ */
.carte-contact {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--filet);
}
.carte-infos {
  display: grid; grid-template-columns: max-content 1fr; gap: 3px 16px; margin: 0;
  font-family: var(--sans); font-size: .88rem;
}
.carte-infos dt { color: var(--rouge); }
.carte-infos dd { margin: 0; color: var(--ardoise); }
.logo-institut { flex: none; max-width: 100px; height: auto; }

.motscles { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 6px 0 0; font-family: var(--sans); }
.motscles li { margin: 0; padding: 2px 10px; background: var(--puce); border: 1px solid var(--filet); border-radius: 999px; font-size: .85rem; color: var(--ardoise); }

/* --- Publications HAL --------------------------------------------- */
.hal-annee { margin: 18px 0 6px; font-size: .9rem; color: var(--discret); font-weight: 600; letter-spacing: .03em; }
.hal-annee:first-child { margin-top: 0; }
.hal-liste { margin: 0; padding: 0; list-style: none; }
.hal-liste li { margin: 0 0 10px; padding-left: 1.1em; text-indent: -1.1em; font-size: .97rem; line-height: 1.5; }
.hal-liste li::before { content: "▸"; color: var(--rouge); display: inline-block; width: 1.1em; text-indent: 0; font-size: .85em; }
.hal-auteurs { color: var(--ardoise); }
.hal-auteurs b {
  font-weight: normal; color: var(--encre);
  text-decoration: underline; text-decoration-color: var(--rouge);
  text-decoration-thickness: 2px; text-underline-offset: 3px;
}
.hal-titre { font-weight: 600; color: var(--encre); }
.hal-lieu { color: var(--ardoise); }
.hal-liens { white-space: nowrap; }
.hal-liens a {
  display: inline-block; margin: 0 4px 0 0; padding: 0 6px; text-indent: 0;
  font: 600 .7rem/1.7 var(--sans); letter-spacing: .03em; text-decoration: none;
  color: var(--rouge-lien); background: var(--rouge-pale); border-radius: 3px;
}
.hal-liens a:hover { background: var(--rouge); color: #FFF; }
.hal-vide { color: var(--discret); }

/* --- Pied de page ------------------------------------------------- */
#pied { margin-top: 36px; padding-top: 12px; border-top: 1px solid var(--filet); font: .8rem var(--sans); color: var(--discret); }
#pied a { color: inherit; }

/* --- Petits écrans ------------------------------------------------- */
@media (max-width: 760px) {
  body { padding-top: 18px; font-size: 16px; }
  #entete { gap: 14px; align-items: flex-start; }
  #entete::after { display: none; }
  #entete .photo { width: 64px; height: 80px; }
  #entete h1 { font-size: 1.6rem; }
  #centre.avec-sidebar { grid-template-columns: 1fr; }
  #navigation li:not(.droite) + li.droite { margin-left: 0; }
  #navigation a { padding: 8px 10px 6px; }
  .colonnes ul { columns: 1; }
  .carte-contact { flex-direction: column; }
  .postit { padding: 14px 16px; }
}

@media print {
  #navigation, #secondaire, #entete::after { display: none; }
  .postit { background: none; padding: 0; border: 0; }
}
