/* =========================================================
   Feuille de style commune – CV Christophe Sabourin
   Partagée par index.html, publications.html, enseignement.html
   ========================================================= */

:root {
  --accent: #1f6fa8;
  --accent-soft: #e8f1f8;
  --text: #1f2328;
  --muted: #5f6b76;
  --line: #e2e6ea;
  --bg: #ffffff;
  --bg-alt: #f7f9fb;
  --maxw: 960px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; }
body {
  margin: 0;
  font-family: "Segoe UI", Lato, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Bilingue / Bilingual ---------- */
html[data-lang="fr"] .en { display: none !important; }
html[data-lang="en"] .fr { display: none !important; }

/* ---------- Barre de navigation ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.topbar .inner {
  max-width: var(--maxw); margin: 0 auto; padding: 10px 20px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.brand { font-weight: 600; color: var(--text); white-space: nowrap; }
.nav { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; }
.nav a { color: var(--muted); }
.nav a:hover, .nav a.current { color: var(--accent); text-decoration: none; }
.lang-switch { margin-left: auto; display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.lang-switch button {
  border: 0; background: var(--bg); color: var(--muted);
  padding: 4px 10px; font: inherit; font-size: 13px; cursor: pointer;
}
.lang-switch button[aria-pressed="true"] { background: var(--accent); color: #fff; }

/* ---------- Mise en page ---------- */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 20px 40px; }
section { padding: 34px 0 10px; border-bottom: 1px solid var(--line); }
section:last-of-type { border-bottom: 0; }
h1 { font-size: 34px; line-height: 1.2; margin: 0 0 6px; font-weight: 600; }
h2 {
  font-size: 22px; font-weight: 600; color: var(--accent);
  margin: 0 0 16px;
}
h3 { font-size: 17px; margin: 22px 0 8px; }
p { margin: 0 0 12px; }
.lead { font-size: 17px; color: var(--text); }
.muted { color: var(--muted); }

/* ---------- En-tête profil ---------- */
.hero {
  display: grid; grid-template-columns: 150px 1fr; gap: 28px; align-items: center;
  padding: 36px 0 28px; border-bottom: 1px solid var(--line);
}
.photo {
  width: 150px; height: 150px; border-radius: 50%; object-fit: cover;
  background: var(--accent-soft); display: flex; align-items: center; justify-content: center;
  font-size: 46px; font-weight: 600; color: var(--accent); overflow: hidden;
}
.photo img { width: 100%; height: 100%; object-fit: cover; }
.role { font-size: 18px; color: var(--muted); margin: 0 0 10px; }
.affil { margin: 0 0 14px; }
.links { display: flex; flex-wrap: wrap; gap: 8px; }
.links a {
  font-size: 13px; padding: 4px 11px; border: 1px solid var(--line); border-radius: 14px;
  color: var(--text); background: var(--bg-alt);
}
.links a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ---------- Chiffres clés ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin: 6px 0 22px; }
.stat { background: var(--bg-alt); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.stat b { display: block; font-size: 26px; color: var(--accent); line-height: 1.2; }
.stat span { font-size: 13px; color: var(--muted); }

/* ---------- Frise de recherche ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  position: relative; padding: 0 0 18px 26px; border-left: 2px solid var(--line); margin-left: 6px;
}
.timeline li:last-child { padding-bottom: 4px; }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: 6px;
  width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent);
}
.timeline li.now::before { background: var(--accent); }
.timeline .period { font-size: 13px; font-weight: 600; color: var(--accent); }
.timeline .topic { font-weight: 600; display: block; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tags span { font-size: 12px; background: var(--accent-soft); color: var(--accent); padding: 2px 9px; border-radius: 10px; }

/* ---------- Listes (publications, CV) ---------- */
.pubs { margin: 0; padding-left: 20px; }
.pubs li { margin-bottom: 10px; }
.pubs .t { font-weight: 600; }
.pubs .v { font-style: italic; }
.me { text-decoration: underline; }
.more { display: inline-block; margin-top: 6px; font-weight: 600; }

.cv { width: 100%; border-collapse: collapse; }
.cv td { padding: 7px 0; vertical-align: top; border-bottom: 1px solid var(--line); }
.cv tr:last-child td { border-bottom: 0; }
.cv td.when { width: 130px; color: var(--muted); white-space: nowrap; padding-right: 16px; font-size: 14px; }

table.phd { width: 100%; border-collapse: collapse; font-size: 15px; }
table.phd th, table.phd td { text-align: left; padding: 7px 10px 7px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
table.phd th { font-size: 13px; color: var(--muted); font-weight: 600; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

/* Éléments à compléter (à supprimer avant la mise en ligne) */
.todo { background: #fff3c4; border-radius: 3px; padding: 0 4px; color: #6b5300; }

/* ---------- Contact / pied de page ---------- */
.contact p { margin: 0 0 6px; }
footer {
  max-width: var(--maxw); margin: 0 auto; padding: 18px 20px 30px;
  font-size: 13px; color: var(--muted); border-top: 1px solid var(--line);
}

/* ---------- Mobile ---------- */
@media (max-width: 700px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .photo { margin: 0 auto; }
  .links { justify-content: center; }
  .two-col { grid-template-columns: 1fr; }
  /* Menu sur téléphone : une ligne défilable sous le nom */
  html { scroll-padding-top: 100px; }
  .topbar .inner { gap: 8px 12px; padding: 8px 16px; }
  .nav {
    order: 3; width: 100%; flex-wrap: nowrap; gap: 18px;
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
    padding-bottom: 2px; white-space: nowrap;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav { -webkit-mask-image: linear-gradient(to right, #000 85%, transparent); mask-image: linear-gradient(to right, #000 85%, transparent); padding-right: 24px; }
  .nav a { flex: 0 0 auto; }
  h1 { font-size: 28px; }
  .cv td.when { width: 95px; }
  table.phd th:nth-child(2), table.phd td:nth-child(2) { display: none; }
}

/* ---------- Impression / PDF ---------- */
@media print {
  @page { margin: 14mm 14mm 16mm; }
  body { font-size: 10.5pt; line-height: 1.45; }
  .topbar, .no-print, .more { display: none !important; }
  main { padding: 0; max-width: none; }
  section { padding: 12px 0 4px; break-inside: auto; }
  h2 { font-size: 14pt; margin-bottom: 8px; break-after: avoid; }
  h3 { break-after: avoid; }
  .hero { padding: 0 0 12px; grid-template-columns: 90px 1fr; gap: 18px; }
  .photo { width: 90px; height: 90px; font-size: 28px; }
  h1 { font-size: 20pt; }
  .stat b { font-size: 16pt; }
  .stats { gap: 6px; margin-bottom: 10px; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); grid-auto-flow: column; width: 98%; }
  .stat { padding: 6px 8px; }
  .timeline li { padding-right: 4px; }
  .links a { border: 0; padding: 0 8px 0 0; background: none; }
  .timeline li, .pubs li, .cv tr, table.phd tr { break-inside: avoid; }
  a { color: var(--text); }
  .todo { background: none; color: inherit; }
  footer { border: 0; padding: 8px 0 0; }
}

/* =========================================================
   Page Publications : filtres et liste
   ========================================================= */
.page-head { padding: 34px 0 10px; }
.page-head p { color: var(--muted); }
.filters {
  position: sticky; top: 49px; z-index: 5; background: var(--bg);
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.type-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.type-btns button {
  border: 1px solid var(--line); background: var(--bg-alt); color: var(--text);
  border-radius: 16px; padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer;
}
.type-btns button:hover { border-color: var(--accent); }
.type-btns button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.type-btns .n { opacity: .75; margin-left: 4px; }
.filters .right { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.filters select, .filters input[type=search] {
  font: inherit; font-size: 13px; padding: 5px 8px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text);
}
.filters input[type=search] { width: 210px; }
.status { color: var(--muted); font-size: 13px; margin: 10px 0 0; }
.year-block h3 {
  color: var(--accent); font-weight: 400; font-size: 22px;
  margin: 22px 0 4px; padding-bottom: 2px; border-bottom: 1px solid var(--line);
}
.publist { list-style: none; margin: 0; padding: 0; }
.publist li { padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.publist li:last-child { border-bottom: 0; }
.ptag {
  display: inline-block; font-size: 11px; letter-spacing: .02em; min-width: 54px; text-align: center;
  padding: 1px 7px; border-radius: 10px; margin-right: 6px; vertical-align: 1px;
  background: var(--bg-alt); color: var(--muted); border: 1px solid var(--line);
}
.ptag.J { background: var(--accent-soft); color: var(--accent); border-color: #cfe0ee; }
.publist .t { font-weight: 600; }
.publist .v { font-style: italic; }
.empty { color: var(--muted); padding: 24px 0; }
@media (max-width: 700px) {
  .filters { position: static; }
  .filters .right { margin-left: 0; width: 100%; }
  .filters input[type=search] { flex: 1; }
}
@media print {
  .filters { display: none; }
  .publist li { break-inside: avoid; font-size: 9.5pt; padding: 3px 0; }
  .year-block h3 { font-size: 12pt; margin: 10px 0 2px; }
}

/* Sous-titre des étapes de recherche */
.timeline .q { display: block; font-style: italic; color: var(--muted); font-size: 14px; margin-bottom: 2px; }

/* Liens DOI / HAL sur la page Publications */
.plink {
  display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .03em;
  padding: 0 6px; margin-left: 4px; border: 1px solid var(--line); border-radius: 4px;
  color: var(--accent); vertical-align: 1px;
}
.plink:hover { border-color: var(--accent); text-decoration: none; }
@media print { .plink { display: none; } }

/* Vignettes vidéo de la frise de recherche */
.video {
  display: inline-flex; align-items: center; gap: 12px; margin-top: 10px;
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px 6px 6px;
  color: var(--text); background: var(--bg-alt); font-size: 14px;
}
.video:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.video img { width: 160px; height: 90px; object-fit: cover; border-radius: 5px; display: block; }
@media print { .video { display: none; } }
