/* ------------------------------------------------------------
   Tommaso Treu — homepage stylesheet
   Change the colours / fonts here; index.html holds all content.
   ------------------------------------------------------------ */

:root {
  --ink: #1d1f24;
  --muted: #5b6170;
  --rule: #e3e5ea;
  --accent: #2774ae;          /* UCLA blue */
  --accent-dark: #005587;
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --width: 46rem;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 3.5rem; }

body {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.1rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- Header with the JWST image ---------- */
.hero {
  position: relative;
  min-height: 21rem;
  display: flex;
  align-items: flex-end;
  color: #fff;
  background: #05060a url("images/hero.jpg") center / cover no-repeat;
}
.hero::after {               /* darkens the bottom so the name is legible */
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(5,6,10,0.05) 30%, rgba(5,6,10,0.8));
}
.hero-inner {
  position: relative; z-index: 1;
  width: 100%; max-width: var(--width);
  margin: 0 auto; padding: 3rem 1.5rem 2.25rem;
}
.hero h1 {
  margin: 0;
  font-weight: 400;
  font-size: clamp(2.3rem, 6vw, 3.3rem);
  letter-spacing: 0.01em;
  line-height: 1.1;
}
.hero p {
  margin: 0.6rem 0 0;
  font-family: var(--sans);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.85);
}

/* ---------- Navigation ---------- */
nav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule);
}
nav ul {
  list-style: none; margin: 0 auto; padding: 0 1.5rem;
  max-width: var(--width);
  display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem;
  font-family: var(--sans); font-size: 0.85rem;
  letter-spacing: 0.06em; text-transform: uppercase;
}
nav a { display: block; padding: 0.85rem 0; color: var(--muted); }
nav a:hover { color: var(--ink); border-bottom-color: transparent; }

/* ---------- Main content ---------- */
main { max-width: var(--width); margin: 0 auto; padding: 1rem 1.5rem 3rem; }

section { padding-top: 2.5rem; }
section + section { border-top: 1px solid var(--rule); margin-top: 2.5rem; }

h2 {
  margin: 0 0 1rem;
  font-family: var(--sans);
  font-size: 0.85rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent);
}
h3 { margin: 1.75rem 0 0.4rem; font-size: 1.2rem; font-weight: 600; }

p { margin: 0 0 1rem; }

.lead { font-size: 1.2rem; }

.portrait {                 /* optional photo next to the bio */
  float: right; width: 9rem; height: 9rem;
  margin: 0.3rem 0 1rem 1.5rem;
  border-radius: 50%; object-fit: cover;
}

.logo {                     /* small round logo floated beside a paragraph */
  float: right; width: 8.5rem;
  margin: 0.2rem 0 0.75rem 1.5rem;
  border-bottom: 0;
}
.logo img { width: 100%; height: auto; display: block; }
.logo:hover { border-bottom: 0; }
h3, figure { clear: both; }

figure { margin: 2rem 0; }
figure img { width: 100%; height: auto; display: block; border-radius: 3px; }
figcaption {
  margin-top: 0.6rem;
  font-family: var(--sans); font-size: 0.82rem; line-height: 1.5;
  color: var(--muted);
}

/* Simple lists (honours, press, teaching) */
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 0.35rem 0; }
.meta { font-family: var(--sans); font-size: 0.85rem; color: var(--muted); }

/* Group members */
.people { list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 0.2rem 1.5rem; }
.people li { padding: 0.2rem 0; }

/* Alumni — compact two-column table */
table.alumni { width: 100%; border-collapse: collapse; font-size: 0.98rem; }
table.alumni td { padding: 0.35rem 0; vertical-align: top; border-bottom: 1px solid var(--rule); }
table.alumni td:first-child { width: 42%; padding-right: 1rem; }
table.alumni td:last-child { color: var(--muted); }

details { margin-top: 1rem; }
summary {
  cursor: pointer; font-family: var(--sans); font-size: 0.9rem; color: var(--accent);
}

.button {
  display: inline-block; margin: 0.25rem 0.5rem 0.25rem 0;
  padding: 0.55rem 1.1rem;
  font-family: var(--sans); font-size: 0.9rem;
  border: 1px solid var(--accent); border-radius: 3px;
}
.button:hover { background: var(--accent); color: #fff; border-bottom-color: var(--accent); }

address { font-style: normal; }

footer {
  border-top: 1px solid var(--rule);
  background: var(--bg-soft);
  font-family: var(--sans); font-size: 0.8rem; color: var(--muted);
}
footer div { max-width: var(--width); margin: 0 auto; padding: 1.5rem; }

@media (max-width: 600px) {
  body { font-size: 1.03rem; }
  .hero { min-height: 15rem; }
  .portrait { width: 6.5rem; height: 6.5rem; }
  .logo { width: 6rem; margin-left: 1rem; }
  nav ul { flex-wrap: nowrap; overflow-x: auto; gap: 1.1rem; font-size: 0.78rem; scrollbar-width: none; }
  nav ul::-webkit-scrollbar { display: none; }
  nav li { flex: none; }
  table.alumni td { display: block; width: 100% !important; border: 0; padding: 0; }
  table.alumni tr { display: block; padding: 0.4rem 0; border-bottom: 1px solid var(--rule); }
}
