/* ============================================
   Brand Color Palette
   ============================================ */

:root {
  /* Primary palette - Professional blue (distinct from MS blue) */
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-primary-light: #3b82f6;

  /* Accent colors */
  --color-accent: #0891b2;
  --color-accent-light: #22d3ee;

  /* Semantic colors */
  --color-success: #059669;
  --color-warning: #d97706;

  /* Neutral palette */
  --color-text: #1f2937;
  --color-text-muted: #6b7280;
  --color-text-light: #9ca3af;
  --color-bg: #ffffff;
  --color-bg-subtle: #f9fafb;
  --color-border: #e5e7eb;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
}

/* Update existing styles to use variables where appropriate */
/* (Don't break existing #007acc references - keep them for compatibility) */

/* Custom styles for Shihab Khan's website */

/* Site title styling (previously h1 in sidebar) */
aside .site-title {
  font-size: 1.8rem;
  font-weight: bold;
  margin: 1rem 0;
}

aside .site-title a {
  color: inherit;
  text-decoration: none;
}

aside .site-title a:hover {
  color: #007acc;
  text-decoration: none;
}

/* ===========================================
   Homepage Styles (extracted from home.html)
   =========================================== */

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 3rem 0;
  border-bottom: 1px solid #eee;
}

.hero-section img {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  margin-bottom: 1.5rem;
}

.hero-section h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.hero-section .hero-subtitle {
  font-size: 1.3rem;
  color: #666;
  margin-bottom: 1rem;
}

.hero-section .hero-description {
  max-width: 600px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

/* CTA Buttons */
.cta-buttons .btn-primary {
  display: inline-block;
  padding: 0.8rem 2rem;
  background: #007acc;
  color: white;
  text-decoration: none;
  border-radius: 5px;
  margin: 0 0.5rem;
}

.cta-buttons .btn-secondary {
  display: inline-block;
  padding: 0.8rem 2rem;
  border: 2px solid #007acc;
  color: #007acc;
  text-decoration: none;
  border-radius: 5px;
  margin: 0 0.5rem;
}

.cta-buttons a:hover {
  opacity: 0.9;
}

/* Featured Projects Section */
.featured-projects {
  padding: 3rem 0;
}

.featured-projects h2,
.recent-posts h2,
.connect-section h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
}

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

.project-card {
  border: 1px solid #eee;
  padding: 1.5rem;
  border-radius: 8px;
  transition: box-shadow 0.3s;
}

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

.project-card h3 {
  margin-bottom: 0.5rem;
}

.project-card h3 a {
  color: inherit;
  text-decoration: none;
}

.project-card p {
  color: #666;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.project-tags span {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: #f0f0f0;
  border-radius: 3px;
  font-size: 0.85rem;
  margin-right: 0.5rem;
}

.view-all-link {
  text-align: center;
}

.view-all-link a {
  color: #007acc;
  text-decoration: none;
  font-weight: 500;
}

/* Recent Blog Posts Section */
.recent-posts {
  padding: 3rem 0;
  border-top: 1px solid #eee;
}

.posts-list article {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f0f0f0;
}

.posts-list article h3 {
  margin-bottom: 0.5rem;
}

.posts-list article h3 a {
  color: inherit;
  text-decoration: none;
}

.post-meta {
  color: #888;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.post-meta a {
  color: #888;
}

.posts-list article p,
.posts-list .no-posts {
  color: #666;
  line-height: 1.6;
}

/* Connect Section */
.connect-section {
  padding: 3rem 0;
  background: #f8f9fa;
  text-align: center;
  margin: 0 -2rem;
  padding-left: 2rem;
  padding-right: 2rem;
}

.connect-section p {
  color: #666;
  margin-bottom: 2rem;
}

.social-links {
  margin-bottom: 2rem;
}

.social-links a {
  display: inline-block;
  margin: 0 1rem;
  color: #007acc;
  text-decoration: none;
  font-size: 1.5rem;
}

.email-cta {
  margin-top: 2rem;
}

.email-cta a {
  display: inline-block;
  padding: 0.8rem 2rem;
  background: #007acc;
  color: white;
  text-decoration: none;
  border-radius: 5px;
  font-size: 1.1rem;
}

/* ===========================================
   Top Navigation Bar Styling
   =========================================== */
main nav {
  text-align: center;
  width: 100%;
}

main nav ul {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

main nav a {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 0.5rem 0.25rem;
}

/* ===========================================
   Active Navigation Indicator
   =========================================== */
main nav a.active {
  font-weight: 600;
  color: #007acc;
  position: relative;
}

main nav a.active::after {
  content: '';
  position: absolute;
  bottom: -14px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: #007acc;
}

/* ===========================================
   Hide Duplicate Hero Image on Desktop
   =========================================== */
@media screen and (min-width: 768px) {
  .hero-section .hero-image {
    display: none;
  }

  /* Adjust hero section spacing when image is hidden */
  .hero-section {
    padding-top: 2rem;
  }
}

/* ===========================================
   Reading Time Styling
   =========================================== */
.reading-time {
  color: #888;
  font-style: italic;
}

/* ============================================
   CV Page Visual Enhancement
   ============================================ */

/* Target experience section headers with timeline effect */
article h3 {
  position: relative;
  padding-left: 1.5rem;
  margin-left: 0.5rem;
}

/* Timeline dot for h3 headers in experience-like sections */
article h2#professional-experience ~ h3::before,
article h2#education ~ h3::before {
  content: '';
  position: absolute;
  left: -0.5rem;
  top: 0.4em;
  width: 10px;
  height: 10px;
  background: #007acc;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #007acc;
}

/* Timeline line connector */
article h2#professional-experience ~ h3,
article h2#education ~ h3 {
  border-left: 2px solid #e5e7eb;
  margin-left: 0.25rem;
  padding-left: 1.5rem;
}

/* Style skill lists as inline chips */
article h2#technical-skills ~ h3 + ul,
article h3[id*="machine-learning"] + ul,
article h3[id*="languages"] + ul,
article h3[id*="mlops"] + ul,
article h3[id*="statistics"] + ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

article h2#technical-skills ~ h3 + ul li {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

article h2#technical-skills ~ h3 + ul li:hover {
  background: #007acc;
  color: white;
  border-color: #007acc;
}

/* Achievement metrics with accent border */
article h2#key-achievements-impact ~ h3 + ul li,
article h3[id*="achievements"] + ul li {
  padding-left: 1rem;
  border-left: 3px solid #007acc;
  margin-bottom: 0.75rem;
}

/* Section icons using pseudo-elements */
article h2 {
  position: relative;
  padding-left: 2rem;
}

article h2::before {
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  left: 0;
  color: #007acc;
  font-size: 1rem;
}

article h2#professional-experience::before { content: '\f0b1'; } /* briefcase */
article h2#education::before { content: '\f19d'; } /* graduation-cap */
article h2#technical-skills::before { content: '\f121'; } /* code */
article h2#key-achievements-impact::before { content: '\f091'; } /* trophy */
article h2#publications::before { content: '\f02d'; } /* book */
article h2#open-source-contributions::before { content: '\f09b'; } /* github */
article h2#professional-activities::before { content: '\f0c0'; } /* users */

/* ============================================
   Projects Page Visual Enhancement
   ============================================ */

/* Style project section headers as cards */
article h3 a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

article h3 a:hover {
  color: #007acc;
}

/* Add visual separation between project sections */
article hr {
  border: none;
  height: 1px;
  background: linear-gradient(to right, transparent, #e5e7eb, transparent);
  margin: 2.5rem 0;
}

/* Style impact/technology lines */
article p strong:first-child {
  color: #007acc;
}

/* Category section headers */
article h2[id*="ml"],
article h2[id*="infrastructure"],
article h2[id*="bayesian"],
article h2[id*="optimization"] {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  color: #1f2937; /* Explicit dark text for light mode gradient */
  padding: 1rem 1.5rem;
  border-radius: 8px;
  margin-top: 2rem;
  margin-bottom: 1.5rem;
}

/* ============================================
   About Page Visual Enhancement
   ============================================ */

/* Subtle timeline effect for About page h2 headers
   Use exact ID prefixes to avoid matching Projects page headings */
article h2[id^="building-ai"],
article h2[id^="what-im-building"],
article h2[id^="the-journey"],
article h2[id^="the-technical"],
article h2[id^="what-drives"],
article h2[id^="what-excites"] {
  position: relative;
}

article h2[id^="building-ai"]::before,
article h2[id^="what-im-building"]::before,
article h2[id^="the-journey"]::before,
article h2[id^="the-technical"]::before,
article h2[id^="what-drives"]::before,
article h2[id^="what-excites"]::before {
  content: '';
  position: absolute;
  left: -1.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  background: #007acc;
  border-radius: 50%;
}

/* Ensure Projects page category headers don't get About page dots */
article h2[id*="ml"],
article h2[id*="infrastructure"],
article h2[id*="bayesian"],
article h2[id*="optimization"] {
  padding-left: 1.5rem; /* Override the 2rem from general h2 */
}

article h2[id*="ml"]::before,
article h2[id*="infrastructure"]::before,
article h2[id*="bayesian"]::before,
article h2[id*="optimization"]::before,
article h2[id*="building-ml"]::before,
article h2[id*="connecting"]::before,
article h2[id*="explore"]::before {
  content: none; /* Remove any pseudo-element content */
}

/* Better list styling in About page */
article ul {
  padding-left: 1.5rem;
}

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

/* Emphasis on bold text */
article strong {
  color: #1f2937;
}

/* ============================================
   Micro-interactions
   ============================================ */

/* Smooth transitions on all interactive elements */
a, button, .project-card, .btn, input, textarea {
  transition: all var(--transition-fast, 150ms ease);
}

/* Card hover lift effect */
.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg, 0 10px 15px rgba(0,0,0,0.1));
}

/* Navigation link hover effect */
main nav a {
  position: relative;
}

main nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary, #2563eb);
  transition: width var(--transition-normal, 250ms ease);
}

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

/* Button press effect */
.btn:active,
.btn-primary:active,
.btn-secondary:active {
  transform: translateY(1px);
}

/* Focus states for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-primary, #2563eb);
  outline-offset: 2px;
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Social link hover */
.social-link:hover,
ul.social a:hover {
  transform: translateY(-2px);
}

/* Tag hover effect on homepage */
.tag:hover,
.project-tags span:hover {
  background: var(--color-primary, #2563eb);
  color: white;
}

/* ============================================
   P3.16: Blog Enhancements
   ============================================ */

/* Table of Contents Styling */
.toc {
  background: var(--color-bg-subtle, #f9fafb);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0 2rem;
  max-width: 400px;
}

.toc-title,
.toc > strong:first-child {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted, #6b7280);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
}

.toc ul,
.toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc li {
  margin: 0.375rem 0;
  line-height: 1.4;
}

.toc li a {
  color: var(--color-text, #1f2937);
  text-decoration: none;
  font-size: 0.9375rem;
  transition: color var(--transition-fast, 150ms ease);
}

.toc li a:hover {
  color: var(--color-primary, #2563eb);
}

/* Nested TOC items */
.toc ul ul,
.toc ol ol {
  padding-left: 1.25rem;
  margin-top: 0.25rem;
}

.toc ul ul li a,
.toc ol ol li a {
  font-size: 0.875rem;
  color: var(--color-text-muted, #6b7280);
}

.toc ul ul li a:hover,
.toc ol ol li a:hover {
  color: var(--color-primary, #2563eb);
}

/* Share Post Section Styling */
#post-share-links {
  background: var(--color-bg-subtle, #f9fafb);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 2rem 0;
  text-align: center;
  font-size: 0.9375rem;
}

#post-share-links a {
  color: var(--color-primary, #2563eb);
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: all var(--transition-fast, 150ms ease);
}

#post-share-links a:hover {
  background: var(--color-primary, #2563eb);
  color: white;
}

/* Related Posts Styling */
.related-posts {
  background: var(--color-bg-subtle, #f9fafb);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 2rem 0;
  border-left: 4px solid var(--color-primary, #2563eb);
}

.related-posts h4,
.related-posts h5 {
  color: var(--color-text, #1f2937);
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
}

.related-posts h5 {
  font-size: 0.875rem;
  color: var(--color-text-muted, #6b7280);
  margin-top: 1rem;
}

ul.related-posts {
  list-style: none;
  padding: 0;
  margin: 0;
}

ul.related-posts li {
  margin: 0.5rem 0;
  padding-left: 1.25rem;
  position: relative;
}

ul.related-posts li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  background: var(--color-primary, #2563eb);
  border-radius: 50%;
}

ul.related-posts li a {
  color: var(--color-text, #1f2937);
  text-decoration: none;
  transition: color var(--transition-fast, 150ms ease);
}

ul.related-posts li a:hover {
  color: var(--color-primary, #2563eb);
}

/* Social Share Center Styling */
.center.social-share {
  text-align: center;
  padding: 1.5rem;
  margin: 2rem 0;
  background: var(--color-bg-subtle, #f9fafb);
  border-radius: 8px;
}

.center.social-share p {
  color: var(--color-text-muted, #6b7280);
  margin-bottom: 1rem;
}

/* ============================================
   P3.17: Scroll-to-Top Button
   ============================================ */

.scroll-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  background: var(--color-primary, #2563eb);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md, 0 4px 6px rgba(0,0,0,0.07));
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--transition-normal, 250ms ease);
  z-index: 1000;
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-top:hover {
  background: var(--color-primary-dark, #1d4ed8);
  box-shadow: var(--shadow-lg, 0 10px 15px rgba(0,0,0,0.1));
  transform: translateY(-2px);
}

.scroll-to-top:active {
  transform: translateY(0);
}

.scroll-to-top:focus-visible {
  outline: 2px solid var(--color-primary, #2563eb);
  outline-offset: 2px;
}

.scroll-to-top svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* Hide on very small screens to avoid mobile nav conflicts */
@media (max-width: 480px) {
  .scroll-to-top {
    bottom: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
  }

  .scroll-to-top svg {
    width: 20px;
    height: 20px;
  }
}

/* ============================================
   P3.18: Typography Improvements
   ============================================ */

/* Improved line-height for readability */
article p,
article li,
.post-content p,
.page-content p {
  line-height: 1.7;
}

/* Improved paragraph spacing */
article p {
  margin-bottom: 1.25rem;
}

article p + p {
  margin-top: 0;
}

/* Drop cap styling for first paragraph of articles */
article.single > div > p:first-of-type::first-letter,
.article-content > p:first-of-type::first-letter,
.drop-cap::first-letter {
  float: left;
  font-size: 3.5rem;
  line-height: 1;
  font-weight: 700;
  color: var(--color-primary, #2563eb);
  margin-right: 0.5rem;
  margin-top: 0.1rem;
}

/* Ensure drop cap works with wrapped text */
article.single > div > p:first-of-type,
.article-content > p:first-of-type,
.drop-cap {
  overflow: hidden;
}

/* Better heading spacing */
article h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

article h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

article h4 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

/* Blockquote improvements */
article blockquote {
  border-left: 4px solid var(--color-primary, #2563eb);
  padding-left: 1.5rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--color-text-muted, #6b7280);
}

article blockquote p {
  margin-bottom: 0.75rem;
}

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

/* ============================================
   P3.19: Lazy Loading Support
   ============================================ */

/* Smooth loading transition for lazy images */
article img[loading="lazy"],
.lazy-load {
  opacity: 0;
  transition: opacity var(--transition-normal, 250ms ease);
}

article img[loading="lazy"].loaded,
.lazy-load.loaded {
  opacity: 1;
}

/* Placeholder background while loading */
article img[loading="lazy"]:not(.loaded) {
  background: var(--color-bg-subtle, #f9fafb);
}

/* Picture element lazy loading */
picture img[loading="lazy"] {
  opacity: 0;
  transition: opacity var(--transition-normal, 250ms ease);
}

picture img[loading="lazy"].loaded {
  opacity: 1;
}

/* ============================================
   P3.20: Polish and Consistency
   ============================================ */

/* Consistent code block styling */
article pre {
  background: #1e293b;
  border-radius: 8px;
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

article code {
  font-family: 'Source Code Pro', Consolas, Monaco, monospace;
  font-size: 0.9em;
}

article p code,
article li code {
  background: var(--color-bg-subtle, #f9fafb);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  color: #c7254e;
  font-size: 0.875em;
}

/* Consistent table styling */
article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
}

article th,
article td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
}

article th {
  background: var(--color-bg-subtle, #f9fafb);
  font-weight: 600;
  color: var(--color-text, #1f2937);
}

article tr:hover {
  background: var(--color-bg-subtle, #f9fafb);
}

/* Consistent image styling */
article img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1rem 0;
}

article figure {
  margin: 1.5rem 0;
  text-align: center;
}

article figcaption {
  font-size: 0.875rem;
  color: var(--color-text-muted, #6b7280);
  margin-top: 0.5rem;
  font-style: italic;
}

/* Consistent link styling in articles */
article a:not(.btn):not(.tag):not([class*="share"]) {
  color: var(--color-primary, #2563eb);
  text-decoration: underline;
  text-decoration-color: rgba(37, 99, 235, 0.3);
  text-underline-offset: 2px;
  transition: all var(--transition-fast, 150ms ease);
}

article a:not(.btn):not(.tag):not([class*="share"]):hover {
  text-decoration-color: var(--color-primary, #2563eb);
}

/* Tag cloud consistency */
.tag-cloud p {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0;
}

.tag-cloud a {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--color-bg-subtle, #f9fafb);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 9999px;
  font-size: 0.875rem;
  color: var(--color-text, #1f2937);
  text-decoration: none;
  transition: all var(--transition-fast, 150ms ease);
}

.tag-cloud a:hover {
  background: var(--color-primary, #2563eb);
  border-color: var(--color-primary, #2563eb);
  color: white;
}

/* Article header consistency */
article.single header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
}

article.single header h1 {
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

article.single header p {
  color: var(--color-text-muted, #6b7280);
  font-size: 0.9375rem;
  margin: 0;
}

/* Neighbors (prev/next) styling */
.neighbors {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 2rem 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border, #e5e7eb);
}

.neighbors a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--color-bg-subtle, #f9fafb);
  border-radius: 8px;
  color: var(--color-text, #1f2937);
  text-decoration: none;
  transition: all var(--transition-fast, 150ms ease);
  max-width: 45%;
}

.neighbors a:hover {
  background: var(--color-primary, #2563eb);
  color: white;
}

.neighbors a:first-child {
  text-align: left;
}

.neighbors a:last-child {
  text-align: right;
  margin-left: auto;
}

/* Print styles for articles */
@media print {
  .scroll-to-top,
  .tag-cloud,
  .neighbors,
  .related-posts,
  #post-share-links,
  .social-share {
    display: none !important;
  }

  article {
    font-size: 12pt;
    line-height: 1.5;
  }

  article a {
    text-decoration: none;
    color: inherit;
  }

  article a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
}

/* ============================================
   Dark Mode Overrides
   ============================================ */

/* Media query for automatic dark mode detection */
@media (prefers-color-scheme: dark) {
  /* CSS Variables */
  :root {
    --color-text: #eeeeee;
    --color-text-muted: #b0b0b0;
    --color-text-light: #888888;
    --color-bg: #333333;
    --color-bg-subtle: #404040;
    --color-border: #555555;
    --color-primary: #60a5fa;
    --color-primary-dark: #3b82f6;
    --color-primary-light: #93c5fd;
  }

  /* Hero section */
  .hero-section {
    border-bottom-color: #444;
  }
  .hero-section .hero-subtitle {
    color: #b0b0b0;
  }

  /* Project cards */
  .project-card {
    border-color: #555;
    background: #3a3a3a;
  }
  .project-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  }
  .project-card p {
    color: #b0b0b0;
  }

  /* Project tags - CRITICAL */
  .project-tags span {
    background: #4a5568 !important;
    color: #ffffff !important;
    border: 1px solid #718096 !important;
  }
  .project-tags span:hover {
    background: #60a5fa !important;
    color: #ffffff !important;
    border-color: #60a5fa !important;
  }

  /* CTA Buttons */
  .cta-buttons .btn-secondary {
    border-color: #60a5fa;
    color: #60a5fa;
  }
  .cta-buttons .btn-secondary:hover {
    background: #60a5fa;
    color: #1a1a1a;
  }

  /* Recent posts */
  .recent-posts {
    border-top-color: #444;
  }
  .posts-list article {
    border-bottom-color: #444;
  }
  .posts-list article p,
  .posts-list .no-posts {
    color: #b0b0b0;
  }
  .post-meta,
  .post-meta a {
    color: #888;
  }

  /* Connect section (footer) - CRITICAL */
  .connect-section {
    background: #2a2a2a !important;
    color: #eeeeee;
  }
  .connect-section h2 {
    color: #ffffff !important;
  }
  .connect-section p {
    color: #b0b0b0;
  }
  .connect-section .social-links a {
    color: #60a5fa;
  }
  .connect-section .social-links a:hover {
    color: #93c5fd;
  }
  .connect-section .email-cta a {
    background: #007acc;
    color: #ffffff;
  }

  /* View all link */
  .view-all-link a {
    color: #60a5fa;
  }

  /* Article links */
  article a:not(.btn):not(.tag):not([class*="share"]) {
    color: #60a5fa;
    text-decoration-color: rgba(96, 165, 250, 0.4);
  }
  article a:not(.btn):not(.tag):not([class*="share"]):hover {
    color: #93c5fd;
    text-decoration-color: #93c5fd;
  }

  /* Bold text */
  article strong {
    color: #ffffff;
  }
  article a strong,
  article a > strong,
  article strong a {
    color: #93c5fd !important;
  }
  article p strong:first-child {
    color: #60a5fa;
  }

  /* All h2 headings */
  article h2 {
    color: #ffffff;
  }
  article h2::before {
    color: #60a5fa;
  }

  /* Section headers with gradients */
  article h2[id*="ml"],
  article h2[id*="infrastructure"],
  article h2[id*="bayesian"],
  article h2[id*="optimization"],
  article h2[id*="building-ml"],
  article h2[id*="connecting"],
  article h2[id*="explore"],
  article h2[id^="building-ai"],
  article h2[id^="what-im-building"],
  article h2[id^="the-journey"],
  article h2[id^="the-technical"],
  article h2[id^="what-drives"],
  article h2[id^="what-excites"],
  article h2[id^="open-source"],
  article h2[id^="beyond"],
  article h2[id^="lets-connect"] {
    background: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 100%) !important;
    color: #ffffff !important;
  }

  /* Remove bullets from section headers */
  article h2[id*="ml"]::before,
  article h2[id*="infrastructure"]::before,
  article h2[id*="bayesian"]::before,
  article h2[id*="optimization"]::before,
  article h2[id*="building-ml"]::before,
  article h2[id*="connecting"]::before,
  article h2[id*="explore"]::before {
    content: none;
  }

  /* About page timeline dots */
  article h2[id^="building-ai"]::before,
  article h2[id^="what-im-building"]::before,
  article h2[id^="the-journey"]::before,
  article h2[id^="the-technical"]::before,
  article h2[id^="what-drives"]::before,
  article h2[id^="what-excites"]::before {
    background: #60a5fa;
  }

  /* Horizontal rules */
  article hr {
    background: linear-gradient(to right, transparent, #555, transparent);
  }

  /* Blockquotes */
  article blockquote {
    border-left-color: #60a5fa;
    color: #b0b0b0;
    background: #3a3a3a;
    padding: 1rem 1.5rem;
    border-radius: 0 8px 8px 0;
  }
  article blockquote p {
    color: #eeeeee;
  }

  /* Inline code */
  article p code,
  article li code {
    background: #2a2a2a;
    color: #f472b6;
    border: 1px solid #444;
  }

  /* Tables */
  article th {
    background: #3a3a3a;
    color: #eeeeee;
  }
  article th,
  article td {
    border-bottom-color: #555;
  }
  article tr:hover {
    background: #3a3a3a;
  }

  /* TOC */
  .toc {
    background: #3a3a3a;
    border-color: #555;
  }
  .toc-title,
  .toc > strong:first-child {
    color: #b0b0b0;
    border-bottom-color: #555;
  }
  .toc li a {
    color: #eeeeee;
  }
  .toc li a:hover {
    color: #60a5fa;
  }

  /* Tag cloud */
  .tag-cloud a {
    background: #3a3a3a;
    border-color: #555;
    color: #eeeeee;
  }
  .tag-cloud a:hover {
    background: #60a5fa;
    border-color: #60a5fa;
    color: #1a1a1a;
  }

  /* Article header */
  article.single header {
    border-bottom-color: #555;
  }
  article.single header p {
    color: #b0b0b0;
  }

  /* Neighbors */
  .neighbors {
    border-top-color: #555;
  }
  .neighbors a {
    background: #3a3a3a;
    color: #eeeeee;
  }
  .neighbors a:hover {
    background: #60a5fa;
    color: #1a1a1a;
  }

  /* Navigation */
  main nav a.active {
    color: #60a5fa;
  }
  main nav a.active::after {
    background-color: #60a5fa;
  }
  main nav a::after {
    background: #60a5fa;
  }

  /* Scroll to top */
  .scroll-to-top {
    background: #60a5fa;
  }
  .scroll-to-top:hover {
    background: #3b82f6;
  }

  /* Focus states */
  a:focus-visible,
  button:focus-visible,
  input:focus-visible,
  textarea:focus-visible {
    outline-color: #60a5fa;
  }

  /* Reading time */
  .reading-time {
    color: #888;
  }

  /* Related posts */
  .related-posts {
    background: #3a3a3a;
    border-left-color: #60a5fa;
  }
  .related-posts h4,
  .related-posts h5 {
    color: #eeeeee;
  }
  ul.related-posts li::before {
    background: #60a5fa;
  }
  ul.related-posts li a {
    color: #eeeeee;
  }
  ul.related-posts li a:hover {
    color: #60a5fa;
  }

  /* Share links */
  #post-share-links {
    background: #3a3a3a;
  }
  #post-share-links a {
    color: #60a5fa;
  }
  #post-share-links a:hover {
    background: #60a5fa;
    color: #1a1a1a;
  }

  /* Social share */
  .center.social-share {
    background: #3a3a3a;
  }
  .center.social-share p {
    color: #b0b0b0;
  }

  /* CV page timeline */
  article h2#professional-experience ~ h3,
  article h2#education ~ h3 {
    border-left-color: #555;
  }
  article h2#professional-experience ~ h3::before,
  article h2#education ~ h3::before {
    border-color: #333;
    box-shadow: 0 0 0 2px #60a5fa;
  }

  /* Skills chips */
  article h2#technical-skills ~ h3 + ul li {
    background: #404040;
    border-color: #555;
    color: #eeeeee;
  }
  article h2#technical-skills ~ h3 + ul li:hover {
    background: #60a5fa;
    color: #1a1a1a;
    border-color: #60a5fa;
  }

  /* Achievement metrics */
  article h2#key-achievements-impact ~ h3 + ul li,
  article h3[id*="achievements"] + ul li {
    border-left-color: #60a5fa;
  }
}

/* Manual override with body.dark-theme class */
body.dark-theme {
  /* Override CSS variables for dark mode */
  --color-text: #eeeeee;
  --color-text-muted: #b0b0b0;
  --color-text-light: #888888;
  --color-bg: #333333;
  --color-bg-subtle: #404040;
  --color-border: #555555;
  --color-primary: #60a5fa;
  --color-primary-dark: #3b82f6;
  --color-primary-light: #93c5fd;
}

/* Hero section dark mode */
body.dark-theme .hero-section {
  border-bottom-color: #444;
}

body.dark-theme .hero-section .hero-subtitle {
  color: #b0b0b0;
}

/* Project cards in dark mode */
body.dark-theme .project-card {
  border-color: #555;
  background: #3a3a3a;
}

body.dark-theme .project-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

body.dark-theme .project-card p {
  color: #b0b0b0;
}

/* Project tags - CRITICAL FIX - Use !important to override theme defaults */
body.dark-theme .project-tags span {
  background: #4a5568 !important;
  color: #ffffff !important;
  border: 1px solid #718096 !important;
}

body.dark-theme .project-tags span:hover {
  background: #60a5fa !important;
  color: #ffffff !important;
  border-color: #60a5fa !important;
}

/* CTA Buttons in dark mode */
body.dark-theme .cta-buttons .btn-secondary {
  border-color: #60a5fa;
  color: #60a5fa;
}

body.dark-theme .cta-buttons .btn-secondary:hover {
  background: #60a5fa;
  color: #1a1a1a;
}

/* Recent posts section */
body.dark-theme .recent-posts {
  border-top-color: #444;
}

body.dark-theme .posts-list article {
  border-bottom-color: #444;
}

body.dark-theme .posts-list article p,
body.dark-theme .posts-list .no-posts {
  color: #b0b0b0;
}

body.dark-theme .post-meta,
body.dark-theme .post-meta a {
  color: #888;
}

/* Connect section (homepage footer) - CRITICAL FIX */
body.dark-theme .connect-section {
  background: #2a2a2a !important;
  color: #eeeeee;
}

body.dark-theme .connect-section h2 {
  color: #ffffff !important;
}

body.dark-theme .connect-section p {
  color: #b0b0b0;
}

body.dark-theme .connect-section .social-links a {
  color: #60a5fa;
}

body.dark-theme .connect-section .social-links a:hover {
  color: #93c5fd;
}

body.dark-theme .connect-section .email-cta a {
  background: #007acc;
  color: #ffffff;
}

/* View all link */
body.dark-theme .view-all-link a {
  color: #60a5fa;
}

/* Article links - CRITICAL FIX for readability */
body.dark-theme article a:not(.btn):not(.tag):not([class*="share"]) {
  color: #60a5fa;
  text-decoration-color: rgba(96, 165, 250, 0.4);
}

body.dark-theme article a:not(.btn):not(.tag):not([class*="share"]):hover {
  color: #93c5fd;
  text-decoration-color: #93c5fd;
}

/* Bold text in dark mode */
body.dark-theme article strong {
  color: #ffffff;
}

/* Bold text inside links - ensure visibility */
body.dark-theme article a strong,
body.dark-theme article a > strong,
body.dark-theme article strong a {
  color: #93c5fd !important;
}

/* Impact/technology lines - first bold child */
body.dark-theme article p strong:first-child {
  color: #60a5fa;
}

/* CV page timeline */
body.dark-theme article h2#professional-experience ~ h3,
body.dark-theme article h2#education ~ h3 {
  border-left-color: #555;
}

body.dark-theme article h2#professional-experience ~ h3::before,
body.dark-theme article h2#education ~ h3::before {
  border-color: #333;
  box-shadow: 0 0 0 2px #60a5fa;
}

/* Skills chips in dark mode */
body.dark-theme article h2#technical-skills ~ h3 + ul li {
  background: #404040;
  border-color: #555;
  color: #eeeeee;
}

body.dark-theme article h2#technical-skills ~ h3 + ul li:hover {
  background: #60a5fa;
  color: #1a1a1a;
  border-color: #60a5fa;
}

/* Achievement metrics */
body.dark-theme article h2#key-achievements-impact ~ h3 + ul li,
body.dark-theme article h3[id*="achievements"] + ul li {
  border-left-color: #60a5fa;
}

/* Section icons */
body.dark-theme article h2::before {
  color: #60a5fa;
}

/* Category section headers on projects page - ENHANCED */
body.dark-theme article h2[id*="ml"],
body.dark-theme article h2[id*="infrastructure"],
body.dark-theme article h2[id*="bayesian"],
body.dark-theme article h2[id*="optimization"],
body.dark-theme article h2[id*="building-ml"],
body.dark-theme article h2[id*="connecting"],
body.dark-theme article h2[id*="explore"] {
  background: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 100%) !important;
  color: #ffffff !important;
}

/* About page gradient boxes - CRITICAL FIX */
body.dark-theme article h2[id^="building-ai"],
body.dark-theme article h2[id^="what-im-building"],
body.dark-theme article h2[id^="the-journey"],
body.dark-theme article h2[id^="the-technical"],
body.dark-theme article h2[id^="what-drives"],
body.dark-theme article h2[id^="what-excites"],
body.dark-theme article h2[id^="open-source"],
body.dark-theme article h2[id^="beyond"],
body.dark-theme article h2[id^="lets-connect"] {
  color: #ffffff !important;
}

/* All h2 headings in dark mode should be visible */
body.dark-theme article h2 {
  color: #ffffff;
}

/* Horizontal rules */
body.dark-theme article hr {
  background: linear-gradient(to right, transparent, #555, transparent);
}

/* TOC in dark mode */
body.dark-theme .toc {
  background: #3a3a3a;
  border-color: #555;
}

body.dark-theme .toc-title,
body.dark-theme .toc > strong:first-child {
  color: #b0b0b0;
  border-bottom-color: #555;
}

body.dark-theme .toc li a {
  color: #eeeeee;
}

body.dark-theme .toc li a:hover {
  color: #60a5fa;
}

body.dark-theme .toc ul ul li a,
body.dark-theme .toc ol ol li a {
  color: #999;
}

/* Share links */
body.dark-theme #post-share-links {
  background: #3a3a3a;
}

body.dark-theme #post-share-links a {
  color: #60a5fa;
}

body.dark-theme #post-share-links a:hover {
  background: #60a5fa;
  color: #1a1a1a;
}

/* Related posts */
body.dark-theme .related-posts {
  background: #3a3a3a;
  border-left-color: #60a5fa;
}

body.dark-theme .related-posts h4,
body.dark-theme .related-posts h5 {
  color: #eeeeee;
}

body.dark-theme .related-posts h5 {
  color: #b0b0b0;
}

body.dark-theme ul.related-posts li::before {
  background: #60a5fa;
}

body.dark-theme ul.related-posts li a {
  color: #eeeeee;
}

body.dark-theme ul.related-posts li a:hover {
  color: #60a5fa;
}

/* Social share center */
body.dark-theme .center.social-share {
  background: #3a3a3a;
}

body.dark-theme .center.social-share p {
  color: #b0b0b0;
}

/* Scroll to top button */
body.dark-theme .scroll-to-top {
  background: #60a5fa;
}

body.dark-theme .scroll-to-top:hover {
  background: #3b82f6;
}

/* Inline code in dark mode */
body.dark-theme article p code,
body.dark-theme article li code {
  background: #2a2a2a;
  color: #f472b6;
  border: 1px solid #444;
}

/* Tables in dark mode */
body.dark-theme article th {
  background: #3a3a3a;
  color: #eeeeee;
}

body.dark-theme article th,
body.dark-theme article td {
  border-bottom-color: #555;
}

body.dark-theme article tr:hover {
  background: #3a3a3a;
}

/* Tag cloud */
body.dark-theme .tag-cloud a {
  background: #3a3a3a;
  border-color: #555;
  color: #eeeeee;
}

body.dark-theme .tag-cloud a:hover {
  background: #60a5fa;
  border-color: #60a5fa;
  color: #1a1a1a;
}

/* Article header */
body.dark-theme article.single header {
  border-bottom-color: #555;
}

body.dark-theme article.single header p {
  color: #b0b0b0;
}

/* Neighbors (prev/next) */
body.dark-theme .neighbors {
  border-top-color: #555;
}

body.dark-theme .neighbors a {
  background: #3a3a3a;
  color: #eeeeee;
}

body.dark-theme .neighbors a:hover {
  background: #60a5fa;
  color: #1a1a1a;
}

/* Blockquotes in dark mode - CRITICAL FIX */
body.dark-theme article blockquote {
  border-left-color: #60a5fa;
  color: #b0b0b0;
  background: #3a3a3a;
  padding: 1rem 1.5rem;
  border-radius: 0 8px 8px 0;
}

body.dark-theme article blockquote p {
  color: #eeeeee;
}

/* About page timeline dots - Use exact ID prefixes to avoid matching Projects page */
body.dark-theme article h2[id^="building-ai"]::before,
body.dark-theme article h2[id^="what-im-building"]::before,
body.dark-theme article h2[id^="the-journey"]::before,
body.dark-theme article h2[id^="the-technical"]::before,
body.dark-theme article h2[id^="what-drives"]::before,
body.dark-theme article h2[id^="what-excites"]::before {
  background: #60a5fa;
}

/* Ensure Projects page h2 headers don't get bullets in dark mode */
body.dark-theme article h2[id*="ml"]::before,
body.dark-theme article h2[id*="infrastructure"]::before,
body.dark-theme article h2[id*="bayesian"]::before,
body.dark-theme article h2[id*="optimization"]::before,
body.dark-theme article h2[id*="building-ml"]::before,
body.dark-theme article h2[id*="connecting"]::before,
body.dark-theme article h2[id*="explore"]::before {
  content: none;
}

/* Navigation active state */
body.dark-theme main nav a.active {
  color: #60a5fa;
}

body.dark-theme main nav a.active::after {
  background-color: #60a5fa;
}

/* Navigation hover underline */
body.dark-theme main nav a::after {
  background: #60a5fa;
}

/* Focus states in dark mode */
body.dark-theme a:focus-visible,
body.dark-theme button:focus-visible,
body.dark-theme input:focus-visible,
body.dark-theme textarea:focus-visible {
  outline-color: #60a5fa;
}

/* Reading time */
body.dark-theme .reading-time {
  color: #888;
}

/* ===========================================
   Blog Filter Bar Styles
   =========================================== */

.blog-filters {
  margin-bottom: 2rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.blog-filters-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: flex-start;
}

/* Filter item base */
.filter-item {
  position: relative;
}

/* Dropdown button */
.filter-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--secondary-bg, #f5f5f5);
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-color, #333);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-dropdown-btn:hover {
  background: var(--primary-color, #3584e4);
  color: #fff;
  border-color: var(--primary-color, #3584e4);
}

.filter-arrow {
  font-size: 0.7rem;
  transition: transform 0.2s ease;
}

.filter-dropdown.active .filter-arrow {
  transform: rotate(180deg);
}

/* Dropdown menu */
.filter-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 180px;
  max-height: 300px;
  overflow-y: auto;
  background: var(--bg-color, #fff);
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 100;
}

.filter-dropdown.active .filter-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.filter-dropdown-menu li {
  margin: 0;
  padding: 0;
}

.filter-dropdown-menu a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  color: var(--text-color, #333);
  text-decoration: none;
  font-size: 0.875rem;
  transition: background 0.15s ease;
}

.filter-dropdown-menu a:hover {
  background: var(--secondary-bg, #f5f5f5);
  color: var(--primary-color, #3584e4);
}

.filter-count {
  font-size: 0.75rem;
  color: var(--muted-color, #888);
  margin-left: 0.5rem;
}

.filter-divider {
  height: 1px;
  background: var(--border-color, #e0e0e0);
  margin: 0.5rem 0;
}

/* Tags dropdown - 2 columns for many tags */
.filter-dropdown-tags {
  min-width: 280px;
}

/* All Posts button */
.filter-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  background: var(--primary-color, #3584e4);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  background: var(--primary-dark, #2a6bc0);
  color: #fff;
}

.filter-btn-all {
  background: transparent;
  color: var(--primary-color, #3584e4);
  border: 1px solid var(--primary-color, #3584e4);
}

.filter-btn-all:hover {
  background: var(--primary-color, #3584e4);
  color: #fff;
}

/* Search input placeholder */
.filter-search-placeholder {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--secondary-bg, #f5f5f5);
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 6px;
  color: var(--muted-color, #888);
  font-size: 0.9rem;
}

.filter-icon {
  font-size: 1rem;
}

/* Stork search styling */
.stork-wrapper {
  position: relative;
}

.filter-search-input {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 6px;
  font-size: 0.9rem;
  width: 200px;
  transition: all 0.2s ease;
}

.filter-search-input:focus {
  outline: none;
  border-color: var(--primary-color, #3584e4);
  box-shadow: 0 0 0 3px rgba(53, 132, 228, 0.1);
}

.stork-output {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  min-width: 300px;
  z-index: 1000;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .blog-filters-container {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-item {
    width: 100%;
  }

  .filter-dropdown-btn {
    width: 100%;
    justify-content: space-between;
  }

  .filter-dropdown-menu {
    position: relative;
    top: 0;
    width: 100%;
    box-shadow: none;
    border: none;
    border-top: 1px solid var(--border-color, #e0e0e0);
    border-radius: 0;
    max-height: 200px;
  }

  .filter-btn {
    width: 100%;
    justify-content: center;
  }

  .filter-search-input {
    width: 100%;
  }
}

/* Dark mode for blog filters - class-based */
body.dark-theme .blog-filters {
  border-bottom-color: #555;
}

body.dark-theme .filter-dropdown-btn {
  background: #3a3a3a;
  border-color: #555;
  color: #eeeeee;
}

body.dark-theme .filter-dropdown-btn:hover {
  background: #60a5fa;
  border-color: #60a5fa;
  color: #1a1a1a;
}

body.dark-theme .filter-dropdown-menu {
  background: #2a2a2a;
  border-color: #555;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.dark-theme .filter-dropdown-menu a {
  color: #eeeeee;
}

body.dark-theme .filter-dropdown-menu a:hover {
  background: #3a3a3a;
  color: #60a5fa;
}

body.dark-theme .filter-count {
  color: #888;
}

body.dark-theme .filter-divider {
  background: #555;
}

body.dark-theme .filter-btn-all {
  color: #60a5fa;
  border-color: #60a5fa;
  background: transparent;
}

body.dark-theme .filter-btn-all:hover {
  background: #60a5fa;
  color: #1a1a1a;
}

body.dark-theme .filter-search-placeholder {
  background: #3a3a3a;
  border-color: #555;
  color: #888;
}

body.dark-theme .filter-search-input {
  background: #3a3a3a;
  border-color: #555;
  color: #eeeeee;
}

body.dark-theme .filter-search-input:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

/* Dark mode for blog filters - media query based */
@media (prefers-color-scheme: dark) {
  .blog-filters {
    border-bottom-color: #555;
  }

  .filter-dropdown-btn {
    background: #3a3a3a;
    border-color: #555;
    color: #eeeeee;
  }

  .filter-dropdown-btn:hover {
    background: #60a5fa;
    border-color: #60a5fa;
    color: #1a1a1a;
  }

  .filter-dropdown-menu {
    background: #2a2a2a;
    border-color: #555;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }

  .filter-dropdown-menu a {
    color: #eeeeee;
  }

  .filter-dropdown-menu a:hover {
    background: #3a3a3a;
    color: #60a5fa;
  }

  .filter-count {
    color: #888;
  }

  .filter-divider {
    background: #555;
  }

  .filter-btn-all {
    color: #60a5fa;
    border-color: #60a5fa;
    background: transparent;
  }

  .filter-btn-all:hover {
    background: #60a5fa;
    color: #1a1a1a;
  }

  .filter-search-placeholder {
    background: #3a3a3a;
    border-color: #555;
    color: #888;
  }

  .filter-search-input {
    background: #3a3a3a;
    border-color: #555;
    color: #eeeeee;
  }

  .filter-search-input:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
  }
}

/* ===========================================
   Project Page TOC Styles
   =========================================== */

.project-toc {
  margin: 1.5rem 0;
  padding: 0;
}

.project-toc p {
  margin: 0 0 0.5rem 0;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--muted-color, #666);
}

/* Style the generated TOC list */
.project-toc .toc {
  margin: 0;
  padding: 0;
}

.project-toc .toc > ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.project-toc .toc > ul > li {
  display: inline-block;
  margin: 0;
  padding: 0;
}

.project-toc .toc > ul > li > a {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  background: transparent;
  border: 1px solid var(--border-color, #ddd);
  border-radius: 4px;
  color: var(--text-color, #333);
  text-decoration: none;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.project-toc .toc > ul > li > a:hover {
  background: var(--primary-color, #3584e4);
  border-color: var(--primary-color, #3584e4);
  color: #fff;
}

/* Hide nested TOC levels (only show h2 categories, not h3 projects) */
.project-toc .toc > ul > li > ul {
  display: none;
}

/* Hide the first item (intro heading) and last item (Explore More) */
.project-toc .toc > ul > li:first-child,
.project-toc .toc > ul > li:last-child {
  display: none;
}

/* Dark mode for project TOC - class-based */
body.dark-theme .project-toc p {
  color: #888;
}

body.dark-theme .project-toc .toc > ul > li > a {
  background: transparent;
  border-color: #555;
  color: #eeeeee;
}

body.dark-theme .project-toc .toc > ul > li > a:hover {
  background: #60a5fa;
  border-color: #60a5fa;
  color: #1a1a1a;
}

/* Dark mode for project TOC - media query based */
@media (prefers-color-scheme: dark) {
  .project-toc p {
    color: #888;
  }

  .project-toc .toc > ul > li > a {
    background: transparent;
    border-color: #555;
    color: #eeeeee;
  }

  .project-toc .toc > ul > li > a:hover {
    background: #60a5fa;
    border-color: #60a5fa;
    color: #1a1a1a;
  }
}
