/* Catalog tables (effects / modifiers / layouts / drivers), rendered from prose
   ### blocks by moondeck/docs/mkdocs_hooks.py. Give the four columns sensible
   proportions and let the preview image fill its column instead of the tiny
   hand-authored width="300".

   Scoped to `.mm-catalog` (a class we add to the rendered table) so it doesn't
   reshape the generated test-inventory tables or any other table on the site. */

/* Material tables default to width:auto with content-based column sizing, which
   IGNORES percentage column widths (the Preview column collapsed to ~100px and
   the GIF rendered as a 68px thumbnail). `table-layout: fixed` + full width makes
   the browser honour the column percentages below. */
.md-typeset .mm-catalog-wrap table {
  table-layout: fixed;
  width: 100%;
}

/* The preview leads its cell, above the name. Capped rather than full-bleed: it
   shares the cell with the prose now, so a tall GIF would push the name out of
   sight. The cap keeps the picture legible and the title on the first screenful. */
.md-typeset .mm-catalog-wrap table td img.mm-preview {
  width: 100%;
  max-width: 320px;
  height: auto;
  display: block;
  margin-bottom: 0.4rem;
}

/* Two columns. Each added column divides the page again, and the links column at 18%
   made a three-link card taller than its own controls; merged under them it costs no
   width at all. Two also degrades best on a phone, where the browser stacks cells. */
.md-typeset .mm-catalog-wrap table th:nth-child(1),
.md-typeset .mm-catalog-wrap table td:nth-child(1) { width: 48%; }   /* Preview + name + description */
.md-typeset .mm-catalog-wrap table th:nth-child(2),
.md-typeset .mm-catalog-wrap table td:nth-child(2) { width: 52%; }   /* Controls, then the links */

/* fixed layout clips overflow by default — allow long param/description text to wrap. */
.md-typeset .mm-catalog-wrap table td { word-wrap: break-word; overflow-wrap: anywhere; vertical-align: top; }

/* Name column: title distinct from description (was one run-on line). The name is
   bold and slightly larger; the description sits below in a muted color with a
   small gap, reading as title + subtitle. */
.md-typeset .mm-catalog-wrap .mm-name {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--md-typeset-a-color);   /* accent purple, matching the param names */
}
.md-typeset .mm-catalog-wrap .mm-desc {
  color: var(--md-default-fg-color--light);
  display: inline-block;
  margin-top: 0.3rem;
}

/* Parameters column: each param on its own line, compact (small gap, no left rule
   — the earlier version made many-param effects like GameOfLife very tall). What
   makes each param scannable is the NAME standing out, not the spacing. */
.md-typeset .mm-catalog-wrap .mm-param {
  display: block;
  margin: 0 0 0.25rem 0;
  line-height: 1.4;
}
.md-typeset .mm-catalog-wrap .mm-param:last-child { margin-bottom: 0; }

/* The param NAME (a `code` chip in the source) is the anchor the eye scans for —
   make it stand out: accent color, bold, no chip background so it reads as a
   highlighted term rather than a muted grey box blending into the prose. */
.md-typeset .mm-catalog-wrap .mm-param code {
  color: var(--md-typeset-a-color);   /* the theme accent (purple) */
  background: transparent;
  font-weight: 600;
  font-size: 0.82em;
  padding: 0;
}

/* Control description (the prose after the em-dash) greyed, matching the muted
   module description — so within a param, the name pops (purple) and its
   explanation recedes (grey), consistent with name-vs-description elsewhere. */
.md-typeset .mm-catalog-wrap .mm-pdesc {
  color: var(--md-default-fg-color--light);
}

/* Links column: grey the plain attribution prose (author, project, year). The
   actual links (Tests, source .h, MoonLight) keep their accent color — Material's
   `a` rule is more specific than this, so only the surrounding text greys. */
/* A link that has no target yet: shown, not hidden. The label stays in place so the two
   rows sit identically on every card, and the gap is visible rather than silent. */
.md-typeset .mm-catalog-wrap .mm-missing {
  color: var(--md-default-fg-color--lighter);
  font-style: italic;
}

.md-typeset .mm-catalog-wrap .mm-links {
  color: var(--md-default-fg-color--light);
  display: block;
  margin-top: 0.6rem;
  padding-top: 0.5rem;
  /* A rule rather than a gap: sharing a cell with the controls, the links need a visible
     boundary or the two read as one list. */
  border-top: 1px solid var(--md-default-fg-color--lightest);
  font-size: 0.85em;
}

/* ---------------------------------------------------------------------------
   Colored headings (whole site). The slate theme renders every heading in the
   same near-white, so an h1/h2/h3 doesn't stand out from body text — the page
   reads as one grey wall. Give headings the theme's primary/accent color so
   the document structure is scannable at a glance (the standard Material-site
   look: colored headings over neutral body). h4+ stay default — coloring
   every level would just re-flatten the hierarchy. */
.md-typeset h1,
.md-typeset h2 {
  color: var(--md-primary-fg-color);
  font-weight: 700;
}
.md-typeset h3 {
  color: var(--md-accent-fg-color);
  font-weight: 600;
}

/* ---------------------------------------------------------------------------
   Signature standout on the generated moxygen technical pages. Each attribute /
   method renders as a paragraph leading with its declaration
   (`uint8_t protocol = 0`, `virtual void defineControls() override`) followed
   by a `: summary`. gen_api.py rewrites each into
   `<code class="mm-sig">…<span class="mm-sig-name">name</span>…</code>` so the
   chip can highlight ONLY the declared member name while the type and arguments
   stay muted — the eye lands on the name it's scanning for, and the signature
   still reads as one code chip. (A flat `<code>` can't do this in CSS alone —
   there's no way to select 'the name' inside an undelimited string.) */
.md-typeset code.mm-sig {
  background: color-mix(in srgb, var(--md-accent-fg-color) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--md-accent-fg-color) 22%, transparent);
  color: var(--md-default-fg-color--light);   /* type + args: muted */
  padding: 0.15em 0.5em;
}
.md-typeset code.mm-sig .mm-sig-name {
  color: var(--md-accent-fg-color);           /* the declared name: accent + bold */
  font-weight: 700;
}

/* Power-functions tables: the first column holds a function NAME, which must never
   break mid-token (`draw::fill` wrapping to "draw::fil / l" is unreadable — the reader
   is scanning for an identifier, not prose). Material sizes table columns by content
   and lets long inline code wrap anywhere: right for prose, wrong for a symbol.
   Applied via an explicit {.mm-pf} class on each table (attr_list), so no other table
   on the site is reshaped. */
.md-typeset .mm-pf table,
.md-typeset table.mm-pf {
  table-layout: fixed;
  width: 100%;
}
.md-typeset .mm-pf table th:nth-child(1), .md-typeset .mm-pf table td:nth-child(1),
.md-typeset table.mm-pf th:nth-child(1), .md-typeset table.mm-pf td:nth-child(1) { width: 17%; }
.md-typeset .mm-pf table th:nth-child(2), .md-typeset .mm-pf table td:nth-child(2),
.md-typeset table.mm-pf th:nth-child(2), .md-typeset table.mm-pf td:nth-child(2) { width: 35%; }
.md-typeset .mm-pf table th:nth-child(3), .md-typeset .mm-pf table td:nth-child(3),
.md-typeset table.mm-pf th:nth-child(3), .md-typeset table.mm-pf td:nth-child(3) { width: 38%; }
.md-typeset .mm-pf table th:nth-child(4), .md-typeset .mm-pf table td:nth-child(4),
.md-typeset table.mm-pf th:nth-child(4), .md-typeset table.mm-pf td:nth-child(4) { width: 10%; }
/* The identifier column: keep each symbol whole rather than breaking it mid-token. */
.md-typeset .mm-pf table td:nth-child(1) code,
.md-typeset table.mm-pf td:nth-child(1) code { white-space: nowrap; }
.md-typeset .mm-pf table td, .md-typeset table.mm-pf td { vertical-align: top; }
