/* ============================================================
   Montgomery Lab — shared stylesheet
   Michigan State University · Dept. of Integrative Biology
   ============================================================ */

:root {
  --green:        #18453B;   /* MSU green */
  --green-light:  #2c6a5b;
  --green-pale:   #eef3f1;
  --ink:          #1d2320;
  --body:         #3a423e;
  --muted:        #6b746f;
  --line:         #e2e7e4;
  --bg:           #ffffff;
  --bg-soft:      #f7f9f8;
  --maxw:         1080px;
  --serif:  "Georgia", "Iowan Old Style", "Times New Roman", serif;
  --sans:   -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--body);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--ink);
  line-height: 1.2;
  font-weight: 600;
}

h1 { font-size: 2.4rem; margin: 0 0 .5rem; }
h2 { font-size: 1.7rem; margin: 0 0 .75rem; }
h3 { font-size: 1.2rem; margin: 0 0 .4rem; }

p { margin: 0 0 1rem; }

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

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

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

.narrow { max-width: 780px; }

/* ---------- Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: .85rem 1.5rem;
}
.brand {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--green);
  letter-spacing: .3px;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.nav-links {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  display: block;
  padding: .4rem .7rem;
  border-radius: 6px;
  color: var(--body);
  font-size: .95rem;
  font-weight: 500;
}
.nav-links a:hover { background: var(--green-pale); text-decoration: none; }
.nav-links a.active { color: var(--green); background: var(--green-pale); }

/* mobile nav toggle */
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: .3rem; }
.nav-toggle span {
  display: block; width: 24px; height: 2px; margin: 5px 0;
  background: var(--ink); transition: .2s;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  color: #fff;
  background: var(--green);
}
.hero-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: .55;
}
.hero-overlay {
  position: relative;
  background: linear-gradient(180deg, rgba(10,30,25,.35), rgba(10,30,25,.65));
}
.hero-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 6rem 1.5rem 5rem;
}
.hero h1 {
  color: #fff;
  font-size: 3rem;
  margin-bottom: .75rem;
  text-shadow: 0 1px 18px rgba(0,0,0,.35);
}
.hero .tagline {
  font-size: 1.35rem;
  max-width: 640px;
  color: #f1f5f3;
  font-family: var(--serif);
  font-style: italic;
}

/* page banner (interior pages) */
.page-head {
  background: var(--green);
  color: #fff;
  padding: 3rem 0 2.5rem;
}
.page-head h1 { color: #fff; }
.page-head p { color: #d7e4df; margin: 0; max-width: 680px; }

/* ---------- Sections ---------- */
section { padding: 3.5rem 0; }
section.tight { padding: 2.5rem 0; }
.bg-soft { background: var(--bg-soft); }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .78rem;
  font-weight: 700;
  color: var(--green-light);
  margin: 0 0 .5rem;
}
.lead { font-size: 1.15rem; color: var(--body); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: var(--green);
  color: #fff;
  padding: .7rem 1.3rem;
  border-radius: 7px;
  font-weight: 600;
  font-size: .95rem;
}
.btn:hover { background: var(--green-light); text-decoration: none; }
.btn.outline {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,.7);
  color: #fff;
}
.btn.outline:hover { background: rgba(255,255,255,.15); }
.btn.ghost {
  background: transparent; color: var(--green);
  border: 1.5px solid var(--line);
}
.btn.ghost:hover { background: var(--green-pale); }
.btn-row { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.5rem; }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.card .card-body { padding: 1.4rem; }
.card img { width: 100%; height: 220px; object-fit: cover; }
.card h3 { margin-top: 0; }
.card .sci { font-style: italic; color: var(--muted); font-size: .95rem; }

/* system feature blocks */
.system {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
}
.system img { border-radius: 12px; height: 340px; width: 100%; object-fit: cover; }
.system.reverse .sys-text { order: 2; }
.system.reverse .sys-media { order: 1; }
.sci-name { font-style: italic; color: var(--muted); }
.meta-tag {
  display: inline-block;
  background: var(--green-pale);
  color: var(--green);
  font-size: .8rem;
  font-weight: 600;
  padding: .2rem .6rem;
  border-radius: 20px;
  margin-bottom: .8rem;
}

/* theme list */
.themes { counter-reset: theme; display: grid; gap: 1.5rem; }
.theme {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.2rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.theme::before {
  counter-increment: theme;
  content: counter(theme);
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff;
  background: var(--green);
  width: 2.6rem; height: 2.6rem;
  border-radius: 50%;
  display: grid; place-items: center;
}
.theme h3 { margin-bottom: .3rem; }
.theme p { margin: 0; }
.theme .theme-sub {
  font-style: italic;
  color: var(--green-light);
  margin-bottom: .6rem;
}

/* Physio–Eco–Socio triangle */
.triad {
  max-width: 460px;
  margin: 2.25rem auto 2.75rem;
  text-align: center;
}
.triad svg { width: 100%; height: auto; overflow: visible; }
.triad .triad-node {
  fill: #fff;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
}
.triad .triad-center {
  fill: #fff;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
}
.triad .triad-center-sub {
  fill: #d7e4df;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: .02em;
}
.triad figcaption {
  margin-top: 1rem;
  font-size: .9rem;
  color: var(--muted);
}

/* comparison table of two systems */
.compare {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: .96rem;
}
.compare th, .compare td {
  text-align: left;
  padding: .7rem .9rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.compare thead th {
  color: var(--green);
  font-family: var(--serif);
  font-size: 1.05rem;
}
.compare tbody th { font-weight: 600; color: var(--ink); }

/* ---------- People ---------- */
.pi-card {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2rem;
  align-items: start;
}
.pi-card img { border-radius: 12px; width: 100%; }
.pi-name { margin-bottom: .1rem; }
.pi-role { color: var(--green-light); font-weight: 600; margin-bottom: 1rem; }
.detail-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.detail-list li { padding-left: 1.3rem; position: relative; margin-bottom: .5rem; }
.detail-list li::before {
  content: "›"; position: absolute; left: 0; color: var(--green); font-weight: 700;
}

.placeholder-roles { display: grid; gap: 1rem; }
.role-slot {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 1.2rem 1.4rem;
  background: var(--bg-soft);
}
.role-slot h3 { margin-bottom: .25rem; }
.role-slot p { margin: 0; color: var(--muted); font-size: .95rem; }

/* ---------- Publications ---------- */
.pub-group { margin-bottom: 2.5rem; }
.pub-group h2 {
  border-bottom: 2px solid var(--green-pale);
  padding-bottom: .4rem;
}
.pub {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 1rem;
}
.pub .year { font-family: var(--serif); font-weight: 600; color: var(--green); }
.pub p { margin: 0; }
.pub .venue { font-style: italic; }
.pub .badge {
  display: inline-block; margin-top: .4rem;
  font-size: .8rem; color: var(--green);
  background: var(--green-pale); padding: .15rem .55rem; border-radius: 5px;
}
.pub strong { color: var(--ink); }

/* ---------- Join ---------- */
.join-section { margin-bottom: 2.2rem; }
.join-section h2 { color: var(--green); }
.callout {
  background: var(--green-pale);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  padding: 1.2rem 1.4rem;
  margin: 1.2rem 0;
}
.callout p:last-child { margin-bottom: 0; }

/* ---------- Resources ---------- */
.res-cat { margin-bottom: 2rem; }
.res-cat h2 { color: var(--green); }
.res-list { list-style: none; padding: 0; margin: 0; }
.res-list li {
  padding: .55rem 0;
  border-bottom: 1px solid var(--line);
}
.res-list li:last-child { border-bottom: 0; }
.res-list .desc { color: var(--muted); font-size: .92rem; }

/* ---------- News / highlight ---------- */
.highlight {
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  padding: 1.4rem 1.6rem;
  background: #fff;
}
.press-links { font-size: .92rem; color: var(--muted); margin-top: .4rem; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--green);
  color: #d7e4df;
  padding: 2.8rem 0 2rem;
  font-size: .95rem;
}
.site-footer a { color: #fff; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
}
.site-footer h4 {
  color: #fff;
  font-size: 1rem;
  margin: 0 0 .7rem;
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: .4rem; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.18);
  margin-top: 2rem;
  padding-top: 1.2rem;
  font-size: .85rem;
  color: #b9cec7;
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  h1 { font-size: 2rem; }
  .hero h1 { font-size: 2.2rem; }
  .hero .tagline { font-size: 1.15rem; }
  .hero-inner { padding: 4rem 1.5rem 3.5rem; }

  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: .5rem 1.5rem 1rem;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: .65rem .5rem; border-radius: 0; }

  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .system, .system.reverse { grid-template-columns: 1fr; }
  .system.reverse .sys-text,
  .system.reverse .sys-media { order: 0; }
  .pi-card { grid-template-columns: 1fr; }
  .pi-card img { max-width: 240px; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .pub { grid-template-columns: 1fr; gap: .2rem; }
  .theme { grid-template-columns: 1fr; }
  .theme::before { margin-bottom: .3rem; }
}
