/* ============================================================
   Tong Wu — Academic Website
   style.css
   ============================================================ */

/* ── Custom Properties ── */
:root {
  --primary:  #003087;   /* UTSA blue  */
  --accent:   #F15A22;   /* UTSA orange */
  --bg:       #ffffff;
  --text:     #1a1a1a;
  --muted:    #666666;
  --border:   #e0e0e0;
  --nav-h:    56px;
}

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

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  padding-top: var(--nav-h);
}

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

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

/* ── Navigation ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--primary);
  z-index: 1000;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.20);
}

.nav-inner {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.nav-brand:hover { color: #fff; text-decoration: none; }

.nav-links {
  list-style: none;
  display: flex;
  gap: 0;
}

.nav-links li a {
  display: block;
  padding: 0 1rem;
  line-height: var(--nav-h);
  color: rgba(255,255,255,0.88);
  font-size: 0.93rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.nav-links li a:hover,
.nav-links li a.active {
  background: rgba(255,255,255,0.12);
  color: #fff;
  text-decoration: none;
}

.nav-links li a.active {
  border-bottom: 3px solid var(--accent);
}

/* ── Page Container ── */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* ── Page Header / Title ── */
.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
  border-bottom: 3px solid var(--accent);
  padding-bottom: 0.4rem;
  margin-bottom: 1.8rem;
}

/* ── Home / Profile Layout ── */
.profile {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.profile-photo {
  flex-shrink: 0;
  width: 180px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.profile-info h1 {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.profile-info .title-line {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.profile-info p { margin-bottom: 0.9rem; font-size: 0.97rem; }

/* ── Contact Block ── */
.contact-block {
  background: #f4f7fb;
  border-left: 4px solid var(--primary);
  border-radius: 0 4px 4px 0;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.92rem;
}

.contact-block p { margin-bottom: 0.25rem; }

.contact-block strong { color: var(--primary); }

/* ── Profile Links ── */
.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 1rem;
  border-radius: 3px;
  font-size: 0.88rem;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: 1px solid var(--primary);
}
.btn-primary:hover { background: #002070; color: #fff; text-decoration: none; }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; text-decoration: none; }


/* ── Section Headers (Research / Teaching) ── */
.section-header {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.35rem;
  margin: 2.2rem 0 1rem;
}

.section-header:first-of-type { margin-top: 0; }

/* ── Research Areas ── */
.research-area {
  margin-bottom: 2.8rem;
}

.research-area h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.75rem;
  padding-left: 0.75rem;
  border-left: 4px solid var(--accent);
}

.research-area p {
  font-size: 0.95rem;
  margin-bottom: 0.8rem;
}

.research-figures {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1.1rem 0;
  align-items: flex-start;
}

.research-figures img {
  border-radius: 3px;
  box-shadow: 0 1px 5px rgba(0,0,0,0.12);
  max-width: 100%;
}

.fig-caption {
  font-size: 0.83rem;
  color: var(--muted);
  margin-top: 0.35rem;
  font-style: italic;
}

/* ── Publications ── */
.pub-section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.3rem;
  margin: 2rem 0 1rem;
}

.pub-section-title:first-of-type { margin-top: 0; }

.pub-note {
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 1.2rem;
}

.pub-list { list-style: none; }

.pub-entry {
  padding: 0.85rem 1rem;
  margin-bottom: 0.6rem;
  border-left: 3px solid var(--primary);
  background: #fafcff;
  border-radius: 0 3px 3px 0;
  font-size: 0.91rem;
  line-height: 1.55;
}

.pub-entry:hover { background: #f0f5ff; }

.pub-body { }

.pub-authors { margin-bottom: 0.2rem; color: var(--muted); font-size: 0.84rem; }
.pub-authors strong { color: var(--text); font-weight: 700; }

.pub-title {
  font-size: 0.97rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text);
}

.pub-venue { color: var(--muted); font-size: 0.84rem; }

.pub-doi {
  font-size: 0.83rem;
  margin-top: 0.25rem;
}

.pub-doi a { color: var(--accent); }

/* Submitted / In Prep entries (lighter border) */
.pub-entry.submitted { border-left-color: var(--accent); background: #fffaf7; }
.pub-entry.submitted:hover { background: #fff3ec; }

.pub-entry.in-prep { border-left-color: var(--border); background: #f9f9f9; }

/* ── Teaching ── */
.teaching-year {
  margin-bottom: 2rem;
}

.teaching-year h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.3rem;
  margin-bottom: 0.7rem;
}

.course-list { list-style: none; }

.course-list li {
  padding: 0.35rem 0;
  font-size: 0.93rem;
  border-bottom: 1px dotted var(--border);
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

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

.course-sem {
  flex-shrink: 0;
  width: 90px;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.85rem;
}

.course-name { flex: 1; }

.course-link {
  font-size: 0.82rem;
  color: var(--accent);
  margin-left: 0.4rem;
}

/* Prior institution block (collapsed details) */
details { margin-top: 2rem; }

details summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--primary);
  padding: 0.5rem 0;
  user-select: none;
  list-style: none;
}

details summary::before {
  content: "▶ ";
  font-size: 0.75rem;
  color: var(--accent);
}

details[open] summary::before { content: "▼ "; }

.prior-section { margin-top: 1rem; }

.prior-section h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.25rem;
  margin-bottom: 0.6rem;
  margin-top: 1.2rem;
}

.prior-section h3:first-child { margin-top: 0; }

/* ── Footer ── */
footer {
  background: var(--primary);
  color: rgba(255,255,255,0.8);
  text-align: center;
  padding: 1.1rem 1rem;
  font-size: 0.85rem;
  margin-top: 4rem;
}

footer a { color: rgba(255,255,255,0.7); }
footer a:hover { color: #fff; text-decoration: none; }

/* ── Responsive ── */
@media (max-width: 700px) {
  body { padding-top: var(--nav-h); }

  .nav-brand { font-size: 0.95rem; }

  .nav-links li a {
    padding: 0 0.65rem;
    font-size: 0.85rem;
  }

  .profile {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .profile-photo { width: 140px; }

  .profile-links { justify-content: center; }

  .news-date { width: 90px; font-size: 0.82rem; }


.course-sem { width: 70px; }

  .research-figures { flex-direction: column; }
}

@media (max-width: 440px) {
  .nav-inner { padding: 0 0.75rem; }
  .nav-links li a { padding: 0 0.45rem; font-size: 0.78rem; }
  .container { padding: 1.5rem 1rem 3rem; }
}

/* ── Print ── */
@media print {
  body { padding-top: 0; font-size: 11pt; color: #000; }
  nav, footer { display: none; }
  .container { max-width: 100%; padding: 0; }
  a { color: #000; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
  .pub-entry { border-left: 2pt solid #333; background: none; page-break-inside: avoid; }
  details { display: block; }
  details summary::before { content: ""; }
}
