/* Thomas Hérault — personal academic website
   Shared stylesheet for all pages. */

:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-alt: #eef1f5;
  --text: #1f2733;
  --text-muted: #5b6472;
  --border: #dfe3e8;
  --accent: #2f6f8f;
  --accent-strong: #1c4a63;
  --accent-contrast: #ffffff;
  --tag-bg: #eaf2f6;
  --tag-text: #1c4a63;
  --shadow: 0 1px 3px rgba(20, 30, 45, 0.08), 0 1px 2px rgba(20, 30, 45, 0.06);
  --max-width: 920px;
  --radius: 8px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161d;
    --surface: #191f28;
    --surface-alt: #1f2630;
    --text: #e6e9ee;
    --text-muted: #9aa3b2;
    --border: #2a323e;
    --accent: #6fb3d8;
    --accent-strong: #8fc6e6;
    --accent-contrast: #0c1116;
    --tag-bg: #1d2c34;
    --tag-text: #8fc6e6;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

img { max-width: 100%; }
[hidden] { display: none !important; }

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

/* ---- language visibility ---- */
html:not([data-lang="fr"]) [lang="fr"] { display: none !important; }
html[data-lang="fr"] [lang="en"] { display: none !important; }

/* ---- layout shell ---- */
.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

header.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.header-top {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 28px 0 20px;
  flex-wrap: wrap;
}

.portrait {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  flex: none;
}

.identity h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.7rem;
  margin: 0 0 4px;
  letter-spacing: 0.2px;
}

.identity .role {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.identity .role strong { color: var(--text); font-weight: 600; }

.lang-toggle {
  margin-left: auto;
  align-self: flex-start;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.03em;
}

.lang-toggle:hover { background: var(--tag-bg); color: var(--accent-strong); }

nav.tabs {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

nav.tabs .wrap {
  display: flex;
  gap: 4px;
}

nav.tabs a {
  display: block;
  white-space: nowrap;
  padding: 12px 14px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

nav.tabs a:hover { color: var(--accent-strong); }

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

main { padding: 32px 0 60px; }

section { margin-bottom: 44px; }
section:last-child { margin-bottom: 0; }

h2 {
  font-size: 1.35rem;
  margin: 0 0 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

h3 {
  font-size: 1.08rem;
  margin: 26px 0 10px;
  color: var(--accent-strong);
}

h3:first-child { margin-top: 0; }

p { margin: 0 0 12px; }

.lede {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 68ch;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.card + .card { margin-top: 14px; }

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.translation-note {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--text-muted);
  background: var(--surface-alt);
  border-left: 3px solid var(--accent);
  padding: 8px 14px;
  border-radius: 4px;
  margin: 0 0 24px;
}

.tag {
  display: inline-block;
  background: var(--tag-bg);
  color: var(--tag-text);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  margin: 0 6px 6px 0;
  text-decoration: none;
}

a.tag:hover { background: var(--accent); color: var(--accent-contrast); }

table.timeline {
  width: 100%;
  border-collapse: collapse;
}

table.timeline td {
  padding: 8px 10px 8px 0;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

table.timeline tr:last-child td { border-bottom: none; }

table.timeline td.when {
  white-space: nowrap;
  color: var(--text-muted);
  font-size: 0.88rem;
  width: 1%;
  padding-right: 18px;
}

ul.plain, ol.plain {
  margin: 0 0 12px;
  padding-left: 20px;
}

ul.plain li, ol.plain li { margin-bottom: 6px; }

ul.bare {
  list-style: none;
  margin: 0;
  padding: 0;
}

ul.bare li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

ul.bare li:last-child { border-bottom: none; }

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

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.pill-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

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

.pill-btn[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}

.pub-year { margin-top: 22px; margin-bottom: 8px; font-size: 1rem; color: var(--text-muted); font-weight: 700; }
.pub-year:first-of-type { margin-top: 4px; }

.pub-entry {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

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

.pub-links { margin-top: 4px; }

.pub-link {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--accent);
  color: var(--accent-strong);
  border-radius: 4px;
  padding: 1px 7px;
  margin-right: 6px;
  text-decoration: none;
}

.pub-link:hover { background: var(--tag-bg); }

.pub-count { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 16px; }

footer.site-footer {
  border-top: 1px solid var(--border);
  padding: 26px 0 40px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

footer.site-footer a { color: var(--text-muted); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  background: var(--accent);
  color: var(--accent-contrast);
  padding: 10px 16px;
  z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }

@media (max-width: 560px) {
  .header-top { padding: 20px 0 14px; gap: 14px; }
  .portrait { width: 64px; height: 64px; }
  .identity h1 { font-size: 1.35rem; }
  .lang-toggle { order: -1; margin-left: 0; }
  main { padding: 22px 0 44px; }
}
