/* The Slade Lab — static rebuild
   Palette and layout mirror the original Harvard Sites theme. */

:root {
  --crimson: #a51c30;
  --accent: #b41111;
  --ink: #1e1e1e;
  --muted: #555;
  --bg: #ffffff;
  --bg-alt: #eeeeec;
  --border: #e0e0dd;
  --maxw: 1140px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 17px;
}

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

a { color: var(--crimson); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: #7a1523; }

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

/* ---------- Harvard top bar ---------- */
.harvard-bar { background: #000; color: #fff; }
.harvard-bar .container {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 46px;
}
.harvard-bar img.harvard-logo { height: 24px; width: auto; }
.harvard-bar a { color: #fff; text-decoration: none; }
.harvard-bar .harvard-links {
  display: flex; align-items: center; gap: 1.25rem; min-width: 0;
}
.harvard-bar .top-email {
  font-size: 12px; color: #ddd; text-decoration: underline;
  text-underline-offset: 3px; overflow-wrap: anywhere;
}
.harvard-bar .top-email:hover { color: #fff; }
.harvard-bar .harvard-edu {
  font-size: 13px; letter-spacing: .06em; font-weight: 600;
  text-transform: uppercase; text-decoration: underline; text-underline-offset: 3px;
}
@media (max-width: 640px) {
  .harvard-bar .top-email { display: none; } /* email stays in footer + contact page */
}

/* ---------- Site header / nav ---------- */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-top: .9rem; padding-bottom: .9rem; flex-wrap: wrap;
}
.site-brand { text-decoration: none; color: var(--ink); }
.site-brand .site-title {
  font-size: 1.75rem; font-weight: 700; line-height: 1.2;
  border-bottom: 2px dotted var(--crimson); display: inline-block;
  padding-bottom: 2px;
}
.site-brand .site-tagline {
  font-size: .9rem; color: var(--muted); margin-top: .25rem;
}
.site-nav ul {
  list-style: none; display: flex; flex-wrap: wrap; gap: .25rem;
  margin: 0; padding: 0; align-items: center;
}
.site-nav a {
  display: block; padding: .45rem .65rem; text-decoration: none;
  color: var(--ink); font-size: .95rem; font-weight: 500;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--crimson); border-bottom-color: var(--crimson); }
.site-nav a[aria-current="page"] { color: var(--crimson); border-bottom-color: var(--crimson); }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--border);
  border-radius: 4px; padding: .4rem .6rem; font-size: 1.2rem; cursor: pointer;
  color: var(--ink);
}

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; width: 100%; }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .site-nav a { padding: .7rem .25rem; border-bottom: 1px solid var(--border); }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 72vh; display: flex;
  align-items: center; justify-content: center; overflow: hidden;
}
.hero-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 52% 61%;
}
.hero::after {
  content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.42);
}
.hero-inner {
  position: relative; z-index: 1; text-align: center; color: #fff;
  padding: 4rem 1.25rem; max-width: 760px;
}
.hero-inner h1 { font-size: clamp(2rem, 5vw, 2.9rem); margin: 0 0 1rem; }
.hero-inner p { font-size: clamp(1.15rem, 3vw, 1.85rem); line-height: 1.6; margin: 0 0 1.75rem; }
.btn {
  display: inline-block; background: var(--accent); color: #fff;
  font-size: .85rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; text-decoration: none;
  padding: .85rem 1.6rem; border-radius: 2px;
}
.btn:hover { background: #8f0d0d; color: #fff; }

/* ---------- Generic page sections ---------- */
.page-title {
  background: var(--bg-alt); border-bottom: 1px solid var(--border);
}
.page-title h1 { margin: 0; padding: 1.6rem 0; font-size: 2rem; }

main.content { padding: 2.5rem 0 3.5rem; }
main.content > .container > *:first-child { margin-top: 0; }

h2 { font-size: 1.7rem; margin: 2.2rem 0 1rem; }
h3 { font-size: 1.25rem; margin: 1.6rem 0 .75rem; }
h4 { font-size: 1.1rem; margin: 1.5rem 0 .75rem; }

figure { margin: 1.25rem 0; }
figcaption { font-size: .9rem; color: var(--muted); margin-top: .4rem; }

/* Home two-column welcome band */
.band { padding: 2.75rem 0; }
.band-alt { background: var(--bg-alt); }
.cols-2-1 {
  display: grid; grid-template-columns: 2fr 1fr; gap: 2rem; align-items: center;
}
@media (max-width: 900px) { .cols-2-1 { grid-template-columns: 1fr; } }

.video-embed { position: relative; aspect-ratio: 16 / 9; }
.video-embed iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}

.news h2 { margin-top: 0; }
.news p { margin: 0 0 1.1rem; }

/* ---------- Research cards ---------- */
.card-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem; align-items: stretch;
}
@media (max-width: 900px) { .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .card-grid { grid-template-columns: 1fr; } }

.card {
  background: var(--bg-alt); border-radius: 4px; overflow: hidden;
  display: flex; flex-direction: column;
}
.card figure { margin: 0; }
.card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.card .card-body { padding: 1.1rem 1.25rem 1.4rem; }
.card h3 { margin: 0 0 .6rem; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--crimson); }
.card p { margin: 0; font-size: .97rem; }

/* ---------- People ---------- */
.lead-photo img { width: 100%; }

.profile {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2rem;
  align-items: center; margin: 1.5rem 0 2.5rem;
}
@media (max-width: 800px) { .profile { grid-template-columns: 1fr; } }
.profile h3 { font-size: 1.6rem; margin: 0 0 .5rem; }
.profile .role { font-size: 1.1rem; margin: 0 0 1rem; }

.people-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem; margin: 1.5rem 0 2.5rem;
}
.people-grid.cols-center { justify-content: center; }
@media (max-width: 900px) { .people-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .people-grid { grid-template-columns: 1fr; } }

.person { text-align: center; }
.person img {
  width: min(319px, 100%); aspect-ratio: 1 / 1; object-fit: cover;
  margin: 0 auto .9rem;
}
.person .p-name { font-size: 1.45rem; line-height: 1.25; margin: 0 0 .5rem; }
.person .p-email { font-size: .95rem; color: var(--muted); margin: 0 0 .6rem; word-break: break-all; }
.person .p-project { font-size: 1rem; margin: 0; }

/* Alumni table */
table { border-collapse: collapse; width: 100%; max-width: 560px; margin: 1.25rem 0; }
td, th { border: 1px solid var(--border); padding: .5rem .75rem; text-align: left; }
tr:nth-child(even) td { background: var(--bg-alt); }

/* ---------- Publications ---------- */
.citation {
  font-family: "Times New Roman", Times, Georgia, serif;
  font-size: 1.18rem; margin: 0 0 1.6rem; line-height: 1.55;
}
.pub-year { font-size: 2rem; margin: 2.2rem 0 1.2rem; }
.pub-year:first-child { margin-top: 0; }

/* ---------- Galleries ---------- */
.gallery {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem; margin: 1.25rem 0 2rem;
}
@media (max-width: 900px) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .gallery { grid-template-columns: 1fr; } }
.gallery a { display: block; }
.gallery img {
  width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 2px;
}

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,.88);
  display: none; align-items: center; justify-content: center;
  z-index: 100; padding: 2rem; cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 100%; max-height: 92vh; width: auto; height: auto;
  box-shadow: 0 8px 40px rgba(0,0,0,.6);
}
.lightbox .lb-close {
  position: absolute; top: 1rem; right: 1.25rem; background: none; border: 0;
  color: #fff; font-size: 2rem; line-height: 1; cursor: pointer;
}

/* Community figures */
.figure-block { margin: 0 0 2.25rem; }
.figure-block p.caption { margin: 0 0 .6rem; }
.figure-block img { width: 100%; border-radius: 2px; }
.figure-pair {
  display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; align-items: start;
}
@media (max-width: 700px) { .figure-pair { grid-template-columns: 1fr; } }

/* ---------- Posts ---------- */
.post-meta { color: var(--muted); font-size: .95rem; margin: -1rem 0 1.5rem; }
.post-nav {
  display: flex; justify-content: space-between; gap: 1rem;
  margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border);
}
.post-nav a {
  text-decoration: none; background: var(--bg-alt); padding: .7rem 1.1rem;
  border-radius: 3px; color: var(--ink); font-size: .95rem;
}
.post-nav a:hover { background: #e2e2de; }

/* ---------- Contact box ---------- */
.contact-box {
  background: var(--bg-alt); border-left: 4px solid var(--crimson);
  padding: .9rem 1.2rem; margin: 0 0 1.75rem; font-size: 1.05rem;
  overflow-wrap: anywhere;
}

/* ---------- Footer ---------- */
.site-footer {
  background: #1a1a1a; color: #ccc; margin-top: 0;
  font-size: .85rem;
}
.site-footer .container {
  padding-top: 1.5rem; padding-bottom: 1.5rem; text-align: center;
}
.site-footer a { color: #fff; }
.site-footer .footer-contact {
  margin-bottom: .6rem; font-size: .95rem; overflow-wrap: anywhere;
}
