/* ───────────────────────────────────────────────────────────
   THE ZHAO FOOD CHEMISTRY LAB — main stylesheet
   ───────────────────────────────────────────────────────────
   Design tokens live at the top. Change colors/fonts here and
   they propagate through the whole site.
   ─────────────────────────────────────────────────────────── */

:root {
  /* Color — SDSU brand red + neutral academic palette */
  --color-bg: #ffffff;
  --color-surface: #faf7f6;
  --color-text: #2d2828;
  --color-muted: #6b6362;
  --color-border: #e8e1e0;
  --color-primary: #a6192e;        /* SDSU dark red */
  --color-primary-bright: #d41736; /* SDSU bright red */
  --color-charcoal: #2d2828;
  --color-teal: #00a39d;           /* SDSU secondary accent */
  --color-placeholder-bg: #fff3d6;
  --color-placeholder-text: #8a5a00;

  /* Type */
  --font-display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-body: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", SFMono-Regular, Menlo, monospace;

  /* Layout */
  --container-width: 1120px;
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(45, 40, 40, 0.06);
  --shadow-md: 0 10px 28px rgba(45, 40, 40, 0.10);
}

/* ── Reset ───────────────────────────────────────────────── */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; }
ul { margin: 0; }
table { width: 100%; border-collapse: collapse; }

a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

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

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.skip-link {
  position: absolute;
  left: -999px;
  background: var(--color-primary);
  color: #fff;
  padding: 10px 16px;
  z-index: 200;
  border-radius: 0 0 6px 0;
  text-decoration: none;
}
.skip-link:focus { left: 0; top: 0; }

/* ── Layout helpers ──────────────────────────────────────── */
.container {
  max-width: var(--container-width);
  margin-inline: auto;
  padding-inline: 24px;
}

.section { padding: 64px 0; }
.section--muted { background: var(--color-surface); }
.section__head { margin-bottom: 28px; }
.section__head h2 { font-family: var(--font-display); font-size: 1.8rem; margin-top: 6px; }
.section__more { margin-top: 22px; }
.section__more a { color: var(--color-primary); font-weight: 600; text-decoration: none; }
.section__more a:hover { text-decoration: underline; }
.section-subhead { font-family: var(--font-display); font-size: 1.3rem; margin: 36px 0 14px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin: 0 0 10px;
}
.eyebrow--inline {
  font-weight: 700;
  color: var(--color-primary);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 4px;
}

.grid { display: grid; gap: 20px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; } }

.intro-copy { max-width: 760px; margin: 0 auto; font-size: 1.05rem; color: var(--color-muted); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  border: 1.5px solid transparent;
}
.btn--primary { background: var(--color-primary); color: #fff; }
.btn--primary:hover { background: var(--color-primary-bright); transform: translateY(-1px); }
.btn--ghost { border-color: rgba(255, 255, 255, 0.65); color: #fff; }
.btn--ghost:hover { background: rgba(255, 255, 255, 0.12); }
.btn--on-dark { background: #fff; color: var(--color-charcoal); }
.btn--on-dark:hover { background: var(--color-surface); }

/* ── Header / Nav ────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--color-border);
}
.site-header__row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 16px;
}
.site-header__brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--color-text); }
.site-header__mark {
  width: 40px; height: 40px;
  border-radius: 8px;
  background: var(--color-primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}
.site-header__name-main { font-family: var(--font-display); font-weight: 700; font-size: 17px; white-space: nowrap; }

.site-nav__list { display: flex; gap: 4px; list-style: none; padding: 0; margin: 0; align-items: center; }
.site-nav__link, .site-nav__sublink {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 6px;
  display: inline-block;
}
.site-nav__link:hover, .site-nav__sublink:hover, .site-nav__link.is-active, .site-nav__sublink.is-active {
  color: var(--color-primary);
}

.site-nav__dropdown { position: relative; }
.site-nav__dropdown summary {
  list-style: none !important;
  cursor: pointer;
  display: inline-flex !important;
  align-items: center;
  padding: 10px 12px;
}
.site-nav__dropdown summary::-webkit-details-marker { display: none; }
.site-nav__dropdown summary::marker { content: ""; }
.site-nav__link-text { display: inline-block; }
.site-nav__chevron { font-size: 10px; margin-left: 4px; color: var(--color-muted); line-height: 1; }
.site-nav__submenu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 190px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-primary);
  border-radius: 4px;
  box-shadow: var(--shadow-md);
  list-style: none;
  padding: 6px;
  margin: 0;
}
.site-nav__submenu li { list-style: none; }
.site-nav__submenu .site-nav__sublink { display: block; padding: 8px 10px; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle__bar { width: 22px; height: 2px; background: var(--color-text); display: block; }

@media (max-width: 1300px) and (min-width: 881px) {
  .site-header__name-main { font-size: 14px; }
  .site-nav__link, .site-nav__sublink { font-size: 13px; padding: 10px 8px; }
}

@media (max-width: 880px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    display: none;
  }
  .site-nav.is-open { display: block; }
  .site-nav__list { flex-direction: column; align-items: stretch; padding: 10px; gap: 2px; }
  .site-nav__dropdown { position: static; }
  .site-nav__submenu { position: static; box-shadow: none; border: none; padding-left: 14px; }
}

/* ── Homepage: welcome + news sidebar (Coley-style) ─────── */
.home-intro { padding-top: 48px; padding-bottom: 32px; }
.home-intro__grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 56px;
  align-items: start;
}
.home-intro__main h1 { font-family: var(--font-display); font-weight: 700; font-size: 2.2rem; margin: 0 0 18px; }
.home-intro__main p { color: var(--color-text); margin: 0 0 16px; }
.text-link { color: var(--color-primary); font-weight: 600; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

.home-intro__sidebar {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
}
.home-intro__sidebar h2 { font-family: var(--font-display); font-size: 1.15rem; margin: 0 0 16px; }
.news-sidebar { list-style: none; padding: 0; margin: 0 0 16px; }
.news-sidebar__item { padding: 12px 0; border-bottom: 1px solid var(--color-border); }
.news-sidebar__item:first-child { padding-top: 0; }
.news-sidebar__date { font-family: var(--font-mono); font-size: 0.7rem; color: var(--color-muted); text-transform: uppercase; margin: 0 0 4px; }
.news-sidebar__title { font-size: 0.92rem; margin: 0; }

@media (max-width: 760px) {
  .home-intro__grid { grid-template-columns: 1fr; gap: 32px; }
}

/* ── Cards: research areas ──────────────────────────────── */
.area-card, .project-card, .news-item {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s ease, transform .15s ease;
}
.area-card:hover, .project-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.area-card__title { font-family: var(--font-display); font-size: 1.05rem; margin: 0 0 8px; color: var(--color-primary); }
.area-card__desc { font-size: 0.92rem; color: var(--color-muted); margin: 0 0 10px; }

/* ── Cards: projects ─────────────────────────────────────── */
.project-card { border-left: 4px solid var(--color-primary); }
.project-card--forming { border-left-color: var(--color-teal); }
.project-card--completed { border-left-color: var(--color-muted); opacity: 0.88; }
.project-card__codename {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  background: var(--color-surface);
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  margin: 0 0 12px;
}
.project-card__status {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-muted);
  margin: 0 0 10px;
}
.project-card__team { font-size: 0.85rem; color: var(--color-muted); margin: 0 0 10px; }
.project-card__desc { font-size: 0.9rem; margin: 0; }

/* ── Cards: people ───────────────────────────────────────── */
.member-card { display: flex; gap: 18px; align-items: flex-start; background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius); padding: 22px; }
.member-card__avatar {
  width: 76px; height: 76px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  flex-shrink: 0;
  overflow: hidden;
}
.member-card__avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--0 { background: var(--color-primary); }
.avatar--1 { background: var(--color-charcoal); }
.avatar--2 { background: var(--color-teal); }
.member-card__name { font-family: var(--font-display); font-size: 1rem; margin: 0 0 2px; }
.member-card__role { font-size: 0.84rem; color: var(--color-muted); margin: 0 0 6px; }
.member-card__project { font-size: 0.84rem; margin: 0 0 6px; }
.member-card__icons { display: flex; gap: 12px; margin-top: 4px; }
.member-card__icons a { color: var(--color-primary); display: inline-flex; }
.contact-icon { width: 18px; height: 18px; }
.member-card__note { font-size: 0.78rem; color: var(--color-muted); margin-top: 6px; font-style: italic; }
.member-card__bio { font-size: 0.85rem; color: var(--color-muted); margin-top: 8px; line-height: 1.55; }

/* ── News ────────────────────────────────────────────────── */
.news-item__date { font-family: var(--font-mono); font-size: 0.72rem; color: var(--color-muted); text-transform: uppercase; margin: 0 0 8px; }
.news-item__title { font-family: var(--font-display); font-size: 1.1rem; margin: 0 0 8px; }
.news-item__summary { font-size: 0.92rem; color: var(--color-muted); margin: 0; }

/* ── Badges ──────────────────────────────────────────────── */
.badge { display: inline-block; font-size: 0.72rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; margin-top: 6px; }
.badge--placeholder { background: var(--color-placeholder-bg); color: var(--color-placeholder-text); }

/* ── Inner page header / content ────────────────────────── */
.page-header { background: var(--color-surface); border-bottom: 1px solid var(--color-border); padding: 44px 0 26px; }
.page-header__title { font-family: var(--font-display); font-size: 2.2rem; margin: 0 0 10px; }
.page-header__subtitle { color: var(--color-muted); font-size: 1.05rem; max-width: 680px; margin: 0; }
/* padding-block only: preserves the .container 24px horizontal padding so page
   content aligns with the page-header title on the same left axis. */
.page-content { padding-block: 28px 64px; }
.page-content h2 { font-family: var(--font-display); font-size: 1.5rem; margin: 36px 0 14px; }
.page-content ul { padding-left: 1.2rem; }
.page-content p { margin: 0 0 16px; }
/* First section follows the header with one consistent gap (no extra top margin) */
.page-content > *:first-child { margin-top: 0; }
.page-footnote {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
}

/* ── Equipment cards (Facilities page) ──────────────────── */
.equipment-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.equipment-card__photo { aspect-ratio: 4 / 3; overflow: hidden; background: var(--color-surface); }
.equipment-card__photo img { width: 100%; height: 100%; object-fit: contain; }
.equipment-card__body { padding: 16px 18px; }
.equipment-card__name { font-family: var(--font-display); font-size: 1rem; margin: 0 0 4px; }
.equipment-card__desc { font-size: 0.88rem; color: var(--color-muted); margin: 0; }

.facility-section { margin-bottom: 56px; }
.facility-section h2 { font-family: var(--font-display); font-size: 1.5rem; margin: 0 0 12px; }
.facility-section__intro { max-width: 760px; }

.spec-columns { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin: 20px 0; }
@media (max-width: 640px) { .spec-columns { grid-template-columns: 1fr; } }
.spec-columns h4 { font-family: var(--font-display); font-size: 0.95rem; margin: 0 0 8px; }
.spec-columns ul { margin: 0; padding-left: 1.1rem; font-size: 0.9rem; }

.sensory-test-table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 0.88rem; }
.sensory-test-table th, .sensory-test-table td {
  border: 1px solid var(--color-border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}
.sensory-test-table th { background: var(--color-surface); font-family: var(--font-display); }

/* ── Equipment cards end ─────────────────────────────────── */

/* ── Profile block (About page) ─────────────────────────── */
.profile-block { display: flex; gap: 24px; align-items: center; margin-bottom: 40px; flex-wrap: wrap; }
.profile-block--centered { flex-direction: column; text-align: center; margin: 8px auto 32px; max-width: 520px; }
.profile-block--centered h2 { font-family: var(--font-display); font-size: 1.6rem; margin: 8px 0 4px; }
.profile-block__avatar {
  width: 96px; height: 96px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
}
.profile-block__avatar--lg { width: 168px; height: 168px; font-size: 2.4rem; }
.profile-block__avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-block__title { color: var(--color-muted); margin: 2px 0 10px; }
.profile-block__titles p { font-style: italic; color: var(--color-muted); margin: 0; font-size: 0.95rem; line-height: 1.5; }
.profile-block__icons { display: flex; gap: 14px; margin-top: 14px; }
.profile-block__icons a { color: var(--color-primary); display: inline-flex; }
.profile-bio { max-width: 680px; margin: 0 auto 40px; }
.profile-bio p { margin: 0 0 16px; }

/* ── Publications ────────────────────────────────────────── */
.scholar-cta { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 24px; margin-bottom: 36px; }
.scholar-cta__note { font-size: 0.85rem; color: var(--color-muted); margin-top: 12px; }
.pub-list { list-style: none; padding: 0; margin: 0; }
.pub-item { display: flex; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--color-border); }
.pub-item__year { font-family: var(--font-mono); color: var(--color-primary); font-weight: 600; flex-shrink: 0; width: 48px; }
.pub-item__body { font-size: 0.92rem; line-height: 1.55; }
.pub-item__doi { color: var(--color-primary); text-decoration: none; font-size: 0.85rem; }
.pub-item__doi:hover { text-decoration: underline; }

/* ── Contact ─────────────────────────────────────────────── */
.contact-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 640px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-card { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius); padding: 22px; }
.contact-card h2 { font-family: var(--font-display); margin: 0 0 4px; }
.contact-card h3 { font-family: var(--font-display); font-size: 1rem; margin: 14px 0 4px; }
.contact-card h3:first-child { margin-top: 0; }
.contact-card p { margin: 0 0 4px; }
.contact-card__links { list-style: none; padding: 0; margin: 0; }
.contact-card__links li { margin-bottom: 6px; }
.contact-card a { color: var(--color-primary); text-decoration: none; }
.contact-card a:hover { text-decoration: underline; }

/* ── Misc: coming soon, placeholder table ───────────────── */
.coming-soon {
  background: var(--color-surface);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  max-width: 640px;
  margin: 20px auto;
}
.placeholder-table table { margin-top: 16px; }
.placeholder-table th, .placeholder-table td {
  border: 1px solid var(--color-border);
  padding: 10px 12px;
  text-align: left;
  font-size: 0.9rem;
}
.placeholder-table th { background: var(--color-surface); }

/* ── Footer ──────────────────────────────────────────────── */
.site-footer { background: var(--color-charcoal); color: rgba(255, 255, 255, 0.85); margin-top: 8px; }
.site-footer__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; padding: 48px 0 32px; }
@media (max-width: 760px) { .site-footer__grid { grid-template-columns: 1fr; } }
.site-footer__title { font-family: var(--font-display); font-size: 1.1rem; color: #fff; margin: 0 0 6px; }
.site-footer__heading { font-weight: 700; color: #fff; margin: 0 0 10px; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; }
.site-footer__muted { font-size: 0.88rem; color: rgba(255, 255, 255, 0.65); line-height: 1.7; margin: 0; }
.site-footer__muted a { color: rgba(255, 255, 255, 0.85); }
.site-footer__links { list-style: none; padding: 0; margin: 0; }
.site-footer__links li { margin-bottom: 8px; }
.site-footer__links a { color: rgba(255, 255, 255, 0.85); text-decoration: none; font-size: 0.88rem; }
.site-footer__links a:hover { text-decoration: underline; }
.site-footer__bottom { border-top: 1px solid rgba(255, 255, 255, 0.12); padding: 18px 0; font-size: 0.78rem; color: rgba(255, 255, 255, 0.55); }

/* ── Second-level (nested) dropdown menu ─────────────────── */
/* Fly-out to the right on desktop; stacks inline on mobile.  */
.site-nav__subdropdown { position: relative; }
.site-nav__subdropdown summary {
  list-style: none !important;
  cursor: pointer;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.site-nav__subdropdown summary::-webkit-details-marker { display: none; }
.site-nav__subdropdown summary::marker { content: ""; }
.site-nav__chevron--right { margin-left: auto; }
.site-nav__submenu--nested {
  position: absolute;
  top: -9px;
  left: calc(100% + 6px);
  min-width: 210px;
  z-index: 60;
}
.site-nav__subdropdown summary .site-nav__chevron--right { color: var(--color-muted); }

@media (max-width: 880px) {
  /* On phones the fly-out becomes a simple indented list */
  .site-nav__submenu--nested {
    position: static;
    box-shadow: none;
    border: none;
    padding-left: 14px;
    min-width: 0;
  }
}

/* ── Project tiles (image card grid, "Current Projects") ─── */
.project-tile {
  display: block;
  text-decoration: none;
  color: inherit;
}
.project-tile__photo {
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.project-tile__photo img { width: 100%; height: 100%; object-fit: cover; }
.project-tile__mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.6rem;
  color: #fff;
  opacity: 0.92;
}
.project-tile__title {
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-primary);
  margin: 0;
  line-height: 1.35;
}
a.project-tile:hover .project-tile__title { text-decoration: underline; }
a.project-tile:hover .project-tile__photo { box-shadow: var(--shadow-md); }
/* Gradient placeholders (used when a project has no photo yet) */
.tile-grad--0 { background: linear-gradient(135deg, #a6192e, #d41736); }
.tile-grad--1 { background: linear-gradient(135deg, #00a39d, #007c78); }
.tile-grad--2 { background: linear-gradient(135deg, #2d2828, #5a4f4f); }
.tile-grad--3 { background: linear-gradient(135deg, #d41736, #8a5a00); }

/* ── Content adjustments for the July 2026 content update ── */
/* Full-width homepage intro (Recent News sidebar removed) */
.home-intro__main--full { max-width: 820px; }

/* Faculty Profile / ORCID links on member cards */
.member-card__links { margin: 10px 0 0; font-size: 0.85rem; }
.member-card__links a { color: var(--color-primary); font-weight: 600; text-decoration: none; }
.member-card__links a:hover { text-decoration: underline; }

/* Rich project cards on the consolidated Research Projects page
   (reuses the existing .project-card look) */
.project-card__title {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 12px;
  color: var(--color-text);
}
.project-card__meta { font-size: 0.85rem; color: var(--color-text); margin: 0 0 6px; }
.project-card__collabs { list-style: none; padding: 0; margin: 0 0 10px; }
.project-card__collabs li { font-size: 0.85rem; color: var(--color-muted); margin: 0 0 4px; }
.project-card__collabs a { color: var(--color-primary); text-decoration: none; }
.project-card__collabs a:hover { text-decoration: underline; }
.project-card__more { margin: 10px 0 0; }

/* ── Responsive table wrapper (horizontal scroll on small screens) ── */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap .sensory-test-table { min-width: 640px; }
.sensory-test-table th, .sensory-test-table td { white-space: normal; overflow-wrap: normal; word-break: keep-all; }
.sensory-test-table td:nth-child(3) { text-align: center; white-space: nowrap; }
.sensory-test-table td:nth-child(6) { white-space: nowrap; }
/* Row-header (first column) keeps the normal body-cell appearance */
.sensory-test-table tbody th { background: transparent; font-family: var(--font-body); font-weight: 400; text-align: left; }

.section-subhead[id] { scroll-margin-top: 90px; }
html { scroll-behavior: smooth; }

/* ── Publication type label + clickable titles ──────────────── */
.pub-item__body a { color: var(--color-primary); text-decoration: none; }
.pub-item__body a:hover { text-decoration: underline; }
.pub-item__type { display: inline-block; font-size: 0.78rem; color: var(--color-muted); font-style: italic; margin-left: 4px; }
.pub-item__doi { display: inline-block; margin-top: 2px; }

/* ═══════════════════════════════════════════════════════════
   Homepage group-photo carousel placement
   ═══════════════════════════════════════════════════════════ */
.home-carousel-wrap { margin-top: 28px; }
.home-carousel-wrap .lab-gallery { margin-top: 0; }   /* wrapper controls the spacing */

/* ═══════════════════════════════════════════════════════════
   Homepage lab group-photo gallery
   ═══════════════════════════════════════════════════════════ */
.lab-gallery { margin-top: 44px; }
.lab-gallery__widget { position: relative; }

.lab-gallery__stage {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 12px;
}
.lab-gallery__slide { margin: 0; }
.lab-gallery__slide + .lab-gallery__slide { margin-top: 20px; }   /* no-JS: stacked */
.lab-gallery__img {
  display: block;
  width: auto; height: auto;
  max-width: 100%;
  max-height: 600px;                 /* keeps the carousel from getting too tall */
  margin: 0 auto;
  border-radius: 6px;
  object-fit: contain;               /* never crop, never stretch */
}
.lab-gallery__caption {
  margin-top: 12px;
  text-align: center;
  font-size: 0.92rem;
  color: var(--color-text);
  line-height: 1.5;
}
.lab-gallery__count {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--color-primary);
  margin-right: 8px;
}

/* Controls are hidden until JavaScript enhances the gallery */
.lab-gallery__nav,
.lab-gallery__thumbs { display: none; }

.lab-gallery__widget.is-enhanced .lab-gallery__slide { display: none; }
.lab-gallery__widget.is-enhanced .lab-gallery__slide.is-active { display: block; }
.lab-gallery__widget.is-enhanced .lab-gallery__slide + .lab-gallery__slide { margin-top: 0; }

.lab-gallery__widget.is-enhanced .lab-gallery__nav {
  display: inline-flex; align-items: center; justify-content: center;
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px;            /* >= 44x44 tap target */
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.92);
  color: var(--color-charcoal);
  font-size: 1.7rem; line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}
.lab-gallery__widget.is-enhanced .lab-gallery__nav:hover { background: #fff; }
.lab-gallery__nav--prev { left: 10px; }
.lab-gallery__nav--next { right: 10px; }

.lab-gallery__widget.is-enhanced .lab-gallery__thumbs {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  margin-top: 14px;
}
.lab-gallery__thumb {
  width: 64px; height: 48px;
  padding: 0; border: 2px solid transparent; border-radius: 6px;
  overflow: hidden; cursor: pointer;
  background: var(--color-surface);
  opacity: 0.72; transition: opacity 0.15s ease, border-color 0.15s ease;
}
.lab-gallery__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lab-gallery__thumb:hover { opacity: 1; }
.lab-gallery__thumb.is-active { opacity: 1; border-color: var(--color-primary); }

@media (max-width: 640px) {
  .lab-gallery__img { max-height: 380px; }   /* shorter stage on phones */
}

/* ═══════════════════════════════════════════════════════════
   Official ENS logo in the (dark) footer
   ═══════════════════════════════════════════════════════════ */
.site-footer__bottom {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 14px 24px;
}
.site-footer__bottom p { margin: 0; }
.site-footer__ens { display: inline-flex; flex-shrink: 0; }
.site-footer__ens img { width: 300px; max-width: 72vw; height: auto; display: block; }
@media (max-width: 640px) { .site-footer__ens img { width: 240px; } }

/* Keyboard focus must stay visible on the dark footer */
.site-footer a:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
