/* ─── Reset / base ─────────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 70px;
}

body {
  max-width: 860px;
  margin: auto;
  padding: 0 1.2rem;
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  color: #1a1a1a;
}

a {
  color: #2563eb;
}

/* ─── Navbar ────────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  gap: 2rem;
  background: white;
  padding: 1rem 0;
  border-bottom: 1px solid #e5e5e5;
  font-weight: 500;
}

.navbar a {
  text-decoration: none;
  color: #333;
  position: relative;
  padding-bottom: 4px;
}

.navbar a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0%;
  height: 2px;
  background-color: #2563eb;
  transition: width 0.2s ease;
}

.navbar a:hover::after {
  width: 100%;
}

.navbar a.active {
  font-weight: 700;
}

.nav-section {
  font-weight: 350;
  color: #666;
  margin-left: -0.8rem;
}

/* ─── Hero / header ─────────────────────────────────────────────── */
.hero {
  padding: 2rem 0 1.5rem;
}

.hero-name {
  text-align: center;
  font-size: 2.2rem;
  font-weight: 400;
  margin: 0 0 1.6rem;
  letter-spacing: -0.01em;
}

.hero-name strong {
  font-weight: 700;
}

.hero-body {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2rem;
  align-items: center;
}

.hero-photo {
  width: 250px;
  border-radius: 10px;
  display: block;
}

.hero-content {
  font-size: 1rem;
}

.hero-affil {
  font-size: 1.05rem;
  color: #555;
  margin: 0 0 0.9rem;
}

.hero-content p {
  margin: 0 0 0.7rem;
}

/* ─── Social links ──────────────────────────────────────────────── */
.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.1rem;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.75rem;
  border: 1px solid #c8d4e3;
  border-radius: 6px;
  text-decoration: none;
  color: #2c5aa0;
  font-size: 0.88rem;
  font-weight: 500;
  background: #f6f8fb;
  transition: background 0.15s, border-color 0.15s;
}

.social-links a:hover {
  background: #e0ecff;
  border-color: #2563eb;
}

/* ─── Section shell ─────────────────────────────────────────────── */
.sec {
  padding: 1.3rem 1.6rem;
  margin: 1.5rem 0;
  border-radius: 10px;
  background: #f8f8f8;
  border-left: 4px solid #c6d6f5;
}

.sec > h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

/* ─── Conference / venue tag ────────────────────────────────────── */
.conf-tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: #2563eb;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-right: 0.3rem;
  vertical-align: middle;
}

.conf-tag.conf-lecture {
  background: #7c3aed;
}

/* ─── Publication / lecture cards ───────────────────────────────── */
.pub-card {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 1.3rem;
  align-items: start;
  padding: 1.1rem 0;
  border-bottom: 1px solid #e2e8f0;
}

.pub-card:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* Wrapper gives the thumbnail a fixed height and anchors the hover preview */
.pub-img-wrap {
  position: relative;
  width: 150px;
  height: 108px;
  flex-shrink: 0;
}

/* Real paper image — cropped to fixed height */
.pub-img {
  width: 150px;
  height: 108px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #dde4ed;
  display: block;
}

/* Full-size preview that appears to the right on hover */
.pub-img-preview {
  position: absolute;
  left: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%) scale(0.97);
  width: 340px;
  border-radius: 8px;
  border: 1px solid #dde4ed;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
  background: white;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 200;
}

.pub-img-wrap:hover .pub-img-preview {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

/* Placeholder shown until a real image is available */
.pub-img-placeholder {
  width: 150px;
  height: 108px;
  border-radius: 6px;
  border: 1px dashed #b0bec5;
  background: #eef1f5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #90a4ae;
  font-size: 1.6rem;
  flex-shrink: 0;
  box-sizing: border-box;
}

.pub-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.pub-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.4;
}

.pub-title a {
  color: #1a1a1a;
  text-decoration: none;
}

.pub-title a:hover {
  color: #2563eb;
  text-decoration: underline;
}

.pub-authors {
  font-size: 0.9rem;
  color: #555;
  margin: 0;
}

.pub-venue {
  font-size: 0.88rem;
  color: #666;
  margin: 0;
}

/* ─── ACM artifact badges ───────────────────────────────────────── */
.pub-badges {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.3rem;
}

.pub-badges img {
  height: 48px;
  width: auto;
}

/* ─── Paper action links ────────────────────────────────────────── */
.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.2rem;
}

.pub-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  padding: 0.22rem 0.6rem;
  border: 1px solid #c8d4e3;
  border-radius: 5px;
  text-decoration: none;
  color: #2c5aa0;
  background: #f0f5ff;
  transition: background 0.15s, border-color 0.15s;
}

.pub-links a:hover {
  background: #dbeafe;
  border-color: #2563eb;
}

/* ─── BibTeX collapsible ────────────────────────────────────────── */
.bibtex-block {
  margin-top: 0.4rem;
}

/* display:contents makes the <details> element disappear from the layout
   tree while keeping its DOM semantics. The <summary> and <pre> become
   direct flex items of .pub-links: the summary sits inline with the other
   buttons, and the pre (when details is open) takes a full-width row and
   pushes content below downward. */
.pub-links .bibtex-block {
  display: contents;
}

.pub-links .bibtex-block pre {
  flex-basis: 100%;
  margin-top: 0.1rem;
}

.bibtex-block summary {
  cursor: pointer;
  font-size: 0.82rem;
  color: #2c5aa0;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.6rem;
  border: 1px solid #c8d4e3;
  border-radius: 5px;
  background: #f0f5ff;
  user-select: none;
  transition: background 0.15s;
}

.bibtex-block summary::-webkit-details-marker {
  display: none;
}

.bibtex-block summary:hover {
  background: #dbeafe;
  border-color: #2563eb;
}

.bibtex-block pre {
  margin-top: 0.5rem;
  background: #f4f6f9;
  border: 1px solid #dde4ed;
  border-radius: 6px;
  padding: 0.8rem 1rem;
  font-size: 0.78rem;
  overflow-x: auto;
  white-space: pre;
  line-height: 1.5;
}

.bibtex-pre-wrap {
  position: relative;
}

.bibtex-copy-btn {
  position: absolute;
  top: 0.85rem;
  right: 0.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  background: #ffffff;
  color: #4b5563;
  border: 1px solid #dde4ed;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.78rem;
  padding: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  z-index: 1;
}

.bibtex-copy-btn:hover {
  background: #eff3f9;
  color: #2c5aa0;
  border-color: #2563eb;
}

.bibtex-copy-btn.copied {
  color: #16a34a;
  border-color: #16a34a;
}

/* ─── Term badge ────────────────────────────────────────────────── */
.term-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  color: #4b5563;
  background: #e5e7eb;
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  margin-left: 0.3rem;
  vertical-align: middle;
}

/* ─── Teaching list ─────────────────────────────────────────────── */
.teaching-list {
  margin: 0.5rem 0 0;
  padding: 0;
}

.teaching-list dt {
  font-size: 1rem;
  margin-top: 0.9rem;
}

.teaching-list dt:first-child {
  margin-top: 0;
}

.teaching-list dd {
  margin: 0.25rem 0 0 0;
  padding: 0;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  color: #444;
  font-size: 0.95rem;
}

/* ─── Mobile ────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .hero-body {
    grid-template-columns: 1fr;
  }

  .hero-photo {
    width: 150px;
    margin: 0 auto;
  }

  .pub-card {
    grid-template-columns: 1fr;
  }

  .pub-img-wrap {
    width: 100%;
    height: 120px;
  }

  .pub-img,
  .pub-img-placeholder {
    width: 100%;
    height: 120px;
  }

  .pub-img-preview {
    display: none;
  }
}

/* ─── Highlight / info boxes (kept for future use) ──────────────── */
mark {
  background-color: #fff3b0;
  padding: 0.1em 0.25em;
  border-radius: 3px;
}

.info,
.warning,
.note {
  position: relative;
  padding: 1rem 1.2rem 1rem 3.2rem;
  margin: 1.2rem 0;
  border: 1px solid;
  border-radius: 8px;
  line-height: 1.5;
}

.info    { background: #eef4ff; border-color: #3a6fdc; color: #1f3b73; }
.warning { background: #fff3b0; border-color: #e06c00; color: #5a2d00; }
.note    { background: #f7f7f7; border-color: #999;    color: #333;    }

.info::before,
.warning::before,
.note::before {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: "Font Awesome 7 Free";
  font-weight: 900;
  font-size: 1.4rem;
}

.info::before    { content: "\f05a"; color: #3a6fdc; }
.warning::before { content: "\f071"; color: #e06c00; }
.note::before    { content: "\f249"; color: #666;    }
