/* css styles */
/* Bootstrap-like utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Homepage Hero Section */
.hero-section {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 4rem 0;
  margin-bottom: 3rem;
}

.hero-section h1 {
  font-size: 2rem;
  font-weight: 400;
  color: #495057;
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.6;
  font-style: italic;
}

/* Content Sections */
.content-section {
  padding: 3rem 0;
}

.content-section .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Article Content - Narrow for Better Readability */
article,
main article,
#quarto-content article,
.quarto-post article {
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 2rem;
  font-size: 35px;
  line-height: 2.2;
}

article p,
main article p,
#quarto-content article p,
.quarto-post article p {
  font-size: 35px;
  line-height: 2.2;
  margin-bottom: 1.25rem;
}

/* Keep full width for listings and special pages */
.quarto-listing article,
.quarto-listing-container article {
  max-width: none;
}

.content-section h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: #343a40;
  font-weight: 600;
}

/* Topics Grid */
.topics-grid {
  margin-top: 2rem;
}

.topic-card {
  padding: 1.5rem;
  background: #fff;
  border-left: 4px solid #4895ab;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.topic-card:hover {
  transform: translateX(5px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  border-left-color: #d46c5b;
}

.topic-card strong {
  display: block;
  font-size: 1.1rem;
  color: #4895ab;
  margin-bottom: 0.5rem;
}

/* Grid Layout Improvements */
.quarto-listing-grid {
  display: grid;
  gap: 2rem;
  margin-top: 2rem;
}

.quarto-listing-grid .g-col-1 {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.quarto-listing-grid .g-col-1:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.quarto-listing-grid .listing-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.quarto-listing-grid .listing-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 1rem 0 0.5rem 0;
  color: #343a40;
}

.quarto-listing-grid .listing-description {
  color: #6c757d;
  font-size: 0.95rem;
  line-height: 1.6;
}

.quarto-listing-grid .listing-categories {
  margin-top: 0.5rem;
}

.quarto-listing-grid .listing-category {
  display: inline-block;
  background: #4895ab;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 3px;
  font-size: 0.85rem;
  margin-right: 0.5rem;
}

/* Sidebar Styling - Force light backgrounds */
.sidebar,
.sidebar-navigation,
#quarto-margin-sidebar,
div.sidebar,
aside.sidebar {
  background-color: #ffffff !important;
  background: #ffffff !important;
  border: 1px solid #dee2e6 !important;
  border-radius: 8px !important;
  padding: 1.5rem !important;
  margin-bottom: 2rem !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08) !important;
}

.sidebar nav .sidebar-title,
.sidebar-title,
#quarto-margin-sidebar .sidebar-title,
#quarto-margin-sidebar h2 {
  font-weight: 600 !important;
  font-size: 1.1rem !important;
  color: #343a40 !important;
  margin-bottom: 1rem !important;
  padding-bottom: 0.5rem !important;
  border-bottom: 2px solid #4895ab !important;
}

.sidebar nav ul,
#quarto-margin-sidebar nav ul,
#quarto-margin-sidebar ul {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 0 1.5rem 0 !important;
}

.sidebar nav li,
#quarto-margin-sidebar nav li,
#quarto-margin-sidebar li {
  margin-bottom: 0.5rem !important;
}

.sidebar nav a,
#quarto-margin-sidebar nav a,
#quarto-margin-sidebar a {
  color: #495057 !important;
  text-decoration: none !important;
  padding: 0.5rem 0.75rem !important;
  display: block !important;
  border-radius: 4px !important;
  transition: all 0.2s ease !important;
}

.sidebar nav a:hover,
#quarto-margin-sidebar nav a:hover,
#quarto-margin-sidebar a:hover {
  background: #4895ab !important;
  color: white !important;
  transform: translateX(5px) !important;
}

/* Projects Page Styling */
article h3 {
  color: #4895ab;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 1rem;
  border-left: 4px solid #4895ab;
  padding-left: 1rem;
}

article h4 {
  color: #343a40;
  font-weight: 600;
  margin-top: 1.5rem;
}

article hr {
  margin: 3rem 0;
  border: 0;
  border-top: 2px solid #e9ecef;
}

article ul li {
  margin-bottom: 0.5rem;
}

article ul li a {
  color: #4895ab;
  text-decoration: none;
  transition: color 0.2s ease;
}

article ul li a:hover {
  color: #d46c5b;
  text-decoration: underline;
}

/* Navbar Menu Dropdowns */
.navbar .dropdown-menu {
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.navbar .dropdown-item {
  padding: 0.5rem 1rem;
  color: #495057;
  transition: all 0.2s ease;
}

.navbar .dropdown-item:hover {
  background: #4895ab;
  color: white;
}

/* Dark mode adjustments - using media query */
@media (prefers-color-scheme: dark) {
  .hero-section {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
  }

  .hero-section h1 {
    color: #e0e0e0;
  }

  .topic-card {
    background: #2d2d2d;
    border-left-color: #4895ab;
  }

  .topic-card:hover {
    border-left-color: #d46c5b;
  }

  .topic-card strong {
    color: #5aa9bd;
  }

  .quarto-listing-grid .g-col-1 {
    background: #2d2d2d;
  }

  .quarto-listing-grid .listing-title {
    color: #e0e0e0;
  }

  .content-section h2 {
    color: #e0e0e0;
  }

  .navbar .dropdown-menu {
    background: #2d2d2d;
    border-color: #404040;
  }

  .navbar .dropdown-item {
    color: #e0e0e0;
  }

  .navbar .dropdown-item:hover {
    background: #5aa9bd;
  }
}

/* Dark mode adjustments - using Quarto's class-based theme toggle */
body.quarto-dark .hero-section {
  background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
}

body.quarto-dark .hero-section h1 {
  color: #e0e0e0;
}

body.quarto-dark .topic-card {
  background: #2d2d2d;
  border-left-color: #4895ab;
}

body.quarto-dark .topic-card:hover {
  border-left-color: #d46c5b;
}

body.quarto-dark .topic-card strong {
  color: #5aa9bd;
}

body.quarto-dark .quarto-listing-grid .g-col-1 {
  background: #2d2d2d;
}

body.quarto-dark .quarto-listing-grid .listing-title {
  color: #e0e0e0;
}

body.quarto-dark .content-section h2 {
  color: #e0e0e0;
}

/* Dark mode sidebar styles with Quarto class */
body.quarto-dark .sidebar,
body.quarto-dark .sidebar-navigation,
body.quarto-dark #quarto-margin-sidebar,
body.quarto-dark div.sidebar,
body.quarto-dark aside.sidebar,
body.quarto-dark .margin-sidebar {
  background-color: #2d2d2d !important;
  background: #2d2d2d !important;
  border: 1px solid #404040 !important;
}

body.quarto-dark .sidebar nav .sidebar-title,
body.quarto-dark .sidebar-title,
body.quarto-dark #quarto-margin-sidebar .sidebar-title,
body.quarto-dark #quarto-margin-sidebar h2 {
  color: #e0e0e0 !important;
  border-bottom-color: #5aa9bd !important;
}

body.quarto-dark .sidebar nav a,
body.quarto-dark #quarto-margin-sidebar nav a,
body.quarto-dark #quarto-margin-sidebar a {
  color: #adb5bd !important;
}

body.quarto-dark .sidebar nav a:hover,
body.quarto-dark #quarto-margin-sidebar nav a:hover,
body.quarto-dark #quarto-margin-sidebar a:hover {
  background: #5aa9bd !important;
  color: white !important;
}

body.quarto-dark .navbar .dropdown-menu {
  background: #2d2d2d;
  border-color: #404040;
}

body.quarto-dark .navbar .dropdown-item {
  color: #e0e0e0;
}

body.quarto-dark .navbar .dropdown-item:hover {
  background: #5aa9bd;
}

/* ORCID icon inline with author name */
.quarto-title-meta .quarto-title-meta-contents,
.quarto-title-author-orcid {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.quarto-title-author-orcid img,
a.quarto-title-author-orcid img {
  display: inline-block !important;
  margin: 0 !important;
  vertical-align: middle;
  width: 16px;
  height: 16px;
}

.author .orcid,
.author-orcid,
a[href*="orcid.org"] img {
  display: inline-block !important;
  margin: 0 0 0 0.25rem !important;
  vertical-align: middle;
  width: 16px;
  height: 16px;
}

/* Image centering - all devices */
img {
  display: block;
  margin-left: auto;
  margin-right: auto;
  max-width: 100%;
  height: auto;
}

/* Exception: ORCID and other inline images should not be centered */
.quarto-title-meta img,
.author img,
a[href*="orcid.org"] img,
.quarto-title-author-orcid img {
  display: inline-block !important;
  margin: 0 0 0 0.25rem !important;
}

/* Center images in paragraphs and divs */
p img,
div img,
figure img,
.quarto-figure img,
.column-page img,
.column-body img,
.column-body-outset img {
  display: block;
  margin-left: auto;
  margin-right: auto;
  max-width: 100%;
  height: auto;
}

/* Center figure elements */
figure,
.quarto-figure {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

/* Center figure captions */
figcaption,
.quarto-figure-caption {
  text-align: center;
}

/* Blockquotes */
blockquote {
  border-left: 4px solid #4895ab;
  margin: 1.5em 0;
  padding: 0.5em 1em;
  background-color: #f8f9fa;
  font-style: italic;
  color: #555;
}

blockquote p:first-child {
  margin-top: 0;
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* PWA and mobile optimizations */
@media (max-width: 768px) {
  .sidebar {
    position: static;
    width: 100%;
  }

  .content {
    margin-left: 0;
  }
}

/* Code highlighting improvements - vim-hybrid inspired */
pre.sourceCode {
  position: relative;
  overflow: visible;
  font-family: 'Fira Code', 'Inconsolata', monospace;
  font-weight: 500;

pre.sourceCode code::-moz-selection,
pre.sourceCode code span::-moz-selection {
  background: #99c7c7;
  opacity: 0.75;
}

pre.sourceCode:before {
  content: attr(data-language);
  position: absolute;
  top: -10px;
  right: 10px;
  padding: 2px 8px;
  background: var(--bs-primary);
  color: white;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Algolia Search Styling */
.aa-Autocomplete {
  width: 100%;
}

.aa-Form {
  width: 100%;
}

.aa-InputWrapper {
  position: relative;
}

/* Search button in navbar */
.aa-DetachedSearchButton {
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  padding: 0.5rem 1rem;
  cursor: pointer;
}

.aa-DetachedSearchButton:hover {
  background-color: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

.aa-DetachedSearchButtonIcon {
  color: white;
}

.aa-DetachedSearchButtonPlaceholder {
  color: rgba(255, 255, 255, 0.9);
}

/* Search modal/panel */
.aa-Panel {
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-width: 640px;
  margin: 0 auto;
}

.aa-PanelLayout {
  border-radius: 8px;
  overflow: hidden;
}

/* Search input */
.aa-Input {
  font-size: 1rem;
  padding: 0.75rem;
  border: 1px solid #dee2e6;
  border-radius: 4px;
}

.aa-Input:focus {
  border-color: #007bff;
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Search results */
.aa-Item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.aa-Item:hover {
  background-color: #f8f9fa;
}

.aa-Item[aria-selected='true'] {
  background-color: #007bff;
  color: white;
}

.aa-Item[aria-selected='true'] .aa-ItemContentTitle,
.aa-Item[aria-selected='true'] .aa-ItemContentDescription {
  color: white;
}

/* Search result icon/image */
.aa-ItemIcon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f0f0;
  border-radius: 6px;
  overflow: hidden;
}

.aa-ItemIcon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.aa-ItemIcon svg,
.aa-ItemIcon i {
  font-size: 1.25rem;
  color: #6c757d;
}

.aa-Item[aria-selected='true'] .aa-ItemIcon {
  background: rgba(255, 255, 255, 0.2);
}

.aa-Item[aria-selected='true'] .aa-ItemIcon svg,
.aa-Item[aria-selected='true'] .aa-ItemIcon i {
  color: white;
}

/* Search result content wrapper */
.aa-ItemContent {
  flex: 1;
  min-width: 0;
}

.aa-ItemContentTitle {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
  color: #333;
}

.aa-ItemContentDescription {
  font-size: 0.875rem;
  color: #6c757d;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.aa-ItemContentSubtitle {
  font-size: 0.8rem;
  color: #999;
  margin-top: 0.25rem;
}

/* Highlighted matches */
.aa-ItemContentTitle mark,
.aa-ItemContentDescription mark {
  background-color: #fff3cd;
  padding: 0 0.2em;
  border-radius: 2px;
  font-weight: 600;
}

.aa-Item[aria-selected='true'] mark {
  background-color: rgba(255, 255, 255, 0.3);
  color: white;
}

/* Category badges in results */
.aa-ItemContentCategory {
  display: inline-block;
  background-color: #007bff;
  color: white;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  margin-right: 0.5rem;
}

/* No results state */
.aa-SourceNoResults {
  padding: 2rem 1rem;
  text-align: center;
  color: #6c757d;
}

/* Algolia logo */
.aa-DetachedSearchButtonQuery {
  margin-left: 0.5rem;
}

/* Dark mode support for search */
@media (prefers-color-scheme: dark) {
  .aa-Panel {
    background-color: #2d2d2d;
    color: #e0e0e0;
  }

  .aa-Input {
    background-color: #1a1a1a;
    border-color: #404040;
    color: #e0e0e0;
  }

  .aa-Input:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
  }

  .aa-Item {
    border-bottom-color: #404040;
  }

  .aa-Item:hover {
    background-color: #404040;
  }

  .aa-Item[aria-selected='true'] {
    background-color: #0d6efd;
  }

  .aa-ItemIcon {
    background: #404040;
  }

  .aa-ItemIcon svg,
  .aa-ItemIcon i {
    color: #adb5bd;
  }

  .aa-ItemContentTitle {
    color: #e0e0e0;
  }

  .aa-ItemContentDescription {
    color: #adb5bd;
  }

  .aa-ItemContentTitle mark,
  .aa-ItemContentDescription mark {
    background-color: #665d03;
    color: #fff;
  }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .aa-Panel {
    max-width: 100%;
    margin: 0;
  }

  .aa-DetachedSearchButton {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
  }

  .aa-Item {
    padding: 0.5rem 0.75rem;
  }
}

/* Social links */
.social-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin: 2rem 0;
}

.social-links a {
  color: var(--bs-secondary);
  font-size: 1.5rem;
  transition: color 0.2s;
}

.social-links a:hover {
  color: var(--bs-primary);
}

/* Blog Listing Enhancements */
.quarto-listing {
  margin-top: 2rem;
}

/* Category cloud styling */
.category-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 2rem 0;
  justify-content: center;
}

.category-tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: #f0f0f0;
  border-radius: 20px;
  text-decoration: none;
  color: #495057;
  transition: all 0.2s;
  border: 1px solid #dee2e6;
}

.category-tag:hover {
  background: #007bff;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Grid view improvements */
.quarto-listing-category .category {
  background-color: #007bff;
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  font-size: 0.8rem;
  margin-right: 0.3rem;
}

/* Default listing improvements */
.quarto-listing.quarto-listing-container-default {
  border-left: 3px solid transparent;
  padding-left: 1rem;
  transition: all 0.2s;
}

.quarto-listing.quarto-listing-container-default:hover {
  border-left-color: #007bff;
  background: #f8f9fa;
}

/* Table listing improvements */
.quarto-listing-container-table table {
  font-size: 0.95rem;
}

.quarto-listing-container-table tbody tr:hover {
  background-color: #f8f9fa !important;
  cursor: pointer;
}

/* Listing metadata */
.listing-date,
.listing-author,
.listing-reading-time {
  color: #6c757d;
  font-size: 0.875rem;
}

.listing-reading-time::before {
  content: "📖 ";
}

/* Category filter UI */
.quarto-listing-filter {
  margin-bottom: 2rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
}

.quarto-listing-filter .filter-text {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #dee2e6;
  border-radius: 4px;
}

/* Sort UI */
.quarto-listing-sort {
  margin-bottom: 1rem;
}

.quarto-listing-sort select {
  padding: 0.375rem 0.75rem;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  background: white;
}

/* Tables */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.5em 0;
  font-size: 0.9em;
}

table thead {
  background-color: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
}

table th,
table td {
  padding: 0.75rem;
  border: 1px solid #dee2e6;
  text-align: left;
}

table tbody tr:nth-child(even) {
  background-color: #f8f9fa;
}

table tbody tr:hover {
  background-color: #e9ecef;
}

/* Kable-style tables in code output */
.cell-output-display table,
.cell-output table,
pre + table,
code + table,
.sourceCode + table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.5em auto;
  font-size: 0.9em;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  background-color: white;
}

.cell-output-display table thead,
.cell-output table thead,
pre + table thead,
code + table thead,
.sourceCode + table thead {
  background-color: #4895ab;
  color: white;
  border-bottom: 3px solid #3a7a8a;
}

.cell-output-display table th,
.cell-output table th,
pre + table th,
code + table th,
.sourceCode + table th {
  padding: 0.85rem 1rem;
  font-weight: 600;
  text-align: left;
  border-right: 1px solid rgba(255,255,255,0.2);
}

.cell-output-display table th:last-child,
.cell-output table th:last-child,
pre + table th:last-child,
code + table th:last-child,
.sourceCode + table th:last-child {
  border-right: none;
}

.cell-output-display table td,
.cell-output table td,
pre + table td,
code + table td,
.sourceCode + table td {
  padding: 0.75rem 1rem;
  border: 1px solid #dee2e6;
  text-align: left;
}

.cell-output-display table tbody tr:nth-child(even),
.cell-output table tbody tr:nth-child(even),
pre + table tbody tr:nth-child(even),
code + table tbody tr:nth-child(even),
.sourceCode + table tbody tr:nth-child(even) {
  background-color: #f8f9fa;
}

.cell-output-display table tbody tr:hover,
.cell-output table tbody tr:hover,
pre + table tbody tr:hover,
code + table tbody tr:hover,
.sourceCode + table tbody tr:hover {
  background-color: #e3f2f7;
  transition: background-color 0.2s ease;
}

/* Dark mode table styling */
body.quarto-dark .cell-output-display table,
body.quarto-dark .cell-output table,
body.quarto-dark pre + table,
body.quarto-dark code + table,
body.quarto-dark .sourceCode + table {
  background-color: #2d2d2d;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

body.quarto-dark .cell-output-display table thead,
body.quarto-dark .cell-output table thead,
body.quarto-dark pre + table thead,
body.quarto-dark code + table thead,
body.quarto-dark .sourceCode + table thead {
  background-color: #5aa9bd;
  color: white;
  border-bottom: 3px solid #4895ab;
}

body.quarto-dark .cell-output-display table td,
body.quarto-dark .cell-output table td,
body.quarto-dark pre + table td,
body.quarto-dark code + table td,
body.quarto-dark .sourceCode + table td {
  border: 1px solid #404040;
  color: #e0e0e0;
}

body.quarto-dark .cell-output-display table tbody tr:nth-child(even),
body.quarto-dark .cell-output table tbody tr:nth-child(even),
body.quarto-dark pre + table tbody tr:nth-child(even),
body.quarto-dark code + table tbody tr:nth-child(even),
body.quarto-dark .sourceCode + table tbody tr:nth-child(even) {
  background-color: #1a1a1a;
}

body.quarto-dark .cell-output-display table tbody tr:hover,
body.quarto-dark .cell-output table tbody tr:hover,
body.quarto-dark pre + table tbody tr:hover,
body.quarto-dark code + table tbody tr:hover,
body.quarto-dark .sourceCode + table tbody tr:hover {
  background-color: #3a5a64;
}

/* Pagination */
.pagination {
  margin-top: 2rem;
  justify-content: center;
}

.page-link {
  color: #4895ab;
  border-radius: 4px;
  margin: 0 2px;
}

.page-item.active .page-link {
  background-color: #4895ab;
  border-color: #4895ab;
}

/* Tables */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.5em 0;
  font-size: 0.9em;
}

table thead {
  background-color: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
}007bff;
  border-radius: 4px;
  margin: 0 2px;
}

.page-item.active .page-link {
  background-color: #007bff;
  border-color: #007bf

  .quarto-listing-filter {
    background: #1a1a1a;
  }

  .quarto-listing-filter .filter-text,
  .quarto-listing-sort select {
    background: #2d2d2d;
    border-color: #404040;
    color: #e0e0e0;
  }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .quarto-listing-container-grid {
    grid-template-columns: 1fr !important;
  }

  .category-cloud {
    justify-content: flex-start;
  }

  /* Ensure images stay centered on mobile */
  img {
    display: block;
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
  }
  div.sourceCode {
    background-color:rgba(233,236,239,.02);
    border:1px solid rgba(233,236,239,.02);
    overflow-x: visible !important;
    overflow-y: visible !important;
  }
  /* Mobile code block adjustments */
  pre.sourceCode {
    font-size: 13px;
    overflow-x: visible !important;
    overflow-y: visible !important;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
  }

  pre[class*="language-"]::before,
  pre.sourceCode::before {
    font-size: 9px;
    padding: 0.25em 0.5em;
  }

  code {
    font-size: 13px;
  }
}

/* Tablet responsiveness */
@media (min-width: 769px) and (max-width: 1024px) {
  /* Ensure images stay centered on tablets */
  img {
    display: block;
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
  }
}

/* Large screen responsiveness */
@media (min-width: 1025px) {
  /* Ensure images stay centered on large screens */
  img {
    display: block;
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
  }
}

/* Code block language support */
/* General code styling with vim-hybrid colors */
code {
  font-family: 'Fira Code', 'Inconsolata', monospace;
  font-weight: 500;
  font-size: 14.457px;
  line-height: 2em;
  color: #d46c5b;
  background-color: rgba(212, 108, 91, 0.015);
  padding: 3px;
  border-radius: 3px;
  opacity: 0.9;
}

/* Prevent horizontal scrolling on all code containers */
div.sourceCode,
pre.sourceCode,
pre code,
pre {
  overflow-x: visible !important;
  overflow-y: visible !important;
  white-space: pre-wrap !important;
  word-wrap: break-word !important;
  word-break: break-word !important;
}

pre code {
  font-family: 'Fira Code', 'Inconsolata', monospace;
  font-weight: 500;
  opacity: 1;
  background-color: transparent;
  padding: 0.5em;
  color: #536878cc;
  font-size: 0.9103em;
}

/* Stata syntax highlighting */
pre.stata code {
  font-family: 'Fira Code', 'Inconsolata', monospace;
  font-size: 0.9103em;}

/* Julia syntax highlighting */
pre.julia code {
  font-family: 'Fira Code', 'Inconsolata', monospace;
  font-size: 0.9103em;}

/* Pseudocode styling */
.pseudocode,
pre.pseudocode code,
.algorithm {
  font-family: "Courier New", Consolas, monospace;
  padding: 1.5em;
  border-left: 4px solid #007bff;
  border-radius: 4px;
  line-height: 1.8;
  font-size: 0.95em;
}

.algorithm {
  margin: 2em 0;
  background: #f8f9fa;
}

.algorithm strong {
  color: #007bff;
  font-weight: 600;
}

/* Algorithm line numbers */
.algorithm ol {
  counter-reset: algorithm-line;
  list-style: none;
  padding-left: 2em;
}

.algorithm ol li {
  counter-increment: algorithm-line;
  position: relative;
}

.algorithm ol li::before {
  content: counter(algorithm-line) ": ";
  position: absolute;
  left: -2em;
  color: #6c757d;
  font-weight: 600;
}

/* Indented pseudocode */
.pseudocode .indent-1 {
  margin-left: 2em;
}

.pseudocode .indent-2 {
  margin-left: 4em;
}

.pseudocode .indent-3 {
  margin-left: 6em;
}

/* Keywords in pseudocode */
.pseudocode .keyword {
  color: #d63384;
  font-weight: 600;
}

.pseudocode .comment {
  color: #6c757d;
  font-style: italic;
}

/* Dark mode for pseudocode */
@media (prefers-color-scheme: dark) {
  .pseudocode,
  pre.pseudocode code,
  .algorithm {
    border-left-color: #0d6efd;
    color: orange;
  }

  .algorithm {
    background: #2d2d2d;
  }

  .algorithm strong {
    color: #0d6efd;
  }

  .algorithm ol li::before {
    color: #adb5bd;
  }
}

/* Fix code block positioning for copy button and language labels */
div.sourceCode {
  position: relative;
  margin: 0 0 0.5em 0;
  padding-top: 0;
  overflow-x: visible !important;
  overflow-y: visible !important;
}

pre.sourceCode {
  position: relative;
  margin: 0 !important;
  padding: 0.5em 1em !important;
  border-radius: 3px;
  font-size: 0.9103em !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
  white-space: pre-wrap !important;
  word-wrap: break-word !important;
}

/* Hide default Quarto copy button */
.code-copy-button {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

.code-copy-button:hover {
  display: none !important;
  opacity: 0 !important;
}

/* Make language labels clickable for copying */
pre[class*="language-"]::before,
pre.sourceCode::before {
  cursor: pointer;
  transition: all 0.2s;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

pre[class*="language-"]:hover::before,
pre.sourceCode:hover::before {
  opacity: 0.8;
  transform: scale(1.05);
}

/* Add copy-on-click functionality via language badge */
div.sourceCode {
  position: relative;
}

div.sourceCode::after {
  content: "Click language badge to copy";
  position: absolute;
  top: 0;
  right: 0;
  padding: 0.25em 0.5em;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 0.7em;
  border-radius: 0 3px 0 3px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 50;
}

div.sourceCode:hover::after {
  opacity: 1;
}

/* Language indicators for code blocks */
pre[class*="language-"]::before,
pre.sourceCode::before {
  content: attr(data-language);
  position: absolute;
  top: 0;
  right: 0;
  padding: 0.385em 0.825em;
  margin: 0;
  background: #4895ab;
  color: white;
  font-size: 0.85em;  font-weight: 600;
  text-transform: uppercase;
  border-radius: 0 3px 0 3px;
  box-sizing: border-box;
  z-index: 10;
  opacity: 0.85;
  transition: all 0.3s ease;
  font-family: 'Fira Code', 'Inconsolata', monospace;
}

pre[class*="language-"]:hover::before,
pre.sourceCode:hover::before {
  background: #d46c5b;
  opacity: 1;
}

/* Specific language labels */
pre.stata::before,
pre.sourceCode.stata::before {
  content: "STATA";
  background: #4895ab;
}

pre.julia::before,
pre.sourceCode.julia::before {
  content: "JULIA";
  background: #9558b2;
}

pre.pseudocode::before,
.algorithm::before {
  content: "ALGORITHM";
  background: #c6d6e4;
}

pre.r::before,
pre.sourceCode.r::before {
  content: "R";
  background: #3f8f9b;
}

pre.python::before,
pre.sourceCode.python::before {
  content: "PYTHON";
  background: #3f8f9b;
}
//* Algolia search customization */
.aa-DetachedSearchButton {
  background-color: var(--bs-primary);
  border: none;
  border-radius: 4px;
  padding: 0.5rem 1rem;
}

.aa-DetachedSearchButton:hover {
  background-color: var(--bs-primary-dark);
}

.aa-Panel {
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.aa-Item[aria-selected='true'] {
  background-color: var(--bs-primary);
  color: white;
}
