/* Palette of the green-and-yellow mark (docs/assets/logo.svg),
   whose darkest tone is NVIDIA green #76B900. The header is a near-black green in both schemes,
   because every mark tone clears 7:1 against it while the yellows clear under 2:1 against white.

   --md-typeset-a-color is not optional here: with a near-black primary, Material derives
   near-black body links. The values below are the lightest members of the ramp that still reach
   WCAG AA for text -- #4F8000 is 4.75:1 on white, #98C000 is 6.20:1 on slate. The brand green
   #76B900 itself is only 2.41:1 on white, so it is never used for text on a light background. */

:root,
[data-md-color-scheme="default"] {
  --md-primary-fg-color: #15200a;
  --md-primary-fg-color--light: #24350f;
  --md-primary-fg-color--dark: #0d1506;
  --md-accent-fg-color: #4f8000;
  --md-accent-fg-color--transparent: rgba(118, 185, 0, 0.1);
  --md-typeset-a-color: #4f8000;
}

[data-md-color-scheme="slate"] {
  --md-primary-fg-color: #15200a;
  --md-primary-fg-color--light: #24350f;
  --md-primary-fg-color--dark: #0d1506;
  --md-accent-fg-color: #98c000;
  --md-accent-fg-color--transparent: rgba(152, 192, 0, 0.1);
  --md-typeset-a-color: #98c000;
}

/* Example gallery: credits line under each example, and thumbnail cards on the index. */
.ordito-credits {
  font-size: 0.75rem;
  color: var(--md-default-fg-color--light);
}
.md-typeset .ordito-gallery.grid.cards {
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
}
.ordito-gallery.grid.cards > ul > li {
  text-align: center;
  font-size: 0.7rem;
}
.ordito-gallery.grid.cards img {
  display: block;
  margin: 0 auto 0.3rem;
  max-height: 9rem;
}

/* Layout width. Material's 61rem grid leaves the content column about 80 code characters wide,
   so every 100-column line of the examples (ruff's width) scrolled sideways. 76rem fits them at
   the code font size below without changing the prose measure much. */
.md-grid {
  max-width: 76rem;
}
.md-typeset pre > code {
  font-size: 0.8em;
}

/* Collapsed backlinks (overrides/mkdocstrings/python/material/backlinks.html.jinja). */
.md-typeset details.ordito-backlinks {
  border: none;
  box-shadow: none;
  background: none;
  margin: 0.4em 0 0.8em;
  font-size: 0.7rem;
}
.md-typeset details.ordito-backlinks > summary {
  padding: 0 0 0 1.4rem;
  background: none;
  font-weight: normal;
  color: var(--md-default-fg-color--light);
}
.md-typeset details.ordito-backlinks > summary::before {
  left: 0;
  top: 0.15em;
  background-color: var(--md-default-fg-color--light);
}
.md-typeset details.ordito-backlinks > summary::after {
  display: none;
}
.md-typeset details.ordito-backlinks > p {
  margin: 0.3em 0 0 1.4rem;
}
.ordito-backlinks-section {
  font-weight: 600;
  margin-right: 0.4em;
}
.ordito-backlinks-section::after {
  content: ":";
}

/* Home-page strip of example thumbnails: one row of six on a wide screen, two rows of three
   otherwise, never a row with one card left over. */
.md-typeset .ordito-hero.grid.cards {
  grid-template-columns: repeat(3, 1fr);
}
@media screen and (min-width: 60em) {
  .md-typeset .ordito-hero.grid.cards {
    grid-template-columns: repeat(6, 1fr);
  }
}
.md-typeset .ordito-hero.grid.cards > ul > li {
  padding: 0.4rem;
}

/* The landing page's title is the wordmark (assets/wordmark*.svg), one image per scheme. */
.md-typeset h1.ordito-wordmark {
  margin-bottom: 0.8em;
}

.md-typeset h1.ordito-wordmark img {
  height: 3.2rem;
  width: auto;
}

/* Benchmark charts (inline SVG from benchmarks/tools/render_docs.py): ordito takes the brand
   accent, every reference one muted gray; text keeps the page's own ink. Both pairs went through
   the dataviz palette validator. Light: worst pair dE 17.0 under CVD, 20.6 normal; the gray's
   2.74:1 contrast is in the warning band, relieved by every bar's direct value label. Dark: CVD
   and contrast pass; the accent's lightness flag (0.713 > 0.67) is accepted to stay on the brand
   green. A chart is drawn at its native width (one viewBox unit per pixel) and shrinks on a
   narrower column. */
[data-md-color-scheme="default"] {
  --bench-subject: #4f8000;
  --bench-reference: #9a9a9a;
}
[data-md-color-scheme="slate"] {
  --bench-subject: #76b900;
  --bench-reference: #7a7a7a;
}
.bench-figure {
  /* Material makes a figure fit-content, which leaves the chart no width to resolve against: the
     SVG then falls back to a fixed height and a chart with fewer rows renders wider. */
  width: 100%;
  margin: 1em 0;
}
.bench-chart {
  display: block;
  width: 100%;
  max-width: 640px;
  height: auto;
  font-family: var(--md-text-font-family), sans-serif;
}
.bench-chart .bench-subject {
  fill: var(--bench-subject);
}
.bench-chart .bench-reference {
  fill: var(--bench-reference);
}
.bench-chart .bench-label,
.bench-chart .bench-value {
  fill: var(--md-default-fg-color);
  font-size: 12px;
}
/* A halo in the page colour keeps a value label legible where a gridline runs through it. */
.bench-chart .bench-value {
  paint-order: stroke;
  stroke: var(--md-default-bg-color);
  stroke-width: 3px;
  stroke-linejoin: round;
}
.bench-chart .bench-tick {
  fill: var(--md-default-fg-color--light);
  font-size: 10px;
}
.bench-chart .bench-grid {
  stroke: var(--md-default-fg-color--lightest);
  stroke-width: 1;
}
.bench-chart .bench-baseline {
  stroke: var(--md-default-fg-color--light);
  stroke-width: 1;
}
.bench-chart g:hover rect {
  opacity: 0.8;
}
/* Logos are transparent; two marks need a tint to show on one of the themes. PyTorch3D's is pure
   white, Open3D's mostly black. */
[data-md-color-scheme="default"] .bench-chart .bench-logo-pytorch3d {
  filter: invert(0.75);
}
[data-md-color-scheme="slate"] .bench-chart .bench-logo-open3d {
  filter: invert(1);
}
.bench-figure figcaption {
  font-size: 0.7rem;
  color: var(--md-default-fg-color--light);
  max-width: 640px;
  margin: 0.2em 0 0;
  text-align: left;
}
/* A run stopped at the time limit: the bar is a lower bound, drawn paler. */
.bench-chart .bench-timeout {
  fill-opacity: 0.4;
}
/* A run that crashed or ran out of memory: no time, so no bar, only a red cross. */
[data-md-color-scheme="default"] {
  --bench-failed: #c62828;
}
[data-md-color-scheme="slate"] {
  --bench-failed: #ef5350;
}
.bench-chart .bench-failed {
  stroke: var(--bench-failed);
  stroke-width: 2;
  stroke-linecap: round;
  fill: none;
}
