/* shared/skeleton.css — Cerebro DS loading primitives (D1 §4 + amendments).

   Placement follows v1.16: .c-skeleton base + shimmer live in
   components.css/motion.css; this file carries the §4 rules that v1.16
   lacked — shape variants (P-11), indeterminate progress (P-10), the
   composite section loader (G4), and layout-shift prevention utilities
   (§4.4). Minimum display time (~400ms) is a runtime concern — see
   CerebroUI.minDisplay() in shared/ds.js.

   Geometry choices for data-shape are D1-silent; values below mirror the
   primitives they stand in for (.c-avatar 28/36px, .c-list-row 44px,
   media 16:9) so swaps stay CLS-free per §4.4. */

/* ---- P-11: skeleton shapes (base .c-skeleton = 9px text line) ---- */
.c-skeleton[data-shape=block] { width:100%; height:auto; min-height:var(--c-space-48); border-radius:var(--c-radius-group); }
.c-skeleton[data-shape=circle] { width:28px; height:28px; border-radius:50%; }
.c-skeleton[data-shape=circle][data-size=lg] { width:36px; height:36px; }
.c-skeleton[data-shape=media] { width:100%; height:auto; aspect-ratio:16/9; border-radius:var(--c-radius-group); }

/* ---- P-10: indeterminate progress — sliding segment for waits of
   unknown length (exports, imports). Transform-only per H1; reuses the
   loader-loop timing token (D1 gives no separate indeterminate duration). */
.c-progress[data-indeterminate]>span { width:40%; animation:c-progress-indeterminate var(--c-motion-shimmer) linear infinite; }
@keyframes c-progress-indeterminate { 0% { transform:translateX(-100%); } 100% { transform:translateX(250%); } }

/* ---- G4: section-level loader — spinner is aria-hidden; the visible
   「読み込み中」 text carries role=status semantics in markup:
   <span class="c-loader" role="status"><span class="c-spinner" aria-hidden="true"></span>読み込み中</span> */
.c-loader { display:inline-flex; align-items:center; gap:var(--c-space-8); color:var(--c-text-secondary); font-size:var(--c-type-meta); }
.c-loader>.c-spinner { color:var(--c-text-muted); }

/* ---- §4.4 layout-shift prevention utilities ----
   Reserve the final box before async content arrives. */
.c-skeleton { display:block; }
.c-ratio-16x9 { aspect-ratio:16/9; }
.c-ratio-4x3 { aspect-ratio:4/3; }
.c-ratio-1x1 { aspect-ratio:1/1; }

/* Media frame: skeleton and content share one absolutely-positioned box;
   the frame's aspect-ratio (or fixed height) reserves space up front. */
.c-skel-frame { position:relative; }
.c-skel-frame>.c-skeleton[data-shape=media] { position:absolute; inset:0; width:100%; height:100%; aspect-ratio:auto; }
.c-skel-content { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; opacity:0; transition:opacity var(--c-motion-fast) ease; }
.c-skel-content.is-loaded { opacity:1; }
