/* Route Manager public theme variables
   Maps WordPress Theme JSON presets and Elementor globals (if present)
   to Route Manager CSS custom properties with sensible fallbacks.
*/
:root {
  /* Colors */
  --rm-color-primary: var(--wp--preset--color--primary, var(--e-global-color-primary, #0073aa));
  --rm-color-secondary: var(--wp--preset--color--secondary, var(--e-global-color-secondary, #54595F));
  --rm-color-text: var(--wp--preset--color--foreground, var(--e-global-color-text, #2c3e50));
  --rm-color-muted: var(--wp--preset--color--muted, #666666);
  --rm-color-bg: var(--wp--preset--color--background, #ffffff);
  --rm-color-surface: var(--wp--preset--color--surface, #f8f9fa);
  --rm-color-border: var(--wp--preset--color--border, #e1e1e1);
  --rm-color-accent: var(--wp--preset--color--accent, var(--e-global-color-accent, #61CE70));
  --rm-color-info: #0c5460;
  --rm-color-success: #1b5e20;
  --rm-color-success-bg: #e8f5e9;
  --rm-color-error: #b71c1c;
  --rm-color-error-bg: #ffebee;
  --rm-color-warning: #856404;
  --rm-color-warning-bg: #fff3cd;
  --rm-color-link: var(--wp--preset--color--link, #0a66c2);

  /* Typography */
  --rm-typography-primary: var(--wp--preset--font-family--primary, var(--e-global-typography-primary-font-family, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif));
  --rm-typography-primary-weight: var(--e-global-typography-primary-font-weight, 600);
  --rm-typography-secondary: var(--wp--preset--font-family--secondary, var(--e-global-typography-secondary-font-family, var(--rm-typography-primary)));
  --rm-typography-secondary-weight: var(--e-global-typography-secondary-font-weight, 400);
  --rm-typography-text: var(--wp--preset--font-family--body, var(--e-global-typography-text-font-family, var(--rm-typography-primary)));
  --rm-typography-text-weight: var(--e-global-typography-text-font-weight, 400);
  --rm-typography-accent: var(--wp--preset--font-family--accent, var(--e-global-typography-accent-font-family, var(--rm-typography-primary)));
  --rm-typography-accent-weight: var(--e-global-typography-accent-font-weight, 500);

  /* Radii and spacing tokens to help blending into themes */
  --rm-radius-sm: 4px;
  --rm-radius-md: 6px;
  --rm-radius-lg: 8px;
  --rm-shadow-sm: 0 1px 2px rgba(0,0,0,.06);
  --rm-shadow-md: 0 2px 10px rgba(0,0,0,.08);
}

/* Scope Route Manager containers to theme typography by default */
.rm-container,
.rm-container * {
  font-family: var(--rm-typography-text);
}

/* Headings within RM blocks follow primary/secondary typography */
.rm-container h1, .rm-container h2, .rm-container h3,
.rm-container h4, .rm-container h5, .rm-container h6 {
  font-family: var(--rm-typography-primary);
  font-weight: var(--rm-typography-primary-weight);
  color: var(--rm-color-text);
}

/* Font utility classes (used by TinyMCE Styles dropdown) */
.rm-font-text { font-family: var(--rm-typography-text); font-weight: var(--rm-typography-text-weight); }
.rm-font-primary { font-family: var(--rm-typography-primary); font-weight: var(--rm-typography-primary-weight); }
.rm-font-secondary { font-family: var(--rm-typography-secondary); font-weight: var(--rm-typography-secondary-weight); }
.rm-font-accent { font-family: var(--rm-typography-accent); font-weight: var(--rm-typography-accent-weight); }
.rm-font-serif { font-family: Georgia, "Times New Roman", serif; }
.rm-font-sans { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.rm-font-mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }
