/* Bingxin Zhao — personal site. Layout adapted from Jon Barron's academic template. */

/* Penn / Wharton brand colors (standards.wharton.upenn.edu) */
:root {
  --penn-blue: #011f5b;
  --penn-red: #990000;
  --link: #1a4fa3;
  --marine-gray: #eeedea;
  --morning-yellow: #d7bc6a;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #fff;
  color: #000;
  font-family: 'Lato', Verdana, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.4;
}

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

a:focus,
a:hover {
  color: var(--penn-blue);
  text-decoration: underline;
}

h1,
h2 {
  margin: 0;
  font-weight: 400;
}

h2 {
  color: var(--penn-blue);
  font-size: 22px;
  scroll-margin-top: 80px;
}

p {
  margin: 14px 0;
}

/* Top navigation */

.top-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid #e4e2dc;
  backdrop-filter: blur(8px);
}

.top-nav-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  padding: 10px 16px;
}

.top-nav-brand:hover {
  text-decoration: none;
}

.top-nav-brand {
  font-weight: 700;
  color: var(--penn-blue);
  font-size: 15px;
}

.top-nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
}

.top-nav-links a {
  color: #111;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 14px;
}

.top-nav-links a:hover,
.top-nav-links a:focus {
  background-color: var(--marine-gray);
  color: var(--penn-blue);
  text-decoration: none;
}

/* Page column */

.page {
  max-width: 900px;
  margin: 0 auto;
}

.section {
  padding: 16px;
}

/* Introduction */

.intro {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

.intro-text {
  flex: 63 1 420px;
  min-width: 0;
  padding: 2.5%;
}

.intro-photo {
  flex: 37 1 220px;
  max-width: 333px;
  padding: 2.5%;
}

.intro-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 50%;
}

.name {
  padding-top: 20px;
  color: var(--penn-blue);
  font-size: 32px;
  text-align: center;
}

.intro-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 10px;
}

/* Research */

.directions {
  margin: 0 0 14px;
  padding-left: 28px;
}

.directions li + li {
  margin-top: 6px;
}

.rule {
  height: 1px;
  background-color: #eee;
}

.pub-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
}

.pub-filter-bar .label {
  font-weight: 600;
}

.pub-filter-bar button {
  padding: 6px 12px;
  border-radius: 18px;
  border: 1px solid #ddd;
  background-color: #f7f7f7;
  color: #333;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  transition: 0.15s;
}

.pub-filter-bar button[aria-pressed='true'] {
  border-color: var(--penn-blue);
  background-color: var(--penn-blue);
  color: #fff;
}

.pub-tag-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 12px;
}

.pub-tag-bar[hidden] {
  display: none;
}

.pub-tag-bar button {
  padding: 4px 10px;
  border-radius: 5px;
  border: 1px solid #ddd;
  background-color: #fff;
  color: #333;
  cursor: pointer;
  font: inherit;
  font-size: 12.5px;
  transition: 0.15s;
}

.pub-tag-bar button[aria-pressed='true'] {
  border-color: var(--penn-blue);
  background-color: var(--marine-gray);
  color: var(--penn-blue);
  font-weight: 700;
}

.pub-card {
  display: flex;
  gap: 14px;
  margin-bottom: 10px;
  padding: 12px 14px;
  border: 1px solid #e4e2dc;
  border-radius: 10px;
  background: #fff;
}

.pub-card-left {
  flex: 0 0 22%;
}

.pub-card-left img {
  display: block;
  width: 100%;
  max-width: 160px;
  height: auto;
  border-radius: 6px;
}

.pub-card-right {
  flex: 1;
  min-width: 0;
}

.papertitle {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

span.papertitle {
  color: #111;
}

.pub-authors {
  margin-top: 3px;
  color: #333;
}

.pub-note {
  color: #666;
  font-size: 13px;
}

.pub-venue {
  margin-top: 2px;
}

.pub-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.pub-tag {
  padding: 2px 7px;
  border-radius: 4px;
  background-color: var(--marine-gray);
  color: var(--penn-blue);
  font-size: 12px;
}

.pub-highlights {
  margin: 8px 0 2px;
  padding: 4px 0 4px 12px;
  border-left: 3px solid var(--morning-yellow);
  list-style: none;
  color: #555;
  font-size: 13px;
  line-height: 1.45;
}

.pub-highlights li + li {
  margin-top: 3px;
}

.pub-year-heading {
  margin: 26px 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--penn-blue);
  color: var(--penn-blue);
  font-size: 16px;
  font-weight: 700;
}

.pub-year-heading:first-child {
  margin-top: 0;
}

/* Bordered cards used by Platforms and Group */

.card-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
}

.card {
  padding: 12px 14px;
  border: 1px solid #eee;
  border-radius: 10px;
}

.card-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 4px 12px;
}

.card-row > .card-main {
  flex: 1 1 420px;
  min-width: 0;
}

.card-title {
  color: var(--penn-blue);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
}

.card-sub {
  margin-top: 2px;
  color: #333;
}

.card-side {
  color: #666;
  white-space: nowrap;
}

.subhead {
  margin-top: 10px;
  font-weight: 600;
}

.people {
  margin-top: 6px;
  column-width: 380px;
  column-gap: 28px;
}

.people > div {
  padding: 2px 0;
  break-inside: avoid;
}

.people .affil {
  color: #666;
}

.footer {
  padding: 24px 16px 40px;
  text-align: right;
  color: #666;
  font-size: 13px;
}

@media (max-width: 600px) {
  .top-nav-inner {
    justify-content: center;
  }

  .top-nav-links {
    justify-content: center;
    gap: 0 4px;
  }

  .intro-photo {
    max-width: 240px;
  }

  .pub-card-left {
    flex-basis: 30%;
  }
}

/* News */

.news {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.news li {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 12px;
  padding: 6px 0;
}

.news li + li {
  border-top: 1px solid #f2f2f2;
}

.news-date {
  color: var(--penn-blue);
  font-weight: 700;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .news li {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

.card-paper {
  margin-top: 4px;
}

/* Phones and narrow windows: name, then photo, then bio */
@media (max-width: 720px) {
  .intro {
    flex-direction: column;
    align-items: stretch;
  }

  .intro-text {
    display: contents;
  }

  .intro .name {
    order: 1;
    padding-top: 16px;
  }

  .intro-photo {
    order: 2;
    align-self: center;
    width: 62%;
    max-width: 240px;
    padding: 12px 0 4px;
  }

  .intro-text > p {
    order: 3;
    margin: 12px 16px 0;
  }
}
