/*
 * Short status, level or lesson type. Not interactive.
 * Each status sits on its -tint background with the -strong text (>= 8:1, docs/DESIGN.md, Tokens),
 * never the base color. Without a variant the badge is --neutral.
 */
@layer components {
  .badge {
    display: inline-flex;
    /* A badge never stretches, even as the child of a flex column (the video facade mounts one there). */
    inline-size: fit-content;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    background: var(--badge-bg, var(--color-surface-sunken));
    color: var(--badge-fg, var(--color-text-muted));
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    line-height: var(--leading-tight);
    white-space: nowrap;

    & svg {
      flex: none;
      inline-size: 1em;
      block-size: 1em;
    }
  }

  .badge--success {
    --badge-bg: var(--color-success-tint);
    --badge-fg: var(--color-success-strong);
  }

  .badge--danger {
    --badge-bg: var(--color-danger-tint);
    --badge-fg: var(--color-danger-strong);
  }

  .badge--warning {
    --badge-bg: var(--color-warning-tint);
    --badge-fg: var(--color-warning-strong);
  }

  .badge--info {
    --badge-bg: var(--color-info-tint);
    --badge-fg: var(--color-info-strong);
  }

  .badge--neutral {
    --badge-bg: var(--color-surface-sunken);
    --badge-fg: var(--color-text-muted);
  }
}
