/* ================================================================
   Jotunheim Magic — Global Theme Tokens (fallback defaults)
   Edited visually via the [jotun_style_studio] shortcode.

   Published themes are written by Jotun_Style_Studio_Css_Generator as
   `body.theme-{slug}` rules that override these defaults. This file only
   ships fallbacks so pages still render if no theme is active.

   Any page can opt-in by consuming the token names below.
   ================================================================ */

/* ---- Light (default fallback) ----------------------------------------- */
:root {
    --bg-body:       #e8e8ed;
    --bg-page:       #f0f0f0;
    --bg-card:       #ffffff;
    --border-card:   #e0e0e0;

    --text-primary:  #1a1a2e;
    --text-muted:    #6b6b8a;

    --input-bg:      #ffffff;
    --input-border:  #d0d0d8;

    --accent-from:   #667eea;
    --accent-to:     #764ba2;
    --header-text:   #ffffff;

    --surface-hover: #eef1fb;
    --border-hover:  #b8c2f5;
    --focus-ring:    rgba(102, 126, 234, 0.35);
    --link-color:    #4f5fd4;

    --notice-success: #2f7d4f;
    --notice-warning: #b8881e;
    --notice-error:   #c74646;

    /* Derived helpers (auto-adapt from the base tokens above). */
    --accent-glow:   color-mix(in srgb, var(--accent-from) 35%, transparent);
    --accent-strong: color-mix(in srgb, var(--accent-to) 85%, black 15%);
    --card-shadow:   0 4px 14px rgba(0, 0, 0, 0.08);
}

/* Consume --bg-body so the site's outer background flips with the theme.
 * Pages and sections keep using --bg-page / --bg-card for their surfaces.
 *
 * Uses `html body` descendant selectors (specificity 0,0,2) to outrank WP
 * global-styles rules (specificity 0,0,1) that hardcode body backgrounds. */
html {
    background-color: var(--bg-body, var(--bg-page, #f0f0f0));
}
html body {
    background-color: var(--bg-body, var(--bg-page, #f0f0f0));
    color: var(--text-primary, #1a1a2e);
}

/* ---- Legacy compatibility shim ----------------------------------------
 * Older code may still toggle `body.dark-mode` / `body.dark-mode-brown`
 * directly. The Style Studio CSS generator now emits those selectors as
 * aliases of `body.theme-dark-purple` / `body.theme-dark-brown` so the
 * current token values flow through automatically. No hardcoded overrides
 * live here anymore. */
