/* =========================================================
   Lab website styles
   Change colors and fonts here; every page uses this file.
   ========================================================= */

:root {
  --paper: #FBFCFD;      /* page background */
  --ink: #16232C;        /* main text */
  --muted: #5A6B76;      /* secondary text */
  --rule: #DCE4E9;       /* thin dividers */
  --accent: #127A68;     /* links, active nav */
  --accent-dark: #0C5A4C;
  --night: #071016;      /* hero/footer background */

  --serif: "Newsreader", Georgia, serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --measure: 42rem;      /* comfortable reading width */
  --wide: 72rem;         /* max page width */
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { color: var(--accent-dark); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.25rem, 5vw, 3.25rem); }
h2 { font-size: 1.75rem; margin-top: 2.25rem; }
h3 { font-size: 1.25rem; margin-top: 1.75rem; }
p  { margin: 0 0 1.1em; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: #fff; padding: 0.5rem 1rem; z-index: 10;
}
.skip-link:focus { left: 1rem; top: 1rem; }

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

.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}
.site-header .inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 1.1rem 1.5rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem 2rem;
  flex-wrap: wrap;
}
.site-name {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}
.site-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 0.25rem 1.4rem;
}
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* ---------- Home hero ---------- */

.hero {
  position: relative;
  min-height: min(78vh, 720px);
  background: var(--night) url("images/background.jpg") center / cover no-repeat;
  display: flex;
  align-items: flex-end;
}
.hero::after { /* darkens the bottom so text stays readable on any photo */
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(to top, rgba(7,16,22,.85), rgba(7,16,22,0) 65%),
    linear-gradient(to right, rgba(7,16,22,.55), rgba(7,16,22,0) 60%);
}
.hero .inner {
  position: relative; z-index: 1;
  max-width: var(--wide); width: 100%;
  margin: 0 auto; padding: 0 1.5rem 3.5rem;
}
.hero h1 {
  color: #F2F7F9;
  font-size: clamp(2.5rem, 6.5vw, 4.75rem);
  font-weight: 400;
  max-width: 14ch;
  margin: 0;
}

.intro {
  max-width: var(--wide); margin: 0 auto; padding: 3.5rem 1.5rem 4.5rem;
  display: grid; grid-template-columns: minmax(0, var(--measure)) 1fr; gap: 3rem;
}
.intro p.lead { font-family: var(--serif); font-size: 1.4rem; line-height: 1.5; }
.intro .quick-links { list-style: none; padding: 0; margin: 0.4rem 0 0; border-top: 1px solid var(--rule); }
.intro .quick-links li { border-bottom: 1px solid var(--rule); }
.intro .quick-links a { display: block; padding: 0.8rem 0; text-decoration: none; color: var(--ink); }
.intro .quick-links a:hover { color: var(--accent); }
.intro .quick-links span { display: block; color: var(--muted); font-size: 0.9rem; }

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

.page {
  max-width: var(--wide); margin: 0 auto; padding: 3.5rem 1.5rem 4rem;
}
.page-header { max-width: var(--measure); margin-bottom: 2rem; }
.page-header p { color: var(--muted); font-size: 1.15rem; }
.prose { max-width: var(--measure); }

.split {
  display: grid; grid-template-columns: minmax(0, var(--measure)) minmax(0, 1fr);
  gap: 3rem; align-items: start;
}
figure { margin: 0 0 2rem; }
figcaption { color: var(--muted); font-size: 0.875rem; margin-top: 0.5rem; }

/* Publications */
.pub-list { list-style: none; padding: 0; margin: 0; max-width: var(--measure); }
.pub-list li { margin: 0 0 2.25rem; line-height: 1.65; }
.pub-list .pub-title { color: var(--ink); font-weight: 600; text-decoration: none; }
.pub-list .pub-title:hover { color: var(--accent); text-decoration: underline; }
.pub-list .pmid { white-space: nowrap; }

/* Resources */
.resource-group { max-width: var(--measure); }
.resource-group ul { padding-left: 1.2rem; }
.resource-group li { margin-bottom: 0.35rem; }

/* Lab members */
.people {
  display: grid; gap: 2.5rem 2rem;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  list-style: none; padding: 0; margin: 0;
}
.people img { aspect-ratio: 5 / 6; object-fit: cover; width: 100%; background: var(--rule); }
.people .name { font-weight: 600; margin: 0.75rem 0 0; }
.people .role { color: var(--muted); font-size: 0.95rem; margin: 0; }
.pi {
  display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, var(--measure));
  gap: 2rem; margin-bottom: 3.5rem; align-items: start;
}
.pi img { aspect-ratio: 5 / 6; object-fit: cover; width: 100%; }
.pi .role { color: var(--muted); margin-top: -0.4rem; }

/* Contact */
address { font-style: normal; line-height: 1.75; }

/* Buttons (used for "Email us") */
.button {
  display: inline-block; background: var(--accent); color: #fff;
  padding: 0.7rem 1.2rem; text-decoration: none; border-radius: 3px; font-weight: 600;
}
.button:hover { background: var(--accent-dark); color: #fff; }

/* ---------- Footer ---------- */

.site-footer { background: var(--night); color: #B9C7CF; font-size: 0.95rem; }
.site-footer .inner {
  max-width: var(--wide); margin: 0 auto; padding: 2rem 1.5rem;
  display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between;
}
.site-footer a { color: #E6EEF2; }
.site-footer .links { display: flex; gap: 1.5rem; flex-wrap: wrap; }

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

@media (max-width: 760px) {
  .site-header .inner { padding: 1rem; }
  .site-nav ul { gap: 0.15rem 1.1rem; }
  .hero { min-height: 62vh; }
  .hero .inner, .intro, .page { padding-left: 1rem; padding-right: 1rem; }
  .intro, .split, .pi { grid-template-columns: 1fr; gap: 2rem; }
  .pi img { max-width: 14rem; }
  .people { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 1rem; }
  .site-footer .inner { padding: 1.5rem 1rem; }
}
