/* =========================
   Academic Minimal Palette
========================= */

:root {
  --bg: #f4f6f8;
  --card-bg: #ffffff;
  --paper-bg: #fafcff;
  --text: #1c1f23;
  --muted: #5f6b76;
  --accent: #2f4f6f;
  --accent-soft: #4a6a8a;
  --border: #e1e5ea;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
  --radius: 14px;
  --paper-radius: 8px;
}

[data-theme="dark"] {
  --bg: #121417;
  --card-bg: #1c1f23;
  --paper-bg: #1c1f23;
  --text: #e6e9ed;
  --muted: #a0a8b0;
  --accent: #8faecc;
  --accent-soft: #a9c3dd;
  --border: #2a2f35;
  --shadow: none;
}

/* ========================= */

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

html {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "kern" 1, "liga" 1;
}

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.3s ease, color 0.3s ease;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2.8rem 1.5rem;
  width: 100%;
}

/* =========================
   Card Layout
========================= */

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 2.5rem 2.6rem;
  transition: background 0.3s ease, border 0.3s ease;
}

.layout {
  display: flex;
  align-items: center;
  gap: 2.2rem;
}

.photo img {
  width: 190px;
  border-radius: 6px;
  object-fit: cover;
}

.info {
  flex: 1;
}

/* =========================
   Typography
========================= */

h1 {
  font-size: 2.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.subtitle {
  font-size: 1.12rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.location {
  font-size: 0.92rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  margin-bottom: 0.85rem;
  line-height: 1.5;
}

.email {
  margin-bottom: 0.85rem;
}

.email a {
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.email a:hover {
  color: var(--accent-soft);
}

.location a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.location a:hover {
  color: var(--accent); 
}

/* =========================
   Navigation
========================= */

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 2.1rem;
  margin-top: 1.2rem;
}

.main-nav a {
  position: relative;
  text-decoration: none;
  color: var(--accent);
  font-weight: 500;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  padding-bottom: 3px;
}

.main-nav a::after {
  content: "";
  position: absolute;
  width: 0%;
  height: 1px;
  bottom: 0;
  left: 0;
  background-color: var(--accent);
  transition: width 0.25s ease;
}

.main-nav a:hover::after {
  width: 100%;
}

.main-nav a.active::after {
  content: "";
  position: absolute;
  width: 0%;
  height: 1px;
  bottom: 0;
  left: 0;
  background-color: var(--accent);
  transition: width 0.25s ease;
  width: 100%;
}

/* =========================
   Social Icons
========================= */

.social {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 1.3rem;
  margin-bottom: 0.9rem;
}

.social a {
  font-size: 1.2rem;
  line-height: 1;
  color: var(--muted);
  transition: color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.social a:hover {
  transform: translateY(-2px);
  color: var(--accent);
}

.social a.googlescholar:hover {
  color: #4285f4;
}

.social a.arxiv:hover {
  color: #d41414;
}

.social a.orcid:hover {
  color: #90ff80;
}

.social a.dblp:hover {
  color: #f9d004;
}

.social a.mathscinet:hover {
  color: #072582;
}

.social a.mathoverflow:hover {
  color: #f38810;
}

.social a.mathstodon:hover {
  color: #4f0c80;
}

.social a.bluesky:hover {
  color: #87ceeb;
}

.social a.pure:hover {
  color: #002e62;
}

.social a.github:hover {
  color: #000000;
}

.social a.linkedin:hover {
  color: #007bb6;
}

[data-theme="light"] .social a {
  color: #6b737c;
}

[data-theme="dark"] .social a {
  color: #9aa6b2;
}

[data-theme="dark"] .social a.github:hover {
  color: #ffffff;
}

/* =========================
   Footer
========================= */

footer {
  margin-top: auto;
  padding: 1.8rem 1rem;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.footer-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.2rem;
}

footer a {
  color: var(--muted);
  text-decoration: none;
  opacity: 0.8;
}

footer a:hover {
  opacity: 1;
  text-decoration: underline;
}

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--muted);
  transition: color 0.2s ease;
}

.theme-toggle:hover {
  color: var(--accent);
}

/* =========================
   Responsive
========================= */

@media (max-width: 750px) {
  .layout {
    flex-direction: column;
    text-align: center;
  }

  .main-nav ul {
    justify-content: center;
    flex-wrap: wrap;
  }

  .footer-inner {
    flex-direction: column;
    gap: 0.6rem;
  }
}

/* =========================
   Small Business Card (photo cropped)
========================= */

.small-card .photo img {
  width: 190px;       /* keep a compact width */
  height: 90px;      /* fixed height for layout */
  object-fit: cover;  /* crop top/bottom automatically */
  object-position: center; /* show the vertical center of the image */
  border-radius: 6px;
}

/* Layout adjustments */
.small-card .layout {
  gap: 1.6rem;
  align-items: center;
}

/* Responsive adjustments */
@media (max-width: 750px) {
  .small-card .layout {
    flex-direction: column;
    text-align: center;
  }

  .small-card .photo img {
    height: 160px; /* slightly smaller on mobile */
  }

  .main-nav.secondary ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }
}

[data-theme="dark"] .small-card .info h1 a {
  color: var(--accent);
}

[data-theme="light"] .small-card .info h1 a {
  color: #000000;
}

.small-card .info h1 a {
  text-decoration: none;
  text-color:;
}

.small-card .info h1 a:hover {
  color: var(--accent-soft);
}


/* =========================
   News List – proper inline links
========================= */

.news-list {
  list-style: none;
  padding-left: 0;
  margin-top: 2rem;
  display: grid;
  gap: 0.5rem;
}

.news-list li {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 0.2rem;
  display: grid;
  grid-template-columns: 12ch 1fr; 
  grid-column-gap: 0.8rem;
  align-items: start; 
}

.news-list .news-date {
  font-weight: 500;
  color: var(--muted);
  margin-right: 0.6rem;
  min-width: 6.2ch;
}

.news-list li a {
  color: var(--accent);
  text-decoration: none;
  display: inline;      
  padding: 0;           
  margin: 0;            
  transform: none;      
  transition: color 0.2s ease;
}

.news-list li a:hover {
  color: var(--accent-soft);
  text-decoration: underline;
}

/* Dark mode adjustments */
[data-theme="dark"] .news-list li {
  color: var(--text);
}

[data-theme="dark"] .news-list li a {
  color: var(--accent-soft);
}

/* =========================
   Older News Link Styling
========================= */

#show-older-news {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  margin-bottom: 0.8rem;
  margin-left: 13ch;
  display: inline-block;
  transition: color 0.2s ease, text-decoration 0.2s ease;
  margin-top: 1rem;
}

#show-older-news:hover {
  color: var(--accent-soft);
  text-decoration: underline;
}

/* =========================
   About Page Styling
========================= */

.about-text {
  margin-top: 2rem;        
  display: block;
}

.about-text h2 {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.about-text ul {
  margin-left: 1.5rem;   
}

.about-text ul li {
  margin-bottom: 0.25rem;
}

.about-text a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

.about-text a:hover {
  color: var(--accent-soft);
  text-decoration: underline;
}

/* Dark mode adjustments */
[data-theme="dark"] .about-text a {
  color: var(--accent-soft);
}

[data-theme="dark"] .about-text a:hover {
  color: #A6CE39;
}


/* =========================
   Group Page Styling
========================= */

.groupphoto a::before {
  transform: scaleX(0);
}



/* =========================
   Research Page Styling
========================= */

.publications-list {
  list-style-type: none;  
}

.paper {
  background: var(--paper-bg);
  border-radius: var(--paper-radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 1rem 1rem;
}

.paper .title {
  font-weight: bold;
}

.paper .detail {
  /*font-style: italic;*/
}

.paper .link {
  color: #bbbbbb;
}


/* =========================================
   Publication Controls Layout (Refined)
========================================= */

.publication-controls {
  display: flex;
  flex-direction: column;
  font-size: 0.95rem;
  margin-top: 1rem;
}

/* Two horizontal rows */

.publication-controls > .year-slider,
.publication-controls > .type-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

/* ---------- Row 1: Year ---------- */

.year-slider {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding-right: 2rem;
}

.year-display {
  font-size: 0.9rem;
  color: var(--muted);
  white-space: nowrap;
  padding-left: 2rem;
}

.publication-count {
  font-size: 0.9rem;
  color: var(--muted);
  white-space: nowrap;
  padding-left: 2rem;  
}

/* Slider must take remaining space */

.range-container {
  position: relative;
  flex: 1;
  height: 28px;
  min-width: 220px;     /* prevents collapse */
  max-width: 550px;     /* keeps it elegant */
}

/* Track */

.range-track {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--border);
  transform: translateY(-50%);
  border-radius: 2px;
}

/* Fill */

.range-fill {
  position: absolute;
  top: 50%;
  height: 3px;
  background: var(--accent);
  transform: translateY(-50%);
  border-radius: 2px;
  transition: left 0.1s ease, width 0.1s ease;
}

/* Thumbs */

.range-thumb {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: background 0.2s ease;
  z-index: 2;   /* important */
}

.range-thumb:hover {
  background: var(--accent-soft);
}

/* ---------- Row 2: Count + Types ---------- */

.type-filter-row {
  width: 100%;
  padding-right: 1.5rem;
}

.publication-count {
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

/* Type buttons aligned right */

.type-filter {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.type-filter span {
  color: var(--muted);
  margin-right: 0.4rem;
}

.type-filter label {
  cursor: pointer;
  white-space: nowrap;
}

.type-filter input {
  margin-right: 0.25rem;
}