/* Badge atom: current shadcn/ui proportions with no framework dependencies. */
.badge-stage {
  align-items: stretch;
  padding: clamp(20px, 4vw, 40px);
}

.badge-showcase {
  width: min(100%, 680px);
  display: grid;
  align-content: center;
  gap: 12px;
}

.badge-example {
  min-width: 0;
  padding: 18px;
  display: grid;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-xs);
}

.badge-example-heading {
  display: grid;
  gap: 2px;
}

.badge-example-heading h2 {
  margin: 0;
  color: var(--card-foreground);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.badge-example-heading p {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 1.4;
}

.badge-row {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.badge-pill {
  width: fit-content;
  max-width: 100%;
  height: 20px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  overflow: hidden;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--foreground);
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  text-decoration: none;
  white-space: nowrap;
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.badge-pill > svg {
  width: 12px;
  height: 12px;
  flex: none;
  pointer-events: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.badge-pill--icon-start {
  padding-inline-start: 6px;
}

.badge-pill--icon-end {
  padding-inline-end: 6px;
}

.badge-pill--default {
  color: var(--primary-foreground);
  background: var(--primary);
}

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

.badge-pill--destructive {
  color: var(--destructive);
  background: color-mix(in srgb, var(--destructive) 10%, transparent);
}

.badge-pill--outline {
  border-color: var(--border);
  color: var(--foreground);
}

.badge-pill--ghost {
  color: var(--foreground);
}

.badge-pill--ghost:hover {
  color: var(--muted-foreground);
  background: var(--muted);
}

.badge-pill:is(a, button) {
  cursor: pointer;
}

.badge-pill--default:is(a, button):hover {
  background: color-mix(in srgb, var(--primary) 80%, transparent);
}

.badge-pill--secondary:is(a, button):hover {
  background: color-mix(in srgb, var(--secondary) 80%, transparent);
}

.badge-pill--outline:is(a, button):hover {
  color: var(--muted-foreground);
  background: var(--muted);
}

.badge-pill:focus-visible {
  border-color: var(--ring);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 50%, transparent);
}

.badge-pill--destructive:focus-visible,
.badge-pill--invalid {
  border-color: var(--destructive);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--destructive) 20%, transparent);
}

.badge-pill:disabled,
.badge-pill[aria-disabled="true"] {
  pointer-events: none;
  cursor: not-allowed;
  opacity: 0.5;
}

.badge-spinner {
  width: 12px;
  height: 12px;
  flex: none;
  border: 1.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: badge-spin 700ms linear infinite;
}

@keyframes badge-spin {
  to { transform: rotate(360deg); }
}

.badge-pill--blue {
  color: #1447e6;
  background: #eff6ff;
}

.badge-pill--green {
  color: #15803d;
  background: #f0fdf4;
}

.badge-pill--sky {
  color: #0369a1;
  background: #f0f9ff;
}

.badge-pill--purple {
  color: #7e22ce;
  background: #faf5ff;
}

.badge-pill--red {
  color: #b91c1c;
  background: #fef2f2;
}

.badge-example--rtl .badge-row {
  justify-content: flex-start;
}

@media (prefers-color-scheme: dark) {
  .badge-pill--destructive {
    background: color-mix(in srgb, var(--destructive) 20%, transparent);
  }

  .badge-pill--ghost:hover {
    background: color-mix(in srgb, var(--muted) 50%, transparent);
  }

  .badge-pill--blue {
    color: #8ec5ff;
    background: #172554;
  }

  .badge-pill--green {
    color: #7bf1a8;
    background: #052e16;
  }

  .badge-pill--sky {
    color: #74d4ff;
    background: #052f4a;
  }

  .badge-pill--purple {
    color: #dab2ff;
    background: #3c0366;
  }

  .badge-pill--red {
    color: #ffa2a2;
    background: #460809;
  }
}

@media (max-width: 540px) {
  .badge-stage {
    padding: 14px;
  }

  .badge-example {
    padding: 16px;
  }
}
