/*
 * developments/css/dev-states.css — D76.H canonical state-template visuals.
 *
 * Visual treatment for the three states emitted by dev-states.js:
 * empty (editorial muted), error (status-error tinted), loading
 * (skeleton shimmer). All tokens from _tokens.css.
 *
 * Mode-wrapping (.panel-section--state vs .lens--state) inherits its
 * own context's spacing from devmap.css / project-panel-lenses.css;
 * dev-states.css only styles the inner .dev-state block.
 */

.dev-state {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
}
.dev-state__title {
  font: var(--weight-medium) var(--text-md)/1.3 var(--font-display);
  color: var(--ink-1);
  letter-spacing: -0.005em;
}
.dev-state__body {
  font: var(--weight-regular) var(--text-base)/1.5 var(--font-body);
  color: var(--ink-2);
  margin: 0;
  white-space: pre-line; /* preserve newlines passed by the caller */
}
.dev-state__action {
  align-self: start;
  margin-top: var(--space-1);
  font: var(--weight-medium) var(--text-sm)/1.2 var(--font-body);
  color: var(--gold-dark);
  background: transparent;
  border: 1px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  text-decoration: none;
  transition:
    background-color var(--duration-base) var(--ease-out),
    color var(--duration-base) var(--ease-out);
}
.dev-state__action:hover,
.dev-state__action:focus-visible {
  background: var(--gold-faint);
}

/* ── Empty ─────────────────────────────────────────────────────────── */
.dev-state--empty .dev-state__title { color: var(--ink-1); }
.dev-state--empty .dev-state__body  { color: var(--ink-3); }

/* ── Error ─────────────────────────────────────────────────────────── */
.dev-state--error .dev-state__title { color: var(--status-error); }
.dev-state--error .dev-state__body  { color: var(--ink-2); }

/* ── Loading skeleton ──────────────────────────────────────────────── */
.dev-state--loading { gap: var(--space-2); }
.dev-state__skel-row {
  height: 12px;
  background: linear-gradient(
    90deg,
    var(--surface-2) 0%,
    var(--bg-sunken) 40%,
    var(--surface-2) 80%
  );
  background-size: 200% 100%;
  border-radius: var(--radius-sm);
  animation: dev-state-shimmer 1300ms var(--ease-in-out) infinite;
}
.dev-state__skel-row--full  { width: 100%; }
.dev-state__skel-row--mid   { width: 70%; }
.dev-state__skel-row--short { width: 40%; }
@keyframes dev-state-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Reduced motion ────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .dev-state__skel-row {
    animation: none;
    background: var(--surface-2);
    opacity: 0.7;
  }
}

/* ── Mode wrappers ─────────────────────────────────────────────────── */
/* Section mode reuses the panel-section box; nothing extra to style. */

/* Lens mode: drop the default lens__header padding since the inner
   .dev-state already provides spacing. */
.lens--state {
  padding: 0;
}

/* When a lens or panel-section uses the state wrapper, neutralize the
   default cursor: pointer the panel-section uses (these states aren't
   clickable as a whole). */
.panel-section--state { cursor: default; }
