/*
Theme Name: IE Theme
Template: twentytwentyfive
Description: Informa Echo child theme — FSE, WCAG 2.1 AA, headless-ready.
             Multi-site architecture: porabimanj.info, reus.si, pozitivnaenergija.si.
             Per-site variations via IE_SITE_ID constant in wp-config.php.
Version: 0.1.0
*/

/*
 * Dark mode overrides.
 *
 * Triggered by data-theme="dark" on <html>.
 * Set by dark-mode-toggle.js (admin bar dev tool, logged-in users only).
 * Architecture matches the Astro.js toggle pattern — same attribute, same
 * localStorage key (ie-theme-mode), same JS logic. Zero migration rework.
 *
 * Why !important on background-color and color:
 * WordPress FSE outputs background-color and color as inline style attributes
 * on <body> directly from theme.json tokens. Inline styles beat all stylesheet
 * rules regardless of specificity. !important is the only working mechanism
 * in a WordPress FSE context.
 * This is a WordPress-specific constraint — remove !important in Astro.
 *
 * All dark mode hex values sourced from DESIGN_Style_ColorSystem.md §5.
 * WCAG 2.1 AA verified — all 16 pairs pass, zero failures.
 */

[data-theme="dark"] body {
    background-color: #1c1f20 !important; /* base (dark) — replaces #ffffff */
    color: #f0f0ef !important;            /* contrast (dark) — 14.54:1 on dark bg ✅ */
}

[data-theme="dark"] {

    /* ── Structural palette overrides ───────────────────────────────── */
    --wp--preset--color--base:     #1c1f20; /* Page background */
    --wp--preset--color--contrast: #f0f0ef; /* Body + heading text — 14.54:1 ✅ */
    --wp--preset--color--accent-2: #2a2d2e; /* Card / box surface — slightly lighter than bg */
    --wp--preset--color--accent-3: #9a9d9e; /* Meta text — 6.07:1 on dark bg ✅ */
    --wp--preset--color--accent-5: #7da4e0; /* Inline links — 6.52:1 on dark bg ✅ */
    /* accent-1 (#E6AE36) unchanged — 8.27:1 on dark bg ✅ */

    /* ── Footer overrides ────────────────────────────────────────────── */
    --color-footer-heading: #c8cacc; /* Lightened — 10.59:1 on footer bg ✅ */
    /* --color-footer-link, --color-footer-body, --color-footer-copyright unchanged */

    /* ── Category surface overrides — mid-tones for dark backgrounds ── */
    /* Pale tints (#D4ECF9 etc.) are unusable on dark bg — near-white on near-black.
       Mid-tones maintain category signal while passing AA with light text (#f0f0ef). */
    --color-heating-surface:    #3a6e8a; /* 4.88:1 with #f0f0ef ✅ */
    --color-cooling-surface:    #6b5a10; /* 5.95:1 with #f0f0ef ✅ */
    --color-electrical-surface: #5a3a7a; /* 7.93:1 with #f0f0ef ✅ */
    --color-mobility-surface:   #3d5a15; /* 6.89:1 with #f0f0ef ✅ */

    /* ── Button hover ────────────────────────────────────────────────── */
    /* Deepened for dark surface — 5.34:1 ✅ vs 7.4:1 in light mode */
    /* Applied via .wp-element-button:hover in theme.json CSS block */
}