/* ── Utilities ──────────────────────────────────────────────────
   Low-specificity helper classes. Loaded after components so
   they can override when applied. Keep this file small.
   ──────────────────────────────────────────────────────────── */

/* ── Visibility ─────────────────────────────────────────────── */

.hidden {
  display: none !important;
}

.sr-only,
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Text ───────────────────────────────────────────────────── */

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Loading ────────────────────────────────────────────────── */

.loading {
  color: var(--color-muted);
  text-align: center;
  padding: var(--space-xl);
}

.loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-skeleton {
  background: linear-gradient(
    90deg,
    var(--color-surface-raised) 25%,
    var(--color-border) 50%,
    var(--color-surface-raised) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

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

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── State classes ──────────────────────────────────────────── */

.is-active {
  color: var(--color-accent);
}

.is-open {
  display: block;
}

.is-loading {
  opacity: 0.6;
  pointer-events: none;
}

.is-visible {
  visibility: visible;
  opacity: 1;
}
