/* Academic Pages Main CSS - TypeScript Version */

/* Variables */
:root {
  --primary-color: #494e52;
  --sidebar-bg: #eae7d9;
  --link-color: #1e6bb8;
  --text-color: #333;
  --text-muted: #5c5c5c;   /* #666 fell to 4.45:1 on the warm sidebar */
  --accent-color: #0a5fc4;   /* white text clears AA on this; #007bff did not */
  --gray-light: #e6e3d4;
  --border-color: #d9d5c4;
  --box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
  --background-color: #f2f0e4;
  --nav-bg: #f2f0e4;
  --card-bg: #ffffff;
  --card-background: #ffffff;
  --hover-bg: #e6e3d4;
}

/* Dark theme variables */
[data-theme="dark"] {
  --primary-color: #4a4d57;
  --sidebar-bg: #2a2b31;
  --link-color: #7cc4ff;
  --text-color: #ffffff;
  --text-muted: #b9bcc4;
  --accent-color: #155ea8;
  --gray-light: #3a3c44;
  --border-color: #3d3f47;
  --box-shadow: 0 2px 3px rgba(0, 0, 0, 0.5);
  --background-color: #232429;
  --nav-bg: #1c1d21;
  --card-bg: #2d2f36;
  --card-background: #2d2f36;
  --hover-bg: #3a3c44;
}

/* Base Styles */
* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Roboto", "Segoe UI", "Helvetica Neue", "Lucida Grande", Arial, sans-serif;
  line-height: 1.5;
  color: var(--text-color);
  background-color: var(--background-color);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin: 2em 0 0.5em;
  line-height: 1.2;
  font-family: -apple-system, BlinkMacSystemFont, "Roboto", "Segoe UI", "Helvetica Neue", "Lucida Grande", Arial, sans-serif;
  font-weight: bold;
}

h1 { font-size: 1.563em; }
h2 { font-size: 1.25em; }
h3 { font-size: 1.125em; }

p {
  margin-bottom: 1.3em;
}

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

a:hover {
  color: #0056b3;
  text-decoration: underline;
}

/* Navigation */
.site-nav {
  background-color: var(--nav-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 1em 0;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background-color 0.3s ease;
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title a {
  font-size: 1.5em;
  font-weight: bold;
  color: var(--text-color);
  text-decoration: none;
}

.nav-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 2em;
}

.nav-list a {
  color: var(--text-color);
  font-weight: 500;
  padding: 0.5em 1em;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

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

/* Layout */
.layout--single {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2em 1em;
}

.page {
  display: flex;
  gap: 2em;
}

.page__inner-wrap {
  display: flex;
  width: 100%;
  gap: 2em;
}

/* Sidebar */
.sidebar {
  flex: 0 0 250px;
  background-color: var(--sidebar-bg);
  padding: 2em;
  border-radius: 8px;
  height: fit-content;
  position: sticky;
  top: 100px;
}

.author__avatar {
  text-align: center;
  margin-bottom: 1.5em;
}

.author__avatar-image {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: var(--box-shadow);
}

.author__content {
  text-align: left;
}

.author__name {
  margin: 0 0 0.5em;
  font-size: 1.2em;
  text-align: left;
}

.author__bio {
  font-style: italic;
  color: #666;
  margin-bottom: 1.5em;
  text-align: left;
}

.author__urls {
  list-style: none;
  padding: 0;
  margin: 0;
}

.author__urls li {
  margin-bottom: 0.8em;
  font-size: 0.9em;
}

.author__urls a {
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.3em 0;
  transition: all 0.3s ease;
}

.author__urls a:hover {
  color: var(--link-color);
  transform: translateX(3px);
}

/* Colorful Icons */
.author__urls .fas.fa-map-marker-alt {
  color: #dc3545;
}

.author__urls .fas.fa-envelope {
  color: #28a745;
}

.author__urls .fas.fa-phone {
  color: #ffc107;
}

.author__urls .fas.fa-globe {
  color: #007bff;
}

.author__urls .ai.ai-google-scholar {
  color: #4285f4;
}

.author__urls .ai.ai-researchgate {
  color: #00d0b7;
}

.author__urls .fab.fa-github {
  color: #333;
}

.author__urls .fas.fa-face-smiling-hands {
  color: #fed11c;
}

.author__urls .fab.fa-kaggle {
  color: #20beff;
}

.author__urls .fab.fa-linkedin {
  color: #0077b5;
}

.author__urls .fab.fa-twitter {
  color: #1da1f2;
}

.author__urls .ai.ai-orcid {
  color: #a6ce39;
}

/* Main Content */
.page__content {
  flex: 1;
  min-width: 0;
}

.page__title {
  margin-top: 0;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5em;
}

/* About Cards */
.about_card {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  padding: 20px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-family: Arial, sans-serif;
  line-height: 1.6;
  box-shadow: var(--box-shadow);
  transition: box-shadow 0.3s ease;
}

.about_card:hover {
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

.about_card__logo {
  margin: 0 25px 0 0;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  object-fit: contain;
}

.about_card__content {
  flex: 1;
}

.about_card__content__title {
  font-weight: bold;
  font-size: 1.1rem;
  margin-bottom: 5px;
}

.about_card__content__subtitle {
  font-style: italic;
  color: #555;
}

.about_card__content__date,
.about_card__content__achievement {
  display: block;
  margin-top: 5px;
  font-size: 0.95rem;
  color: #666;
}

.about_card__content__details {
  margin-top: 10px;
  font-size: 0.9rem;
  color: #444;
  line-height: 1.4;
  text-align: justify;
  text-justify: inter-word;
}

.about_card__content__details ul {
  margin: 0;
  padding-left: 1.5em;
}

.about_card__content__details li {
  margin-bottom: 0.5em;
}

/* Skills */
.about_item {
  border-left: 4px solid #d3d3d3;
  padding: 15px;
  margin-bottom: 20px;
  background-color: var(--card-bg);
  border-radius: 8px;
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

.about_item:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.about_item strong {
  font-size: 1.1em;
  color: var(--text-color);
}

.about_item span {
  font-size: 0.95em;
  color: var(--text-color);
}

/* Publications */
.publications-list {
  margin: 2em 0;
}

.publication-item {
  margin-bottom: 1.5em;
  padding: 1em;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: var(--card-bg);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.publication-title {
  margin-bottom: 0.5em;
}

.publication-venue {
  margin-bottom: 0.3em;
}

.publication-authors {
  color: #666;
}

/* Footer */
.page__footer {
  margin-top: 3em;
  padding: 2em 0;
  border-top: 1px solid var(--border-color);
  background-color: var(--sidebar-bg);
}

.page__footer-follow {
  text-align: center;
  margin-bottom: 1em;
}

.page__footer-follow ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  gap: 1em;
  flex-wrap: wrap;
}

.page__footer-copyright {
  text-align: center;
  font-size: 0.9em;
  color: var(--text-muted);
}

/* Social Icons */
.social-icons a {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
}

.fab, .fas, .ai {
  width: 1.2em;
  text-align: center;
}

/* Portfolio Styles */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2em;
  margin: 2em 0;
}

.portfolio-item {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
  background-color: var(--card-bg);
}

.portfolio-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.portfolio-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.portfolio-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.portfolio-item:hover .portfolio-image img {
  transform: scale(1.05);
}

.portfolio-content {
  padding: 1.5em;
}

.portfolio-content h3 {
  margin: 0 0 0.5em 0;
  color: var(--text-color);
}

.portfolio-content p {
  color: #666;
  margin-bottom: 1em;
  line-height: 1.5;
}

.portfolio-tags {
  margin-bottom: 1em;
}

.tag {
  display: inline-block;
  background-color: var(--gray-light);
  color: var(--text-color);
  padding: 0.3em 0.6em;
  border-radius: 15px;
  font-size: 0.8em;
  margin-right: 0.5em;
  margin-bottom: 0.3em;
}

.portfolio-links {
  display: flex;
  gap: 1em;
}

.btn-link {
  padding: 0.5em 1em;
  background-color: var(--link-color);
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.9em;
  transition: background-color 0.3s ease;
}

.btn-link:hover {
  background-color: #0056b3;
  text-decoration: none;
  color: white;
}

/* File Upload Styles */
.generate-section {
  margin-top: 3em;
  padding: 2em;
  background-color: var(--sidebar-bg);
  border-radius: 8px;
}

.file-upload-area {
  margin-top: 1em;
}

.file-upload-area input[type="file"] {
  margin-bottom: 1em;
  padding: 0.5em;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  width: 100%;
}

.file-upload-area button {
  background-color: var(--link-color);
  color: white;
  border: none;
  padding: 0.7em 1.5em;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1em;
}

.file-upload-area button:hover {
  background-color: #0056b3;
}

/* Navigation current page highlight */
.nav-list a.current,
.navbar-btn.active {
  background-color: #20beff;
  color: #0b2a3a !important;
  border-radius: 6px;
  box-shadow: 0 0 0 2px #20beff;
  outline: none;
}

/* Consistent navbar button style */
.navbar-btn {
  color: var(--text-color);
  font-weight: 500;
  padding: 0.5em 1.2em;
  border-radius: 6px;
  background: none;
  border: none;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  font-size: 1em;
  margin: 0 0.2em;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.navbar-btn:hover {
  background: #e6f7ff;
  color: #20beff;
  text-decoration: none;
}

/* Publication abstract toggle */
.publication-abstract {
  margin-top: 1em;
  padding: 1em;
  background-color: var(--card-bg);
  border-left: 4px solid var(--link-color);
  border-radius: 0 4px 4px 0;
  transition: background-color 0.3s ease;
}

/* Teaching & Talks Styles */
.teaching-item, .talk-item {
  margin-bottom: 2em;
  padding: 1.5em;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: var(--card-bg);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.teaching-header, .talk-header {
  margin-bottom: 1em;
}

.teaching-header h3, .talk-item h3 {
  margin: 0 0 0.5em 0;
  color: var(--text-color);
}

.teaching-meta {
  display: flex;
  gap: 1em;
  flex-wrap: wrap;
  margin-bottom: 0.5em;
}

.term, .institution {
  background-color: var(--gray-light);
  padding: 0.3em 0.6em;
  border-radius: 15px;
  font-size: 0.9em;
  color: var(--text-color);
}

.talk-date {
  background-color: var(--link-color);
  color: white;
  padding: 0.3em 0.6em;
  border-radius: 15px;
  font-size: 0.9em;
  display: inline-block;
  margin-bottom: 0.5em;
}

.talk-venue {
  font-style: italic;
  color: #666;
  margin-bottom: 1em;
}

.teaching-content, .talk-description {
  line-height: 1.6;
}

.teaching-content ul, .talk-description ul {
  margin: 0.5em 0;
  padding-left: 1.5em;
}

.teaching-content li, .talk-description li {
  margin-bottom: 0.3em;
}

.teaching-links, .talk-links {
  margin-top: 1em;
  display: flex;
  gap: 1em;
  flex-wrap: wrap;
}

/* Feedback Styles */
.feedback-section {
  margin-top: 2em;
  padding: 2em;
  background-color: var(--sidebar-bg);
  border-radius: 8px;
}

.student-feedback {
  margin: 1.5em 0;
  padding: 1em;
  border-left: 4px solid var(--link-color);
  background-color: var(--card-bg);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  transition: background-color 0.3s ease;
}

.student-feedback cite {
  display: block;
  margin-top: 0.5em;
  font-style: normal;
  font-weight: bold;
  color: #666;
  font-size: 0.9em;
}

/* Map Styles */
.map-section {
  margin-top: 3em;
}

#talk-map {
  border: 1px solid var(--border-color);
}

/* Responsive Design */
@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    gap: 1em;
  }
  
  .nav-list {
    gap: 1em;
  }
  
  .page__inner-wrap {
    flex-direction: column;
  }
  
  .sidebar {
    flex: none;
    position: static;
  }
  
  .about_card {
    flex-direction: column;
    text-align: center;
  }
  
  .about_card__logo {
    margin: 0 0 1em 0;
  }
}

/* Theme Toggle */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--primary-color);
  color: var(--background-color);
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  cursor: pointer;
  z-index: 1000;
  transition: all 0.3s ease;
  box-shadow: var(--box-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2em;
}

.theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Dark theme specific styling for cards and content */
[data-theme="dark"] .about_card {
  background-color: var(--card-bg);
  border-color: var(--border-color);
}

[data-theme="dark"] .nav-list a:hover {
  background-color: var(--hover-bg);
}

[data-theme="dark"] pre,
[data-theme="dark"] code {
  background-color: var(--gray-light);
  color: var(--text-color);
}

/* Ensure all cards and elements use theme variables */
.about_card,
.card,
.publication-card {
  background-color: var(--card-bg);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* Enhanced dark theme text visibility */
[data-theme="dark"] {
  color: var(--text-color);
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
  color: #ffffff;
}

[data-theme="dark"] p,
[data-theme="dark"] li,
[data-theme="dark"] span,
[data-theme="dark"] div {
  color: #e6edf3;
}

[data-theme="dark"] .about_card__content__title {
  color: #ffffff !important;
}

[data-theme="dark"] .about_card__content__subtitle {
  color: var(--link-color) !important;
}

[data-theme="dark"] .about_card__content__date {
  color: var(--text-muted) !important;
}

[data-theme="dark"] .about_card__content__details {
  color: #e6edf3 !important;
}

[data-theme="dark"] .about_card__content__achievement {
  color: #ffa726 !important;
}

[data-theme="dark"] .page__title {
  color: #ffffff !important;
  border-bottom-color: var(--border-color);
}

[data-theme="dark"] .publication-title {
  color: #ffffff !important;
}

[data-theme="dark"] .publication-venue {
  color: #8b949e !important;
}

[data-theme="dark"] .publication-authors {
  color: #e6edf3 !important;
}

[data-theme="dark"] strong,
[data-theme="dark"] b {
  color: #ffffff;
}

/* Additional dark theme fixes for specific elements */
[data-theme="dark"] .about_item {
  background-color: var(--card-bg);
  border-left-color: #64b5f6;
}

[data-theme="dark"] .about_item strong {
  color: #ffffff !important;
}

[data-theme="dark"] .about_item span {
  color: #e6edf3 !important;
}

[data-theme="dark"] .publication-item {
  background-color: var(--card-bg);
  color: #e6edf3;
}

[data-theme="dark"] .publication-item .publication-title {
  color: #ffffff !important;
}

[data-theme="dark"] .publication-item .publication-venue {
  color: #8b949e !important;
}

[data-theme="dark"] .publication-item .publication-authors {
  color: #e6edf3 !important;
}

[data-theme="dark"] .teaching-item,
[data-theme="dark"] .talk-item {
  background-color: var(--card-bg);
  color: #e6edf3;
}

[data-theme="dark"] .portfolio-item {
  background-color: var(--card-bg);
}

[data-theme="dark"] .portfolio-content {
  color: #e6edf3;
}

[data-theme="dark"] .portfolio-content h3 {
  color: #ffffff !important;
}

@media (max-width: 480px) {
  .layout--single {
    padding: 1em 0.5em;
  }
  
  .sidebar {
    padding: 1em;
  }
  
  .author__avatar-image {
    width: 120px;
    height: 120px;
  }
}

/* Enhanced Portfolio Styles */
.project-filters {
    margin: 2rem 0;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-transform: capitalize;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.portfolio-item {
    background: var(--background-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    position: relative;
}

.portfolio-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.portfolio-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.portfolio-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.portfolio-item:hover .portfolio-image img {
    transform: scale(1.05);
}

.project-year {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
}

.portfolio-content {
    padding: 1.5rem;
}

.portfolio-content h3 {
    color: var(--text-color);
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
    line-height: 1.3;
}

.portfolio-content p {
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.5;
    font-size: 0.95rem;
}

.portfolio-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tag {
    background: var(--accent-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.portfolio-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.btn-link {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    text-decoration: none;
}

/* Portfolio item filtering */
.portfolio-item.hidden {
    display: none;
}

/* Enhanced dark theme portfolio styles */
[data-theme="dark"] .portfolio-item {
    background: var(--card-background);
    border-color: var(--border-color);
}

[data-theme="dark"] .portfolio-content h3 {
    color: var(--text-color) !important;
}

[data-theme="dark"] .portfolio-content p {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .filter-btn {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

[data-theme="dark"] .filter-btn:hover,
[data-theme="dark"] .filter-btn.active {
    background: var(--primary-color);
    color: white;
}

[data-theme="dark"] .btn-link {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

[data-theme="dark"] .btn-link:hover {
    background: var(--primary-color);
    color: white;
}

/* Responsive portfolio design */
@media (max-width: 768px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .filter-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .portfolio-content {
        padding: 1rem;
    }
    
    .portfolio-links {
        flex-direction: column;
    }
    
    .btn-link {
        text-align: center;
    }
}

/* Publications page styles */
.publication-filters {
    margin: 2rem 0;
}

.publications-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.publication-item {
    background: var(--card-background);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    position: relative;
}

.publication-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.publication-type {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--accent-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
}

.publication-content {
    padding-right: 120px; /* Space for publication type badge */
}

.publication-title {
    margin-bottom: 0.75rem;
}

.publication-title strong {
    color: var(--text-color);
    font-size: 1.1rem;
    line-height: 1.4;
}

.publication-venue {
    margin-bottom: 0.5rem;
}

.publication-venue small {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.publication-venue a {
    color: var(--link-color);
    text-decoration: none;
    font-weight: 500;
}

.publication-venue a:hover {
    text-decoration: underline;
}

.publication-authors {
    margin-bottom: 1rem;
}

.publication-authors small {
    color: var(--text-muted);
    line-height: 1.4;
}

.highlight-author {
    color: #20beff !important;
    font-weight: bold;
}

.publication-abstract {
    margin-bottom: 1rem;
}

.publication-abstract p {
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
}

.publication-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.publication-tags .tag {
    background: var(--accent-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Publication item filtering */
.publication-item.hidden {
    display: none;
}

/* Dark theme publications styles */
[data-theme="dark"] .publication-item {
    background: var(--card-background);
    border-color: var(--border-color);
}

[data-theme="dark"] .publication-title strong {
    color: var(--text-color);
}

[data-theme="dark"] .publication-abstract p {
    color: var(--text-color);
}

[data-theme="dark"] .publication-venue small,
[data-theme="dark"] .publication-authors small {
    color: var(--text-muted);
}

[data-theme="dark"] .highlight-author {
    color: #20beff !important;
}

/* Responsive publications design */
@media (max-width: 768px) {
    .publications-grid {
        gap: 1.5rem;
    }
    
    .publication-content {
        padding-right: 0;
    }
    
    .publication-type {
        position: static;
        display: inline-block;
        margin-bottom: 1rem;
    }
    
    .publication-tags {
        margin-top: 1rem;
    }
}

/* Teaching page styles */
.teaching-item {
    background: var(--card-background);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.teaching-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.teaching-header {
    margin-bottom: 1rem;
}

.teaching-header h3 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.teaching-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.teaching-meta .term {
    font-weight: 600;
    color: var(--accent-color);
}

.teaching-meta .institution {
    font-style: italic;
}

.teaching-content {
    color: var(--text-color);
    line-height: 1.6;
}

.teaching-content p {
    margin-bottom: 0.75rem;
}

.teaching-content ul {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

.teaching-content li {
    margin-bottom: 0.5rem;
}

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

/* Testimonials styles */
.testimonials-section {
    margin-top: 2rem;
}

.testimonial-item {
    background: var(--card-background);
    border-radius: 16px;
    padding: 2.5rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    border: 2px solid var(--border-color);
    border-left: 6px solid var(--accent-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* .testimonial-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), #20beff, var(--accent-color));
} */

.testimonial-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 48px rgba(0,0,0,0.18);
    border-color: var(--accent-color);
}

.testimonial-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.testimonial-author h4 {
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.testimonial-role {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    line-height: 1.5;
    font-weight: 500;
}

.testimonial-date {
    color: var(--accent-color);
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
    opacity: 0.8;
}

.testimonial-content {
    background: var(--background-color);
    border-radius: 12px;
    padding: 2rem;
    color: var(--text-color);
    line-height: 1.8;
    font-style: italic;
    position: relative;
    border: 1px solid var(--border-color);
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.06);
    font-size: 1.05rem;
}



/* Dark theme teaching styles */
[data-theme="dark"] .teaching-item,
[data-theme="dark"] .testimonial-item {
    background: var(--card-background);
    border-color: var(--border-color);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

[data-theme="dark"] .testimonial-item:hover {
    box-shadow: 0 12px 48px rgba(0,0,0,0.4);
}

[data-theme="dark"] .teaching-header h3,
[data-theme="dark"] .teaching-content {
    color: var(--text-color);
}

[data-theme="dark"] .testimonial-author h4 {
    color: var(--accent-color);
}

[data-theme="dark"] .teaching-meta,
[data-theme="dark"] .testimonial-role {
    color: var(--text-muted);
}

[data-theme="dark"] .testimonial-content {
    background: var(--background-color);
    border-color: var(--border-color);
    color: var(--text-color);
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.2);
}

[data-theme="dark"] .testimonial-header {
    border-bottom-color: var(--border-color);
}

/* Responsive teaching design */
@media (max-width: 768px) {
    .teaching-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .testimonial-item {
        padding: 2rem 1.5rem;
        margin-bottom: 2rem;
    }
    
    .testimonial-content {
        padding: 1.5rem;
        font-size: 1rem;
    }
    

    
    .testimonial-author h4 {
        font-size: 1.1rem;
    }
    
    .teaching-links {
        flex-direction: column;
    }
    
    .btn-link {
        text-align: center;
    }
}
/* ==========================================================================
   Migration additions — Google Scholar metrics, interest/hobby grids,
   external-platform chips and adjudication cards.
   Shared verbatim between _sass/_custom.scss (Jekyll) and
   assets/css/main.css (static webpages/ build).
   ========================================================================== */

/* --- Google Scholar metrics card ---------------------------------------- */
.scholar-stats {
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin: 0 0 2.5rem;
  background: #fafafa;
}

.scholar-stats__header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.scholar-stats__title {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.scholar-stats__link {
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
}

.scholar-stats__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.scholar-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.9rem 0.5rem;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #ececec;
}

.scholar-stat__value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--link-color);
}

.scholar-stat__label {
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 0.2rem;
}

.scholar-stat__sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.scholar-stats__note {
  margin: 1rem 0 0;
  font-size: 0.78rem;
  font-style: italic;
  color: var(--text-muted);
}

/* --- Research interests / hobbies icon grid ----------------------------- */
.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 2.5rem;
  padding: 0;
  list-style: none;
}

.icon-card {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid #e6e6e6;
  border-left-width: 4px;
  border-radius: 8px;
  background: #fff;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.icon-card:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.09);
  transform: translateY(-2px);
}

.icon-card__img {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 6px;
  background: #f4f4f4;
  padding: 4px;
}

.icon-card__body {
  min-width: 0;
}

.icon-card__title {
  display: block;
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.3;
  margin-bottom: 0.2rem;
}

.icon-card__desc {
  display: block;
  font-size: 0.84rem;
  line-height: 1.45;
  color: #666;
}

/* --- External platform chips -------------------------------------------- */
.platform-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1rem 0 2rem;
  padding: 0;
  list-style: none;
}

.platform-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid #e0e0e0;
  border-radius: 999px;
  font-size: 0.86rem;
  text-decoration: none;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.platform-link:hover {
  border-color: #20BEFF;
  box-shadow: 0 2px 8px rgba(32, 190, 255, 0.18);
}

.platform-link img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

/* --- Service / adjudication entries ------------------------------------- */
.service-list {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
}

.service-list > li {
  padding: 1rem 0 1rem 1.1rem;
  border-left: 3px solid #20BEFF;
  margin-bottom: 1rem;
  background: #fbfbfb;
  border-radius: 0 8px 8px 0;
}

.service-list__role {
  font-weight: 700;
  font-size: 1rem;
}

.service-list__org {
  display: block;
  font-size: 0.88rem;
  color: #555;
  margin: 0.15rem 0 0.5rem;
}

.service-list__org .service-list__date::before {
  content: " \00b7  ";
}

.service-list p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
}

/* --- Dark theme ---------------------------------------------------------- */
[data-theme="dark"] .scholar-stats,
[data-theme="dark"] .service-list > li {
  background: #1e1e1e;
  border-color: #333;
}

[data-theme="dark"] .scholar-stat,
[data-theme="dark"] .icon-card,
[data-theme="dark"] .platform-link {
  background: #252525;
  border-color: #383838;
}

[data-theme="dark"] .scholar-stat__sub,
[data-theme="dark"] .scholar-stats__note,
[data-theme="dark"] .icon-card__desc,
[data-theme="dark"] .service-list__org {
  color: #a9a9a9;
}

[data-theme="dark"] .icon-card__img {
  background: #333;
}

/* ==========================================================================
   Round 2 fixes
   Shared verbatim between _sass/_custom.scss (Jekyll) and
   assets/css/main.css (static webpages/ build).
   ========================================================================== */

/* --- Author-name highlight in publication/author lists ------------------- */
:root { --author-highlight: #1668b8; } /* author names: blue, so they read distinctly against the orange venue line */
[data-theme="dark"] { --author-highlight: var(--link-color); }

.publication-authors strong,
.publication-authors b,
.about_card__content__details strong,
[data-theme="dark"] .publication-authors strong,
[data-theme="dark"] .publication-authors b,
[data-theme="dark"] .about_card__content__details strong {
  color: var(--author-highlight);
  font-weight: 700;
}

/* --- 1a. Site title must never wrap onto a second line ------------------- */
.nav-container {
  gap: 1em;
  /* keeps nav links clear of the fixed theme-toggle button */
  padding-right: 5em;
}

.site-title {
  flex: 0 0 auto;
  min-width: 0;
}

.site-title a {
  display: block;
  white-space: nowrap;
  font-size: clamp(0.95rem, 2.4vw, 1.5rem);
  line-height: 1.2;
}

.nav-list {
  flex: 1 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.75em 1.25em;
}

/* --- 1b. One line per item in the sidebar bio ---------------------------- */
.author__bio {
  margin-bottom: 1.5em;
}

.author__bio-line {
  display: block;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.5;
}

.author__bio-line + .author__bio-line {
  margin-top: 0.35em;
}

/* --- 2a. Publication type badge no longer overlaps the title ------------- */
.publication-type {
  position: static;
  display: inline-block;
  margin-bottom: 0.85rem;
  max-width: 100%;
  white-space: normal;
  line-height: 1.35;
}

.publication-content {
  /* the badge is in normal flow now, so no reserved gutter is needed */
  padding-right: 0;
}

/* --- c. Theme toggle must not sit on top of the navbar ------------------- */
.theme-toggle {
  top: auto;
  bottom: 24px;
  right: 24px;
  width: 46px;
  height: 46px;
}

@media (max-width: 768px) {
  .nav-container {
    padding-right: 1em;
  }
  .nav-list {
    justify-content: flex-start;
  }
  .theme-toggle {
    bottom: 16px;
    right: 16px;
    width: 42px;
    height: 42px;
  }
}

/* --- Photo galleries ----------------------------------------------------- */
.gallery-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 0.25rem;
}

.gallery-strip__item {
  margin: 0;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  background: var(--card-bg);
}

.gallery-strip__item img {
  display: block;
  width: 100%;
  height: 140px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-strip__item:hover img {
  transform: scale(1.04);
}

.gallery-strip__item--placeholder {
  border-style: dashed;
}

.gallery-strip__item--placeholder img {
  object-fit: contain;
  background: #e9edf2;
}

.gallery-strip__item figcaption {
  padding: 0.4rem 0.6rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Keep the portfolio scroll-to-top button clear of the fixed theme toggle. */
.floating-button-scroll-top {
  right: 5.5rem;
}

/* ==========================================================================
   Round 3
   Shared verbatim between _sass/_custom.scss (Jekyll) and
   assets/css/main.css (static webpages/ build).
   ========================================================================== */

/* --- Wider sidebar so the full name fits on one line --------------------- */
.sidebar {
  flex: 0 0 300px;
  max-width: 300px;
}

.author__name {
  white-space: nowrap;
  font-size: 1.15em;
}

@media (max-width: 768px) {
  .sidebar {
    flex: none;
    max-width: none;
  }
  .author__name {
    white-space: normal;
  }
}

/* --- On-this-page navigation --------------------------------------------
   Static build renders `.page-toc` in the left sidebar; the Jekyll `single`
   layout renders `.sidebar__right`, which is floated left here so both builds
   put the table of contents on the same side. */
.sidebar__right {
  float: left;
  margin: 0 1.5em 1em 0;
  max-width: 260px;
}

.page-toc {
  margin-top: 1.75em;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  background: var(--card-bg);
}

.page-toc__title {
  margin: 0;
  padding: 0.6em 0.9em;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--primary-color);
  color: #fff;
}

.page-toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.page-toc__list li + li {
  border-top: 1px solid var(--border-color);
}

.page-toc__list a {
  display: block;
  padding: 0.55em 0.9em;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-color);
  text-decoration: none;
  border-left: 3px solid transparent;
}

.page-toc__list a:hover,
.page-toc__list a.is-active {
  background: var(--hover-bg);
  border-left-color: var(--accent-color);
  text-decoration: none;
}

/* --- Highlights board (About page) --------------------------------------- */
.highlight-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0 2rem;
}

.highlight-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  background: var(--card-bg);
}

.highlight-card__title {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.highlight-card__title i {
  color: var(--accent-color);
  margin-right: 0.4em;
}

.highlight-card__list {
  list-style: none;
  margin: 0 0 0.85rem;
  padding: 0;
  flex: 1 1 auto;
}

.highlight-card__list li {
  padding: 0.4rem 0;
  border-bottom: 1px dashed var(--border-color);
  font-size: 0.82rem;
  line-height: 1.35;
}

.highlight-card__list li:last-child {
  border-bottom: 0;
}

.highlight-card__list strong {
  display: block;
  font-weight: 700;
}

.highlight-card__list span {
  display: block;
  color: var(--text-muted);
  font-size: 0.76rem;
}

.highlight-card__strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.highlight-card__strip img {
  width: 54px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.highlight-card__strip:empty {
  display: none;
}

.highlight-card__more {
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
}

/* --- Ongoing research ---------------------------------------------------- */
.ongoing-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
  list-style: none;
  margin: 1.25rem 0 2rem;
  padding: 0;
}

.ongoing-item {
  padding: 0.8rem 1rem;
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--accent-color);
  border-radius: 0 8px 8px 0;
  background: var(--card-bg);
}

.ongoing-item__title {
  display: block;
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 0.15rem;
}

.ongoing-item__desc {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* --- Under-review badge -------------------------------------------------- */
.publication-item[data-category="under_review"] .publication-type {
  background: #9a4207;
}

/* --- Lightbox ------------------------------------------------------------ */
img.is-zoomable {
  cursor: zoom-in;
}

body.lightbox-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 3.5rem 1rem 4.5rem;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(2px);
}

.lightbox[hidden] {
  display: none;
}

.lightbox__stage {
  margin: 0;
  max-width: min(1100px, 92vw);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.lightbox__img {
  max-width: 100%;
  max-height: calc(100vh - 11rem);
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  cursor: default;
}

.lightbox__caption {
  color: #e6e6e6;
  font-size: 0.85rem;
  text-align: center;
  max-width: 70ch;
}

.lightbox__caption[hidden] {
  display: none;
}

.lightbox__close,
.lightbox__nav {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.lightbox__close:hover,
.lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.08);
}

.lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 42px;
  height: 42px;
  font-size: 1.6rem;
  line-height: 1;
}

.lightbox__nav {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  font-size: 1.2rem;
}

.lightbox__nav[hidden] {
  display: none;
}

.lightbox__counter {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  color: #cfcfcf;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}

@media (max-width: 600px) {
  .lightbox {
    padding: 3.5rem 0.5rem 4rem;
  }
  .lightbox__nav {
    position: absolute;
    bottom: 1rem;
  }
  .lightbox__nav--prev { left: 1rem; }
  .lightbox__nav--next { right: 1rem; }
  .lightbox__counter { bottom: 1.9rem; }
}

/* ==========================================================================
   Round 4
   Shared verbatim between _sass/_custom.scss (Jekyll) and
   assets/css/main.css (static webpages/ build).
   ========================================================================== */

/* --- 1. "On this page" moves to the right and follows the scroll ---------
   Static build renders `.toc-rail` as a third flex column; the Jekyll `single`
   layout renders `.sidebar__right`, which floats right. Both stay sticky. */
.toc-rail {
  flex: 0 0 230px;
  align-self: flex-start;
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.sidebar__right {
  float: right;
  margin: 0 0 1em 1.5em;
  max-width: 240px;
  position: sticky;
  top: 100px;
}

.toc-rail .page-toc {
  margin-top: 0;
}

@media (min-width: 769px) and (max-width: 1100px) {
  /* Two-to-three column band: not enough room for three columns, so wrap the
     TOC onto its own full-width row above the content.

     Bounded below at 769px on purpose. Under 768px .page__inner-wrap switches
     to flex-direction: column, and `flex-wrap: wrap` on a column container
     makes it wrap into extra *columns* — with .toc-rail claiming a full column
     via flex-basis: 100% (of the height, in a column container), everything
     else was pushed into a second column off the side of the screen. */
  .page__inner-wrap {
    flex-wrap: wrap;
  }
  .toc-rail {
    flex: 1 1 100%;
    position: static;
    max-height: none;
    order: -1;
  }
  .toc-rail .page-toc {
    margin-bottom: 1.5em;
  }
  .sidebar__right {
    float: none;
    margin: 0 0 1.5em;
    max-width: none;
    position: static;
  }
}

/* Single-column stack. The base .toc-rail/.sidebar/.page__content flex values
   are written for a row container, where they size the width; in a column
   container the same values size the *height* (a 230px-tall clipped TOC, a
   250px-tall sidebar), so each one is reset here. */
@media (max-width: 768px) {
  .page,
  .page__inner-wrap {
    flex-direction: column;
    flex-wrap: nowrap;
  }
  .toc-rail {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    order: -1;
    position: static;
    align-self: stretch;
    max-height: none;
    overflow-y: visible;
  }
  .toc-rail .page-toc {
    margin-bottom: 1.5em;
  }
  .sidebar,
  .page__content {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
  }
}

/* --- 2. Navigation stays on a single line -------------------------------- */
.nav-container {
  /* the theme toggle lives at the bottom-right now, so the old right gutter
     was only costing us the room that made "Interests" wrap */
  padding-right: 1em;
  gap: 0.75em;
}

.site-title a {
  font-size: clamp(0.85rem, 1.5vw, 1.35rem);
}

.nav-list {
  flex-wrap: nowrap;
  gap: 0;
  overflow: visible;
}

.nav-list li {
  flex: 0 0 auto;
}

.nav-list a {
  white-space: nowrap;
  padding: 0.5em 0.55em;
  font-size: clamp(0.72rem, 1.02vw, 0.92rem);
}

@media (max-width: 768px) {
  /* stacked layout has a full row to itself — wrapping is fine here */
  .nav-list {
    flex-wrap: wrap;
    gap: 0.25em;
  }
  .nav-list a {
    font-size: 0.85rem;
    padding: 0.4em 0.6em;
  }
  .site-title a {
    font-size: 1.15rem;
  }
}

/* --- 3. Bigger highlight thumbnails, two per row ------------------------- */
.highlight-card__strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.highlight-card__strip img {
  width: 100%;
  height: 92px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  transition: transform 0.25s ease;
}

.highlight-card__strip img:hover {
  transform: scale(1.03);
}

/* ==========================================================================
   Round 5
   Shared verbatim between _sass/_custom.scss (Jekyll) and
   assets/css/main.css (static webpages/ build).
   ========================================================================== */

/* --- Download CV entry at the foot of the "On this page" rail ------------- */
.page-toc__cv a,
.toc__menu .page-toc__cv a {
  background: var(--accent-color);
  color: #fff;
  border-left-color: transparent;
  text-transform: none;
  letter-spacing: 0.01em;
}

.page-toc__cv a:hover,
.toc__menu .page-toc__cv a:hover {
  background: var(--link-color);
  color: #fff;
  border-left-color: transparent;
}

.page-toc__cv i {
  margin-right: 0.45em;
}

/* --- Logo tiles inside a photo strip -------------------------------------
   Institution logos are not event photos: contain them on a neutral ground
   rather than cropping them to fill like a photograph. */
.gallery-strip__item--logo img {
  object-fit: contain;
  background: #fff;
  padding: 10px;
}

[data-theme="dark"] .gallery-strip__item--logo img {
  background: #f2f4f7;
}

/* ==========================================================================
   Round 6 — visible panel borders
   Shared verbatim between _sass/_custom.scss (Jekyll) and
   assets/css/main.css (static webpages/ build).
   ========================================================================== */

/* The three page panels (author sidebar, main content, "On this page" rail)
   were outlined with --border-color, which is #EEEEEE in light mode and so
   effectively invisible. They now carry an explicit accent border that is
   identical in both themes. */
:root,
[data-theme="light"],
[data-theme="dark"] {
  --panel-border: #20bdff;
}

.sidebar,
.page__content,
.page-toc,
.sidebar__right .toc {
  border: 1px solid var(--panel-border);
  border-radius: 8px;
}

/* the content column had no padding, so a border would sit against the text */
.page__content {
  padding: 1.5em 1.75em;
}

/* the rail's own heading bar sits flush inside the rounded border */
.page-toc {
  overflow: hidden;
}

@media (max-width: 768px) {
  .page__content {
    padding: 1.25em;
  }
}

/* ==========================================================================
   Round 7 — testimonials, publication figures, mobile hardening
   Shared verbatim between _sass/_custom.scss (Jekyll) and
   assets/css/main.css (static webpages/ build).
   ========================================================================== */

/* --- Testimonials -------------------------------------------------------- */
.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 1rem;
  margin: 1.25rem 0 1rem;
}

.testimonial {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--panel-border);
  border-radius: 0 10px 10px 0;
  background: var(--card-bg);
}

.testimonial__head {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin-bottom: 0.7rem;
}

.testimonial__avatar {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--panel-border);
}

.testimonial__who {
  flex: 1 1 auto;
  min-width: 0;
}

.testimonial__name {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
}

.testimonial__title,
.testimonial__meta {
  display: block;
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.testimonial__meta {
  margin-top: 0.15rem;
  font-style: italic;
}

/* small screenshot thumbnail — click opens it in the lightbox */
.testimonial__shot {
  flex: 0 0 56px;
  width: 56px;
  height: 42px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px dashed var(--border-color);
  background: #e9edf2;
}

.testimonial__quote {
  flex: 1 1 auto;
  margin: 0 0 0.75rem;
  padding: 0;
  border: 0;
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--text-color);
}

.testimonial__quote::before {
  content: "\201C";
  font-size: 1.6rem;
  line-height: 0;
  vertical-align: -0.35rem;
  margin-right: 0.15rem;
  color: var(--panel-border);
}

.testimonial__more a,
.testimonial-all a {
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
}

.testimonial-all {
  margin: 0 0 2rem;
}

/* --- Publication thumbnails, like the project cards ---------------------- */
.publication-item--has-figure {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
}

.publication-figure {
  flex: 0 0 190px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
}

.publication-figure img {
  display: block;
  width: 100%;
  height: 130px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.publication-figure img:hover {
  transform: scale(1.04);
}

.publication-item--has-figure .publication-content {
  flex: 1 1 auto;
  min-width: 0;
}

/* ==========================================================================
   Mobile hardening
   ========================================================================== */

/* Nothing may force the page wider than the viewport.
   `clip` rather than `hidden`: `overflow-x: hidden` on html/body creates a
   scroll container and silently breaks `position: sticky` on the sidebar and
   the TOC rail. Browsers without `clip` simply ignore the line. */
html,
body {
  max-width: 100%;
  overflow-x: clip;
}

/* Long URLs, author lists and Bangla strings must wrap rather than overflow. */
.page__content,
.publication-authors,
.publication-venue,
.about_card__content__details,
.service-list p,
.testimonial__quote {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Wide tables (Quick Facts) scroll inside their own box. */
.page__content table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

.page__content table td,
.page__content table th {
  padding: 0.4em 0.6em;
  vertical-align: top;
}

/* Media can never exceed its column. */
.page__content img,
.gallery-strip img,
.portfolio-image img,
.publication-figure img,
.highlight-card__strip img {
  max-width: 100%;
}

/* The project grid demanded a 350px minimum, which overflows a 360px phone. */
.portfolio-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
}

@media (max-width: 900px) {
  /* stack the publication thumbnail above the text before it gets squeezed */
  .publication-item--has-figure {
    flex-direction: column;
    gap: 0.9rem;
  }
  .publication-figure {
    flex: 1 1 auto;
    width: 100%;
  }
  .publication-figure img {
    height: 180px;
  }
}

@media (max-width: 768px) {
  .layout--single {
    padding: 1em 0.75em;
  }
  .page,
  .page__inner-wrap {
    gap: 1.25em;
  }
  .sidebar {
    padding: 1.25em;
  }
  .author__avatar-image {
    width: 120px;
    height: 120px;
  }
  .gallery-strip {
    grid-template-columns: repeat(auto-fill, minmax(min(140px, 47%), 1fr));
  }
  .highlight-board,
  .icon-grid,
  .ongoing-list,
  .testimonial-grid {
    grid-template-columns: 1fr;
  }
  .scholar-stats {
    padding: 1rem;
  }
  .scholar-stat__value {
    font-size: 1.6rem;
  }
  .page__title {
    font-size: 1.6rem;
  }
  .testimonial__shot {
    flex-basis: 48px;
    width: 48px;
    height: 36px;
  }
}

@media (max-width: 480px) {
  .layout--single {
    padding: 0.75em 0.5em;
  }
  .page__content {
    padding: 1em 0.9em;
  }
  .sidebar {
    padding: 1em;
  }
  .gallery-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .highlight-card__strip img {
    height: 78px;
  }
  .platform-links {
    gap: 0.45rem;
  }
  .platform-link {
    font-size: 0.78rem;
    padding: 0.4rem 0.7rem;
  }
  /* the header buttons need room for a thumb */
  .btn-link {
    padding: 0.45rem 0.7rem;
    font-size: 0.78rem;
  }
}

/* ==========================================================================
   Round 8 — avatar border + mobile hardening pass 2
   Shared verbatim between _sass/_custom.scss (Jekyll) and
   assets/css/main.css (static webpages/ build).
   ========================================================================== */

/* --- Profile photo border, identical on every page and in both themes ----- */
:root,
[data-theme="light"],
[data-theme="dark"] {
  --avatar-border: #1cb6f6;
}

.author__avatar-image,
.author__avatar img,
.sidebar .author__avatar img {
  border: 3px solid var(--avatar-border);
  box-shadow: var(--box-shadow);
}

/* ==========================================================================
   Mobile hardening, pass 2
   ========================================================================== */

/* The nav has ten items now. `nowrap` only relaxed at 768px, which left a
   769–1024px band where the row could push past the viewport. Let it wrap
   onto a second line well before that happens. */
@media (max-width: 1024px) {
  .nav-list {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.15em;
  }
}

/* Any remaining long string wraps instead of widening its column. */
.testimonial__title,
.testimonial__name,
.testimonial__meta,
.highlight-card__list span,
.highlight-card__list strong,
.service-list__role,
.service-list__org,
.ongoing-item__title,
.icon-card__title,
.page-toc__list a,
.publication-title strong {
  overflow-wrap: anywhere;
}

/* Code and pre scroll inside their own box rather than stretching the page. */
.page__content pre,
.page__content code {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Button rows wrap on narrow screens (one of the two rules lacked wrapping). */
.portfolio-links,
.publication-tags,
.portfolio-tags {
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  /* the site title and nav each get their own row here, so allow full width */
  .nav-container {
    align-items: flex-start;
  }
  .nav-list {
    justify-content: flex-start;
    width: 100%;
  }

  /* the sticky sidebar is unhelpful once everything is stacked */
  .sidebar {
    position: static;
    top: auto;
  }

  .author__avatar {
    text-align: center;
  }
  .author__content,
  .author__name,
  .author__bio {
    text-align: center;
  }
  .author__urls {
    max-width: 320px;
    margin: 0 auto;
  }

  .testimonial__head {
    flex-wrap: wrap;
  }

  .lightbox__caption {
    font-size: 0.78rem;
  }
}

@media (max-width: 480px) {
  .author__avatar-image {
    width: 108px;
    height: 108px;
  }
  .page-toc__list a {
    font-size: 0.76rem;
    padding: 0.5em 0.7em;
  }
  .highlight-card,
  .testimonial {
    padding: 0.9rem 1rem;
  }
  .publication-figure img {
    height: 150px;
  }
  .scholar-stats__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }
  .scholar-stat {
    padding: 0.6rem 0.25rem;
  }
  .scholar-stat__value {
    font-size: 1.3rem;
  }
  .scholar-stat__label {
    font-size: 0.72rem;
  }
  .scholar-stat__sub {
    /* 0.62rem lands at 9.9px — under the ~11px floor for comfortable
       reading on a phone. */
    font-size: 0.7rem;
  }
}

/* ==========================================================================
   Anchor offset and Personal Philosophy labels
   ========================================================================== */

/* .site-nav is sticky at top: 0, so an in-page jump used to land with the
   heading hidden underneath it. --nav-h is measured and kept current by
   assets/js/page-toc.js: the nav is 57px tall on a desktop but grows past
   170px once the ten links wrap on a narrow phone, so a fixed value would be
   wrong at one end or the other. The value here is the pre-script fallback. */
:root {
  --nav-h: 57px;
}

[id] {
  scroll-margin-top: calc(var(--nav-h) + 1rem);
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* "Core belief:", "Learning style:", "Mission:" on the About page.
   [data-theme="dark"] strong forces #fff at (0,1,1), so the class is
   repeated under the theme attribute to outrank it in both themes. */
.philosophy-label,
[data-theme="light"] .philosophy-label {
  color: #0757b8;
}
[data-theme="dark"] .philosophy-label {
  color: var(--link-color);
}

/* ==========================================================================
   Requested styling additions
   ========================================================================== */

/* --- Venue / conference line on publication entries ----------------------
   .about_card__content__date is shared with the Education and Work Experience
   cards, so the About-page publication cards carry an explicit
   .about_card--publication modifier and only that variant is recoloured. */
.publication-venue,
.publication-venue small,
.about_card--publication .about_card__content__date,
[data-theme="dark"] .publication-venue,
[data-theme="dark"] .publication-venue small,
[data-theme="dark"] .publication-item .publication-venue,
[data-theme="dark"] .about_card--publication .about_card__content__date {
  color: var(--venue-grey) !important;
}

/* --- Education "Concentration:" / "Achievement:" labels ------------------ */
.about_card__content__achievement .edu-label,
[data-theme="dark"] .about_card__content__achievement .edu-label {
  color: var(--link-color) !important;
  font-weight: 600;
}

.about_card__content__achievement .edu-value,
[data-theme="dark"] .about_card__content__achievement .edu-value {
  color: #e6edf3 !important;
}

/* #e6edf3 is near-white, so it only works on the dark ground. In the light
   theme the value reverts to the normal body colour. */
:root[data-theme="light"] .about_card__content__achievement .edu-value {
  color: var(--text-color) !important;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .about_card__content__achievement .edu-value {
    color: var(--text-color) !important;
  }
}

/* --- Compact Scholar strip above Selected Publications ------------------- */
.scholar-mini {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 1.5rem;
  margin: 0 0 1.4rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--card-bg);
}

.scholar-mini__stat {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
}

.scholar-mini__value,
[data-theme="dark"] .scholar-mini__value {
  font-size: 1.15rem;
  font-weight: 700;
  /* repeated under the theme attribute to outrank the generic
     [data-theme="dark"] text-colour rules */
  color: var(--link-color);
}

.scholar-mini__label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.scholar-mini__link {
  margin-left: auto;
  font-size: 0.8rem;
  white-space: nowrap;
}

/* --- Monogram above the sidebar photo ------------------------------------ */
.author__brand {
  text-align: center;
  margin-bottom: 1rem;
}

.author__brand-image {
  max-width: 150px;
  width: 100%;
  height: auto;
}

/* --- Map My Visitors widget in the footer -------------------------------- */
.page__footer-visitors {
  margin-top: 1rem;
  text-align: center;
}

.page__footer-visitors img {
  max-width: 240px;
  width: 100%;
  height: auto;
  opacity: 0.85;
}

/* --- Tag filter bar on Publications and Projects ------------------------- */
.tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1.5rem;
}

.tag-filter__btn {
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.2;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--card-bg);
  color: var(--text-color);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tag-filter__btn:hover {
  border-color: var(--link-color);
  color: var(--link-color);
}

.tag-filter__btn[aria-pressed="true"] {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff;
}

.tag-filter__count {
  font-size: 0.78rem;
  color: var(--text-muted);
  align-self: center;
  margin-left: auto;
}

/* Set by the filter script. An attribute rather than an inline style, so each
   card keeps its own display mode (block/flex/grid) when shown again. */
[data-filter-hidden] {
  display: none !important;
}

/* Empty groups are hidden with their heading and rule, so a filtered view does
   not leave a bare "Under Review" header with nothing under it. */
.tag-filter__empty {
  display: none !important;
}

@media (max-width: 480px) {
  .scholar-mini { gap: 0.3rem 1rem; }
  .scholar-mini__link { margin-left: 0; }
  .tag-filter__count { margin-left: 0; width: 100%; }
}

/* --- Education detail rows ------------------------------------------------
   Thesis / Supervisor / Publication / Courses used to be separated only by a
   <br>, which ran them together. Each is now its own block with breathing
   room. */
.about_card__content__details .edu-row {
  display: block;
  margin-bottom: 0.7em;
}

.about_card__content__details .edu-row:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   Sidebar scrolling and section headings
   ========================================================================== */

/* --- Sidebar scrolls on its own ------------------------------------------
   It is ~977px tall against a typical 800px viewport, and being sticky with no
   max-height meant the lower half (the social links) could not be reached until
   the whole page had scrolled to the bottom. Same pattern .toc-rail already
   uses: cap it to the viewport and let it scroll independently.
   overscroll-behavior keeps that scroll from chaining to the page once it
   reaches its end. */
@media (min-width: 769px) {
  .sidebar {
    align-self: flex-start;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
  }

  .sidebar::-webkit-scrollbar {
    width: 8px;
  }

  .sidebar::-webkit-scrollbar-track {
    background: transparent;
  }

  .sidebar::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 4px;
  }

  .sidebar:hover::-webkit-scrollbar-thumb {
    background-color: var(--text-muted);
  }
}

/* Stacked layout: never cap the height, or the sidebar clips its own content. */
@media (max-width: 768px) {
  .sidebar {
    max-height: none;
    overflow-y: visible;
  }
}

/* --- Section headings ----------------------------------------------------
   These were 20px and pure white against 16px white body text, so a new
   section barely registered. Scoped to h2[id]: on every page those are the
   real section headings, while the plain <h2> grouping labels on Publications
   and Projects already sit above their own <hr>. */
.page__content-inner h2[id],
[data-theme="dark"] .page__content-inner h2[id] {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--heading-accent);
  margin-top: 2.4rem;
  margin-bottom: 0.9rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border-color);
}

/* The first heading sits right under the page lead and needs no extra room. */
.page__content-inner > h2[id]:first-child {
  margin-top: 0;
}

@media (max-width: 768px) {
  .page__content-inner h2[id],
  [data-theme="dark"] .page__content-inner h2[id] {
    font-size: 1.3rem;
    margin-top: 1.9rem;
  }
}

/* ==========================================================================
   Palette: headings, venues and education labels

   Every colour below is declared twice - a light-mode value on :root and a
   dark-mode value under [data-theme="dark"] - so nothing depends on which
   theme is active. Light values are darkened for contrast against white;
   dark values are lightened for contrast against the #232429 ground.
   ========================================================================== */

:root {
  --heading-accent: #b4460b;   /* "About Me", "Selected Publications" */
  --venue-grey:     #57606a;   /* conference / venue lines */
  --edu-concentration: #0b6e7f;
  --edu-achievement:   #1a7f37;
  --edu-thesis:        #6f42c1;
  --edu-supervisor:    #a4133c;
  --edu-publication:   #cf222e;   /* coral red - never blue, which reads as a link */
  --edu-result:        #3f6212;   /* olive */
  --edu-courses:       #8a6100;
}

[data-theme="dark"] {
  --heading-accent: #ffa657;
  --venue-grey:     #d0d6dc;
  --edu-concentration: #7fe3ea;
  --edu-achievement:   #7ee787;
  --edu-thesis:        #e2c8ff;
  --edu-supervisor:    #ffc2d1;
  --edu-publication:   #ffbdb8;   /* coral, lifted */
  --edu-result:        #c3e88d;   /* lime */
  --edu-courses:       #f0cf70;
}

/* --- Page title ----------------------------------------------------------
   Overrides [data-theme="dark"] .page__title, which forces #fff !important. */
.page__title,
[data-theme="dark"] .page__title {
  color: var(--heading-accent) !important;
}

/* --- Education labels ----------------------------------------------------
   One hue per label so Thesis / Supervisor / Publication / Courses are
   distinguishable at a glance. The base .edu-label rule sets a blue with
   !important, so each modifier repeats under the theme attribute to outrank
   it in both directions. */
.about_card__content__achievement .edu-label--concentration,
[data-theme="dark"] .about_card__content__achievement .edu-label--concentration {
  color: var(--edu-concentration) !important;
}

.about_card__content__achievement .edu-label--achievement,
[data-theme="dark"] .about_card__content__achievement .edu-label--achievement {
  color: var(--edu-achievement) !important;
}

.about_card__content__details .edu-tag,
[data-theme="dark"] .about_card__content__details .edu-tag {
  font-weight: 700;
}

.about_card__content__details .edu-tag--thesis,
[data-theme="dark"] .about_card__content__details .edu-tag--thesis {
  color: var(--edu-thesis) !important;
}

.about_card__content__details .edu-tag--supervisor,
[data-theme="dark"] .about_card__content__details .edu-tag--supervisor {
  color: var(--edu-supervisor) !important;
}

.about_card__content__details .edu-tag--publication,
[data-theme="dark"] .about_card__content__details .edu-tag--publication {
  color: var(--edu-publication) !important;
}

.about_card__content__details .edu-tag--courses,
[data-theme="dark"] .about_card__content__details .edu-tag--courses {
  color: var(--edu-courses) !important;
}

/* --- Supervisor lists ----------------------------------------------------
   Reporting / Remote supervisors used to run together on one comma-separated
   line. */
.supervisor-list {
  margin: 0.35rem 0 0.9rem;
  padding-left: 1.25rem;
}

.supervisor-list li {
  margin-bottom: 0.2rem;
}

/* --- "Result:" label ------------------------------------------------------
   Had no rule of its own, so it inherited the base .edu-label blue - the same
   colour as a hyperlink. Lime in dark mode, olive in light: distinct from
   Achievement green and Courses amber, and nowhere near blue. */
.about_card__content__achievement .edu-label--result,
[data-theme="dark"] .about_card__content__achievement .edu-label--result {
  color: var(--edu-result) !important;
}

/* ==========================================================================
   Touch targets and the phone nav
   ========================================================================== */

/* --- Tap targets ---------------------------------------------------------
   These links rendered 16-23px tall, under the 24px minimum target size in
   WCAG 2.2 AA, which makes them fiddly to hit with a thumb. Flex centring keeps
   the text where it was while min-height enlarges the tappable box. None of
   them carry margins, text-align or pseudo-elements this could disturb. */
.site-title a,
.scholar-mini__link,
.scholar-stats__link,
.highlight-card__more,
.testimonial__name {
  display: flex;
  align-items: center;
  min-height: 24px;
}

/* --- Nav scrolls away on phones ------------------------------------------
   With ten links the nav wraps to 117-170px on phones. Pinned to the top, that
   was 30% of an iPhone SE screen in portrait and 31% in landscape, leaving
   little room to read. Below 768px it now scrolls away with the page.
   assets/js/page-toc.js sees the nav is no longer pinned and publishes
   --nav-h: 0, so in-page anchors stop reserving space for it; the value here
   covers visitors without JavaScript. */
@media (max-width: 768px) {
  .site-nav {
    position: relative;
  }

  :root {
    --nav-h: 0px;
  }
}

/* ==========================================================================
   Theme toggle placement and the testimonial closing quote
   ========================================================================== */

/* --- Theme toggle beside the page content --------------------------------
   assets/js/theme-toggle.js drops the button into the "On this page" rail
   where one exists, so on a desktop it sits just under that list instead of
   floating in the far corner of the window. Pages without a rail keep the
   fixed corner button. */
.toc-rail .theme-toggle {
  position: static;
  margin: 0.85rem auto 0;
  width: 44px;
  height: 44px;
}

@media (max-width: 768px) {
  /* Stacked layout puts the rail at the very top of the page, so a button
     parked there would scroll out of reach - pin it within thumb reach. */
  .toc-rail .theme-toggle {
    position: fixed;
    bottom: 16px;
    right: 16px;
    margin: 0;
    z-index: 1000;
  }
}

/* --- Testimonials close their quotation ----------------------------------
   Only an opening curly quote was rendered, leaving every quotation visibly
   unclosed. */
.testimonial__quote::after {
  content: "”";
  font-size: 1.6rem;
  line-height: 0;
  vertical-align: -0.35rem;
  margin-left: 0.15rem;
  color: var(--panel-border);
}

/* --- Dark-mode overrides for the #232429 ground ---------------------------
   The link colour is now light enough that white-on-link no longer reads, and
   the toggle borrows --primary-color, which is a dark neutral in this theme. */
[data-theme="dark"] .talk-date {
  color: #1f1f1f;
}

[data-theme="dark"] .theme-toggle {
  background: #e6e6e6;
  color: #2e2e2e;
}

/* .teaching-meta .term paints text with --accent-color, which is a button
   background shade; in dark mode that is nearly invisible on the grey chip. */
[data-theme="dark"] .teaching-meta .term {
  color: var(--link-color);
}
