/* ============================================================
   Badge — pill label with color variants, sizes, and states
   Design tokens from src/styles/tokens.css.
   ============================================================ */

/* ---- Base ---- */

.badge {
  align-items:     center;
  justify-content: center;
  border-radius:   var(--radius-full);
  display:         inline-flex;
  flex-shrink:     0;
  font-family:     var(--font-family-default);
  font-size:       var(--font-size-xs);
  font-weight:     var(--font-weight-medium);
  gap:             var(--spacing-1-5);
  line-height:     var(--line-height-xs);
  text-decoration: none;    /* reset <a> */
  transition:      opacity 0.15s;
  white-space:     nowrap;
}

/* Interactive reset for button root */
button.badge {
  appearance: none;
  border:     none;
  cursor:     pointer;
}

/* Inactive toggle state */
.badge--inactive {
  opacity: 0.45;
}

/* Hover — only on interactive roots (button / link) */
a.badge:hover,
button.badge:hover {
  opacity: 0.8;
}

/* Focus */
a.badge:focus-visible,
button.badge:focus-visible {
  outline:        1.5px solid var(--info);
  outline-offset: 2px;
}


/* ============================================================
   Shapes
   ============================================================ */

.badge--round   { border-radius: var(--radius-full); }
.badge--rounded { border-radius: var(--radius-sm);   }


/* ============================================================
   Sizes
   ============================================================ */

.badge--sm {
  gap:       2px;
  height:    1.25rem;           /* 20px */
  min-width: 1.25rem;           /* keeps single-char badges circular */
  padding:   0 var(--spacing-1-5);
}

.badge--md {
  gap:       var(--spacing-1);
  height:    1.25rem;           /* 20px */
  min-width: 1.25rem;
  padding:   0 var(--spacing-2);
}

.badge--lg {
  gap:       var(--spacing-1-5);
  height:    1.625rem;          /* 26px */
  min-width: 1.625rem;
  padding:   0 var(--spacing-3);
}


/* ============================================================
   Variants
   ============================================================ */

.badge--primary {
  background-color: var(--opacity-primary-10);
  color:            var(--primary);
}

.badge--secondary {
  background-color: var(--background);
  color:            var(--foreground);
}

.badge--card {
  background-color: var(--card);
  color:            var(--foreground);
}

.badge--info {
  background-color: var(--opacity-info-10);
  color:            var(--info);
}

.badge--success {
  background-color: var(--opacity-success-10);
  color:            var(--success);
}

.badge--warning {
  background-color: var(--opacity-warning-10);
  color:            var(--warning);
}

.badge--destructive {
  background-color: var(--opacity-destructive-10);
  color:            var(--destructive);
}


/* ============================================================
   Inner elements
   ============================================================ */

/* Label — plain text wrapper */
.badge__label {
  display: contents;
}

/* Left icon */
.badge__icon {
  align-items:     center;
  display:         inline-flex;
  flex-shrink:     0;
  justify-content: center;
}

.badge__icon svg {
  display: block;
  height:  0.75rem;   /* 12px */
  width:   0.75rem;
}

/* Left avatar */
.badge__avatar {
  border-radius: var(--radius-full);
  display:       block;
  flex-shrink:   0;
  height:        0.75rem;   /* 12px */
  object-fit:    cover;
  width:         0.75rem;
}

/* Close button */
.badge__close {
  align-items:     center;
  appearance:      none;
  background:      transparent;
  border:          none;
  color:           inherit;
  cursor:          pointer;
  display:         inline-flex;
  flex-shrink:     0;
  justify-content: center;
  line-height:     1;
  opacity:         0.6;
  padding:         0;
  transition:      opacity 0.15s;
}

.badge__close:hover {
  opacity: 1;
}

.badge__close svg {
  display: block;
  height:  0.75rem;   /* 12px */
  width:   0.75rem;
}

