.katex-display { overflow: auto hidden }

figure.diagram {
  text-align: center;
  margin: 1.5rem auto;
}

figure.diagram img {
  display: block;
  margin: 0 auto 0.4rem auto;
  background: white;
  padding: 12px;
  border-radius: 6px;
}

figure.diagram figcaption {
  text-align: center;
  font-size: 0.9rem;
}

.diagram-svg {
  display: block;
  margin: 1rem auto;
  background: white;
  padding: 0.75rem;
  border-radius: 6px;
}

.side-by-side {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.side-by-side img {
  max-width: 45%;
  height: auto;
  background: white;
  padding: 12px;
  border-radius: 6px;
}


/* Math boxes */
/* Base styles for all math boxes */
.math-box {
    margin: 1.5rem 0;
    padding: 1rem;
    border-radius: 4px;
    border-left: 4px solid #ccc;
    background-color: #f9f9f9;
}

.math-box-header {
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.math-box-title {
    font-weight: normal;
    font-style: italic;
    margin-left: 0.3rem;
}

.math-box-body > :first-child {
    margin-top: 0;
}

.math-box-body > :last-child {
    margin-bottom: 0;
}

/* Specific styling for Definitions (Green) */
.math-box.definition {
    border-left-color: #10b981;
    background-color: #ecfdf5;
}
.math-box.definition .math-box-header {
    color: #047857;
}

/* Specific styling for Propositions/Theorems (Blue) */
.math-box.theorem, 
.math-box.proposition {
    border-left-color: #3b82f6;
    background-color: #eff6ff;
}
.math-box.theorem .math-box-header,
.math-box.proposition .math-box-header {
    color: #1d4ed8;
}

/* Specific styling for Lemmas (Purple) */
.math-box.lemma {
    border-left-color: #8b5cf6;
    background-color: #f5f3ff;
}
.math-box.lemma .math-box-header {
    color: #6d28d9;
}

/* Specific styling for Proofs (Minimalist Gray) */
.math-box.proof {
    border-left-color: #6b7280;
    background-color: transparent;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #6b7280;
}
.math-box.proof .math-box-header {
    color: #374151;
    font-style: italic;
}

/* Add a QED square at the end of the proof */
.math-box.proof .math-box-body::after {
    content: "\25A1"; /* White square unicode */
    display: block;
    text-align: right;
    margin-top: -1.5rem;
} 