/* ==========================================================
   Shared stylesheet (same file used by all three sites).
   To change the look, edit the colours and fonts below.
   ========================================================== */

:root {
  --accent: #1f4e79;        /* links, rules, highlights */
  --accent-soft: #e8eef5;   /* light tint of the accent */
  --ink: #1e2329;           /* main text */
  --muted: #5b6470;         /* secondary text */
  --paper: #fbfaf7;         /* page background */
  --card: #ffffff;
  --line: #e2ded6;
  --serif: "Alegreya", Georgia, "Times New Roman", serif;
  --sans: "Lato", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --width: 46rem;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.0625rem/1.65 var(--sans);
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 0.15em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

.wrap { max-width: var(--width); margin: 0 auto; padding-inline: 1.25rem; }

/* ---------- Header ---------- */
.site-header { padding-block: 3rem 1.5rem; }
.site-header h1 {
  font: 500 2.6rem/1.1 var(--serif);
  margin: 0;
  letter-spacing: -0.01em;
}
.site-header h1 a { color: inherit; text-decoration: none; }
.site-header .tagline { margin: 0.4rem 0 0; color: var(--muted); font-size: 1.05rem; }
.site-header .logo { max-width: 22rem; margin-bottom: 0.25rem; }

/* ---------- Navigation ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 10;
  background: var(--paper);
  border-block: 1px solid var(--line);
}
.site-nav ul {
  list-style: none; margin: 0 auto; padding: 0.15rem 1.25rem;
  max-width: var(--width);
  display: flex; flex-wrap: wrap; gap: 0 1.6rem;
}
.site-nav a {
  display: inline-block; padding: 0.7rem 0;
  font-weight: 700; font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink); text-decoration: none;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
@media (max-width: 560px) {
  .site-nav ul { flex-wrap: nowrap; overflow-x: auto; gap: 0 1.1rem; scrollbar-width: none; }
  .site-nav a { font-size: 0.78rem; white-space: nowrap; }
}

/* ---------- Sections ---------- */
main section { padding-block: 2.75rem 0.5rem; }
main h2 {
  font: 500 1.9rem/1.2 var(--serif);
  margin: 0 0 1.1rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}
main h3 { font: 700 1.3rem/1.3 var(--serif); margin: 2rem 0 0.5rem; }
main h4 { font-size: 1rem; margin: 1.5rem 0 0.3rem; }
p { margin: 0 0 1rem; }
.muted { color: var(--muted); }
.small { font-size: 0.92rem; }

/* About block: photo beside text, stacks on phones */
.intro { display: grid; grid-template-columns: 11rem 1fr; gap: 1.75rem; align-items: start; }
.intro img { border-radius: 4px; width: 11rem; }
@media (max-width: 560px) {
  .intro { grid-template-columns: 1fr; }
  .intro img { width: 9rem; }
  .site-header h1 { font-size: 2.1rem; }
}

.profile-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; padding: 0; list-style: none; font-size: 0.95rem; }

/* Buttons */
.button {
  display: inline-block; padding: 0.55rem 1.1rem; border-radius: 4px;
  background: var(--accent); color: #fff; text-decoration: none; font-weight: 700; font-size: 0.95rem;
}
.button:hover { filter: brightness(1.12); }

/* Publication lists */
.pubs { padding-left: 0; list-style: none; margin: 0; }
.pubs li { padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
.pubs li:last-child { border-bottom: 0; }
.pubs .tag {
  display: inline-block; margin-left: 0.3rem; padding: 0 0.45rem; border-radius: 3px;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  background: var(--accent-soft); text-decoration: none;
}
.award { color: #8a5a00; font-weight: 700; font-size: 0.92rem; }

details { margin: 1rem 0; border: 1px solid var(--line); border-radius: 6px; background: var(--card); }
details > summary {
  cursor: pointer; padding: 0.8rem 1rem; font-weight: 700; list-style-position: inside;
}
details[open] > summary { border-bottom: 1px solid var(--line); }
details > .inner { padding: 0.25rem 1rem 0.75rem; }

/* Publications table: one box, one expandable row per type */
.pub-table { border: 1px solid var(--line); border-radius: 6px; background: var(--card); margin: 1rem 0 2rem; }
.pub-table details { margin: 0; border: 0; border-radius: 0; border-bottom: 1px solid var(--line); background: none; }
.pub-table details:last-child { border-bottom: 0; }
.pub-table summary { font: 700 1.2rem/1.3 var(--serif); padding: 0.9rem 1.1rem; }

.contact { margin-top: 1.75rem; font-size: 1.1rem; }

/* Cards (projects, related sites, people) */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; margin: 1rem 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 1.1rem 1.2rem; }
.card h3, .card h4 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }

.person { display: grid; grid-template-columns: 7rem 1fr; gap: 1.25rem; margin: 1.5rem 0; }
.person img { width: 7rem; aspect-ratio: 1; object-fit: cover; border-radius: 50%; }
@media (max-width: 560px) { .person { grid-template-columns: 1fr; } }

.photo { margin: 2rem 0 0; }
.photo img { border-radius: 6px; width: 100%; }
.photo figcaption { margin-top: 0.5rem; font-size: 0.85rem; color: var(--muted); }

.banner { width: 100%; aspect-ratio: 16 / 6; object-fit: cover; border-radius: 6px; margin: 0.5rem 0 1.5rem; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 3.5rem; padding-block: 1.75rem 2.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
.site-footer p { margin: 0.25rem 0; }
