/* Compact Academic Website - Inspired by MIT CSAIL style */

:root {
  /* Color scheme */
  --primary: #2e5fa3; /* Classic academic blue */
  --primary-light: #5b9aa9;
  --link-color: #1a73e8; /* Google blue for links */
  --text-dark: #222;
  --text-medium: #555;
  --text-light: #888;
  --bg-white: #ffffff;
  --border-light: #ddd;
  --border-dark: #222;
  --featured-bg: #f0f7fb;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;

  /* Compact spacing */
  --max-width: 900px;
  --section-spacing: 2.5rem;
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 15px;
  line-height: 1.5;
  scroll-behavior: smooth;
  scroll-padding-top: 47px; /* Account for fixed nav height */
  -webkit-text-size-adjust: 100%; /* Prevent iOS font size adjustment in landscape */
  text-size-adjust: 100%; /* Standard property */
}

body {
  font-family: var(--font-sans);
  color: var(--text-dark);
  background-color: var(--bg-white);
  padding-top: 47px; /* Height of nav to prevent content jump */
  overflow-anchor: none; /* Prevent browser scroll anchoring during dynamic content changes */
  -webkit-text-size-adjust: 100%; /* Prevent iOS font size adjustment in landscape */
  text-size-adjust: 100%; /* Standard property */
}

/* Compact Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-dark);
}

h1 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}
h2 {
  font-size: 1.3rem;
  margin: 2rem 0 0.8rem 0;
  font-weight: 700;
}
h3 {
  font-size: 1.1rem;
  margin: 1.5rem 0 0.6rem 0;
  font-weight: 600;
}
h4 {
  font-size: 1rem;
  font-weight: 600;
}

p {
  margin-bottom: 0.8rem;
}

/* Lists - keep bullets/numbers inside content area */
ul,
ol {
  margin-left: 0;
  padding-left: 1.5rem;
  margin-bottom: 0.8rem;
}

ul li,
ol li {
  margin-bottom: 0.3rem;
}

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

a:hover {
  text-decoration: underline;
}

/* Sticky Navigation Bar */
header {
  background-color: #ffffff;
  border-bottom: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: none;
  transition: transform 0.3s ease-in-out;
}

header.nav-hidden {
  transform: translateY(-100%);
}

nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.6rem 1.5rem 0.2rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
}

.site-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
}

.nav-links a {
  color: var(--text-medium);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
  text-decoration: none;
  border-bottom-color: var(--primary);
}

/* Section Navigation (on-page links) - Sticky, Subtle */
.section-nav {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  position: sticky;
  top: 47px;
  z-index: 100;
  font-size: 0.75rem;
}

.section-nav-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.5rem 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  background: #f9f9f9;
  border-bottom: 1px solid var(--border-light);
}

.section-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  list-style: none;
  align-items: center;
  margin: 0;
  padding: 0;
  justify-content: center;
}

.section-nav-links li {
  margin: 0;
}

.section-nav-links a {
  font-size: 0.75rem;
  color: var(--text-light);
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
  font-weight: 400;
}

.section-nav-links a:hover {
  color: var(--text-dark);
  background: #ffffff;
  text-decoration: none;
}

.section-nav-links a.active {
  color: var(--text-dark);
  background: #ffffff;
  font-weight: 500;
}

/* Main Container - Compact */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  position: relative;
  z-index: 1;
  background: var(--bg-white);
}

/* Compact Hero */
.hero {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 2rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.hero-content h1 {
  margin-bottom: 0.2rem;
}

.hero-title {
  font-size: 2rem;
  font-weight: 700;
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--text-medium);
  font-weight: 400;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.hero-bio {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-dark);
}

.hero-bio p {
  margin-bottom: 0.6rem;
}

.hero-links {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.hero-links a,
.hero-links .email-display {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.9rem;
  color: var(--link-color);
}

.email-display {
  font-family: "Courier New", monospace;
  font-size: 0.85rem;
  color: var(--text-medium);
  padding: 0.2rem 0.5rem;
  background: #f5f5f5;
  border-radius: 3px;
  user-select: all;
}

.hero-image img {
  width: 180px;
  height: 180px;
  border-radius: 4px;
  object-fit: cover;
  border: 3px solid var(--border-dark);
}

.hero-affiliation-details {
  font-size: 0.85rem;
  color: var(--text-medium);
  line-height: 1.4;
  margin-top: 0.3rem;
}

/* Compact Sections */
.section {
  margin-bottom: var(--section-spacing);
  scroll-margin-top: 80px;
}

.section-header {
  margin-bottom: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--text-dark);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.section-header h2 {
  margin: 0;
  font-size: 1.3rem;
  color: var(--text-dark);
}

.section-header-link {
  font-size: 0.9rem;
  color: var(--link-color);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.section-header-link:hover {
  text-decoration: underline;
}

/* Compact Lists */
.news-list,
.course-list,
.student-list,
.award-list,
.service-list {
  list-style: none;
}

.news-item,
.course-item,
.student-item,
.award-item,
.service-item {
  padding: 0.6rem 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.95rem;
}

.news-item:last-child,
.course-item:last-child,
.student-item:last-child,
.award-item:last-child,
.service-item:last-child {
  border-bottom: none;
}

/* News - Compact inline format */
.news-item {
  display: flex;
  gap: 1rem;
  align-items: baseline;
}

.news-date {
  color: var(--text-medium);
  font-weight: 600;
  font-size: 0.85rem;
  min-width: 90px;
  flex-shrink: 0;
}

.news-content {
  line-height: 1.5;
  font-size: 0.95rem;
}

/* Featured news items */
.news-featured {
  background: #fffbf0;
  border-left: 3px solid #f0ad4e;
  padding-left: 0.8rem !important;
  margin-left: -0.8rem;
  border-radius: 3px;
}

.news-featured .news-date {
  color: #d08700;
  font-weight: 700;
}

/* Course items */
.course-code {
  display: inline-block;
  background: #e8f4f8;
  color: var(--primary);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-right: 0.5rem;
}

.course-title {
  font-weight: 500;
  font-size: 0.95rem;
}

.course-title-link {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-dark);
  text-decoration: none;
}

.course-title-link:hover {
  color: var(--link-color);
  text-decoration: underline;
}

.course-term {
  color: var(--text-medium);
  font-size: 0.85rem;
  margin-left: 0.5rem;
}

.course-description {
  color: var(--text-medium);
  font-size: 0.9rem;
  margin-top: 0.3rem;
}

/* Student items - Regular (for postdocs) */
.student-item {
  margin-bottom: 0.8rem;
}

.student-name {
  font-weight: 500;
  font-size: 0.95rem;
}

.student-name a {
  color: var(--link-color);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.student-name a:hover {
  border-bottom-color: var(--link-color);
}

.student-info {
  color: var(--text-medium);
  font-size: 0.9rem;
  margin-top: 0.2rem;
}

/* Student items - Compact (for PhD students) */
.student-list-compact {
  list-style: none;
  padding: 0;
}

.student-item-compact {
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

.student-year {
  color: var(--text-medium);
  font-size: 0.85rem;
  margin-left: 0.3rem;
}

.student-info-inline {
  color: var(--text-medium);
  font-size: 0.9rem;
}

/* Student items - Inline (for Masters and Undergrads) */
.student-list-inline {
  line-height: 1.8;
  font-size: 0.95rem;
}

.student-list-inline a {
  font-weight: 500;
  color: var(--link-color);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.student-list-inline a:hover {
  border-bottom-color: var(--link-color);
}

.student-year-inline {
  color: var(--text-medium);
  font-size: 0.85rem;
  margin-left: 0.2rem;
}

/* Alumni items */
.alumni-list {
  list-style: none;
  padding: 0;
}

.alumni-item {
  margin-bottom: 0.6rem;
  font-size: 0.95rem;
}

.alumni-name {
  font-weight: 500;
}

.alumni-name a {
  color: var(--link-color);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.alumni-name a:hover {
  border-bottom-color: var(--link-color);
}

.alumni-degree {
  color: var(--text-medium);
  font-size: 0.85rem;
  margin-left: 0.3rem;
}

.alumni-year {
  color: var(--text-medium);
  font-size: 0.85rem;
  margin-left: 0.2rem;
}

.alumni-current {
  color: var(--text-medium);
  font-size: 0.9rem;
  margin-left: 0.3rem;
}

/* Research Interests - compact tags */
.research-interests {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.interest-tag {
  background: transparent;
  padding: 0.3rem 0.5rem 0.3rem 0.8rem;
  font-size: 0.85rem;
  color: var(--text-dark);
  font-weight: 500;
  cursor: default;
  border-left: 3px solid var(--primary-light);
  margin-left: 0.2rem;
}

/* Awards & Service lists */
.award-item {
  padding: 0.05rem 0;
  border-bottom: none;
  line-height: 1.3;
  font-size: 0.85rem;
}

.award-year {
  display: inline-block;
  font-weight: 600;
  color: var(--text-medium);
  min-width: 75px;
  margin-right: 0.4rem;
  font-size: 0.8rem;
}

.award-list {
  margin-bottom: 0.5rem !important;
}

/* Service - Very compact inline format */
.service-item {
  padding: 0.15rem 0;
  border-bottom: none;
  line-height: 1.4;
  font-size: 0.85rem;
}

.service-year {
  display: inline-block;
  font-weight: 600;
  color: var(--text-medium);
  min-width: 75px;
  margin-right: 0.4rem;
  font-size: 0.8rem;
}

.service-list {
  margin-bottom: 0.8rem !important;
}

#service h3 {
  margin-top: 0.8rem;
  margin-bottom: 0.3rem;
  font-size: 0.95rem;
  font-weight: 600;
}

/* Highlighted service items */
.service-item-highlight {
  background: #f9f9f9;
  padding: 0.25rem 0.5rem;
  margin-left: -0.5rem;
  margin-right: -0.5rem;
  border-left: 3px solid var(--primary);
  border-radius: 2px;
}

/* Publications - Very Compact */
.page-intro {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-medium);
  margin-bottom: 1rem;
  padding: 0.8rem 1rem;
  background: #f9f9f9;
  border-left: 3px solid var(--primary);
  border-radius: 2px;
}

.filter-section {
  background: #f9f9f9;
  padding: 0.8rem 1rem;
  border-radius: 4px;
  margin-bottom: 2rem;
  border: 1px solid var(--border-light);
  position: sticky;
  top: 47px; /* Align with nav height */
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: top 0.3s ease-in-out;
}

/* When nav is hidden, filter section moves to top */
header.nav-hidden ~ main .filter-section {
  top: 0;
}

.filter-group {
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-label {
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0;
  font-size: 0.8rem;
  white-space: nowrap;
  min-width: 60px;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  flex: 1;
}

.filter-btn {
  padding: 0.25rem 0.7rem;
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 3px;
  color: var(--text-medium);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.2s;
  position: relative;
}

.filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--featured-bg);
}

.filter-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Custom tooltip for filter buttons */
.filter-btn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #2c3e50;
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.4;
  white-space: normal;
  width: 280px;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.filter-btn[data-tooltip]::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #2c3e50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 1000;
}

.filter-btn[data-tooltip]:hover::after,
.filter-btn[data-tooltip]:hover::before {
  opacity: 1;
}

/* Compact Publications List */
.publications-list {
  list-style: none;
  /* Prevent browser from auto-adjusting scroll when content changes */
  overflow-anchor: none;
}

.publication {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1rem;
  padding: 1.2rem 0.6rem;
  margin: 0 -0.8rem 0.5rem -0.8rem;
  border-bottom: 1px solid #e8e8e8;
  transition: background 0.2s;
}

.publication:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.publication:hover {
  background: #fafafa;
}

.publication.featured {
  background: var(--featured-bg);
  border: 1px solid #d4e9f5;
  border-left: 3px solid var(--primary);
  border-radius: 4px;
  padding-left: 1rem;
  margin-left: -1rem;
  margin-bottom: 0.5rem;
}

.publication.featured:hover {
  background: #e6f2f9;
  border-top-color: #b8ddf0;
  border-right-color: #b8ddf0;
  border-bottom-color: #b8ddf0;
  box-shadow: 0 2px 8px rgba(46, 95, 163, 0.1);
}

.publication.hidden {
  display: none;
}

/* Subtle fade-in animation for newly appearing publications */
@keyframes subtleFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.publication.filter-animate {
  animation: subtleFadeIn 0.3s ease-out forwards;
}

.pub-image {
  position: relative;
  width: 100%;
  /* aspect-ratio: 4/3; */
}

.pub-image img,
.pub-image video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 3px;
  border: 0px solid var(--border-light);
  opacity: 0.01;
  z-index: 0;
  transition: opacity 0.2s ease-in;
}

.pub-image img.loaded,
.pub-image video.loaded {
  opacity: 1;
  z-index: 1;
}

/* Placeholder for publications without images */
.pub-placeholder {
  display: flex;
  width: 100%;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 3px;
  border: 1px solid var(--border-light);
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 0;
}

.pub-placeholder svg {
  width: 40%;
  height: 40%;
  color: #adb5bd;
  opacity: 0.5;
}

.pub-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--primary);
  color: white;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.5);
  z-index: 2;
}

.pub-badge.in-review {
  background: #f59e0b;
  color: white;
}

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

.pub-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.3rem;
  line-height: 1.3;
}

.pub-title a {
  color: var(--text-dark);
}

.pub-title a:hover {
  color: var(--link-color);
}

.pub-authors {
  color: var(--text-medium);
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
  line-height: 1.4;
}

.pub-authors .me {
  font-weight: 600;
  color: var(--text-dark);
}

.pub-venue {
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  font-style: italic;
}

.pub-venue-link {
  color: var(--primary);
  text-decoration: none;
  font-style: italic;
}

.pub-venue-link:hover {
  color: var(--link-color);
  text-decoration: underline;
}

.pub-venue .year {
  color: var(--text-medium);
  margin-left: 0.3rem;
  font-style: normal;
}

.pub-award {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.15rem 0.5rem;
  background: #fef3c7;
  color: #92400e;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 600;
  font-style: normal;
}

.pub-acceptance-rate {
  color: var(--text-medium);
  font-size: 0.85rem;
  margin-left: 0.4rem;
  font-style: normal;
}

.pub-also-presented {
  color: var(--text-medium);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  font-style: italic;
}

.pub-tldr {
  color: var(--text-medium);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 0.5rem;
  padding: 0.5rem 0.7rem;
  background: #f9f9f9;
  border-left: 2px solid var(--primary-light);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.pub-tldr strong {
  color: var(--text-dark);
  font-weight: 600;
}

.pub-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.5rem;
}

.pub-tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  background: #f0f0f0;
  color: var(--text-dark);
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 500;
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: auto;
}

.pub-link {
  font-size: 0.85rem;
  color: var(--link-color);
  font-weight: 500;
}

.pub-link:hover {
  text-decoration: underline;
}

/* Publication media coverage */
.pub-media {
  margin-top: 0.8rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.9rem;
  line-height: 1.6;
}

.pub-media strong {
  color: var(--text-medium);
  font-weight: 600;
  margin-right: 0.4rem;
}

.pub-media-link {
  color: var(--link-color);
  text-decoration: none;
  font-weight: 500;
}

.pub-media-link:hover {
  text-decoration: underline;
}

/* Blog */
.blog-list {
  list-style: none;
}

.blog-post {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-light);
}

.blog-post:first-child {
  padding-top: 0;
}

.post-meta {
  color: var(--text-medium);
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}

.post-title {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.post-title a {
  color: var(--text-dark);
}

.post-title a:hover {
  color: var(--link-color);
}

.post-excerpt {
  color: var(--text-medium);
  line-height: 1.6;
  font-size: 0.95rem;
}

/* Footer - Compact */
footer {
  background: #f9f9f9;
  border-top: 1px solid var(--border-light);
  margin-top: 3rem;
  padding: 2rem 0;
}

.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 3fr 1fr 1fr;
  gap: 2rem;
  color: var(--text-medium);
  font-size: 0.85rem;
}

.footer-section p {
  margin: 0;
}

.footer-affiliations {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-medium);
}

.footer-heading {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dark);
  margin: 0 0 0.5rem 0;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links a {
  color: var(--text-medium);
  font-size: 0.85rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--link-color);
}

/* Talks & Media Page - Carousel */
.audience-section {
  margin-bottom: 4rem;
}

.audience-section h2 {
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.audience-description {
  color: var(--text-medium);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.carousel-container {
  position: relative;
  padding: 0 3rem;
  overflow: hidden; /* Hide cards that extend beyond container */
}

.carousel-track {
  display: flex;
  gap: 1.5rem;
  transition: transform 0.3s ease-out;
}

.talk-card {
  flex: 0 0 calc(33.333% - 1rem);
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.talk-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.talk-icon {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  text-align: center;
  color: var(--text-medium);
  opacity: 0.7;
}

.talk-thumbnail {
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 1rem;
  border: 1px solid var(--border-light);
}

.talk-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
  line-height: 1.4;
}

.talk-card h3 a {
  color: var(--text-dark);
  text-decoration: none;
}

.talk-card h3 a:hover {
  color: var(--text-dark);
  text-decoration: none;
}

.talk-venue {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.talk-description {
  font-size: 0.9rem;
  color: var(--text-medium);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.talk-link {
  display: inline-block;
  color: var(--link-color);
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.2s;
}

.talk-link:hover {
  color: var(--primary);
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.5rem;
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.2s;
  z-index: 10;
}

.carousel-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.carousel-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.carousel-btn:disabled:hover {
  background: white;
  color: var(--text-dark);
  border-color: var(--border-light);
}

.carousel-btn.prev {
  left: 0;
}

.carousel-btn.next {
  right: 0;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.carousel-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--border-light);
  cursor: pointer;
  transition: background 0.2s;
}

.carousel-dot.active {
  background: var(--primary);
}

.talks-footer {
  text-align: center;
  margin-top: 3rem;
  color: var(--text-medium);
}

/* Responsive */
@media (max-width: 568px) {
  html {
    font-size: 14px;
    scroll-padding-top: 0; /* No sticky nav on mobile */
  }

  /* Remove sticky nav on mobile */
  body {
    padding-top: 0;
  }

  header {
    position: relative; /* Not fixed on mobile */
  }

  nav {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
  }

  .site-title {
    font-size: 1rem;
  }

  .nav-links {
    gap: 0.8rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .nav-links a {
    font-size: 0.85rem;
  }

  main {
    padding: 1.5rem 1rem;
  }

  /* Don't make filter bar sticky on mobile */
  .filter-section {
    position: static;
    top: auto;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .hero-image {
    text-align: center;
  }

  .publication {
    grid-template-columns: 1fr;
    gap: 0.8rem;
    margin-right: 0rem;
  }

  .pub-image {
    width: 100%;
    aspect-ratio: 5/3;
  }

  .news-item {
    flex-direction: column;
    gap: 0.3rem;
  }

  .news-date {
    min-width: auto;
  }

  /* Talks carousel on mobile */
  .carousel-container {
    padding: 0 2.5rem;
  }

  .talk-card {
    flex: 0 0 100%;
  }

  .carousel-btn {
    width: 2rem;
    height: 2rem;
    font-size: 1.2rem;
  }

  /* Make section nav non-sticky on mobile */
  .section-nav {
    position: relative;
    top: auto;
  }

  .section-nav-content {
    padding: 0.5rem 0;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
  }

  .section-nav-content::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
  }

  .section-nav-links {
    gap: 0.3rem;
    flex-wrap: nowrap;
    padding: 0 1rem;
  }

  .section-nav-links a {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    text-align: left;
  }

  .footer-section:first-child {
    text-align: center;
  }
}

/* Disable sticky elements on short screens */
@media (max-height: 750px) {
  html {
    scroll-padding-top: 0;
  }

  body {
    padding-top: 0;
  }

  header {
    position: relative !important;
  }

  .filter-section {
    position: static !important;
    top: auto !important;
  }

  .section-nav {
    position: relative !important;
    top: auto !important;
  }
}

/* Utility Classes */
.text-muted {
  color: var(--text-medium);
}

.text-small {
  font-size: 0.85rem;
}

.mb-0 {
  margin-bottom: 0;
}
.mb-1 {
  margin-bottom: 0.8rem;
}
.mb-2 {
  margin-bottom: 1rem;
}
.mt-0 {
  margin-top: 0;
}
.mt-1 {
  margin-top: 0.8rem;
}
.mt-2 {
  margin-top: 1.5rem;
}

/* Remove default numbering from jekyll-scholar wrapper */
.bibliography {
  list-style: none;
  margin: 0;
  padding: 0;
}
.bibliography > li {
  list-style: none;
}
