/* =========================================================
   styles.css — Shared stylesheet for yuhe-li.github.io
   ========================================================= */

/* ----- CSS Variables ----- */
:root {
  --bg:           #f8f7f5;
  --bg-white:     #ffffff;
  --text:         #1a1a1a;
  --text-muted:   #5a5a5a;
  --accent:       #2c5f8a;
  --accent-hover: #1d4266;
  --accent-light: #e5eff7;
  --border:       #dedad4;
  --max-width:    920px;
  --nav-height:   58px;
  --radius:       4px;
}

/* ----- Reset & Base ----- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: Georgia, 'Times New Roman', Times, serif;
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Use sans-serif for UI elements */
nav, footer, .tag, .btn, .methods-line, h1, h2, h3, h4, label {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

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

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

p {
  margin-bottom: 1rem;
}

p:last-child {
  margin-bottom: 0;
}

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

main {
  flex: 1;
  padding: 3rem 0 4rem;
}

/* ----- Navigation ----- */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
}

nav {
  height: var(--nav-height);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Name/logo in nav */
.nav-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.nav-name:hover {
  color: var(--accent);
  text-decoration: none;
}

/* Nav links list */
.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-links a {
  display: inline-block;
  padding: 0.3rem 0.6rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
}

.nav-links a:hover {
  color: var(--accent);
  background: var(--accent-light);
  text-decoration: none;
}

/* Active page indicator */
.nav-links a.active {
  color: var(--accent);
  font-weight: 600;
  background: var(--accent-light);
}

/* ----- Profile layout (home page) ----- */
.profile {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
  margin-bottom: 2.5rem;
}

.profile-photo {
  display: block;
  width: 150px;
  max-width: 150px;
  height: 190px;
  border-radius: var(--radius);
  object-fit: cover;
  object-position: center top;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.profile-body {
  flex: 1;
  min-width: 0;
}

/* No divider line under the name when it's inside the profile block */
.profile-body .page-header {
  border-bottom: none;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

/* On mobile, stack photo above text */
@media (max-width: 560px) {
  .profile {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
  }

  .profile-photo {
    width: 110px;
    height: 140px;
  }

  .tags {
    justify-content: center;
  }
}

/* ----- Page Headings ----- */
.page-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid var(--border);
}

.page-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.page-header .subtitle {
  margin-top: 0.4rem;
  font-size: 1.05rem;
  color: var(--text-muted);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

/* ----- Section Headings ----- */
.section {
  margin-bottom: 2.5rem;
}

.section h2 {
  font-size: 1.15rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* ----- Research Interest Tags ----- */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 500;
  border: 1px solid #c4d9ec;
}

/* ----- Project Cards ----- */
.card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.25rem;
  transition: border-color 0.15s;
}

.card:hover {
  border-color: #bac8d3;
}

.card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.65rem;
  line-height: 1.35;
}

.card h3 a {
  color: var(--text);
  text-decoration: none;
}

.card h3 a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.card p {
  font-size: 0.97rem;
  color: var(--text);
  margin-bottom: 0.75rem;
}

/* Methods/status line inside cards */
.methods-line {
  font-size: 0.83rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.5rem;
  margin-bottom: 0;
}

/* ----- Project links list on home page ----- */
.project-list {
  list-style: none;
}

.project-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.97rem;
}

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

.project-list a {
  color: var(--text);
  text-decoration: none;
}

.project-list a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.project-num {
  color: var(--text-muted);
  margin-right: 0.5rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 0.85rem;
}

/* ----- Button / Download Link ----- */
.btn {
  display: inline-block;
  padding: 0.55rem 1.2rem;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s;
}

.btn:hover {
  background: var(--accent-hover);
  color: #fff;
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}

.btn-outline:hover {
  background: var(--accent-light);
  color: var(--accent);
}

/* ----- CV PDF embed ----- */
.pdf-wrapper {
  margin-top: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.pdf-fallback {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 1rem 0 0;
}

.pdf-wrapper iframe {
  display: block;
  width: 100%;
  height: 80vh;
  min-height: 500px;
  border: none;
}

/* ----- Teaching sections ----- */
.teaching-role {
  margin-bottom: 2rem;
}

.teaching-role h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  margin-bottom: 0.5rem;
}

.teaching-role p {
  font-size: 0.97rem;
}

/* ----- Research themes list ----- */
.theme-list {
  list-style: none;
  padding: 0;
}

.theme-list li {
  padding: 0.45rem 0 0.45rem 1.2rem;
  position: relative;
  font-size: 0.97rem;
  border-bottom: 1px solid var(--border);
}

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

.theme-list li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* ----- Footer ----- */
footer {
  background: var(--bg-white);
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
}

footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-left {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

.footer-left a {
  color: var(--text-muted);
}

.footer-left a:hover {
  color: var(--accent);
}

.footer-right {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

/* ----- Divider ----- */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* ----- Responsive: Tablet / Mobile ----- */
@media (max-width: 640px) {
  :root {
    --nav-height: auto;
  }

  .nav-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.75rem 1.25rem;
    gap: 0.5rem;
  }

  .nav-links {
    gap: 0.1rem;
  }

  .nav-links a {
    font-size: 0.82rem;
    padding: 0.25rem 0.5rem;
  }

  main {
    padding: 2rem 0 3rem;
  }

  .container {
    padding: 0 1.25rem;
  }

  .page-header h1 {
    font-size: 1.6rem;
  }

  footer .container {
    flex-direction: column;
    align-items: flex-start;
  }

  .pdf-wrapper iframe {
    height: 60vh;
  }
}
