/*
 * Elding Nordic Workspace — proposed design tokens v1.0
 * Prepared 2026-09-14. Reference specification, not a deployed stylesheet.
 * Apply only to an owned application root: <div data-elding-ui>…</div>.
 * Portals/overlays must receive the same scoped root/theme attributes.
 * No global reset, WordPress admin overrides, remote fonts, or logo recoloring.
 * Brand red deliberately has no invented hex value; retain the approved logo.
 */
[data-elding-ui] {
  color-scheme: light;

  --en-canvas: #f5f6f7;
  --en-surface: #ffffff;
  --en-surface-subtle: #f8f9fa;
  --en-surface-muted: #f0f2f4;
  --en-text: #1c2430;
  --en-text-muted: #5e6976;
  --en-border-decorative: #d9dee3;
  --en-border-control: #7b8794;

  --en-nav: #202a36;
  --en-nav-hover: #2b3643;
  --en-nav-text: #ffffff;
  --en-nav-text-muted: #c7d0da;

  --en-action: #4e647f;
  --en-action-hover: #3f536c;
  --en-action-text: #ffffff;
  --en-selection-bg: #e9eef4;
  --en-selection-text: #3f536c;
  --en-focus: #355f88;
  --en-focus-on-dark: #b8d8ff;

  --en-success-text: #356648;
  --en-success-bg: #edf6ef;
  --en-info-text: #355f88;
  --en-info-bg: #edf3fa;
  --en-warning-text: #855500;
  --en-warning-bg: #fff5df;
  --en-danger-text: #a93c3c;
  --en-danger-bg: #fdeeee;
  --en-neutral-text: #5e6976;
  --en-neutral-bg: #f0f2f4;

  --en-font-ui: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  --en-font-mono: ui-monospace, SFMono-Regular, Consolas, monospace;
  --en-font-metadata: 0.75rem;
  --en-font-label: 0.8125rem;
  --en-font-control: 0.875rem;
  --en-font-body: 0.9375rem;
  --en-font-section: 1.125rem;
  --en-font-title: 1.625rem;
  --en-line-height: 1.5;

  --en-space-1: 0.25rem;
  --en-space-2: 0.5rem;
  --en-space-3: 0.75rem;
  --en-space-4: 1rem;
  --en-space-5: 1.5rem;
  --en-space-6: 2rem;
  --en-space-7: 3rem;

  --en-radius-control: 0.375rem;
  --en-radius-panel: 0.625rem;
  --en-radius-overlay: 0.75rem;
  --en-control-height: 2.25rem;
  --en-row-height: 3rem;
  --en-touch-target: 2.75rem;
  --en-page-padding: 1.5rem;
  --en-nav-width: 15rem;
  --en-inspector-width: 25rem;

  --en-shadow-surface: 0 1px 2px rgb(28 36 48 / 6%);
  --en-shadow-overlay: 0 8px 24px rgb(28 36 48 / 12%);
  --en-motion-fast: 120ms;
  --en-motion-standard: 180ms;
  --en-motion-easing: cubic-bezier(0.2, 0, 0, 1);
}

/* Optional density mode: same hierarchy and target-size policy. */
[data-elding-ui][data-density="compact"] {
  --en-row-height: 2.5rem;
  --en-page-padding: 1rem;
}

/* Default palette must already pass accessibility checks. This is additional. */
[data-elding-ui][data-contrast="high"] {
  --en-text: #111923;
  --en-text-muted: #394654;
  --en-border-decorative: #77828e;
  --en-border-control: #46515e;
  --en-action: #3f536c;
}

@media (prefers-reduced-motion: reduce) {
  [data-elding-ui] {
    --en-motion-fast: 0ms;
    --en-motion-standard: 0ms;
  }
}

/* Contrast checks using WCAG relative luminance; ratios are rounded for display:
 * Action text white / action blue: 6.08:1.
 * Success text / success background: 6.05:1.
 * Information text / information background: 5.98:1.
 * Warning text / warning background: 5.88:1.
 * Danger text / danger background: 5.48:1.
 * Muted text / canvas: 5.16:1.
 * Control border / white surface: 3.66:1.
 * These are token-pair checks, not a full interface accessibility audit.
 */
