/* Minimal custom styles for DSP Workshop */

/* ── Graph-paper grid background ───────────────────────────────────── */
:root {
  --graph-line: rgba(140, 160, 180, 0.15);
}

[data-bs-theme="dark"] {
  --graph-line: rgba(100, 120, 140, 0.12);
}

body {
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 1.7rem,
      var(--graph-line) 1.7rem,
      var(--graph-line) calc(1.7rem + 1px)
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 1.7rem,
      var(--graph-line) 1.7rem,
      var(--graph-line) calc(1.7rem + 1px)
    );
  background-attachment: fixed;
}

/* ── Dark-mode matplotlib plot fix ────────────────────────────────── */
/* Invert colours on raster plot images so they look native in dark mode.
   hue-rotate(180deg) undoes the hue shift that invert alone causes,
   keeping blues blue and reds red. */
[data-bs-theme="dark"] .cell-output-display img,
[data-bs-theme="dark"] .quarto-figure img {
  filter: invert(1) hue-rotate(180deg);
}

/* Reduce whitespace around figures */
.cell-output-display figure {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

/* Fix Graphviz SVG sizing: Quarto hardcodes width=672 height=480.
   Override to let the viewBox set intrinsic size, then scale so that
   14pt Graphviz text matches ~16px body text (scale ≈ 1.143). */
.quarto-figure svg[viewbox] {
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: none !important;
}
