/* ============================================================
   Hoh Environmental Health Laboratory
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

/* ── Design Tokens ────────────────────────────────────────── */
:root {
  --navy:        #0F2044;
  --teal:        #1A6B8A;
  --teal-light:  #E8F4F8;
  --amber:       #B5863A;
  --text:        #2D2D2D;
  --text-muted:  #5A6472;
  --border:      #DDE4EA;
  --white:       #FFFFFF;
  --bg-section:  #F7FAFB;

  --font-display: 'DM Sans', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;

  --max-w:   1100px;
  --radius:  6px;
  --shadow:  0 2px 12px rgba(15,32,68,0.08);
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--white);
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--navy); }
ul, ol { padding-left: 1.4em; }
li { margin-bottom: 0.35em; }

/* ── Navigation ───────────────────────────────────────────── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 3px solid var(--teal);
  box-shadow: var(--shadow);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-brand {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--navy);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.nav-brand:hover { color: var(--teal); text-decoration: none; }
.nav-links {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.nav-links a {
  display: block;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.nav-links a:hover,
.nav-links a.active {
  background: var(--teal-light);
  color: var(--teal);
}
.nav-links a.active {
  font-weight: 600;
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: transform 0.2s;
}

/* ── Page Layout ──────────────────────────────────────────── */
.page-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* ── Page Header / Hero Band ──────────────────────────────── */
.page-hero {
  background: var(--navy);
  padding: 3.5rem 0 3rem;
}
.page-hero .page-wrap { padding-top: 0; padding-bottom: 0; }
.page-hero-eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.6rem;
}
.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  color: var(--white);
  line-height: 1.2;
  margin-bottom: 0.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.page-hero .subtitle {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.72);
}

/* Interior page header (non-hero) */
.section-title {
  font-family: var(--font-display);
  font-size: 1.65rem;
  color: var(--navy);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--teal);
  margin-bottom: 1.5rem;
  display: inline-block;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.section-block {
  margin-bottom: 3rem;
}

/* ── Two-column layout ────────────────────────────────────── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}
.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

/* ── Homepage specific ────────────────────────────────────── */
.home-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 3rem;
  align-items: start;
}
.home-sidebar {
  position: sticky;
  top: 80px;
}
.sidebar-photo {
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  box-shadow: var(--shadow);
  width: 100%;
  object-fit: cover;
}
.sidebar-caption {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 1.25rem;
}

/* ── Inline section headings ──────────────────────────────── */
h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--navy);
  margin: 2rem 0 0.6rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
h3 {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--navy);
  margin: 1.5rem 0 0.5rem;
}
h4 {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 1.2rem 0 0.4rem;
}
p { margin-bottom: 0.85rem; }

/* ── News items ───────────────────────────────────────────── */
.news-section h2 { margin-top: 2rem; }
.news-item {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.news-item:last-child { border-bottom: none; }
.news-date {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--amber);
  padding-top: 0.1rem;
  flex-shrink: 0;
}
.news-text { font-size: 0.92rem; line-height: 1.55; }

/* ── Research cards ───────────────────────────────────────── */
.research-card {
  background: var(--bg-section);
  border-radius: var(--radius);
  border-left: 4px solid var(--teal);
  padding: 1.5rem 1.5rem 1.25rem;
}
.research-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--navy);
  margin-top: 0;
  margin-bottom: 0.5rem;
}
.research-card ul { font-size: 0.9rem; }
.research-card h4 { margin-top: 1rem; }

/* ── Members tables ───────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}
.data-table th {
  background: var(--navy);
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.7rem 1rem;
  text-align: left;
}
.data-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.5;
}
.data-table tbody tr:hover td { background: var(--teal-light); }

/* ── Faculty card ─────────────────────────────────────────── */
.faculty-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: start;
  background: var(--bg-section);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
}
.faculty-photo {
  width: 160px;
  height: 190px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.faculty-info h3 { margin-top: 0; }
.faculty-info p { margin-bottom: 0.3rem; font-size: 0.92rem; }
.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--teal-light);
  color: var(--teal);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  margin-right: 0.4rem;
  margin-bottom: 0.4rem;
}

/* ── Instrumentation grid ─────────────────────────────────── */
.instrument-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.instrument-card {
  background: var(--bg-section);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  text-align: center;
}
.instrument-card img {
  width: 100%;
  height: 130px;
  object-fit: cover;
}
.instrument-card-label {
  padding: 0.5rem 0.5rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--navy);
}

/* ── Equipment cards (photo + description combined) ───────── */
.equipment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}
.equipment-card {
  background: var(--bg-section);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.equipment-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
}
.equipment-card-body {
  padding: 0.9rem 1rem 1.1rem;
}
.equipment-card-body h4 {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  color: var(--navy);
  font-family: var(--font-display);
}
.equipment-card-body p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Matterport embed ─────────────────────────────────────── */
.embed-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 1.5rem 0;
}
.embed-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
}

/* ── Buttons / pills ──────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.45rem 1rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 600;
  border: 2px solid var(--teal);
  color: var(--teal);
  background: transparent;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.btn:hover { background: var(--teal); color: var(--white); text-decoration: none; }

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.6);
  font-size: 0.82rem;
  text-align: center;
  padding: 1.5rem 1rem;
}
.site-footer a { color: rgba(255,255,255,0.8); }
.site-footer a:hover { color: var(--white); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 860px) {
  .home-layout { grid-template-columns: 1fr; }
  .home-sidebar { position: static; display: flex; flex-wrap: wrap; gap: 1rem; }
  .home-sidebar > div { flex: 1 1 200px; }
  .two-col { grid-template-columns: 1fr; }
  .three-col { grid-template-columns: 1fr 1fr; }
  .faculty-card { grid-template-columns: 1fr; }
  .faculty-photo { width: 80px; height: 95px; }
}
@media (max-width: 600px) {
  .nav-links { display: none; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: var(--white); border-bottom: 2px solid var(--teal); padding: 1rem 1.5rem; box-shadow: var(--shadow); }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }
  .three-col { grid-template-columns: 1fr; }
  .news-item { grid-template-columns: 1fr; }
  .instrument-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .equipment-grid { grid-template-columns: 1fr 1fr; }
  .page-wrap { padding: 1.5rem 1rem 3rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
