/*
  Deck-specific overrides on top of ../../theme/slides-theme.css.

  New components for this deck (none in the shared theme yet — see
  theme/README.md before copy-pasting these into another deck; pull them
  up to slides-theme.css only if a second deck ends up needing them):
  - .bell-task / .side-by-side, .console, .code-block/.code-line, .tag-row/
    .tag-chip, .recap-list — copied as-is from python-intro's own
    custom.css (these live per-deck, NOT in the shared theme, despite
    looking like core theme components — see that file's own comment).
    This deck is now the second consumer of all of these, which is
    theme/README.md's own stated trigger to promote them up into
    slides-theme.css instead of copy-pasting again — worth doing next
    time either deck's console/code-block/tag-chip styling changes.
  - .value-matrix   — a small numpy-style grid of (R,G,B) triples, neutral
    background, before the "these numbers ARE the colour" reveal.
  - .pixel-matrix    — the same grid, same values, cell backgrounds now
    set to their real rgb() colour via inline style in the markup.
  - .channel-split   — one pixel decomposed into its R/G/B swatches.
  - .hist-chart       — an 8-bin bar chart per colour channel, bars sized
    from real histogram counts via inline style height percentages.
*/

:root {
  --chan-r: #d1766a;   /* reuses --danger's hue family, tagged as "red channel" */
  --chan-g: #8fbf7a;   /* muted sage green, distinct from --cool teal */
  --chan-b: #6f9fd1;   /* muted blue, distinct enough from --cool */
  --r-h2-size: 1.3em;
}

/* ---- bell-task hook + side-by-side reveal (pattern borrowed from python-intro).
   ".reveal .bell-task" (2 classes), not just ".bell-task" (1 class): the shared
   theme's ".reveal section { text-align: left }" is 1 class + 1 type, which
   otherwise outranks a single-class ".bell-task" rule and silently wins,
   leaving the "centered" bell-task slide left-aligned (present in python-intro
   too — not something this deck introduced, just not re-doing it wrong here). ---- */
.reveal .bell-task { text-align: center; }
.bell-task h1 { margin-bottom: 0.5em; }
.bell-task img {
  max-height: 560px;
  max-width: 90%;
  border-radius: 4px;
  box-shadow: 0 0 0 1px var(--rule);
}

.side-by-side {
  display: flex;
  align-items: center;
  gap: 2em;
  margin-top: 0.6em;
}
.side-by-side .img-col { flex: 0 0 36%; }
.side-by-side .img-col img {
  width: 100%;
  border-radius: 4px;
  display: block;
  box-shadow: 0 0 0 1px var(--rule);
}
.side-by-side .text-col { flex: 1; text-align: left; }
.side-by-side .text-col ul { list-style: none; padding: 0; margin: 0; }
.side-by-side .text-col li {
  font-family: var(--sans);
  font-size: 0.6em;
  line-height: 1.4;
  color: var(--ink);
  margin: 0 0 0.7em 0;
  padding-left: 1.2em;
  position: relative;
}
.side-by-side .text-col li::before {
  content: "\00bb";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.slide-note {
  font-family: var(--mono);
  font-size: 0.5em;
  color: var(--ink-dim);
  margin-top: 0.6em;
}

/* ---- Spyder console block: >>> input lines + output lines (copied from
   python-intro/custom.css — see the header comment on this file) ---- */
.console {
  font-family: var(--mono);
  font-size: 0.68em;
  line-height: 1.9;
  background: rgba(255,255,255,0.04);
  border-left: 2px solid var(--cool);
  border-radius: 2px;
  padding: 0.6em 1.1em;
  text-align: left;
  margin: 0.6em 0;
}
.console .cline { color: var(--ink); white-space: pre-wrap; }
.console .cline .ps { color: var(--ink-dim); margin-right: 0.6em; user-select: none; }
.console .cout { color: var(--accent); padding-left: 1.9em; white-space: pre-wrap; }
.console .ccmt { color: var(--ink-dim); }

/* ---- .py script block: line-numbered, monospace (copied from
   python-intro/custom.css) ---- */
.code-block {
  font-family: var(--mono);
  font-size: 0.56em;
  line-height: 1.7;
  background: rgba(255,255,255,0.04);
  border-left: 2px solid var(--rule);
  border-radius: 2px;
  padding: 0.55em 0;
  text-align: left;
  margin: 0.6em 0;
}
.code-line {
  display: flex;
  align-items: baseline;
  padding: 0 0.9em;
  white-space: pre;
}
.code-line .ln {
  flex: 0 0 2em;
  margin-right: 0.9em;
  color: var(--ink-dim);
  text-align: right;
  user-select: none;
  font-variant-numeric: tabular-nums;
}
.code-line.indent { padding-left: 2.3em; }

.kw  { color: var(--cool); margin-right: 0.35em; }
.str { color: var(--happy, var(--chan-g)); }
.num { color: var(--accent); }
.cmt { color: var(--ink-dim); font-style: italic; }
.fn  { color: var(--accent); }

/* ---- inline tag row (copied from python-intro/custom.css) ---- */
.tag-row { display: flex; gap: 0.6em; flex-wrap: wrap; margin: 0.6em 0; }
.tag-chip {
  font-family: var(--mono);
  font-size: 0.75em;
  color: var(--accent);
  background: var(--accent-dim);
  border-radius: 4px;
  padding: 0.3em 0.7em;
}

/* ---- value-matrix / pixel-matrix: a small grid of (R,G,B) triples.
   Both share the same 4-column layout so the "plain numbers" slide and
   the "same numbers, in colour" slide line up cell-for-cell. ---- */
.value-matrix, .pixel-matrix {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  max-width: 620px;
  margin: 0.7em 0;
}
.value-matrix .cell, .pixel-matrix .cell {
  aspect-ratio: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-radius: 2px;
  box-sizing: border-box;
}
.value-matrix .cell {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--rule);
}
.value-matrix .cell .triple {
  font-family: var(--mono);
  font-size: 0.34em;
  color: var(--ink);
  line-height: 1.3;
  text-align: center;
  padding-bottom: 0.4em;
}
/* pixel-matrix cells set background:rgb(...) inline in the markup itself
   (the real per-pixel colour) — the label chip below just needs to stay
   legible over ANY of those colours, light or dark, so it gets its own
   opaque-ish dark backing rather than relying on the cell's colour. */
.pixel-matrix .cell .triple {
  font-family: var(--mono);
  font-size: 0.32em;
  color: #f2efe8;
  background: rgba(10, 12, 14, 0.55);
  border-radius: 2px;
  padding: 0.15em 0.3em;
  margin-bottom: 0.25em;
  line-height: 1.3;
  text-align: center;
}

/* ---- channel-split: one pixel decomposed into R / G / B swatches ---- */
.channel-split {
  display: flex;
  align-items: center;
  gap: 0.7em;
  margin: 0.8em 0;
  flex-wrap: wrap;
}
.channel-split .swatch-col { text-align: center; }
.channel-split .swatch {
  width: 90px;
  height: 90px;
  border-radius: 4px;
  box-shadow: 0 0 0 1px var(--rule);
}
.channel-split .swatch-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.5em;
  color: var(--ink-dim);
  margin-top: 0.4em;
}
.channel-split .swatch-value {
  display: block;
  font-family: var(--mono);
  font-size: 0.6em;
  color: var(--ink);
  margin-top: 0.1em;
}
.channel-split .op {
  font-family: var(--mono);
  font-size: 1.3em;
  color: var(--ink-dim);
}

/* ---- hist-chart: 8-bin bar chart per channel, real counts as bar heights ---- */
.hist-row {
  display: flex;
  gap: 1.6em;
  margin-top: 0.7em;
  align-items: flex-start;
}
.hist-chart { text-align: center; }
.hist-chart .hist-label {
  font-family: var(--mono);
  font-size: 0.55em;
  margin-bottom: 0.4em;
  display: inline-block;
  padding: 0.15em 0.6em;
  border-radius: 4px;
}
.hist-chart .hist-label.r { color: var(--chan-r); background: rgba(209,118,106,0.14); }
.hist-chart .hist-label.g { color: var(--chan-g); background: rgba(143,191,122,0.14); }
.hist-chart .hist-label.b { color: var(--chan-b); background: rgba(111,159,209,0.14); }
.hist-chart .bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 130px;
  border-bottom: 1px solid var(--rule);
  padding: 0 2px;
}
.hist-chart .bar {
  width: 12px;
  border-radius: 1px 1px 0 0;
}
.hist-chart.r .bar { background: var(--chan-r); }
.hist-chart.g .bar { background: var(--chan-g); }
.hist-chart.b .bar { background: var(--chan-b); }
.hist-chart .axis-caption {
  font-family: var(--mono);
  font-size: 0.4em;
  color: var(--ink-dim);
  margin-top: 0.4em;
}

/* ---- checklist on the closing slide (pattern borrowed from python-intro) ---- */
.recap-list { list-style: none; margin: 0.6em 0 0; padding: 0; }
.recap-list li {
  font-family: var(--mono);
  font-size: 0.85em;
  padding: 0.25em 0;
  color: var(--ink-dim);
}
.recap-list li.fragment.visible { color: var(--ink); }
.recap-list li::before { content: "\2713  "; color: var(--happy, var(--accent)); }
