/* `:not([hidden])` keeps this from overriding the [hidden] attribute the
   controller toggles — otherwise the placeholder stays visible alongside the
   real content instead of being replaced by it. */
[data-c42-skeleton-placeholder]:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

[data-c42-skeleton] {
  display: block;
  background: var(--c42-color-surface, #e5e7eb);
  border-radius: var(--c42-radius-sm, 0.5rem);
  animation: c42-skeleton-pulse 1.5s ease-in-out infinite;
}

[data-c42-skeleton][data-variant='text'] {
  width: 100%;
  height: 0.75rem;
  border-radius: 0.375rem;
}

[data-c42-skeleton][data-variant='circle'] {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
}

[data-c42-skeleton][data-variant='rect'] {
  width: 100%;
  height: 6rem;
}

@keyframes c42-skeleton-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-c42-skeleton] {
    animation: none;
  }
}
