/* Figures: SVG drawings inlined into a page with --8<-- (docs/figures, drawn by hand, and docs/plots, drawn by the
   logring_figures crate from rings the drive example writes). Elements carry classes, never colours, so a figure
   takes the page's scheme: the tokens below, one set for light and one for dark. The palette and the classes are
   those of the ww_tape and WireWeaver books, the accent the brand red. */
[data-md-color-scheme="default"] {
  --ww-fig-ink: #1a1a1a;
  --ww-fig-soft: #646a70;
  --ww-fig-faint: #ececec;
  --ww-fig-accent: #c8141c;
  --ww-fig-blue: #2f5f9e;
  --ww-fig-green: #2e7d43;
  --ww-fig-purple: #7a3fa0;
  --ww-fig-amber: #96570a;
  --ww-fig-teal: #1f7070;
  --ww-fig-tint: 0.22;
}
[data-md-color-scheme="slate"] {
  --ww-fig-ink: #ececec;
  --ww-fig-soft: #a6a8aa;
  --ww-fig-faint: #26272a;
  --ww-fig-accent: #f24c44;
  --ww-fig-blue: #9cc0ee;
  --ww-fig-green: #8fd6a1;
  --ww-fig-purple: #cdaeea;
  --ww-fig-amber: #ecbd6a;
  --ww-fig-teal: #86d6d6;
  --ww-fig-tint: 0.24;
}

.md-typeset figure.ww-figure {
  margin: 1.5em auto;
  max-width: 100%;
}
.md-typeset figure.ww-figure svg {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}
.md-typeset figure.ww-figure figcaption {
  max-width: 36rem;
  margin: 0.4em auto 0;
  color: var(--md-default-fg-color--light);
  font-size: 0.7rem;
}

/* The drawing: text in the page's font, 13 px, in the ink colour unless a class says otherwise */
.ww-svg {
  color: var(--ww-fig-ink);
  font-family: var(--md-text-font-family);
}
.ww-svg text {
  fill: currentColor;
  stroke: none;
  font-size: 13px;
}
.ww-svg text.small {
  font-size: 11.5px;
}
.ww-svg text.strong {
  font-weight: 600;
}
.ww-svg .mono {
  font-family: var(--md-code-font-family);
}
.ww-svg text.soft {
  fill: var(--ww-fig-soft);
}
/* lines */
.ww-svg .line {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}
.ww-svg .thin {
  fill: none;
  stroke: var(--ww-fig-soft);
  stroke-width: 1;
}
.ww-svg .dash {
  stroke-dasharray: 4 3;
}
.ww-svg .accent-line {
  fill: none;
  stroke: var(--ww-fig-accent);
  stroke-width: 2;
}
.ww-svg .head {
  stroke: none;
}
.ww-svg .thin.head {
  fill: var(--ww-fig-soft);
}
.ww-svg .line.head {
  fill: currentColor;
}
.ww-svg .accent-line.head {
  fill: var(--ww-fig-accent);
}
/* filled shapes: a solid colour, or a tint of it behind text */
.ww-svg .faint {
  fill: var(--ww-fig-faint);
  stroke: none;
}
.ww-svg .hatch {
  stroke: var(--ww-fig-soft);
  stroke-width: 0.6;
  stroke-dasharray: 2 2;
}
.ww-svg .hollow {
  fill: var(--md-default-bg-color);
  stroke: var(--ww-fig-blue);
  stroke-width: 1.2;
}
.ww-svg rect.ink,
.ww-svg circle.ink {
  fill: currentColor;
}
.ww-svg .blue:not(text) { fill: var(--ww-fig-blue); stroke: none; }
.ww-svg .green:not(text) { fill: var(--ww-fig-green); stroke: none; }
.ww-svg .purple:not(text) { fill: var(--ww-fig-purple); stroke: none; }
.ww-svg .amber:not(text) { fill: var(--ww-fig-amber); stroke: none; }
.ww-svg .teal:not(text) { fill: var(--ww-fig-teal); stroke: none; }
.ww-svg .accent:not(text) { fill: var(--ww-fig-accent); stroke: none; }
.ww-svg path.blue, .ww-svg path.green, .ww-svg path.purple, .ww-svg path.amber, .ww-svg path.teal,
.ww-svg path.accent, .ww-svg path.ink {
  fill: none;
  stroke-width: 1.5;
}
.ww-svg path.blue { stroke: var(--ww-fig-blue); }
.ww-svg path.green { stroke: var(--ww-fig-green); }
.ww-svg path.purple { stroke: var(--ww-fig-purple); }
.ww-svg path.amber { stroke: var(--ww-fig-amber); }
.ww-svg path.teal { stroke: var(--ww-fig-teal); }
.ww-svg path.accent { stroke: var(--ww-fig-accent); }
.ww-svg path.ink { stroke: currentColor; }
.ww-svg text.blue { fill: var(--ww-fig-blue); }
.ww-svg text.green { fill: var(--ww-fig-green); }
.ww-svg text.purple { fill: var(--ww-fig-purple); }
.ww-svg text.amber { fill: var(--ww-fig-amber); }
.ww-svg text.teal { fill: var(--ww-fig-teal); }
.ww-svg text.accent { fill: var(--ww-fig-accent); }
.ww-svg [class*="tint-"] {
  fill-opacity: var(--ww-fig-tint);
  stroke: none;
}
.ww-svg .tint-ink { fill: currentColor; }
.ww-svg .tint-blue { fill: var(--ww-fig-blue); }
.ww-svg .tint-green { fill: var(--ww-fig-green); }
.ww-svg .tint-purple { fill: var(--ww-fig-purple); }
.ww-svg .tint-amber { fill: var(--ww-fig-amber); }
.ww-svg .tint-teal { fill: var(--ww-fig-teal); }
.ww-svg .tint-accent { fill: var(--ww-fig-accent); }
