/* the lens on the overview page (docs/js/lens.js) */
figure.lens {
  --lens-line: #27272a;
  --lens-ring: #c9d6e8;
  --lens-grid: #e6edf6;
  max-width: 560px;
  margin: 1.5rem auto 2rem;
}

figure.lens canvas {
  display: block;
  width: 100%;
  aspect-ratio: 5 / 4;
  cursor: crosshair;
  touch-action: pan-y;
}
/* to_widget in the browser, with Pyodide (docs/js/widget.js) */
figure.widget {
  --widget-line: #27272a;
  --widget-faint: #d4d4d8;
  --widget-edge: #71717a;
  --widget-track: #e4e4e7;
  --widget-accent: #fdf3e1;
  position: relative;
  max-width: 560px;
  margin: 1rem 0 1.5rem;
}

figure.widget canvas {
  display: block;
  width: 100%;
  aspect-ratio: 5 / 4;
}

figure.widget .widget-cover {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  aspect-ratio: 5 / 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

figure.widget .widget-start {
  font: inherit;
  font-size: 14px;
  padding: 0.45rem 1rem;
  border: 1px solid var(--widget-line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--widget-line);
  cursor: pointer;
}

figure.widget .widget-start:hover:not(:disabled) {
  background: var(--widget-accent);
}

figure.widget .widget-start:disabled {
  cursor: progress;
  border-color: var(--widget-edge);
  color: var(--widget-edge);
}

figure.widget .widget-note,
figure.widget .widget-status {
  font-size: 12px;
  color: var(--widget-edge);
}

figure.widget .widget-controls {
  display: grid;
  gap: 0.4rem;
  font-size: 13px;
  color: var(--widget-line);
}

figure.widget:not(.live) .widget-controls {
  opacity: 0.45;
}

figure.widget .widget-row {
  display: grid;
  grid-template-columns: 6rem 1fr 3rem;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
}

figure.widget .widget-row input {
  width: 100%;
  accent-color: var(--widget-line);
}

figure.widget .widget-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

figure.widget .widget-call {
  justify-self: start;
  font-size: 12px;
  white-space: normal;
  overflow-wrap: anywhere;
}
/* the steps on the page How it works (docs/js/steps.js) */
figure.steps {
  --steps-plate: #ffffff;
  --steps-accent: #fdf8ee;
  --steps-hi: #27272a;
  --steps-edge: #71717a;
  --steps-mid: #a1a1aa;
  --steps-lo: #d4d4d8;
  max-width: 560px;
  margin: 1rem 0 1.5rem;
}

figure.steps svg {
  display: block;
  width: 100%;
  height: auto;
}

figure.parts {
  --steps-plate: #ffffff;
  --steps-fill-a: #f1f1f3;
  --steps-fill-b: #fdf3e1;
  --steps-hi: #27272a;
  --steps-edge: #71717a;
  --steps-lo: #d4d4d8;
  max-width: 560px;
  margin: 0.5rem 0 1rem;
}

figure.parts svg {
  display: block;
  width: 100%;
  height: auto;
}

figure.steps .steps-name,
figure.steps .steps-label,
figure.parts .steps-label {
  font-family: inherit;
  font-size: var(--steps-font, 12px);
}

.md-typeset figure.lens,
.md-typeset figure.steps,
.md-typeset figure.parts,
.md-typeset figure.widget {
  display: block;
  width: 100%;
  text-align: left;
}
.md-typeset figure.lens { margin-left: auto; margin-right: auto; }

/* dark mode (scheme slate) */
[data-md-color-scheme="slate"] figure.lens {
  --lens-line: #e4e4e7;
  --lens-ring: #4b5d78;
  --lens-grid: #2a3445;
}
[data-md-color-scheme="slate"] figure.steps,
[data-md-color-scheme="slate"] figure.parts {
  --steps-plate: #1f2129;
  --steps-accent: #2e2a22;
  --steps-fill-a: #2a2d37;
  --steps-fill-b: #3a3224;
  --steps-hi: #e4e4e7;
  --steps-edge: #a1a1aa;
  --steps-mid: #71717a;
  --steps-lo: #4a4b55;
}
[data-md-color-scheme="slate"] figure.widget {
  --widget-line: #e4e4e7;
  --widget-faint: #4a4b55;
  --widget-edge: #a1a1aa;
  --widget-track: #3f3f46;
  --widget-accent: #3a3224;
}
[data-md-color-scheme="slate"] figure.widget .widget-start {
  background: var(--md-default-bg-color);
}
