/* Shared placeholders for content that is waiting on a page request. */
.tmm-skeleton {
  position: relative;
  display: block;
  width: 100%;
  min-height: 1rem;
  overflow: hidden;
  border-radius: .5rem;
  background: #e2e8f0;
  color: transparent;
  pointer-events: none;
}

.tmm-skeleton::after {
  position: absolute;
  inset: 0;
  content: '';
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .65), transparent);
  transform: translateX(-100%);
  animation: tmm-skeleton-shimmer 1.4s ease-in-out infinite;
}

.tmm-skeleton--text { height: .75rem; min-height: 0; }
.tmm-skeleton--title { height: 1.5rem; min-height: 0; }
.tmm-skeleton--card { height: 6rem; }
.tmm-skeleton--row { height: 2.75rem; }
.tmm-skeleton--circle { aspect-ratio: 1; border-radius: 50%; }
.tmm-skeleton-inline {
  display: inline-block;
  width: 8rem;
  min-height: 1em;
  color: transparent !important;
}

.tmm-skeleton-table-cell { padding: .75rem 1rem; }
.tmm-skeleton-table-lines {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.25fr) minmax(0, .8fr);
  align-items: center;
  gap: 1.25rem;
  min-height: 1.5rem;
}
.tmm-skeleton-table-lines .tmm-skeleton:nth-child(2) { width: 85%; }
.tmm-skeleton-table-lines .tmm-skeleton:nth-child(3) { width: 65%; }

html.dark .tmm-skeleton { background: #334155; }
html.dark .tmm-skeleton::after {
  background: linear-gradient(90deg, transparent, rgba(148, 163, 184, .18), transparent);
}

.tmm-button-loading-content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
}

.tmm-button-spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  flex: none;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: tmm-button-spin .75s linear infinite;
}

@keyframes tmm-skeleton-shimmer {
  to { transform: translateX(100%); }
}

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

@media (prefers-reduced-motion: reduce) {
  .tmm-skeleton::after,
  .tmm-button-spinner { animation: none; }
}
