/* Bozo's Theme Phase 3: readability, contrast and manual theme synchronization.
 * Scoped to article content and calculator surfaces, never WordPress admin.
 * Respect explicit calculator appearance selections in the plugin.
 */
body .cm-inner-page .wp-block-post-content :is(.wp-block-image figcaption, .wp-block-gallery figcaption, .wp-element-caption) {
  color: var(--cm-muted);
}
body .cm-content-shell .cmrc-landing {
  color: var(--cm-text);
}
body .cm-content-shell .cmrc-landing-tool-intro p:last-child {
  color: var(--cm-muted);
}
body .cm-content-shell .cmrc-landing-top-link {
  color: var(--cm-amber) !important;
}
body .cm-content-shell .cmrc-landing-index-count {
  color: #465d75;
}
body .cm-content-shell .cmrc-landing-links a > span:last-child {
  color: #526578;
}
/* The plugin's auto mode checks prefers-color-scheme; align that mode with
 * the manual light/dark toggle of Bozo's Theme without overriding its
 * administrator-chosen light/dark card modes.
 */
html[data-cm-theme="dark"] .cmrc-calculator:not(.cmrc-theme-light):not(.cmrc-theme-dark) {
  --cmrc-bg:#131f2d;
  --cmrc-text:#ecf3f8;
  --cmrc-muted:#afc0d1;
  --cmrc-border:#304459;
  --cmrc-panel:#192b3d;
  --cmrc-field:#0e1a27;
  --cmrc-accent:#ffd17f;
  --cmrc-accent-text:#ffd17f;
  --cmrc-highlight:#23384a;
  --cmrc-focus:#8ccafa;
  --cmrc-alert:#ffa6a6;
}
html[data-cm-theme="light"] .cmrc-calculator:not(.cmrc-theme-light):not(.cmrc-theme-dark) {
  --cmrc-bg:#fff;
  --cmrc-text:#192639;
  --cmrc-muted:#596777;
  --cmrc-border:#dce4ec;
  --cmrc-panel:#f3f6fa;
  --cmrc-field:#fff;
  --cmrc-accent:#bd770c;
  --cmrc-accent-text:#654005;
  --cmrc-highlight:#fff3dc;
  --cmrc-focus:#0a72b2;
  --cmrc-alert:#c33333;
}

/* Phase 4: the main theme's amber link rule overrides the dark text defined
 * by the calculator plugin on its light tool-selector tiles. Keep those
 * tiles dark-on-light regardless of the visitor's site-wide theme choice.
 */
body .cm-content-shell .cmrc-landing-index .cmrc-landing-links a {
  color: #21344a !important;
}
body .cm-content-shell .cmrc-landing-index .cmrc-landing-smallcaps {
  color: #80520b !important;
}

/* Phase 5: Calculator section labels inherited a gold that fails contrast
 * against both the default dark canvas and manually selected light canvas.
 * Bozo's Theme tokens have WCAG AA contrast in both display modes.
 */
body .cm-content-shell .cmrc-landing-tool-intro .cmrc-landing-smallcaps {
  color: var(--cm-amber) !important;
}

