/*
 * Slide figures: cap size (50% of column, max 28rem), centered; block layout so
 * tall PNGs are not clipped by inline/baseline line-box quirks in some browsers.
 */
.md-content__inner.md-typeset img {
  display: block;
  max-width: min(50%, 28rem);
  width: auto;
  height: auto;
  margin: 0.75em auto;
}

/* Material sets overflow:hidden on article; allow vertical overflow for in-flow figures */
.md-content__inner.md-typeset {
  overflow: visible;
}

/* --------------------------------------------------------------------------
 * Prose & article width: comfortable reading for long lecture notes
 * -------------------------------------------------------------------------- */
.md-typeset {
  line-height: 1.68;
}

.md-content__inner {
  max-width: 44rem;
}

/* --------------------------------------------------------------------------
 * Headings: chunk slide-by-slide sections
 * -------------------------------------------------------------------------- */
.md-typeset h2 {
  margin-top: 1.75em;
  margin-bottom: 0.65em;
  padding-bottom: 0.25em;
  border-bottom: 1px solid color-mix(in srgb, var(--md-default-fg-color) 12%, transparent);
}

.md-typeset h3 {
  margin-top: 1.35em;
  margin-bottom: 0.5em;
}

.md-typeset h4 {
  margin-top: 1.1em;
  margin-bottom: 0.4em;
}

/* --------------------------------------------------------------------------
 * Lists: extra air between dense bullet blocks
 * -------------------------------------------------------------------------- */
.md-typeset ul,
.md-typeset ol {
  margin-top: 0.5em;
  margin-bottom: 0.85em;
}

.md-typeset li {
  margin-top: 0.35em;
  margin-bottom: 0.35em;
}

.md-typeset li > ul,
.md-typeset li > ol {
  margin-top: 0.35em;
  margin-bottom: 0.35em;
}

/* --------------------------------------------------------------------------
 * Inline code: notation and O(·) stand out when authors use backticks
 * -------------------------------------------------------------------------- */
.md-typeset code {
  font-size: 0.92em;
  font-variant-numeric: tabular-nums;
}

.md-typeset :not(pre) > code {
  padding: 0.12em 0.45em;
  border-radius: 0.3em;
  background-color: color-mix(in srgb, var(--md-code-bg-color) 88%, var(--md-default-bg-color));
  border: 1px solid color-mix(in srgb, var(--md-default-fg-color) 8%, transparent);
}

/* --------------------------------------------------------------------------
 * Fenced code / pseudocode
 * -------------------------------------------------------------------------- */
.md-typeset .highlight {
  border-radius: 0.35rem;
  border: 1px solid color-mix(in srgb, var(--md-default-fg-color) 10%, transparent);
}

.md-typeset .highlight pre {
  margin: 0;
  padding: 0.85em 1em;
  line-height: 1.55;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  font-variant-numeric: tabular-nums;
}

.md-typeset .highlight code {
  font-size: 0.82em;
}

/* --------------------------------------------------------------------------
 * MathJax (generic arithmatex + CHTML output)
 * -------------------------------------------------------------------------- */
.md-typeset mjx-container {
  display: block;
  margin: 0.85em 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.md-typeset mjx-container[display="true"] {
  text-align: center;
}

.md-typeset .arithmatex {
  overflow-x: auto;
  max-width: 100%;
}

/* --------------------------------------------------------------------------
 * Tables
 * -------------------------------------------------------------------------- */
.md-typeset table:not([class]) {
  border-collapse: collapse;
  font-size: 0.9em;
  display: table;
  overflow: hidden;
}

.md-typeset table:not([class]) th,
.md-typeset table:not([class]) td {
  border: 1px solid color-mix(in srgb, var(--md-default-fg-color) 14%, transparent);
  padding: 0.45em 0.65em;
}

.md-typeset table:not([class]) th {
  background-color: color-mix(in srgb, var(--md-default-fg-color) 6%, var(--md-default-bg-color));
  font-weight: 600;
}

.md-typeset table:not([class]) tbody tr:nth-child(even) {
  background-color: color-mix(in srgb, var(--md-default-fg-color) 4%, var(--md-default-bg-color));
}

.md-typeset table:not([class]) tbody tr:hover {
  background-color: color-mix(in srgb, var(--md-default-fg-color) 8%, var(--md-default-bg-color));
}
