:root {
  --ink: #1c1917;
  --paper: #faf7f2;
  --cream: #f0ebe0;
  --accent: #7c2d12;
  --accent-light: #c2410c;
  --muted: #78716c;
  --border: #e2dbd0;
  --white: #ffffff;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1.1rem;
  line-height: 1.75;
  min-height: 100vh;
}

/* ── Language bar ── */
.lang-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: var(--ink);
  display: flex;
  justify-content: flex-end;
  padding: 0.5rem 2rem;
  gap: 0.25rem;
}

.lang-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.3rem 0.75rem;
  border: 1px solid rgba(255,255,255,0.3);
  background: transparent;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  transition: all 0.2s;
}

.lang-btn.active, .lang-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* ── Page ── */
.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 5rem 2rem 4rem;
}

/* ── Header ── */
header {
  margin-bottom: 0.5rem;
  display: grid;
  grid-template-columns: 140px 1fr 180px;
  gap: 2.5rem;
  align-items: start;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  animation: fadeUp 0.7s ease both;
}

.photo-wrap img {
  width: 140px;
  height: 168px;
  object-fit: cover;
  object-position: top center;
  display: block;
  border: 1px solid var(--border);
}

.kicker {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

h1 {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin-bottom: 0.75rem;
}

h1 em { font-style: italic; color: var(--accent); }

.header-details { font-size: 0.95rem; color: var(--muted); line-height: 1.6; }
.header-details a { color: var(--accent-light); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color 0.2s; }
.header-details a:hover { border-bottom-color: currentColor; }

.ids { margin-top: 0.75rem; display: flex; flex-wrap: wrap; gap: 0.4rem; }

.id-badge {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.6rem;
  background: var(--cream);
  border: 1px solid var(--border);
  color: var(--muted);
  text-decoration: none;
  transition: background 0.2s;
}

.id-badge:hover { background: var(--border); }

/* ── Sections ── */
section {
  margin-bottom: 2.75rem;
  animation: fadeUp 0.7s ease both;
}

section:nth-child(2) { animation-delay: 0.08s; }
section:nth-child(3) { animation-delay: 0.14s; }
section:nth-child(4) { animation-delay: 0.20s; }
section:nth-child(5) { animation-delay: 0.26s; }

.section-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }

.section-head h2 {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.section-head::after { content: ''; flex: 1; height: 1px; background: var(--border); }

p { margin-bottom: 0.9rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent-light); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color 0.2s; }
a:hover { border-bottom-color: currentColor; }

/* ── Publications ── */
.pub-list { list-style: none; }

.pub-item {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 1rem;
  line-height: 1.5;
}

.pub-item:last-child { border-bottom: none; }

.pub-section-header {
  margin-bottom: 0.5rem;
  grid-template-columns: 1fr;
  border-bottom: none;
  padding-top: 1.5rem;
}

.pub-section-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.pub-year {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.72rem;
  color: var(--muted);
  padding-top: 0.15rem;
}

.pub-title { font-style: italic; }
.pub-info { color: var(--muted); font-size: 0.88rem; }

.pub-type {
  display: inline-block;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  padding: 0.1rem 0.4rem;
  background: var(--cream);
  border: 1px solid var(--border);
  color: var(--muted);
  margin-top: 0.3rem;
}

.hal-updated {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

/* ── Newsletter ── */
.newsletter-card {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 2rem 2.5rem;
  position: relative;
}

.newsletter-card::after {
  content: '';
  position: absolute;
  inset: 5px -5px -5px 5px;
  border: 1px solid var(--border);
  z-index: -1;
}

.nl-intro { font-size: 1rem; font-style: italic; color: var(--muted); margin-bottom: 1.5rem; }

.listmonk-form .fields { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1rem; }

.listmonk-form input[type="email"],
.listmonk-form input[type="text"] {
  flex: 1;
  min-width: 180px;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border);
  background: var(--paper);
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}

.listmonk-form input:focus { border-color: var(--accent); }
.listmonk-form input::placeholder { color: var(--muted); }
.listmonk-form .hidden-list { display: none; }

.listmonk-form input[type="submit"] {
  padding: 0.6rem 2rem;
  background: var(--accent);
  color: white;
  border: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.listmonk-form input[type="submit"]:hover { background: var(--accent-light); }
.listmonk-form input[type="submit"]:active { transform: translateY(1px); }

/* ── Footer ── */
footer {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
}

/* ── Animation ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Mobile ── */
@media (max-width: 580px) {
  header {
  margin-bottom: 0.5rem; grid-template-columns: 1fr; gap: 1.5rem; }
  .photo-wrap img { width: 110px; height: 132px; }
  .page { padding: 4.5rem 1.25rem 3rem; }
  .newsletter-card { padding: 1.5rem; }
  .listmonk-form .fields { flex-direction: column; }
}

/* ── Publications deux colonnes ── */
.pub-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.75rem;
}

.pub-columns .pub-col > section {
  margin-bottom: 0;
}

.pub-columns .pub-item {
  grid-template-columns: 2.8rem 1fr;
  gap: 0.5rem;
  padding: 0.5rem 0;
  font-size: 0.92rem;
  line-height: 1.4;
}

.pub-columns .pub-info {
  font-size: 0.8rem;
}

.pub-columns .pub-year {
  font-size: 0.68rem;
}

.pub-columns .pub-type {
  font-size: 0.55rem;
}

.pub-columns .hal-updated {
  font-size: 0.7rem;
}

@media (max-width: 768px) {
  .pub-columns {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* ── Fix espacement flux ── */
.feed-item {
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: 0.75rem;
}

.feed-text {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  line-height: 1.4;
}

/* ── Carrousel de couvertures ── */
.carousel-wrap {
  position: relative;
  width: 180px;
}

.carousel {
  width: 180px;
  height: 260px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--white);
}

.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-img {
  min-width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}

.carousel-nav {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.carousel-btn {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1.4rem;
  line-height: 1;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

@media (max-width: 768px) {
  header {
  margin-bottom: 0.5rem;
    grid-template-columns: 110px 1fr;
  }
  .carousel-wrap {
    grid-column: 1 / -1;
    width: 160px;
    margin: 0 auto;
  }
  .carousel {
    width: 160px;
    height: 230px;
  }
}

/* ── Google Scholar ── */
.scholar-wrap {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 1.5rem 2rem;
}

.scholar-metrics {
  display: flex;
  gap: 2.5rem;
  margin-bottom: 1.25rem;
}

.scholar-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.scholar-number {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 2rem;
  font-weight: 500;
  color: var(--accent);
  line-height: 1.1;
}

.scholar-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.25rem;
}

.scholar-chart {
  margin-bottom: 1rem;
}

.scholar-updated {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.7rem;
  color: var(--muted);
}

/* ── Google Scholar ── */
.scholar-wrap {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 1.5rem 2rem;
}

.scholar-metrics {
  display: flex;
  gap: 2.5rem;
  margin-bottom: 1.25rem;
}

.scholar-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.scholar-number {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 2rem;
  font-weight: 500;
  color: var(--accent);
  line-height: 1.1;
}

.scholar-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.25rem;
}

.scholar-chart {
  margin-bottom: 1rem;
}

.scholar-updated {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.7rem;
  color: var(--muted);
}

.scholar-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  position: relative;
}

.scholar-bar {
  width: 100%;
  background: var(--cream);
  border-top: 2px solid var(--accent);
  min-height: 2px;
  transition: height 0.3s;
}

.scholar-bar-col:nth-last-child(-n+3) .scholar-bar {
  background: var(--accent);
  border-top: none;
}

.scholar-bar-value {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.55rem;
  color: var(--muted);
  margin-bottom: 2px;
  display: none;
}

.scholar-bar-col:hover .scholar-bar-value {
  display: block;
}

.scholar-bar-year {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.5rem;
  color: var(--muted);
  position: absolute;
  bottom: -1.2rem;
  white-space: nowrap;
}

.scholar-bar-col:nth-child(odd) .scholar-bar-year {
  display: none;
}

/* ── Scholar barres ── */
.scholar-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 110px;
  margin-bottom: 1.5rem;
}

.scholar-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}

.scholar-bar {
  width: 100%;
  background: var(--cream);
  min-height: 2px;
}

.scholar-bar-recent {
  background: var(--accent);
}

.scholar-bar-value {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.55rem;
  color: var(--muted);
  margin-bottom: 2px;
}

.scholar-bar-year {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.5rem;
  color: var(--muted);
  margin-top: 3px;
}

/* ── Badges avec icônes ── */
.id-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.id-badge svg {
  flex-shrink: 0;
}

/* ── Formulaire newsletter compact ── */
.newsletter-card {
  padding: 1.25rem 1.75rem !important;
  max-width: 650px;
}

.nl-intro {
  margin-bottom: 1rem !important;
  font-size: 0.95rem !important;
}

.listmonk-form .fields {
  margin-bottom: 0 !important;
  align-items: center;
}

.listmonk-form input[type="submit"] {
  margin-top: 0 !important;
  flex-shrink: 0;
}

.listmonk-form input[type="email"],
.listmonk-form input[type="text"] {
  padding: 0.5rem 0.75rem !important;
}

/* Réduire espace entre header et newsletter */
header + section {
  margin-top: 0.5rem;
}

/* Réduire espace au-dessus de lettre d'information */
header {
  padding-bottom: 0.5rem !important;
  margin-bottom: 0.5rem !important;
}

header + section {
  margin-top: 0 !important;
}

section {
  margin-bottom: 2rem !important;
}

/* ── Layout supérieur : gauche (bio + newsletter) + droite (carrousel) ── */
.top-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2.5rem;
  margin-bottom: 2rem;
}

.top-left {
  min-width: 0;
}

.top-right {
  display: flex;
  justify-content: flex-start;
}

.top-layout header {
  grid-template-columns: 110px 1fr !important;
  gap: 1.5rem;
}

.top-left header {
  margin-bottom: 1.5rem !important;
}

/* Carrousel grand format */
.top-right .carousel-wrap {
  width: 320px;
  position: sticky;
  top: 2rem;
}

.top-right .carousel {
  width: 320px;
  height: 440px;
}

.top-right .carousel-btn {
  width: 2.4rem;
  height: 2.4rem;
  font-size: 1.6rem;
}

@media (max-width: 900px) {
  .top-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .top-right {
    justify-content: center;
  }
}

/* ── Fix header et présentation ── */
.top-left header {
  grid-template-columns: 90px 1fr !important;
  gap: 1rem !important;
}

.top-left header .photo-wrap img {
  width: 90px !important;
  height: 90px !important;
}

.top-left .header-details {
  font-size: 0.88rem;
  line-height: 1.5;
}

.top-left .header-text h1 {
  font-size: 2rem;
}

.top-left .kicker {
  font-size: 0.72rem;
}

.top-left .ids {
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.top-left .id-badge {
  font-size: 0.72rem;
  padding: 0.25rem 0.5rem;
}

/* La présentation occupe toute la largeur du bloc gauche */
.top-section {
  max-width: none !important;
  width: 100%;
}

.top-section p {
  max-width: none !important;
}

/* ── Fix header et présentation v2 ── */
.top-left header {
  grid-template-columns: 120px 1fr !important;
  gap: 1.5rem !important;
}

.top-left header .photo-wrap img {
  width: 120px !important;
  height: 120px !important;
}

/* La section présentation en pleine largeur */
.top-section,
.top-section > *,
.top-section p {
  max-width: 100% !important;
  width: 100%;
}

/* Si le body a un max-width qui limite tout */
section p {
  max-width: none !important;
}
