/* Custom KaTeX styles to match GeneralSans */

/* Import Fira Math font - a sans-serif math font */
@font-face {
  font-family: 'Fira Math';
  src: url('/vendor/fira-math/FiraMath-Regular.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* Override KaTeX math fonts to use sans-serif */
.katex {
  font-family: 'Fira Math', 'GeneralSans-Variable', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

.katex .mathrm {
  font-family: 'GeneralSans-Variable', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

.katex .mathit {
  font-family: 'Fira Math', 'GeneralSans-Variable', -apple-system, BlinkMacSystemFont, sans-serif !important;
  font-style: italic;
}

.katex .mathbf {
  font-family: 'GeneralSans-Variable', -apple-system, BlinkMacSystemFont, sans-serif !important;
  font-weight: 600;
}

/* Override KaTeX text mode to use GeneralSans */
.katex .text {
  font-family: 'GeneralSans-Variable', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

.katex .textbf {
  font-family: 'GeneralSans-Variable', -apple-system, BlinkMacSystemFont, sans-serif !important;
  font-weight: 600;
}

.katex .textit {
  font-family: 'GeneralSans-Variable', -apple-system, BlinkMacSystemFont, sans-serif !important;
  font-style: italic;
}

/* Adjust sizing to match GeneralSans */
.katex {
  font-size: 1.05em; /* Slightly larger to match sans-serif proportions */
}

/* Ensure display math is properly sized */
.katex-display {
  font-size: 1.1em;
}

/* Better integration with prose text */
.prose .katex {
  vertical-align: baseline;
}

/* Adjust spacing for better integration */
.prose p:has(.katex) {
  line-height: 1.5; /* Match default line height */
}