/* Francis Filbet — site stylesheet */

:root {
  --bg: #f8f9fa;
  --surface: #ffffff;
  --text: #1f2328;
  --muted: #5f6670;
  --rule: #e2e5e9;
  --accent: #1f4e8c;
  --accent-soft: #e8eef7;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --width: 860px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15171a;
    --surface: #1c1f23;
    --text: #e6e4df;
    --muted: #9aa1aa;
    --rule: #2d3137;
    --accent: #8fb3e8;
    --accent-soft: #1f2a3a;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--sans);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

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

/* ---------- Header / navigation ---------- */

.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 24px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.site-name {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}
.site-name:hover { text-decoration: none; }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: .92rem; }
.site-nav a { color: var(--muted); }
.site-nav a[aria-current="page"] { color: var(--text); font-weight: 600; }

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 36px;
  align-items: center;
  padding: 56px 0 44px;
}
.hero img {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 50%;
  filter: grayscale(1);
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 2.3rem;
  line-height: 1.15;
  margin: 0 0 8px;
  letter-spacing: -.01em;
}
.hero .roles { margin: 0 0 16px; color: var(--muted); }
.hero .roles strong { color: var(--text); font-weight: 600; }

.links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.links a {
  display: inline-block;
  font-size: .85rem;
  padding: 3px 12px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--text);
  background: var(--surface);
}
.links a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ---------- Sections ---------- */

section {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 36px;
  padding: 36px 0;
  border-top: 1px solid var(--rule);
}
section > h2 {
  font-family: var(--sans);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 6px 0 0;
}
section p:first-child { margin-top: 0; }
section p:last-child { margin-bottom: 0; }

.lead {
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.6;
}

/* Research themes */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.theme {
  display: block;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  color: var(--text);
}
.theme:hover { border-color: var(--accent); text-decoration: none; }
.theme h3 { font-family: var(--serif); font-size: 1.05rem; margin: 0 0 4px; color: var(--accent); }
.theme p { font-size: .88rem; color: var(--muted); margin: 0; line-height: 1.5; }

/* News */
.news { list-style: none; margin: 0; padding: 0; }
.news li { display: grid; grid-template-columns: 90px 1fr; gap: 16px; padding: 6px 0; }
.news time { color: var(--muted); font-size: .88rem; font-variant-numeric: tabular-nums; padding-top: 1px; }

/* Publications */
.pubs { list-style: none; margin: 0; padding: 0; }
.pubs li { padding: 10px 0; border-bottom: 1px dashed var(--rule); }
.pubs li:first-child { padding-top: 0; }
.pubs .title { font-family: var(--serif); font-size: 1.05rem; font-weight: 600; display: block; }
.pubs .meta { color: var(--muted); font-size: .9rem; }
.pubs .meta em { font-style: italic; }
.tag {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .03em;
  padding: 0 7px;
  margin-left: 6px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  vertical-align: 1px;
}
.more { display: inline-block; margin-top: 14px; font-weight: 600; font-size: .92rem; }

/* Figure */
figure { margin: 0; }
figure img {
  width: 100%;
  height: auto;
  display: block;
}
figcaption { font-size: .85rem; color: var(--muted); margin-top: 10px; line-height: 1.5; }

/* Distinctions */
.honours { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.honours li { display: grid; grid-template-columns: 90px 1fr; gap: 16px; }
.honours span { color: var(--muted); font-size: .88rem; font-variant-numeric: tabular-nums; padding-top: 1px; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: 24px;
  padding: 28px 0 40px;
  font-size: .85rem;
  color: var(--muted);
}
.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.site-footer address { font-style: normal; }

/* ---------- Inner pages ---------- */

.page-head { padding: 56px 0 36px; }
.page-head h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 2.3rem;
  line-height: 1.15;
  margin: 0 0 6px;
  letter-spacing: -.01em;
}
.page-head p { margin: 0; color: var(--muted); font-size: 1.1rem; }

section h3 { font-family: var(--serif); font-size: 1.1rem; margin: 28px 0 6px; }
section h3:first-child { margin-top: 0; }

.features { margin: 0; padding-left: 1.1em; }
.features li { margin-bottom: 8px; }
.features li::marker { color: var(--accent); }

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  border-radius: 6px;
  border: 1px solid var(--rule);
  background: #fff;
}
.gallery a:hover img { border-color: var(--accent); }
.gallery.clear img { object-fit: contain; border-color: transparent; background: none; }

dl.team { margin: 0; display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; }
dl.team dt { color: var(--muted); font-size: .9rem; padding-top: 1px; }
dl.team dd { margin: 0; }

/* Filters (publications, drawings) */
.filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 20px 0; border-top: 1px solid var(--rule); }
.filters button {
  font: inherit;
  font-size: .85rem;
  padding: 4px 14px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.filters button:hover { border-color: var(--accent); }
.filters button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--bg); }
section .filters { border-top: 0; padding: 4px 0 16px; }
[hidden] { display: none !important; }

.pubs .lk {
  font-size: .75rem;
  font-weight: 600;
  padding: 0 7px;
  margin-left: 4px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  vertical-align: 1px;
}
.pubs .lk:hover { border-color: var(--accent); text-decoration: none; }

/* CV */
.students { list-style: none; margin: 0; padding: 0; }
.students li { padding: 10px 0; border-bottom: 1px dashed var(--rule); }
.students li:first-child { padding-top: 0; }
.students li > a { font-weight: 600; }
.students .yr { color: var(--muted); font-size: .88rem; margin-left: 6px; font-variant-numeric: tabular-nums; }
.students em { display: block; font-family: var(--serif); }
.students .meta, p.meta { color: var(--muted); font-size: .9rem; }
.compact { font-size: .92rem; color: var(--muted); line-height: 1.8; }

.plain { list-style: none; margin: 0; padding: 0; }
.plain li { padding: 4px 0; }

details { border-bottom: 1px solid var(--rule); }
details:first-child { border-top: 1px solid var(--rule); }
summary {
  cursor: pointer;
  padding: 10px 0;
  font-weight: 600;
  list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary::before { content: "+"; display: inline-block; width: 1.2em; color: var(--accent); }
details[open] > summary::before { content: "–"; }
summary span { color: var(--muted); font-weight: 400; font-size: .88rem; }
details .plain, details .course-body { padding: 0 0 14px 1.2em; font-size: .94rem; }

/* Teaching */
.course-title { font-size: 1.3rem !important; margin-bottom: 2px !important; }
ul.course { margin: 0 0 8px; padding-left: 1.1em; }
ul.course li { padding: 3px 0; }
ul.course li::marker { color: var(--accent); }
.date { color: var(--muted); font-size: .85rem; margin-left: 4px; font-variant-numeric: tabular-nums; }

/* Miscellaneous */
.poem {
  margin: 0 0 12px;
  padding-left: 20px;
  border-left: 2px solid var(--accent);
  white-space: pre-line;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.08rem;
  line-height: 1.7;
}
.drawings { columns: 3 150px; column-gap: 14px; }
.drawings figure { break-inside: avoid; margin: 0 0 18px; }
.drawings img { width: 100%; height: auto; display: block; border-radius: 4px; }
.drawings figcaption { font-size: .85rem; margin-top: 6px; }

/* ---------- Small screens ---------- */

@media (max-width: 720px) {
  .site-header { position: static; }
  .hero, section { grid-template-columns: 1fr; gap: 16px; }
  .hero { padding: 36px 0 28px; text-align: left; }
  .hero img { width: 120px; height: 120px; }
  .hero h1 { font-size: 1.9rem; }
  section { padding: 28px 0; }
  section > h2 { margin: 0; }
  .news li, .honours li, dl.team { grid-template-columns: 1fr; gap: 0; }
  dl.team dd { margin-bottom: 8px; }
  .page-head { padding: 36px 0 24px; }
  .page-head h1 { font-size: 1.9rem; }
}
