/* --- loading placeholders -----------------------------------------------
   A placeholder takes its space at once, so nothing below it moves, but only
   fades in after a beat: a load that finishes inside it shows no placeholder
   at all, and one that does not gets a soft entrance rather than a pop. */

.skeleton,
.sk {
  animation: sk-in 240ms ease-out 120ms both;
}

.sk {
  display: inline-block;
  max-width: 100%;
  width: 60%;
  height: 0.75em;
  border-radius: 999px;
  vertical-align: middle;
  /* Tinted from the ink rather than a surface token: a placeholder sits on
     the page, on a panel and on a tile, and every variant paints those
     differently, while ink contrasts with all of them. */
  --sk-base: color-mix(in srgb, var(--ink) 8%, transparent);
  --sk-glint: color-mix(in srgb, var(--ink) 15%, transparent);
  background: linear-gradient(
    90deg,
    var(--sk-base) 30%,
    var(--sk-glint) 50%,
    var(--sk-base) 70%
  );
  background-size: 300% 100%;
  animation:
    sk-in 240ms ease-out 120ms both,
    sk-shimmer 1.6s ease-in-out 120ms infinite;
}

/* A display-size heading would make a slab of a full-height bar. */
h1 .sk {
  height: 0.5em;
}

/* Fixed shapes for the cells that hold short values. */
.sk.sk-num {
  width: 1.4em;
}

.sk.sk-when {
  width: 5.5em;
}

.sk.sk-access {
  width: 6em;
}

.sk.sk-glyph {
  width: 48px;
  height: 48px;
  border-radius: 12px;
}

/* The placeholder row is not a target: no hover tint, no drag cursor. */
.row.skeleton,
.topic-card.skeleton,
.public-card.skeleton,
.identity.skeleton,
.side-link.skeleton,
.btn-link.skeleton {
  pointer-events: none;
}

@keyframes sk-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes sk-shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton,
  .sk {
    animation: sk-in 1ms 120ms both;
  }
}

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