/* ==========================================================================
   Publications Stylesheet - Directly modeled after MMLab / Chen Change Loy
   PI: LIU WENDI (wendi005@e.ntu.edu.sg)
   ========================================================================== */

.pub-page-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 48px;
  align-items: start;
  padding-top: 30px;
  padding-bottom: 80px;
}

/* ==========================================================================
   Sticky Left Sidebar
   ========================================================================== */
.pub-sidebar {
  position: sticky;
  top: 100px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.pub-sidebar-search {
  margin-bottom: 24px;
}

.pub-search-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.88rem;
  outline: none;
  transition: var(--transition);
}

.pub-search-input:focus {
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.sidebar-block {
  margin-bottom: 24px;
}

.sidebar-block:last-child {
  margin-bottom: 0;
}

.sidebar-heading {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 6px;
}

.sidebar-nav-list {
  list-style: none;
}

.sidebar-nav-list li {
  margin-bottom: 8px;
}

.sidebar-nav-list a {
  color: var(--text-main);
  font-size: 0.92rem;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  border-radius: 4px;
  transition: var(--transition);
}

.sidebar-nav-list a:hover {
  background-color: var(--light-bg);
  color: var(--primary-color);
  text-decoration: none;
}

.sidebar-nav-list a.active {
  background-color: rgba(181, 18, 27, 0.08);
  color: var(--primary-color);
  font-weight: 600;
}

.topic-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--light-bg);
  padding: 2px 7px;
  border-radius: 10px;
}

/* ==========================================================================
   Main Publications Content Column
   ========================================================================== */
.pub-content {
  min-width: 0; /* Prevents grid breakout */
}

.topic-section {
  margin-bottom: 64px;
  scroll-margin-top: 110px;
}

.topic-header {
  border-bottom: 2px solid #0f172a;
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.topic-title {
  font-size: 1.85rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #0f172a;
  letter-spacing: -0.3px;
}

.topic-description {
  font-size: 1.05rem;
  color: #475569;
  line-height: 1.7;
  margin-bottom: 20px;
  text-align: justify;
}

.topic-banner {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.subtopic-title {
  font-size: 1.15rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin: 28px 0 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.subtopic-title::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 16px;
  background: var(--primary-color);
  border-radius: 2px;
}

/* ==========================================================================
   Publication List & Item Cards
   ========================================================================== */
.pub-list {
  list-style: none;
}

.pub-item {
  position: relative;
  padding: 18px 20px;
  margin-bottom: 18px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: var(--transition);
}

.pub-item:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
}

.pub-item.highlight-author {
  border-left: 4px solid var(--primary-color);
}

.pub-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1.45;
  margin-bottom: 6px;
  display: block;
}

.pub-title a {
  color: inherit;
}

.pub-title a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.pub-authors {
  font-size: 0.92rem;
  color: #475569;
  line-height: 1.5;
  margin-bottom: 6px;
}

.pub-authors .pi-author {
  font-weight: 700;
  color: #0f172a;
  text-decoration: underline;
  text-decoration-color: var(--primary-color);
}

.pub-venue {
  font-size: 0.92rem;
  color: #64748b;
  margin-bottom: 12px;
}

.pub-venue strong {
  color: #0f172a;
  font-weight: 700;
}

.pub-venue .award-tag {
  display: inline-block;
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 4px;
  margin-left: 8px;
}

/* Links & Badges */
.pub-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.pub-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  background: #f1f5f9;
  padding: 3px 10px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
}

.pub-badge:hover {
  background: var(--dark-bg);
  color: #ffffff;
  border-color: var(--dark-bg);
  text-decoration: none;
}

.pub-badge.badge-primary {
  color: #1e3a8a;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.pub-badge.badge-primary:hover {
  background: #1e3a8a;
  color: #ffffff;
}

/* BibTeX Drawer */
.bibtex-box {
  display: none;
  margin-top: 14px;
  background: #0f172a;
  color: #f8fafc;
  padding: 16px;
  border-radius: 6px;
  position: relative;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  overflow-x: auto;
}

.bibtex-box.show {
  display: block;
}

.bibtex-copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #334155;
  color: #f8fafc;
  border: none;
  padding: 4px 10px;
  font-size: 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
}

.bibtex-copy-btn:hover {
  background: var(--primary-color);
}

/* Year Section Specific */
.year-marker {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.year-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: #0f172a;
}

.year-line {
  flex-grow: 1;
  height: 2px;
  background: var(--border-color);
}

/* Responsive */
@media (max-width: 992px) {
  .pub-page-container {
    grid-template-columns: 1fr;
  }
  .pub-sidebar {
    position: static;
    max-height: none;
  }
}
