/* ==========================================================================
   .tp-skeleton — P1.F2.T3
   ©2026 Vexstorm Studios – All Rights Reserved

   A loading placeholder for the two surfaces that genuinely fetch after first
   paint: a chart waiting on its data and a table waiting on a filtered page.

   Variants   --text  --heading  --block  --circle  --table-row
   Elements   __line
   States     (none — a skeleton has no interactive state by definition)

   Two accessibility rules are built in:

   1. The shimmer is decoration. Under prefers-reduced-motion the animation is
      cancelled by the blanket in utilities.css and the placeholder becomes a
      flat block — still visible, still the right shape, simply still (ACC-005).
      That is why the resting state is a solid surface colour rather than the
      midpoint of a gradient: with the animation removed, the flat state must
      already look deliberate.

   2. A skeleton is aria-hidden in the template and sits inside a container
      marked aria-busy="true", so assistive technology is told "loading" once
      instead of reading a dozen empty boxes.
   ========================================================================== */

.tp-skeleton {
  display: block;
  border-radius: var(--tp-radius-sm);
  background-color: var(--tp-color-surface-sunken);
  /* The travelling highlight. The gradient's colours are tokens, so the
     shimmer is correct in dark without a second rule. */
  background-image: linear-gradient(
    90deg,
    transparent 0%,
    var(--tp-color-border-subtle) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  background-repeat: no-repeat;
  animation: tp-skeleton-shimmer var(--tp-motion-duration-slow) linear infinite;
  /* Nothing inside a skeleton is real content. */
  user-select: none;
}

/* --------------------------------------------------------------------------
   Shapes
   -------------------------------------------------------------------------- */

.tp-skeleton--text {
  height: var(--tp-space-4);
  margin-block: var(--tp-space-1);
}

.tp-skeleton--heading {
  height: var(--tp-space-6);
  width: 40%;
  margin-block: var(--tp-space-2);
}

.tp-skeleton--block {
  height: var(--tp-space-11);
  border-radius: var(--tp-radius-md);
}

.tp-skeleton--circle {
  width: var(--tp-space-7);
  height: var(--tp-space-7);
  border-radius: var(--tp-radius-pill);
}

.tp-skeleton--table-row {
  height: var(--tp-space-7);
  margin-block: var(--tp-space-1);
}

/* --------------------------------------------------------------------------
   Lines — a paragraph of placeholder text needs a ragged last line, or it
   reads as a solid block rather than as text.
   -------------------------------------------------------------------------- */

.tp-skeleton__line {
  display: block;
  height: var(--tp-space-4);
  margin-block: var(--tp-space-2);
  border-radius: var(--tp-radius-sm);
  background-color: var(--tp-color-surface-sunken);
}

.tp-skeleton__line:last-child {
  width: 60%;
}

/* --------------------------------------------------------------------------
   Motion
   -------------------------------------------------------------------------- */

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

  to {
    background-position: -200% 0;
  }
}

/* Belt and braces alongside the blanket in utilities.css: with motion reduced,
   remove the gradient entirely so no partially-painted highlight is left
   frozen mid-sweep. */
@media (prefers-reduced-motion: reduce) {
  .tp-skeleton {
    background-image: none;
    animation: none;
  }
}
