/* ==========================================================================
   Teng Lab — site stylesheet
   ========================================================================== */

:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f6f8f9;
  --color-text: #232a30;
  --color-text-muted: #5b6670;
  --color-border: #e4e8eb;
  --color-primary: #0f5c6e;
  --color-primary-dark: #0a424f;
  --color-primary-light: #e6f1f3;
  --color-accent: #c96a3a;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-serif: "Lora", Georgia, "Times New Roman", serif;

  --container-width: 980px;
  --radius: 10px;
  --shadow-sm: 0 1px 3px rgba(15, 30, 35, 0.08);
  --shadow-md: 0 6px 24px rgba(15, 30, 35, 0.10);
}

* { box-sizing: border-box; }

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

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

img { max-width: 100%; }

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2.5rem 0;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover { text-decoration: underline; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.25;
  color: #182126;
  margin: 1.6em 0 0.6em;
}

h1 { font-size: 2.1rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.35rem; }

h4 {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  padding-bottom: 0.4em;
  border-bottom: 2px solid var(--color-primary-light);
}

h6 {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: var(--color-primary);
  display: inline-block;
  padding: 0.3em 0.85em;
  border-radius: 999px;
  margin: 2em 0 1em;
}

p:first-child, ul:first-child, ol:first-child { margin-top: 0; }

ul, ol { padding-left: 1.3em; }
li { margin-bottom: 0.35em; }

strong { font-weight: 700; }

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------------------------------------------------------------------- */
/* Header / navigation                                                    */
/* ---------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.site-header__inner {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}

.site-header__brand {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.25rem;
  color: #182126;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.site-header__brand:hover { text-decoration: none; color: var(--color-primary); }

.site-nav__toggle {
  display: none;
}

.site-nav__toggle-label {
  display: none;
  cursor: pointer;
  padding: 8px;
}
.site-nav__toggle-label span,
.site-nav__toggle-label span::before,
.site-nav__toggle-label span::after {
  display: block;
  width: 22px;
  height: 2px;
  background: #182126;
  position: relative;
  transition: 0.2s;
}
.site-nav__toggle-label span::before,
.site-nav__toggle-label span::after {
  content: "";
  position: absolute;
}
.site-nav__toggle-label span::before { top: -7px; }
.site-nav__toggle-label span::after { top: 7px; }

.site-nav {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  display: inline-block;
  padding: 10px 14px;
  color: #3c464e;
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: 6px;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a.is-active {
  color: var(--color-primary-dark);
  background: var(--color-primary-light);
}

@media (max-width: 720px) {
  .site-nav__toggle-label { display: block; }

  .site-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    padding: 8px 16px 16px;
    box-shadow: var(--shadow-md);
  }

  .site-nav a { padding: 12px 8px; }

  .site-nav__toggle:checked ~ .site-nav { display: flex; }
}

/* ---------------------------------------------------------------------- */
/* Main content                                                           */
/* ---------------------------------------------------------------------- */

.site-main {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.page-header {
  margin-bottom: 1.5em;
}

.page-header h3 {
  font-size: 1.7rem;
  margin: 0;
  color: #182126;
}

.page-header small {
  display: block;
  margin-top: 0.3em;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--color-text-muted);
  font-weight: 400;
}

/* ---------------------------------------------------------------------- */
/* Home: news box                                                         */
/* ---------------------------------------------------------------------- */

.lede {
  font-size: 1.15rem;
  color: var(--color-text-muted);
}

.callout {
  background: var(--color-primary-light);
  border: 1px solid #d5e8ea;
  border-radius: var(--radius);
  padding: 1.1em 1.4em;
  color: var(--color-primary-dark);
  font-weight: 600;
  text-align: center;
}

/* ---------------------------------------------------------------------- */
/* Course / lecture lists                                                 */
/* ---------------------------------------------------------------------- */

.course-list {
  margin: 0.8em 0 1.8em;
}

.course-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.course-list li {
  padding: 0.3em 0;
  line-height: 1.55;
}

/* ---------------------------------------------------------------------- */
/* Research highlights (cards)                                            */
/* ---------------------------------------------------------------------- */

.highlight-list {
  margin: 1em 0 1.8em;
}

.highlight-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.highlight-list li {
  padding: 20px;
  line-height: 1.6;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  transition: box-shadow 0.15s, transform 0.15s;
}

.highlight-list li:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.highlight-list li:last-child {
  margin-bottom: 0;
}

.fig-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 0 0 1.8em;
}

.fig-row img {
  display: block;
  width: 100%;
  aspect-ratio: 2.9 / 1;
  object-fit: contain;
  background: var(--color-bg);
}

@media (max-width: 640px) {
  .fig-row {
    grid-template-columns: 1fr;
  }
}

/* ---------------------------------------------------------------------- */
/* Publications list                                                      */
/* ---------------------------------------------------------------------- */

.pub-list h6 {
  margin-top: 1.5em;
}

.pub-list ul {
  list-style: none;
  margin: 0 0 0.5em;
  padding: 0;
}

.pub-list li {
  padding: 0.45em 0.6em;
  margin: 0 -0.6em;
  border-bottom: 1px solid var(--color-border);
  line-height: 1.45;
  border-radius: 6px;
  transition: background 0.15s;
}

.pub-authors {
  font-size: 0.92em;
  color: var(--color-text-muted);
}

.pub-list li:hover {
  background: var(--color-bg-alt);
}

.pub-list li:last-child {
  border-bottom: none;
}

.news-box {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.8em 1.2em;
  background: var(--color-bg-alt);
}

.news-box ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.news-box li {
  padding: 0.3em 0;
  border-bottom: 1px dashed var(--color-border);
  font-size: 0.88rem;
}
.news-box li:last-child { border-bottom: none; }

.news-box .date {
  display: inline-block;
  font-weight: 700;
  color: var(--color-primary);
  min-width: 5.2em;
}

/* ---------------------------------------------------------------------- */
/* Team page                                                              */
/* ---------------------------------------------------------------------- */

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 24px;
  margin: 1.5em 0 2.5em;
}

.team-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  background: #fff;
  transition: box-shadow 0.15s, transform 0.15s;
}

.team-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.team-card__photo {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.team-card__name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.05rem;
  color: #182126;
  margin-bottom: 2px;
}

.team-card__role {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.team-card__bio {
  font-size: 0.92rem;
  color: var(--color-text-muted);
  line-height: 1.55;
}

.alumni-list {
  columns: 2;
  column-gap: 2.5em;
}
@media (max-width: 600px) { .alumni-list { columns: 1; } }

/* ---------------------------------------------------------------------- */
/* Research / software content images                                    */
/* ---------------------------------------------------------------------- */

.site-main img:not(.team-card__photo):not(.carousel__slide):not(.software-card__thumb) {
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}

/* ---------------------------------------------------------------------- */
/* Software cards                                                         */
/* ---------------------------------------------------------------------- */

.software-list {
  margin: 1.5em 0 2em;
}

.software-card {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  padding: 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  transition: box-shadow 0.15s, transform 0.15s;
}

.software-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.software-card > p:first-child {
  margin: 0;
  flex-shrink: 0;
}

.software-card__thumb {
  display: block;
  width: 200px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
}

.software-card__body {
  flex: 1;
  min-width: 0;
}

.software-card__title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.1rem;
  margin: 0 0 8px;
}

.software-card__desc {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

@media (max-width: 640px) {
  .software-card {
    flex-direction: column;
  }
  .software-card__thumb {
    width: 100%;
    height: auto;
    max-height: 200px;
  }
}

/* ---------------------------------------------------------------------- */
/* Footer                                                                 */
/* ---------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-alt);
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.site-footer__inner {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 32px 24px;
}

.site-footer a {
  color: var(--color-text);
  font-weight: 500;
}

.site-footer__links {
  margin-bottom: 12px;
}
.site-footer__links a { margin-right: 4px; }
.site-footer__links span { color: var(--color-border); margin: 0 8px; }

.site-footer p { margin: 0.3em 0; }
