/*
 * Minimal overrides on top of the AcademicPages / Minimal Mistakes theme
 * (assets/css/main.css). Adds publication-item styling, the Douyin QR
 * popover, and a perfectly circular avatar (the source selfie.png is
 * not 1:1, so we crop it to a square at render time). Everything else
 * (masthead, sidebar, typography, footer) is inherited from main.css to
 * match https://yczhou001.github.io/ exactly.
 */

/* Force a perfectly circular avatar regardless of source aspect ratio */
.sidebar .author__avatar img {
  display: block;
  width: 175px;
  height: 175px;
  max-width: 175px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center 20%;
  border-radius: 50%;
  margin: 0 auto;
}

@media (max-width: 64em) {
  .sidebar .author__avatar img {
    width: 110px;
    height: 110px;
    max-width: 110px;
  }
}

/* Publication list */
.pub-item {
  margin: 0 0 1.5em;
  padding: 0 0 1.2em;
  border-bottom: 1px solid #f2f3f3;
}

.pub-item:last-of-type {
  border-bottom: none;
}

.pub-item h3 {
  margin: 0 0 0.25em;
  font-size: 1.05em;
  line-height: 1.35;
  font-weight: 700;
}

.pub-item h3 a {
  color: #252a2e;
}

.pub-item h3 a:hover {
  color: #52adc8;
}

.pub-meta {
  margin: 0 0 0.5em !important;
  color: #6f777d;
  font-size: 0.92em;
}

.pub-links {
  margin: 0.3em 0 0 !important;
  font-size: 0.92em;
}

.pub-links a {
  font-weight: 600;
}

.pub-links span {
  color: #6f777d;
  margin: 0 4px;
}

/* Douyin QR popover on hover */
.qr-hover {
  position: relative;
}

.qr-hover > a {
  cursor: pointer;
}

.qr-card {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  width: 170px;
  padding: 10px;
  background: #fff;
  border: 1px solid #f2f3f3;
  border-radius: 4px;
  box-shadow: 0 14px 30px rgba(24, 33, 42, 0.12);
  opacity: 0;
  visibility: hidden;
  transition: opacity 140ms ease, visibility 140ms ease;
}

.qr-card img {
  display: block;
  width: 100%;
  height: auto;
}

.qr-caption {
  display: block;
  margin-top: 8px;
  color: #6f777d;
  font-size: 0.82rem;
  text-align: center;
}

.qr-hover:hover .qr-card,
.qr-hover:focus-within .qr-card {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 64em) {
  .qr-card {
    left: 50%;
    top: auto;
    bottom: calc(100% + 12px);
    transform: translateX(-50%);
  }
}
