/**
 * Spinner - Loading indicator styles
 * @countermeasure/web-components/primitives/spinner
 */

.cmm-spinner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cmm-spinner__circle {
  display: block;
  border: 2px solid hsl(var(--muted));
  border-top-color: hsl(var(--primary));
  border-radius: 50%;
  animation: cmm-spin 0.6s linear infinite;
}

@keyframes cmm-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Size variants */
.cmm-spinner--sm .cmm-spinner__circle {
  width: 16px;
  height: 16px;
}

.cmm-spinner--md .cmm-spinner__circle {
  width: 24px;
  height: 24px;
}

.cmm-spinner--lg .cmm-spinner__circle {
  width: 40px;
  height: 40px;
}

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