/* ============================================================
   Guanhao (Gavin) Feng — academic homepage
   Static rebuild of the former WordPress.com site, for Netlify.
   ============================================================ */

:root {
  --ink: #1c1c1c;
  --muted: #555;
  --faint: #777;
  --line: #e3e3e3;
  --accent: #8e1537;        /* CityU CB deep magenta/red */
  --accent-soft: #b03a5b;
  --bg: #ffffff;
  --bg-alt: #faf8f6;
  --maxw: 880px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  --serif: Georgia, "Times New Roman", "Songti SC", "SimSun", serif;
}

* { box-sizing: border-box; }

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

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

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .15s ease, color .15s ease;
}
a:hover { color: var(--accent-soft); border-bottom-color: var(--accent-soft); }

/* ---------- Header / nav ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 26px 24px 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}
.brand img.logo {
  height: 68px;
  width: auto;
  display: block;
}
.brand .name {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: .2px;
  margin: 0;
  color: var(--ink);
}
.brand .name a { color: inherit; border: none; }
.brand .name a:hover { color: var(--accent); }

nav.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 26px;
  font-size: 15px;
  letter-spacing: .3px;
}
nav.site-nav a {
  color: var(--muted);
  border: none;
  font-weight: 500;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}
nav.site-nav a:hover { color: var(--accent); border-bottom-color: var(--accent); }
nav.site-nav a.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- Main ---------- */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px 24px 64px;
}

h1.page-title {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  margin: 0 0 28px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

h2.section {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  margin: 38px 0 6px;
  color: var(--ink);
}

/* ---------- Home: bio block ---------- */
.bio-photo {
  float: right;
  width: 210px;
  max-width: 42%;
  margin: 4px 0 18px 28px;
  border: 1px solid var(--line);
  border-radius: 3px;
}
.bio h2.section:first-of-type { margin-top: 0; }
.bio p { margin: 0 0 16px; }

.link-row {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  font-size: 16px;
}
.link-row li { margin: 4px 0; }
.link-cols { display: flex; flex-wrap: wrap; gap: 12px 48px; margin: 18px 0 0; }
.link-cols .link-row { margin: 0; }

.contact {
  clear: both;
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 16px;
  color: var(--muted);
}
.contact strong { color: var(--ink); }

/* ---------- Research list ---------- */
.lead {
  color: var(--muted);
  font-size: 16px;
  margin: 0 0 6px;
}

ol.pubs {
  list-style: none;
  counter-reset: pub;
  padding: 0;
  margin: 10px 0 0;
}
ol.pubs > li {
  counter-increment: pub;
  position: relative;
  padding: 0 0 18px 30px;
  margin: 0;
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
ol.pubs > li::before {
  content: counter(pub) ".";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
}
.pub-title { font-weight: 600; }
.pub-title a { color: var(--accent); border-bottom: 1px solid transparent; }
.pub-title a:hover { border-bottom-color: var(--accent-soft); }
.pub-meta {
  display: block;
  color: var(--muted);
  font-size: 15.5px;
  margin-top: 2px;
}
.pub-venue { color: var(--ink); }
.pub-status { font-style: italic; }
.pub-award { color: var(--accent); }
.pub-media { color: var(--faint); font-size: 14.5px; }
.pub-media a { color: var(--faint); }
.pub-media a:hover { color: var(--accent); }

/* two-column entry: paper on the left, keywords on the right */
.pub-main { flex: 1 1 auto; min-width: 0; }
.pub-keywords { flex: 0 0 360px; align-self: flex-start; padding-top: 2px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; }
.pub-kw {
  display: inline-block;
  font-size: 11.5px;
  color: var(--muted);
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 7px;
  margin: 0;
  line-height: 1.7;
  justify-self: start;
}
/* keyword colours by research area: Finance = red, Econometrics & Statistics = purple */
/* keyword tags coloured by the keyword's OWN type: finance concept = dark red, statistical/econometric method = dark purple */
.kw-fin { color: #6f1d2a; background: #f7eef0; border-color: #e4cfd4; }
.kw-eco { color: #3f2a63; background: #f0edf6; border-color: #d8d1e6; }
/* paper titles coloured by section: Finance = dark red, Econometrics & Statistics = dark purple */
.pubs-fin .pub-title a { color: #6f1d2a; }
.pubs-fin .pub-title a:hover { border-bottom-color: #6f1d2a; }
.pubs-eco .pub-title a { color: #3f2a63; }
.pubs-eco .pub-title a:hover { border-bottom-color: #3f2a63; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-alt);
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px 24px;
  font-size: 13.5px;
  color: var(--faint);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  body { font-size: 16px; }
  .bio-photo { float: none; display: block; width: 60%; max-width: 240px; margin: 0 0 20px; }
  h1.page-title { font-size: 26px; }
  nav.site-nav ul { gap: 6px 18px; }
  ol.pubs > li { flex-direction: column; gap: 6px; }
  .pub-keywords { flex-basis: auto; padding-top: 2px; }
}
