/* Original styles for Yuntao Lu's academic homepage. */

/* Colors */
:root {
  color-scheme: light;
  --paper: #fcf8e6;
  --ink: #463c35;
  --muted: #746a60;
  --bar: #463b36;
  --rule: #62564c;
  --focus: #876332;
}

/* Base */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 110px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: #8a542b;
}

a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 5px;
  border-radius: 2px;
}

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

main {
  min-width: 0;
}

section {
  margin: 0 0 28px;
}

h2 {
  clear: both;
  margin: 0 0 17px;
  padding-bottom: 2px;
  border-bottom: 3px solid var(--rule);
  font-size: 26px;
  line-height: 1.35;
}

h2.about-heading {
  border: 0;
  padding: 0;
  margin-bottom: 17px;
}

h3 {
  margin: 0 0 4px;
  font-size: 20px;
  line-height: 1.45;
}

p {
  margin: 0 0 16px;
}

/* Accessibility */
.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 20;
  background: white;
  padding: 8px 14px;
}

.skip-link:focus {
  top: 10px;
}

/* Navigation */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bar);
  border-bottom: 5px solid #292622;
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 42px;
  min-height: 75px;
  padding: 0 36px;
  overflow-x: auto;
}

.topbar a {
  flex-shrink: 0;
  color: #fcf8ec;
  font-size: 20px;
  font-weight: bold;
  text-decoration: none;
  white-space: nowrap;
}

.topbar a:hover {
  color: #e8cd96;
}

.topbar .brand {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1.5px solid #fcf8ec;
  border-radius: 50%;
  font-size: 11px;
  letter-spacing: 1px;
}

/* Page layout */
.page {
  width: min(100% - 72px, 1010px);
  margin: 45px auto 0;
  display: grid;
  grid-template-columns: 255px minmax(0, 1fr);
  gap: 51px;
  align-items: start;
}

/* Profile */
.profile {
  position: sticky;
  top: 125px;
  text-align: center;
  padding-top: 3px;
}

.portrait {
  width: 224px;
  height: 224px;
  margin: 0 auto 10px;
  border: 3px solid #51463c;
  border-radius: 18px;
  object-fit: cover;
}

.profile h1 {
  font-size: 29px;
  line-height: 1.2;
  margin: 9px 0 8px;
}

.position {
  font-size: 19px;
  margin: 0 0 1px;
}

.affiliation {
  line-height: 1.45;
  margin: 0 0 5px;
  font-size: 17px;
}

.affiliation a {
  text-decoration: none;
}

.email {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 15px;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin: 19px 0;
  font-size: 16px;
  font-weight: bold;
}

.profile-links a {
  text-decoration: none;
}

.contact-button {
  display: inline-block;
  padding: 4px 14px;
  margin-top: 3px;
  border-radius: 7px;
  background: var(--bar);
  color: var(--paper);
  text-decoration: none;
  font-weight: bold;
  font-size: 15px;
}

.contact-button:hover {
  color: white;
  background: #665047;
}

/* About */
.about {
  display: flow-root;
}

.research-figure {
  float: right;
  width: 225px;
  margin: -14px -4px 12px 22px;
}

.research-figure figcaption {
  text-align: center;
  font-size: 12px;
  font-weight: bold;
  margin-top: -1px;
}

/* Research interests */
.interests {
  padding-left: 24px;
  margin: 0;
}

.interests li {
  padding-left: 1px;
  margin-bottom: 5px;
}

/* Publications */
.work-item {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 25px;
  align-items: center;
  padding: 12px 14px 15px;
  margin-bottom: 11px;
}

.work-image {
  position: relative;
  border-radius: 3px;
  background: #fffcf4;
  box-shadow: 0 2px 5px #463b3629;
  overflow: hidden;
}

.work-image img {
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
}

.work-label {
  position: absolute;
  top: 0;
  left: 0;
  min-width: 65px;
  background: var(--bar);
  color: var(--paper);
  padding: 1px 9px;
  font-size: 10px;
  font-weight: bold;
  text-align: center;
  border-bottom-right-radius: 4px;
}

.work-copy h3 {
  margin: 0 0 8px;
  font-size: 19px;
  line-height: 1.45;
}

.work-copy h3 a {
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.work-copy p {
  font-size: 15px;
  line-height: 1.55;
  margin: 4px 0;
}

.work-copy .work-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

.work-copy .publication-authors {
  margin: 0 0 5px;
  font-size: 15px;
  line-height: 1.6;
}

.work-copy .publication-venue {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.publication-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.publication-links a {
  display: inline-block;
  padding: 2px 10px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.5;
  text-decoration: none;
}

.publication-links a:hover {
  background: var(--bar);
  color: var(--paper);
}

/* Expandable content */
details {
  margin: 9px 0 0;
  font-size: 15px;
}

summary {
  cursor: pointer;
  font-weight: bold;
  width: fit-content;
}

details p {
  border-left: 2px solid #b5a58f;
  padding-left: 15px;
  margin-top: 10px;
}

/* Talks */
.talk + .talk {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #d9cfb9;
}

.talk h3 {
  margin-bottom: 4px;
  font-size: 19px;
  line-height: 1.4;
}

.talk > p {
  font-size: 16px;
  margin-top: 8px;
}

.talk .talk-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 20px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.talk-meta time {
  white-space: nowrap;
}

.talk .talk-title {
  margin: 0 0 10px;
  font-size: 17px;
  font-style: italic;
  line-height: 1.6;
}

.talk-abstract summary {
  font-size: 14px;
}

.talk-abstract p {
  margin: 10px 0 0;
  padding-left: 15px;
  border-left: 2px solid #b5a58f;
  font-size: 15px;
  line-height: 1.75;
}

/* Teaching */
.teaching-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 80px 55px 72px;
  align-items: baseline;
  column-gap: 14px;
  row-gap: 6px;
}

.teaching-item + .teaching-item {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #d9cfb9;
}

.teaching-item h3 {
  min-width: 0;
  margin: 0;
  font-size: 15px;
  font-weight: bold;
  line-height: 1.6;
}

.teaching-place,
.teaching-role,
.teaching-term {
  font-size: 13px;
  line-height: 1.6;
  white-space: nowrap;
}

.teaching-place,
.teaching-term {
  color: var(--muted);
}

.teaching-role {
  font-weight: normal;
}

.teaching-term {
  text-align: right;
}

/* News */
.news-list {
  padding-left: 23px;
}

.news-list time {
  font-weight: bold;
}

/* Footer */
.footer {
  margin-top: 42px;
  padding: 16px 0 26px;
  border-top: 1px solid #d9cfb9;
  color: var(--muted);
  font-size: 12px;
}

/* Medium screens */
@media (max-width: 1000px) {
  .page {
    width: calc(100% - 48px);
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 38px;
  }

  .portrait {
    width: 200px;
    height: 200px;
  }

  .research-figure {
    width: 190px;
  }

  .work-item {
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 18px;
    padding-left: 0;
    padding-right: 0;
  }

  .teaching-item {
    grid-template-columns: repeat(3, max-content);
    column-gap: 18px;
  }

  .teaching-item h3 {
    grid-column: 1 / -1;
  }

  .teaching-term {
    text-align: left;
  }
}

/* Small screens */
@media (max-width: 760px) {
  html {
    scroll-padding-top: 88px;
  }

  .topbar nav {
    min-height: 62px;
    gap: 23px;
    padding: 0 22px;
  }

  .topbar a {
    font-size: 16px;
  }

  .page {
    display: block;
    width: min(100% - 40px, 620px);
    margin-top: 30px;
  }

  .profile {
    position: static;
    margin-bottom: 40px;
  }

  .portrait {
    width: 190px;
    height: 190px;
  }

  .profile h1 {
    font-size: 28px;
  }

  .profile-links {
    margin: 13px 0;
  }

  h2 {
    font-size: 24px;
  }

  .research-figure {
    width: 195px;
    margin-left: 16px;
  }

  .work-item {
    grid-template-columns: 145px minmax(0, 1fr);
  }
}

/* Extra-small screens */
@media (max-width: 440px) {
  .topbar nav {
    gap: 18px;
    padding: 0 15px;
  }

  .topbar .brand {
    width: 25px;
    height: 25px;
  }

  body {
    font-size: 16px;
  }

  .research-figure {
    float: none;
    width: 230px;
    margin: 0 auto 20px;
  }

  .work-item {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 7px 0 17px;
  }

  .work-image {
    width: 180px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Print */
@media print {
  body {
    background: white;
    font-size: 11pt;
  }

  .topbar,
  .skip-link,
  .contact-button {
    display: none;
  }

  .page {
    display: block;
    width: 100%;
    margin: 0;
  }

  .profile {
    position: static;
    margin-bottom: 20px;
  }

  .portrait {
    width: 90px;
    height: 90px;
  }

  .work-item {
    break-inside: avoid;
  }
}

.chinese-name {
  font-family:
    "Songti SC",
    "Noto Serif CJK SC",
    "Source Han Serif SC",
    "SimSun",
    serif;
  font-weight: 400;
  letter-spacing: 0.05em;
}

.visitor-map {
  width: 100px;
  max-width: 100%;
  margin: 12px auto 0;
}

/* Remove the widget's default minimum height. */
.visitor-map #mapmyvisitors-widget {
  min-height: 0 !important;
}
