/* Command cards: generated by docs/commands.py (blocks between ihrz:auto markers).
   The heading sits on top of the card, the generated block is its body.
   Colours come from Material variables, so light / dark follow the palette. */

/* Heading = card header */
.md-typeset h2:has(+ .ihrz-cmd),
.md-typeset h3:has(+ .ihrz-cmd) {
  margin: 2.2em 0 0;
  padding: 0.55em 0.9em;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0;
  background: var(--md-code-bg-color);
  border: 0.05rem solid var(--md-default-fg-color--lightest);
  border-left: 0.2rem solid var(--md-primary-fg-color);
  border-radius: 0.4rem 0.4rem 0 0;
}

.md-typeset h2:has(+ .ihrz-cmd) code,
.md-typeset h3:has(+ .ihrz-cmd) code {
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

/* Generated block = card body */
.md-typeset .ihrz-cmd {
  margin: 0 0 1.4em;
  padding: 0.8em 0.9em 0.2em;
  border: 0.05rem solid var(--md-default-fg-color--lightest);
  border-top: 0;
  border-left: 0.2rem solid var(--md-primary-fg-color);
  border-radius: 0 0 0.4rem 0.4rem;
  background: var(--md-default-bg-color);
}

.md-typeset .ihrz-cmd > :first-child { margin-top: 0; }
.md-typeset .ihrz-cmd .admonition { margin: 1em 0; }
.md-typeset .ihrz-cmd table:not([class]) { display: table; width: 100%; font-size: 0.72rem; }

/* Badges */
.md-typeset .ihrz-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 0.7em;
}

.ihrz-badge {
  --ihrz-badge-color: var(--md-default-fg-color--light);
  display: inline-flex;
  align-items: stretch;
  overflow: hidden;
  border: 0.05rem solid var(--ihrz-badge-color);
  border-radius: 1rem;
  font-size: 0.65rem;
  line-height: 1.6;
  white-space: nowrap;
}

.ihrz-badge__label,
.ihrz-badge__value { padding: 0 0.6em; }

.ihrz-badge__label {
  background: var(--ihrz-badge-color);
  color: var(--md-default-bg-color);
  font-weight: 600;
}

.ihrz-badge__value {
  color: var(--md-default-fg-color);
  font-family: var(--md-code-font-family);
}

.ihrz-badge--permission { --ihrz-badge-color: #e5484d; }
.ihrz-badge--prefix     { --ihrz-badge-color: var(--md-primary-fg-color); }
.ihrz-badge--alias      { --ihrz-badge-color: #8e6bd8; }
.ihrz-badge--cooldown   { --ihrz-badge-color: #d9822b; }
.ihrz-badge--ephemeral  { --ihrz-badge-color: #2f9e6e; }

.ihrz-badge--permission .ihrz-badge__value,
.ihrz-badge--ephemeral .ihrz-badge__value { font-family: inherit; }

/* Badges that carry only a value (ephemeral) get a tinted background */
.ihrz-badge--ephemeral .ihrz-badge__value:first-child {
  background: color-mix(in srgb, var(--ihrz-badge-color) 15%, transparent);
}
