/* ==========================================================================
   LOADING (.verser-loading): what a box shows while its content loads. CSS only.

   Content loading (lists, cards, panes) uses the skeleton (the lead, 2 Nov; it replaced the uppercase "LOADING ..."
   word over a bar app-wide): data-variant="skeleton", placeholders in the final shape of what is loading, so nothing
   moves when the content lands. Children: .verser-skeleton with data-shape line (default) | title | circle | row | card;
   --w sets a line's width (e.g. style="--w:60%"). A soft light crosses each one (1.2s, linear, by transform); under
   reduced motion they stay still. A .verser-loading-label inside is read by screen readers only, in sentence case:
   give the box role="status" and the placeholders aria-hidden="true". workspace.js setLoading builds it for every list.

     data-variant  skeleton  the content look above
                   inline    a short track inside a line of text (a value still loading), no word; 3em, sits on the
                             line; hide it from screen readers (aria-hidden="true")
     (none)                  the older word-over-bar look (option D, 28 Oct): kept for a box with no shape to copy;
                             hide it from screen readers (aria-hidden="true")

   Put aria-busy="true" on the region that is loading.
   ========================================================================== */

.verser-loading{
  box-sizing:border-box;display:grid;place-items:center;align-content:center;gap:var(--verser-loading-gap,12px);
  inline-size:100%;min-block-size:var(--verser-loading-min-block-size,120px);padding:var(--space-4)
}
.verser-loading-label{
  margin:0;font:var(--verser-loading-label-weight,500) var(--verser-loading-label-size,11px)/1.2 var(--font-mono);
  letter-spacing:var(--verser-loading-label-tracking,.12em);text-transform:uppercase;text-align:center;
  color:var(--verser-loading-label-color,var(--text-secondary))
}
.verser-loading-label:is(:lang(ar),:dir(rtl)){font-family:var(--font-mono-rtl);letter-spacing:0;text-transform:none}   /* JetBrains Mono has no Arabic: Plex Arabic first */
.verser-loading-bar,.verser-loading[data-variant="inline"]{
  display:block;inline-size:var(--verser-loading-bar-width,min(160px,45%));block-size:var(--verser-loading-bar-height,3px);
  border-radius:var(--radius-pill);
  background:var(--verser-loading-light,linear-gradient(90deg,transparent,var(--brand-from),var(--brand-to),transparent)) no-repeat,
             var(--verser-loading-track,var(--surface-fill-2));
  background-size:45% 100%,100% 100%;
  animation:verser-loading-sweep var(--verser-loading-duration,1.2s) cubic-bezier(.4,0,.2,1) infinite
}
.verser-loading[data-variant="inline"]{
  display:inline-block;inline-size:var(--verser-loading-inline-width,3em);min-block-size:0;padding:0;vertical-align:middle
}
/* A line that is itself loading (a state line under its heading, setLoading kind 'line' alone in its box): the track
   is the bar's width, at the start of the line, so the cue reads where the words will come; inside a sentence it stays
   the short 3em value. */
.verser-loading[data-variant="inline"]:only-child{inline-size:var(--verser-loading-bar-width,min(160px,45%))}
/* Arabic: the light sweeps from the start of the line, right to left, leading with the same brand colour. */
[dir="rtl"] :is(.verser-loading-bar,.verser-loading[data-variant="inline"]){
  --verser-loading-light:linear-gradient(270deg,transparent,var(--brand-from),var(--brand-to),transparent);animation-direction:reverse
}
@keyframes verser-loading-sweep{from{background-position:-70% 0,0 0}to{background-position:170% 0,0 0}}
@keyframes verser-loading-fade{50%{opacity:.4}}

/* ---- Skeleton (data-variant="skeleton", opt-in, 2 Nov) ---- */
.verser-loading[data-variant="skeleton"]{
  position:relative;display:grid;place-items:stretch;align-content:start;gap:var(--verser-skeleton-gap,var(--space-3));
  min-block-size:0;padding:0
}
.verser-loading[data-variant="skeleton"] .verser-loading-label{
  position:absolute;inline-size:1px;block-size:1px;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;
  text-transform:none;letter-spacing:0
}
.verser-skeleton{
  --_verser-skeleton-dir:1;
  position:relative;display:block;overflow:hidden;
  inline-size:var(--w,100%);block-size:var(--verser-skeleton-line-height,12px);
  border-radius:var(--verser-skeleton-radius,var(--radius-3xs));background:var(--verser-skeleton-fill,var(--surface-fill-1))
}
.verser-skeleton:dir(rtl){--_verser-skeleton-dir:-1}
.verser-skeleton[data-shape="title"]{inline-size:var(--w,40%);block-size:var(--font-size-heading)}
.verser-skeleton[data-shape="circle"]{inline-size:var(--w,var(--verser-avatar-size,44px));block-size:var(--w,var(--verser-avatar-size,44px));border-radius:var(--radius-round)}
.verser-skeleton[data-shape="row"]{block-size:var(--verser-skeleton-row-height);border-radius:var(--radius-sm)}
.verser-skeleton[data-shape="card"]{
  block-size:var(--verser-skeleton-card-height);border:var(--border-width) solid var(--vx-hair);border-radius:var(--vx-r-lg);
  background:var(--surface-gloss),var(--surface-panel)
}
/* The light crosses by transform only, linear (constant motion), start to end of the line in either direction. */
.verser-skeleton::after{
  content:"";position:absolute;inset:0;
  background:linear-gradient(90deg,transparent,var(--verser-skeleton-shine,var(--verser-white-a06)),transparent);
  transform:translateX(calc(-100% * var(--_verser-skeleton-dir)));
  animation:verser-skeleton-shine var(--verser-skeleton-duration,1.2s) linear infinite
}
@keyframes verser-skeleton-shine{to{transform:translateX(calc(100% * var(--_verser-skeleton-dir)))}}
@media (prefers-reduced-motion:reduce){
  :is(.verser-loading-bar,.verser-loading[data-variant="inline"]){background-position:50% 0,0 0;animation:verser-loading-fade 1.6s ease-in-out infinite}
  .verser-skeleton::after{animation:none;opacity:0}
}
