/* ============================================================================
   KD's Blog - Beautiful Modern Design System
   ============================================================================ */

/* Import Premium Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Fira+Code:wght@400;500;600&family=Poppins:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&family=Playfair+Display:wght@400;700;900&display=swap');

/* ============================================================================
   CSS Variables - Modern Color Palette
   ============================================================================ */
:root {
  /* Primary Colors - Vibrant Blue/Purple Gradient */
  --primary: #5e72e4;
  --primary-dark: #4c63d2;
  --primary-light: #8b9cf6;
  --secondary: #825ee4;
  --accent: #f5365c;
  --success: #2dce89;
  --info: #11cdef;
  --warning: #fb6340;
  
  /* Text Colors - Darker for better visibility */
  --text-primary: #1a202c;
  --text-secondary: #2d3748;
  --text-muted: #4a5568;
  
  /* Background Colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f7fafc;
  --bg-tertiary: #f4f5f7;
  
  /* Modern Gradients */
  --gradient-primary: linear-gradient(135deg, #f97316 0%, #ec4899 100%);
  --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-hero: linear-gradient(150deg, #000000 0%, #1a1a1a 20%, #404040 50%, #1a1a1a 80%, #000000 100%);
  --gradient-mesh: radial-gradient(at 40% 20%, hsla(28,100%,74%,0.3) 0px, transparent 50%),
                   radial-gradient(at 80% 0%, hsla(189,100%,56%,0.3) 0px, transparent 50%),
                   radial-gradient(at 0% 50%, hsla(355,100%,93%,0.3) 0px, transparent 50%);
  
  /* Shadows - Soft and Modern */
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 40px -4px rgba(0, 0, 0, 0.15), 0 8px 10px -2px rgba(0, 0, 0, 0.05);
  --shadow-colored: 0 20px 40px -4px rgba(94, 114, 228, 0.3);
  --shadow-glow: 0 0 40px rgba(94, 114, 228, 0.3);
  
  /* Borders */
  --border-color: #e9ecef;
  --border-radius: 12px;
  --border-radius-lg: 16px;
  
  /* Animations */
  --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Legacy support */
  --primary-color: var(--primary);
  --link-color: var(--primary);
  --link-hover: var(--primary-dark);
  --code-bg: #f3f4f6;
  --scrollbar-thumb-color: #c1c1c1;
  --scrollbar-thumb-hover-color: #a8a8a8;
}

/* Dark Mode Variables */
[data-bs-theme="dark"] {
  --primary: #8b9cf6;
  --primary-dark: #5e72e4;
  --primary-light: #a5b4fc;
  --secondary: #a084f5;
  --accent: #ff6b6b;
  --text-primary: #f8fafc;
  --text-secondary: #e2e8f0;
  --text-muted: #94a3b8;
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --gradient-hero: linear-gradient(150deg, #000000 0%, #1a1a1a 20%, #404040 50%, #1a1a1a 80%, #000000 100%);
  --border-color: #334155;
  --shadow-colored: 0 20px 40px -4px rgba(139, 156, 246, 0.2);
  --shadow-glow: 0 0 40px rgba(139, 156, 246, 0.2);
  --code-bg: #1f2937;
  --link-color: var(--primary);
  --link-hover: var(--primary-light);
  --scrollbar-thumb-color: #555555;
  --scrollbar-thumb-hover-color: #777777;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  font-size: 18px;
  line-height: 1.75;
  color: var(--text-primary);
  background: var(--bg-primary);
  position: relative;
  overflow-x: hidden;
  transition: var(--transition-base);
}

/* Global font inheritance rule */
body * {
  font-family: inherit;
}

/* Beautiful Background Pattern */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-mesh);
  opacity: 0.4;
  z-index: -1;
  animation: meshAnimation 10s ease infinite;
}

@keyframes meshAnimation {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.1) rotate(5deg); }
}

/* Typography - Beautiful and Readable */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 0;
  margin-bottom: 1rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.8s ease;
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 700;
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  position: relative;
  padding-bottom: 0.75rem;
}

h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--gradient-primary);
  border-radius: 2px;
  transition: width 0.3s ease;
}

h2:hover::after {
  width: 100px;
}

h3 {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 600;
  margin-top: 2rem;
}

p {
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  line-height: 1.85;
  font-size: 1.05rem;
  opacity: 0.95;
}

/* Ensure lists display properly with consistent font */
ul, ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

ul li, ol li {
  display: list-item;
  margin-bottom: 0.6rem;
  line-height: 1.85;
  color: var(--text-secondary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1.05rem;
}

/* Fix for callout lists */
.callout ul li, .callout ol li {
  display: list-item !important;
  list-style-type: disc;
  margin-left: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Ensure consistent font across all content elements */
.content, 
.content p, 
.content li, 
.content span,
.quarto-post,
.quarto-post p,
.quarto-post li,
.quarto-post span,
article,
article p,
article li,
article span,
main,
main p,
main li,
main span {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Ensure bold and italic text inherit the correct font */
strong, b, em, i {
  font-family: inherit;
}

/* Force Inter font for any direct text children */
.content > *,
article > *,
main > * {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Navigation Bar - Modern and Sleek */
.navbar {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.08);
  padding: 1rem 0;
  transition: var(--transition-base);
  position: sticky !important;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

[data-bs-theme="dark"] .navbar {
  background: rgba(15, 23, 42, 0.8) !important;
}

.navbar-brand {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 800;
  font-size: 1.6rem;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: transform 0.3s ease;
}

.navbar-brand:hover {
  transform: translateY(-2px);
}

.navbar-nav .nav-link {
  font-weight: 600;
  color: #1a1a1a;
  padding: 0.5rem 1rem;
  margin: 0 0.25rem;
  border-radius: 8px;
  transition: var(--transition-base);
  position: relative;
  overflow: hidden;
  font-size: 1.05rem;
}

.navbar-nav .nav-link::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.5s ease, height 0.5s ease;
  opacity: 0.12;
}

.navbar-nav .nav-link:hover {
  color: #0a0a0a;
  background: rgba(26, 26, 26, 0.15);
  transform: translateY(-2px);
  font-weight: 700;
}

.navbar-nav .nav-link:hover::before {
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

/* Active navigation state */
.navbar-nav .nav-link.active,
.navbar-nav .nav-item.active .nav-link {
  color: #0a0a0a;
  font-weight: 700;
  background: rgba(26, 26, 26, 0.08);
}

/* Blog Post Cards - Modern Glass Morphism */
.quarto-post {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--border-radius-lg);
  padding: 1.75rem;
  margin-bottom: 2rem;
  transition: var(--transition-base);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

[data-bs-theme="dark"] .quarto-post {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(255, 255, 255, 0.1);
}

.quarto-post::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.quarto-post:hover::before {
  left: 100%;
}

.quarto-post:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-light);
}

.quarto-post .thumbnail {
  margin: -1.75rem -1.75rem 1.5rem -1.75rem;
  overflow: hidden;
  border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
  height: 200px;
  background: var(--gradient-primary);
}

.quarto-post .thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.quarto-post:hover .thumbnail img {
  transform: scale(1.1);
}

.quarto-post h2, .quarto-post h3 {
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  transition: color 0.3s ease;
}

.quarto-post:hover h2,
.quarto-post:hover h3 {
  color: var(--primary);
}

.quarto-post .metadata {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 1rem;
}

.quarto-post .metadata::before {
  content: '📅';
  margin-right: 0.25rem;
}

/* Category Badges - Vibrant and Interactive */
.quarto-category,
.category {
  display: inline-block;
  padding: 0.4rem 1.1rem;
  background: var(--gradient-primary);
  color: white !important;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0.2rem 0.25rem; /* Added vertical margin for spacing */
  transition: var(--transition-base);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  text-align: center;
  vertical-align: middle;
}

.quarto-category::before,
.category::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease;
}

.quarto-category:hover,
.category:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: var(--shadow-colored);
  text-decoration: none;
  color: white !important;
}

.quarto-category:hover::before,
.category:hover::before {
  width: 100%;
  height: 100%;
}

/* Category container in posts - mobile-optimized */
.quarto-title-meta .quarto-categories,
.quarto-title-meta .categories,
.quarto-categories,
.categories {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  row-gap: 0.75rem; /* More vertical space between rows */
  margin: 1rem 0;
  width: 100%;
}

/* Ensure categories wrap properly on all screen sizes */
@media (max-width: 768px) {
  .quarto-title-meta .quarto-categories,
  .quarto-title-meta .categories,
  .quarto-categories,
  .categories {
    gap: 0.4rem;
    row-gap: 0.6rem; /* Vertical spacing between wrapped rows */
    margin: 0.75rem 0;
  }
}

/* Code Blocks - Beautiful Syntax Highlighting */
pre {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  overflow-x: auto;
  font-family: 'Fira Code', monospace;
  font-size: 1rem;
  line-height: 1.7;
  box-shadow: var(--shadow-md);
  position: relative;
  margin: 1.5rem 0;
}

pre::before {
  content: '</>';
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  color: var(--text-muted);
  opacity: 0.5;
  font-size: 0.8rem;
}

code {
  font-family: 'Fira Code', monospace;
  background: rgba(94, 114, 228, 0.1);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.95em;
  color: var(--primary);
  font-weight: 500;
}

pre code {
  background: transparent;
  padding: 0;
  color: #e2e8f0;
  font-weight: 400;
}

/* Math equations styling - Enhanced for better aesthetics */
.math {
  color: inherit;
  font-family: 'Latin Modern Math', 'STIX Two Math', 'Cambria Math', serif;
  font-size: 1.05em;
}

.math.inline {
  padding: 0 0.2em;
}

.math.display {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0;
  background: transparent;
  border-left: none;
  border-radius: 0;
  margin: 1.25rem 0;
  box-shadow: none;
}

/* MathJax specific styling */
.MathJax, .MathJax_Display {
  font-size: 1.1em !important;
}

.MathJax_Display {
  overflow-x: auto !important;
  overflow-y: hidden !important;
  max-width: 100% !important;
  padding: 1.5rem 0 !important;
}

mjx-container {
  max-width: 100% !important;
}

/* ==========================================================================
   MathJax Mobile Display Fix
   ========================================================================== */
/*
 * This rule ensures that MathJax expressions are selectable while also
 * fixing the mobile tap-highlight issue. It targets both the main
 * container and all its child elements, forcing the background to be
 * transparent and disabling the native tap highlight color.
*/
mjx-container, mjx-container * {
  -webkit-user-select: text!important;
  -moz-user-select: text!important;
  -ms-user-select: text!important;
  user-select: text!important;
  pointer-events: auto!important;
  background: none !important;
  background-color: transparent!important;
  outline: none!important;
}

/* Ensure the Quarto math wrapper also suppresses tap highlight */
.math, .math *, code .math, code .math * {
  background: none !important;
  background-color: transparent !important;
}

/* Handle cases where inline math is wrapped in code tags */
code .math, code .math *, code mjx-container, code mjx-container * {
  background: none !important;
  background-color: transparent !important;
  padding: 0 !important;
  color: inherit !important;
}

[data-bs-theme="dark"] mjx-container[display="true"] {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

mjx-container[display="true"] mjx-math {
  padding: 0.5rem 1rem !important;
}

/* Inline math styling */
mjx-container:not([display="true"]) {
  padding: 0 0.05em !important;
  background: transparent !important;
  border-radius: 0 !important;
  color: inherit !important;
  overflow: visible !important;
  /* Hide scrollbars for inline math across browsers */
  -ms-overflow-style: none !important; /* IE/Edge */
  scrollbar-width: none !important; /* Firefox */
}

/* Hide WebKit scrollbars for inline MathJax containers */
mjx-container:not([display="true"])::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
}

/* Prevent scrollable areas inside inline MathJax */
mjx-container:not([display="true"]) mjx-math,
mjx-container:not([display="true"]) svg {
  overflow: visible !important;
}

/* Ensure any nested elements within inline MathJax don't show scrollbars */
mjx-container:not([display="true"]) *,
mjx-container:not([display="true"]) *:before,
mjx-container:not([display="true"]) *:after {
  -ms-overflow-style: none !important;
  scrollbar-width: none !important;
}

mjx-container:not([display="true"]) *::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
}

/* KaTeX inline math: hide vertical scrollbars entirely */
.katex:not(.katex-display) {
  overflow-y: hidden !important;
  -ms-overflow-style: none !important;
  scrollbar-width: none !important;
}

.katex:not(.katex-display)::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
}

/* Final guard: inline math must never become a scroll container (all engines) */
.math.inline,
.math.inline *,
mjx-container:not([display="true"]),
mjx-container:not([display="true"]) mjx-math,
mjx-container:not([display="true"]) * {
  overflow: visible !important;
  max-height: none !important;
  -webkit-overflow-scrolling: auto !important;
}

/* Equation numbering */
.eq-number {
  color: var(--text-secondary);
  font-size: 0.9em;
  font-style: italic;
}

/* KaTeX fallback styling (if used) */
.katex-display {
  overflow-x: auto !important;
  overflow-y: hidden !important;
  padding: 1.5rem !important;
  margin: 1.5rem 0 !important;
}

.katex {
  font-size: 1.1em;
  color: inherit;
}

.katex-display > .katex {
  display: inline-block;
  text-align: center;
  width: 100%;
}

/* Scrollbar for display math containers only */
mjx-container[display="true"]::-webkit-scrollbar,
.katex-display::-webkit-scrollbar {
  height: 6px;
}

mjx-container[display="true"]::-webkit-scrollbar-track,
.katex-display::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 3px;
}

mjx-container[display="true"]::-webkit-scrollbar-thumb,
.katex-display::-webkit-scrollbar-thumb {
  background: var(--math-color);
  border-radius: 3px;
  opacity: 0.5;
}

mjx-container[display="true"]::-webkit-scrollbar-thumb:hover,
.katex-display::-webkit-scrollbar-thumb:hover {
  opacity: 0.8;
}

/* Links - Animated Underlines */
a {
  color: var(--primary);
  text-decoration: none;
  position: relative;
  transition: var(--transition-base);
  font-weight: 500;
}

a:hover {
  color: var(--primary-dark);
}

.content a:not(.btn):not(.quarto-category)::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  bottom: -2px;
  left: 0;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.content a:not(.btn):not(.quarto-category):hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Blockquotes - Elegant Design */
blockquote {
  position: relative;
  padding: 2rem;
  margin: 2rem 0;
  background: linear-gradient(135deg, rgba(94, 114, 228, 0.05) 0%, rgba(130, 94, 228, 0.05) 100%);
  border-left: 4px solid var(--gradient-primary);
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  font-style: italic;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
  font-size: 1.05rem;
}

blockquote::before {
  content: '"';
  position: absolute;
  top: -10px;
  left: 20px;
  font-size: 4rem;
  color: var(--primary);
  opacity: 0.2;
  font-family: 'Playfair Display', serif;
}

/* Tables - Clean and Modern */
.table-responsive {
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-primary);
  overflow: hidden;
}

thead {
  background: var(--gradient-primary);
}

thead th {
  color: white;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  padding: 1rem;
}

tbody tr {
  transition: var(--transition-base);
  border-bottom: 1px solid var(--border-color);
}

tbody tr:hover {
  background: rgba(94, 114, 228, 0.05);
  transform: scale(1.01);
}

td {
  padding: 1rem;
  color: var(--text-secondary);
  font-size: 1.05rem;
}

/* TOC (Table of Contents) - Beautiful Modern Sidebar */
#toc-title,
.sidebar-navigation-title,
.sidebar-title,
#TOC-title {
  font-family: 'Poppins', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid transparent;
  border-image: var(--gradient-primary);
  border-image-slice: 1;
  position: relative;
}

#TOC {
  position: sticky;
  top: 2rem;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(249, 250, 251, 0.98) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 12px;
  border: 1px solid rgba(229, 231, 235, 0.4);
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.08), 0 2px 8px -2px rgba(0, 0, 0, 0.04);
  margin-bottom: 2rem;
}

/* TOC Lists */
#TOC ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

#TOC ul ul {
  padding-left: 0.75rem;
  margin-left: 0.5rem;
  margin-top: 0.25rem;
  border-left: 2px solid rgba(94, 114, 228, 0.1);
}

#TOC li {
  margin-bottom: 0.2rem;
}

/* TOC Links - Modern Style */
#TOC a {
  color: var(--text-secondary);
  padding: 0.5rem 0.75rem;
  display: block;
  border-radius: 8px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.95rem;
  text-decoration: none;
  position: relative;
  font-weight: 500;
  line-height: 1.5;
}

/* Hover Effects */
#TOC a:hover {
  color: var(--primary);
  background: linear-gradient(90deg, rgba(94, 114, 228, 0.1) 0%, transparent 100%);
  transform: translateX(4px);
}

/* Active Link Styling */
#TOC .active > a,
#TOC li.active > a {
  color: var(--primary);
  font-weight: 600;
  background: linear-gradient(90deg, rgba(94, 114, 228, 0.15) 0%, rgba(94, 114, 228, 0.05) 100%);
}

/* Active indicator bar */
#TOC .active > a::before,
#TOC li.active > a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 70%;
  background: var(--gradient-primary);
  border-radius: 2px;
}

/* Nested items styling */
#TOC ul ul a {
  font-size: 0.9rem;
  padding: 0.4rem 0.75rem;
  color: var(--text-muted);
}

#TOC ul ul a:hover {
  color: var(--primary);
  background: rgba(94, 114, 228, 0.05);
}

/* Custom Scrollbar for TOC */
#TOC::-webkit-scrollbar {
  width: 4px;
}

#TOC::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 2px;
}

#TOC::-webkit-scrollbar-thumb {
  background: rgba(94, 114, 228, 0.3);
  border-radius: 2px;
}

#TOC::-webkit-scrollbar-thumb:hover {
  background: rgba(94, 114, 228, 0.5);
}

/* Remove old custom class */
.toc-active {
  border-left: none;
  background: none;
  font-weight: normal;
}

/* Footer - Clean and Professional */
.quarto-footer {
  margin-top: 4rem;
  padding: 3rem 0;
  background: var(--gradient-primary);
  color: white;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.quarto-footer::before {
  content: '';
  position: absolute;
  top: -50px;
  left: -50px;
  right: -50px;
  height: 100px;
  background: var(--bg-primary);
  transform: skewY(-2deg);
}

.quarto-footer * {
  position: relative;
  color: white !important;
  z-index: 1;
}

/* Images - Responsive and Beautiful */
img {
  max-width: 100%;
  height: auto;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  transition: var(--transition-base);
}

img:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-lg);
}

/* Responsive Design */
/* Extra small devices (phones, less than 576px) */
@media (max-width: 575.98px) {
  /* Typography adjustments */
  body {
    font-size: 16px;
  }
  
  h1 {
    font-size: 1.75rem;
  }
  
  h2 {
    font-size: 1.4rem;
  }
  
  h3 {
    font-size: 1.2rem;
  }
  
  /* Navigation */
  .navbar {
    padding: 0.5rem 0;
  }
  
  .navbar-brand {
    font-size: 1rem;
  }
  
  .navbar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .navbar-nav .nav-link {
    padding: 0.25rem 0.5rem;
    font-size: 0.9rem;
  }
  
  /* Main content */
  .quarto-title-banner {
    padding: 2rem 1rem;
  }
  
  .quarto-title-banner h1 {
    font-size: 1.75rem;
  }
  
  .quarto-title-banner .subtitle {
    font-size: 1rem;
  }
  
  /* Blog post cards */
  .list.quarto-listing-default {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .quarto-post {
    padding: 1rem;
  }
  
  /* Code blocks */
  pre {
    padding: 0.75rem;
    font-size: 0.8rem;
  }
  
  /* Tables - make them scrollable */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  table {
    font-size: 0.85rem;
  }
  
  th, td {
    padding: 0.5rem;
  }
  
  /* Callouts */
  .callout {
    padding: 1rem;
    margin: 1rem 0;
  }
  
  /* Footer */
  .quarto-footer {
    padding: 1.5rem 0;
    font-size: 0.85rem;
  }
  
  /* Hide TOC on mobile by default */
  #TOC {
    position: relative;
    margin-bottom: 1.5rem;
    max-height: none;
  }
  
  /* Category badges - larger for better touch targets */
  .quarto-category,
  .category {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    margin: 0.2rem 0.15rem; /* Increased vertical margin for mobile */
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  /* About page adjustments */
  .about-image {
    width: 140px !important;
    height: 140px !important;
  }
  
  .quarto-about-trestles {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
    text-align: center;
    padding: 1rem;
  }
  
  .quarto-about-trestles .about-entity {
    max-width: 100% !important;
    margin: 0 auto;
    position: static !important;  /* Ensure no sticky on mobile */
  }
  
  .quarto-about-trestles .about-contents {
    text-align: left;
  }
  
  /* Mobile social links */
  .quarto-about .about-entity .about-links {
    gap: 0.4rem;
    margin-top: 0.75rem;
  }
  
  .quarto-about .about-entity .about-link {
    padding: 0.35rem 0.7rem !important;
    font-size: 0.8rem !important;
  }
  
  .quarto-about .about-entity .about-link i,
  .quarto-about .about-entity .about-link svg {
    width: 16px !important;
    height: 16px !important;
  }
  
  /* Math display - prevent overflow */
  .math.display {
    overflow-x: auto;
    font-size: 0.9em;
  }
  
  /* MathJax on mobile */
  mjx-container[display="true"] {
    padding: 1rem !important;
    font-size: 0.85em !important;
  }
  
  /* Only display math should scroll horizontally on mobile */
  mjx-container[display="true"] mjx-math {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    max-width: 100% !important;
    -ms-overflow-style: none !important; /* IE/Edge */
    scrollbar-width: none !important; /* Firefox */
  }

  mjx-container[display="true"] mjx-math::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
  }

  /* Inline math must never create a scrollable box */
  mjx-container:not([display="true"]) mjx-math {
    overflow: visible !important;
    max-width: 100% !important;
  }
  
  /* Sidebar on mobile */
  .quarto-sidebar {
    position: relative !important;
    width: 100% !important;
    margin-bottom: 1rem;
  }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
  .navbar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .navbar-nav .nav-link {
    padding: 0.35rem 0.75rem;
    font-size: 0.9rem;
  }
  
  .quarto-category {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.6rem;
  }
  
  h3 {
    font-size: 1.3rem;
  }
  
  .navbar-brand {
    font-size: 1.15rem;
  }
  
  .quarto-title-banner {
    padding: 3rem 1.5rem;
  }
  
  .list.quarto-listing-default {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
  h1 {
    font-size: 2.25rem;
  }
  
  h2 {
    font-size: 1.75rem;
  }
  
  h3 {
    font-size: 1.4rem;
  }
  
  .navbar-brand {
    font-size: 1.2rem;
  }
  
  .list.quarto-listing-default {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
  
  #TOC {
    position: sticky;
    top: 1rem;
  }
  
  /* About page on tablets */
  .quarto-about-trestles {
    grid-template-columns: 180px 1fr !important;
    gap: 2.5rem !important;
  }
  
  .quarto-about-trestles .about-entity {
    position: static !important;  /* No sticky on tablets */
  }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .list.quarto-listing-default {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
  .list.quarto-listing-default {
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  }
  
  .container, .container-fluid {
    max-width: 1400px;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  /* Larger touch targets */
  a, button, .btn {
    min-height: 44px;
    min-width: 44px;
  }
  
  .navbar-nav .nav-link {
    padding: 0.5rem 0.75rem;
  }
  
  /* Disable hover effects on touch devices */
  .quarto-post:hover {
    transform: none;
  }
  
  .content a::after {
    display: none;
  }
  
  /* Larger category badges for easier tapping */
  .quarto-category,
  .category {
    padding: 0.45rem 0.9rem;
    margin: 0.25rem 0.25rem; /* Increased vertical margin for touch devices */
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
  }
}

/* Print Styles */
@media print {
  body::before,
  .navbar,
  #TOC,
  .quarto-footer {
    display: none !important;
  }
  
  body {
    font-size: 12pt;
    color: black;
    background: white;
  }
  
  h1, h2, h3 {
    color: black;
    -webkit-text-fill-color: black;
  }
  
  a {
    color: black;
    text-decoration: underline;
  }
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

/* Ensure images are responsive */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Responsive video embeds */
.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
}

.video-container iframe,
.video-container object,
.video-container embed {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Mobile-friendly navigation toggle */
.navbar-toggler {
  border: none;
  background: transparent;
  padding: 0.25rem 0.5rem;
}

.navbar-toggler:focus {
  box-shadow: none;
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Prevent horizontal scroll on mobile */
body {
  overflow-x: hidden;
}

.container,
.container-fluid {
  padding-left: 15px;
  padding-right: 15px;
}

/* Ensure long words break on mobile */
p, li, td, div {
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

/* Mobile-optimized form inputs */
input, textarea, select {
  font-size: 16px; /* Prevents zoom on iOS */
}

@media (max-width: 768px) {
  input, textarea, select {
    width: 100%;
  }
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb {
  background: var(--gradient-primary);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* Code blocks scrollbar */
pre::-webkit-scrollbar,
mjx-container[display="true"]::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}

pre::-webkit-scrollbar-track,
mjx-container[display="true"]::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 4px;
}

pre::-webkit-scrollbar-thumb,
mjx-container[display="true"]::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
}

pre::-webkit-scrollbar-thumb:hover,
mjx-container[display="true"]::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* ==========================================================================
   Final MathJax Inline Code Fix
   ========================================================================== */
/*
 * This rule targets <code> tags that are specifically used for inline
 * math expressions and resets their styling. It removes the gray
 * background and extra padding that is applied by the global 'code' style,
 * ensuring the math blends seamlessly with the surrounding text.
*/
.math.inline code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* Suppress tap highlight for MathJax SVG output as well */
mjx-container svg, mjx-container svg * {
  background: none !important;
  background-color: transparent !important;
}

/* Comprehensive fix for WebKit tap highlight on MathJax elements (v3 and legacy) */
mjx-container, .MathJax {
  -webkit-tap-highlight-color: transparent !important; /* keep only the webkit-safe variant */
}

/* Callout Boxes - Beautiful Alerts */
.callout {
  padding: 1.75rem;
  margin: 2rem 0;
  border-radius: var(--border-radius);
  border-left: 4px solid;
  position: relative;
  overflow: hidden;
  animation: slideInLeft 0.5s ease;
  box-shadow: var(--shadow-md);
  font-size: 1.05rem;
  line-height: 1.8;
}

.callout::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: inherit;
  filter: brightness(1.2);
}

.callout-note {
  background: linear-gradient(135deg, rgba(17, 205, 239, 0.1) 0%, rgba(17, 113, 239, 0.1) 100%);
  border-color: var(--info);
}


[data-bs-theme="dark"] .callout-note {
  background: linear-gradient(135deg, rgba(17, 205, 239, 0.2) 0%, rgba(17, 113, 239, 0.2) 100%);
}

.callout-tip {
  background: linear-gradient(135deg, rgba(45, 206, 137, 0.1) 0%, rgba(19, 206, 102, 0.1) 100%);
  border-color: var(--success);
}


[data-bs-theme="dark"] .callout-tip {
  background: linear-gradient(135deg, rgba(45, 206, 137, 0.2) 0%, rgba(19, 206, 102, 0.2) 100%);
}

.callout-warning {
  background: linear-gradient(135deg, rgba(251, 99, 64, 0.1) 0%, rgba(245, 54, 92, 0.1) 100%);
  border-color: var(--warning);
}


[data-bs-theme="dark"] .callout-warning {
  background: linear-gradient(135deg, rgba(251, 99, 64, 0.2) 0%, rgba(245, 54, 92, 0.2) 100%);
}

.callout-important {
  background: linear-gradient(135deg, rgba(245, 54, 92, 0.1) 0%, rgba(245, 96, 183, 0.1) 100%);
  border-color: var(--accent);
}


[data-bs-theme="dark"] .callout-important {
  background: linear-gradient(135deg, rgba(245, 54, 92, 0.2) 0%, rgba(245, 96, 183, 0.2) 100%);
}

/* Listing Grid - Modern Card Layout */
.quarto-listing {
  margin-top: 2rem;
}

.list.quarto-listing-default {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  padding: 1rem 0;
}

/* Search Box - Modern Design */
.aa-DetachedSearchButton {
  background: rgba(255, 255, 255, 0.9) !important;
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color) !important;
  border-radius: 50px !important;
  padding: 0.5rem 1rem !important;
  transition: var(--transition-base);
}

.aa-DetachedSearchButton:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary) !important;
}

/* Hero Section / Title Banner */
.quarto-title-banner {
  background: var(--gradient-hero);
  background-size: 200% 200%;
  position: relative;
  overflow: hidden;
  padding: 5rem 0;
  margin-bottom: 3rem;
  animation: gradientShift 10s ease infinite;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 10px 40px rgba(0,0,0,0.5);
}

/* Override Quarto's column-page-left positioning for title banner */
.quarto-title-banner .quarto-title.column-page-left,
.quarto-title-banner .quarto-title.column-page,
.quarto-title-banner .column-page-left,
.quarto-title-banner .column-page {
  max-width: 100% !important;
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  grid-column: 1 / -1 !important; /* Full width in grid */
}

/* Center the title content */
.quarto-title-banner .quarto-title {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* Ensure title banner children are centered */
.quarto-title-banner .quarto-title > * {
  text-align: center !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Override page-columns container in banner */
.quarto-title-banner .page-columns,
.quarto-title-banner .quarto-title-banner-page-columns {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  max-width: 100% !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Fix post title alignment - Override column-body for posts */
.quarto-title-banner .quarto-title.column-body,
.quarto-title-banner .column-body,
.quarto-title.column-body {
  max-width: 100% !important;
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  grid-column: 1 / -1 !important; /* Break out of grid */
}

/* Override the page-columns grid that contains the title */
.quarto-title-banner .page-columns {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  grid-template-columns: none !important;
}

/* Specifically target column-body within page-columns */
.page-columns .column-body {
  grid-column-start: unset !important;
  grid-column-end: unset !important;
  margin: 0 auto !important;
  max-width: 100% !important;
}

/* Force title elements to center in post banners */
.quarto-title-banner .column-body h1.title,
.quarto-title-banner .column-body .subtitle,
.quarto-title-banner .column-body .lead {
  text-align: center !important;
  width: 100% !important;
}

/* Center categories in post banners */
.quarto-title-banner .column-body .quarto-categories {
  display: flex !important;
  justify-content: center !important;
  width: 100% !important;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.quarto-title-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, 
    rgba(255,255,255,0.15) 0%, 
    rgba(255,255,255,0.05) 30%, 
    transparent 50%, 
    rgba(0,0,0,0.2) 100%);
  pointer-events: none;
}

@keyframes floatPattern {
  0% { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(30px, 30px) rotate(360deg); }
}

.quarto-title-banner h1 {
  color: white !important;
  -webkit-text-fill-color: white !important;
  font-size: clamp(2.5rem, 7vw, 4rem);
  text-align: center;
  margin-bottom: 1rem;
  animation: fadeInUp 0.8s ease;
  text-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.quarto-title-banner .subtitle,
.quarto-title-banner .lead {
  color: rgba(255, 255, 255, 0.95) !important;
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  text-align: center;
  font-weight: 400;
  animation: fadeInUp 1s ease;
  animation-delay: 0.2s;
  animation-fill-mode: both;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.quarto-title-banner * {
  position: relative;
  z-index: 1;
}

/* Fix category alignment in title banner */
.quarto-title-banner .quarto-categories,
.quarto-title-banner .categories {
  text-align: center;
  margin: 1rem auto;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.quarto-title-banner .quarto-category,
.quarto-title-banner .category {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

/* About page layout and styling */
.quarto-about-trestles {
  display: grid !important;
  grid-template-columns: 200px 1fr !important;
  gap: 3rem !important;
  align-items: start !important;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.quarto-about-trestles .about-entity {
  max-width: 200px !important;
  /* No sticky positioning - scrolls normally */
  position: static !important;
}

.quarto-about-trestles .about-contents {
  max-width: 900px !important;
  width: 100% !important;
}

.quarto-about-trestles main {
  max-width: 100% !important;
}

/* About page profile image */
.about-image {
  border-radius: 50%;
  box-shadow: var(--shadow-lg);
  border: 3px solid white;
  width: 160px !important;
  height: 160px !important;
  object-fit: cover;
}

/* Quarto about social links */
.quarto-about .about-entity .about-links {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  justify-content: center;
}

.quarto-about .about-entity .about-link {
  padding: 0.4rem 0.8rem !important;
  font-size: 0.85rem !important;
  border-radius: 50px;
  background: var(--gradient-primary);
  color: white !important;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition-base);
}

.quarto-about .about-entity .about-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-colored);
}

.quarto-about .about-entity .about-link i,
.quarto-about .about-entity .about-link svg {
  width: 18px;
  height: 18px;
}

/* Pagination styling */
.pagination {
  margin-top: 3rem;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.pagination a {
  padding: 0.5rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  transition: all 0.2s;
}

.pagination a:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

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

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Buttons - Interactive and Beautiful */
.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: var(--transition-base);
  position: relative;
  overflow: hidden;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.5s ease, height 0.5s ease;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-colored);
  color: white;
}

/* Catch-all for MathJax on mobile WebKit */
mjx-container,
mjx-container *,
.math,
.math *,
mjx-container svg,
mjx-container svg * {
  -webkit-tap-highlight-color: rgba(0,0,0,0) !important;
  -webkit-touch-callout: none !important;
}