/* ==========================================================================
   Alvarez-Prado laboratory website
   ========================================================================== */
:root {
  --paper: #f5f4f0;        /* soft off-white page background */
  --ink: #1b2530;
  --muted: #56636f;
  --line: #dfe1e3;
  --main: #1f3346;        /* headings, links, buttons */
  --soft: #dde5ec;        /* hero block, tags, photo offsets */
  --accent: #a85a24;      /* hover, job titles, year headings */
  --footer: #1f3346;
  --footer-ink: #f1f4f7;
  --footer-accent: #e8b48a;
  --footer-line: rgba(255,255,255,.2);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wrap: 72rem;
  color-scheme: light dark;
}
/* Dark mode, used when the visitor's device is set to dark.
   Delete this whole block to always show the light colours. */
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14191f;
    --ink: #e8ecf0;
    --muted: #a3adb8;
    --line: #263039;
    --main: #a9c4dc;        /* headings, links, buttons */
    --soft: #5a3418;        /* hero block, tags, photo offsets */
    --accent: #e09a62;      /* hover, job titles, year headings */
    --footer: #0f1418;
    --footer-ink: #e8ecf0;
    --footer-accent: #e09a62;
    --footer-line: rgba(255,255,255,.15);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.6 var(--sans); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--main); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; color: var(--main); }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--paper); padding: .5rem 1rem; z-index: 10; }

/* ---------- header ---------- */
.site-header {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem 2rem;
}
.brand { text-decoration: none; display: flex; flex-direction: column; }
.brand-name { font-family: var(--sans); font-size: 1.4rem; font-weight: 600; color: var(--main); line-height: 1.1; }
.brand-sub { font-size: .85rem; color: var(--muted); }
.site-header nav { display: flex; flex-wrap: wrap; gap: .25rem 1.4rem; }
.site-header nav a { color: var(--ink); text-decoration: none; padding: .25rem 0; border-bottom: 2px solid transparent; }
.site-header nav a:hover { color: var(--main); border-color: var(--soft); }
.site-header nav a[aria-current="page"] { color: var(--main); border-color: var(--main); }

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

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  padding: clamp(1.5rem, 5vw, 4rem) 0 clamp(2.5rem, 6vw, 5rem);
}
.hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.5rem); margin: 0 0 1.25rem; letter-spacing: -.01em; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 34em; margin: 0 0 2rem; }
.hero-links { display: flex; flex-wrap: wrap; gap: .75rem; margin: 0; }
.button {
  display: inline-block;
  background: var(--main);
  color: var(--paper);
  text-decoration: none;
  padding: .7rem 1.3rem;
  border-radius: 3px;
  font-weight: 600;
}
.button:hover { background: var(--accent); color: var(--paper); }
.button-quiet { background: transparent; color: var(--main); box-shadow: inset 0 0 0 2px var(--main); }
.button-quiet:hover { background: var(--soft); color: var(--main); }

/* the one bold element: the image sits on a stained-pink block, offset like a slide on a stage */
.hero-figure { margin: 0; }
.hero-frame { position: relative; padding: 0 1.25rem 1.25rem 0; }
.hero-frame::before {
  content: "";
  position: absolute;
  inset: 1.25rem 0 0 1.25rem;
  background: var(--soft);
}
.hero-figure img { position: relative; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.hero-figure figcaption { font-size: .8rem; color: var(--muted); margin-top: .5rem; }

/* ---------- generic sections ---------- */
.section { padding-top: clamp(2.5rem, 5vw, 4rem); }
.section-title { font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 0 0 1rem; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.section-intro { max-width: 40em; color: var(--muted); margin: 0 0 1.75rem; text-align: justify}
.more { white-space: nowrap; font-weight: 600; }
.page-title { font-size: clamp(2.2rem, 5vw, 3.2rem); margin: 2rem 0 1rem; }

/* research lines */
.research-lines { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 2rem; }
.research-lines article { border-top: 3px solid var(--main); padding-top: 1rem; }
.research-lines h3 { font-size: 1.3rem; margin: 0 0 .5rem; }
.research-lines p { margin: 0; color: var(--muted); text-align: justify;}

/* news */
.news-list { list-style: none; padding: 0; margin: 0; }
.news-item {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--line);
}
.news-item img { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }
.news-item h3 { font-size: 1.2rem; margin: .2rem 0 .35rem; }
.news-item h3 a { color: var(--ink); text-decoration: none; }
.news-item h3 a:hover { color: var(--main); text-decoration: underline; }
.news-item p { margin: 0; }
.meta { font-size: .85rem; color: var(--muted); margin: 0; }
.tag { background: var(--soft); color: var(--ink); padding: .05rem .45rem; border-radius: 2px; margin-left: .4rem; font-size: .8rem; }

/* publications */
.pubs { list-style: none; padding: 0; margin: 0; max-width: 52rem; }
.pubs li { padding: 1rem 0; border-top: 1px solid var(--line); }
.pubs p { margin: 0; }
.pub-title { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; }
.pub-title a { color: var(--ink); text-decoration: none; }
.pub-title a:hover { color: var(--main); text-decoration: underline; }
.pub-authors { color: var(--muted); font-size: .95rem; }
.pub-authors strong { color: var(--ink); font-weight: 600; }
.pub-venue { font-size: .95rem; }
.year .section-title { color: var(--accent); }

/* funders */
.funders { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 2rem 3rem; align-items: center; }
/* .funders img { height: 5rem; width: auto; } */

/* team */
.pi {
  display: grid;
  grid-template-columns: minmax(0, 18rem) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
  padding: 1rem 0 0;
}
.pi img { width: 100%; aspect-ratio: 1; object-fit: cover; box-shadow: 1rem 1rem 0 var(--soft); }
.pi h2 { font-size: 2rem; margin: 0; }
.pi p { max-width: 38em; }
.role { color: var(--accent); font-weight: 600; margin: .15rem 0 .75rem; }
.members { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 2.5rem 2rem; }
.member img { width: 100%; aspect-ratio: 1; object-fit: cover; margin-bottom: .9rem; }
.member h3 { font-size: 1.2rem; margin: 0; }
.member p { margin: 0 0 .5rem; font-size: .95rem; }
.member .role { margin: .1rem 0 .5rem; font-size: .9rem; }
.alumni { padding-left: 1.2rem; max-width: 46rem; }
.alumni li { margin-bottom: .4rem; }

/* news page */
.post { max-width: 46rem; padding: 2rem 0; border-top: 1px solid var(--line); }
.post h2 { font-size: 1.6rem; margin: .4rem 0 1rem; }
.post img { margin: 0 0 1rem; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.post:target h2 { color: var(--accent); }

/* ---------- footer ---------- */
.site-footer { background: var(--footer); color: var(--footer-ink); padding: 3rem 1.25rem 1.5rem; }
.footer-inner { max-width: calc(var(--wrap) - 2.5rem); margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 2rem; }
.site-footer h2 { font-family: var(--sans); font-size: .95rem; color: var(--footer-ink); margin: 0 0 .5rem; }
.site-footer p { margin: 0 0 .75rem; font-size: .95rem; }
.site-footer a { color: var(--footer-ink); }
.site-footer a:hover { color: var(--footer-accent); }
.site-footer .footer-name { font-family: var(--serif); font-size: 1.4rem; font-weight: 600; }
.footer-legal { max-width: calc(var(--wrap) - 2.5rem); margin: 2rem auto 0 !important; padding-top: 1rem; border-top: 1px solid var(--footer-line); font-size: .8rem !important; opacity: .85; }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  .pi { grid-template-columns: 1fr; }
  .pi img { max-width: 16rem; }
  .news-item { grid-template-columns: 1fr; }
  .news-item img { max-width: 20rem; }
}
