/* Project-specific tweaks on top of the Material theme. */

/* Keep tables readable when they contain long rule listings. */
.md-typeset table:not([class]) {
  font-size: 0.75rem;
}

/* Give Mermaid diagrams some breathing room. */
.md-typeset .mermaid {
  margin: 1.5em 0;
  text-align: center;
}

/* Mermaid `gitGraph` theming.
 *
 * Material styles only flowchart, sequence, class, state and ER diagrams; git
 * graphs fall back to Mermaid's stock palette, whose pale-yellow branch colour
 * and low-contrast commit labels are unreadable against either Material
 * palette. The rules below restate them with Material's own variables, so the
 * diagram follows the light/dark toggle. `!important` is required: Mermaid
 * prefixes its own rules with the generated SVG id, which outranks any
 * selector we can write here. */

/* Branch colours: neutral for `main`, primary/accent for the rest. `commitN`
 * are the dots, `arrowN` the connecting arrows and `labelN` the background of
 * the branch name box. */
.md-typeset .mermaid .commit0,
.md-typeset .mermaid .arrow0,
.md-typeset .mermaid .label0 {
  fill: var(--md-default-fg-color--light) !important;
  stroke: var(--md-default-fg-color--light) !important;
}

.md-typeset .mermaid .commit1,
.md-typeset .mermaid .arrow1,
.md-typeset .mermaid .label1 {
  fill: var(--md-primary-fg-color) !important;
  stroke: var(--md-primary-fg-color) !important;
}

.md-typeset .mermaid .commit2,
.md-typeset .mermaid .arrow2,
.md-typeset .mermaid .label2 {
  fill: var(--md-accent-fg-color) !important;
  stroke: var(--md-accent-fg-color) !important;
}

/* Arrows are strokes only; a fill would blob them out. */
.md-typeset .mermaid .arrow0,
.md-typeset .mermaid .arrow1,
.md-typeset .mermaid .arrow2 {
  fill: none !important;
}

/* Branch name, written inside the coloured box. */
.md-typeset .mermaid .branch-label0,
.md-typeset .mermaid .branch-label1,
.md-typeset .mermaid .branch-label2 {
  fill: var(--md-primary-bg-color) !important;
}

/* The dashed horizontal line each branch runs along. */
.md-typeset .mermaid .branch {
  stroke: var(--md-default-fg-color--lighter) !important;
}

/* Commit messages. Mermaid draws them at 50% opacity over a pale background,
 * which is what makes them disappear; an opaque background of the page colour
 * keeps them legible where they cross a branch line. */
.md-typeset .mermaid .commit-label {
  fill: var(--md-default-fg-color) !important;
}

.md-typeset .mermaid .commit-label-bkg {
  fill: var(--md-default-bg-color) !important;
  opacity: 0.9 !important;
}

/* Slightly wider content area for the reference tables of the Esperanto section. */
.md-grid {
  max-width: 62rem;
}
