/* Shared stylesheet for pengfeizhang.com */

:root {
  --max-width: 820px;
  --accent: #2f5d50;
  --accent-light: #e8efec;
  --text: #222222;
  --muted: #5b5b5b;
  --border: #e3e3e0;
  --bg: #fdfdfb;
}

* { box-sizing: border-box; }

body {
  font-family: Georgia, "Times New Roman", serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  margin: 0;
}

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

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header / nav */
header.site-header {
  border-bottom: 1px solid var(--border);
  background: #ffffff;
}

header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
}

.site-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}

nav a {
  margin-left: 1.5rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  padding-bottom: 0.15rem;
  border-bottom: 2px solid transparent;
}

nav a:hover,
nav a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Main content */
main.wrap {
  padding: 2.5rem 1.25rem 4rem;
}

h1 {
  font-size: 1.9rem;
  margin: 0 0 0.2rem;
}

.subtitle {
  color: var(--muted);
  margin: 0;
  font-style: italic;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 2.25rem;
}

.hero-text { flex: 1 1 auto; }

.portrait {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  flex: 0 0 auto;
}

section { margin-bottom: 2.5rem; }

section h2 {
  font-size: 1.15rem;
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  display: inline-block;
  padding-bottom: 0.15rem;
  margin: 0 0 1rem;
}

.meta-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
}
.meta-list li { margin-bottom: 0.35rem; }

ul.links {
  list-style: none;
  padding: 0;
  margin: 0;
}
ul.links li { margin-bottom: 0.7rem; }

footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 2rem 1rem;
  border-top: 1px solid var(--border);
}

/* Availability page */
.legend {
  display: flex;
  gap: 1.5rem;
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.legend-item { display: flex; align-items: center; gap: 0.4rem; }

.swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid var(--border);
}

.swatch.avail { background: #4caf7d; }
.swatch.unavail { background: #d9d9d6; }

.schedule-wrap {
  overflow-x: auto;
  margin-bottom: 2rem;
}

table.schedule {
  border-collapse: collapse;
  width: 100%;
  min-width: 560px;
  font-size: 0.85rem;
}

table.schedule th,
table.schedule td {
  border: 1px solid var(--border);
  text-align: center;
  padding: 0;
  height: 1.4rem;
}

table.schedule thead th,
table.schedule tr:first-child th {
  padding: 0.4rem 0.3rem;
  background: var(--accent-light);
  font-weight: 700;
  height: auto;
}

th.time-label {
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  padding: 0 0.5rem;
  text-align: right;
  background: #fff;
}

td.slot.avail { background: #4caf7d; }
td.slot.unavail { background: #d9d9d6; }

/* Home page: Connect / QR codes */
.qr-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.qr-card { text-align: center; }

.qr-card img {
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  display: block;
}

.qr-card p {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Teaching page */
.institution { margin-bottom: 2.25rem; }

.institution h2 {
  font-size: 1.2rem;
  color: var(--text);
  background: var(--accent-light);
  border-bottom: none;
  padding: 0.35rem 0.7rem;
  border-radius: 4px;
  display: block;
}

.term { margin: 1.1rem 0 1.1rem 0.2rem; }

.term h3 {
  font-size: 1rem;
  margin: 0 0 0.5rem;
  color: var(--accent);
}

.course {
  margin: 0 0 0.7rem;
  padding-left: 0.8rem;
  border-left: 3px solid var(--border);
}

.course-title { font-weight: 700; }
.course-book { color: var(--muted); font-size: 0.92rem; }

/* Publications page */
.pub-group { margin-bottom: 2.5rem; }

.pub {
  margin-bottom: 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.pub:last-child { border-bottom: none; }

.pub-index {
  color: var(--muted);
  font-size: 0.85rem;
  margin-right: 0.3rem;
}

.pub-group:first-of-type { counter-reset: pub; }
.pub { counter-increment: pub; }
.pub-title::before { content: counter(pub) ". "; color: var(--muted); font-weight: 400; }

.pub-title { font-weight: 700; }
.pub-authors { color: var(--muted); font-style: italic; margin: 0.2rem 0; }
.pub-venue { margin: 0.2rem 0 0.4rem; }
.pub-links a { margin-right: 0.75rem; font-size: 0.92rem; }

.pub-abstract {
  margin-top: 0.5rem;
  font-size: 0.92rem;
  color: var(--muted);
}
.pub-abstract .label {
  font-weight: 700;
  color: var(--text);
  font-style: normal;
}

/* Responsive */
@media (max-width: 600px) {
  header .wrap { flex-direction: column; align-items: flex-start; }
  nav a { margin-left: 0; margin-right: 1.25rem; }
}
