/* ═══════════════════════════════════════════════════════════════
   htmxRazor Tag Component
   BEM:  rhx-tag  /  rhx-tag__{label,remove}
         rhx-tag--{variant}  rhx-tag--{size}  rhx-tag--{pill,removable}
   ═══════════════════════════════════════════════════════════════ */

/* ── Base ── */
.rhx-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--rhx-space-xs);
  padding: 0.125rem var(--rhx-space-sm);
  font-family: var(--rhx-font-family);
  font-size: var(--rhx-font-size-sm);
  font-weight: var(--rhx-font-weight-medium);
  line-height: var(--rhx-line-height-tight);
  white-space: nowrap;
  vertical-align: middle;
  border: var(--rhx-border-width) solid transparent;
  border-radius: var(--rhx-radius-md);
  transition-property: background-color, border-color, opacity;
  transition-duration: var(--rhx-transition-fast);
  transition-timing-function: ease;
}

/* ── Inner elements ── */
.rhx-tag__label {
  display: inline-flex;
  align-items: center;
}

.rhx-tag__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.125rem;
  border: none;
  border-radius: var(--rhx-radius-sm);
  background: transparent;
  color: inherit;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity var(--rhx-transition-fast) ease, background-color var(--rhx-transition-fast) ease;
}

.rhx-tag__remove:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.1);
}

.rhx-tag__remove:focus-visible {
  outline: 2px solid var(--rhx-color-focus-ring);
  outline-offset: 1px;
  opacity: 1;
}

/* ══════════════════════════════════════════════════════════════
   VARIANTS
   ══════════════════════════════════════════════════════════════ */

/* ── Neutral ── */
.rhx-tag--neutral {
  background: var(--rhx-color-neutral-100);
  color: var(--rhx-color-neutral-700);
  border-color: var(--rhx-color-neutral-200);
}

/* ── Brand ── */
.rhx-tag--brand {
  background: var(--rhx-color-brand-50);
  color: var(--rhx-color-brand-700);
  border-color: var(--rhx-color-brand-200);
}

/* ── Success ── */
.rhx-tag--success {
  background: var(--rhx-color-success-50);
  color: var(--rhx-color-success-700);
  border-color: var(--rhx-color-success-200);
}

/* ── Warning ── */
.rhx-tag--warning {
  background: var(--rhx-color-warning-50);
  color: var(--rhx-color-warning-700);
  border-color: var(--rhx-color-warning-200);
}

/* ── Danger ── */
.rhx-tag--danger {
  background: var(--rhx-color-danger-50);
  color: var(--rhx-color-danger-700);
  border-color: var(--rhx-color-danger-200);
}

/* ══════════════════════════════════════════════════════════════
   SIZES
   ══════════════════════════════════════════════════════════════ */

.rhx-tag--small {
  padding: 0 var(--rhx-space-xs);
  font-size: var(--rhx-font-size-xs);
  gap: 0.125rem;
}

/* medium is the default — no modifier needed */

.rhx-tag--large {
  padding: var(--rhx-space-xs) var(--rhx-space-md);
  font-size: var(--rhx-font-size-md);
  gap: var(--rhx-space-sm);
}

/* ══════════════════════════════════════════════════════════════
   MODIFIERS
   ══════════════════════════════════════════════════════════════ */

/* ── Pill shape ── */
.rhx-tag--pill {
  border-radius: var(--rhx-radius-full);
}

/* ══════════════════════════════════════════════════════════════
   REDUCED MOTION
   ══════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  .rhx-tag {
    transition-duration: 0.01ms;
  }
}
