/**
 * Addon follow-mode: surfaces/text follow html[data-ruh-theme] (header toggle).
 * Preserved: --rekhi-accent*, --gem-accent*, layout, animation, locked blocks.
 * Opt out: data-rekhi-scheme-lock="1" or class "rekhi-scheme-lock".
 */

/* Shared selector shorthand via grouping */
body.rekhi-addons-follow-scheme .rekhi-scheme-aware:not([data-rekhi-scheme-lock]):not(.rekhi-scheme-lock),
body.rekhi-addons-follow-scheme [data-rekhi-scheme-follow="1"]:not([data-rekhi-scheme-lock]) {
  color: var(--rekhi-text, var(--rekhi-text-primary));
}

/* ── Light: remapped surface tokens (accent left alone) ── */
html[data-ruh-theme="light"] body.rekhi-addons-follow-scheme .rekhi-scheme-aware:not([data-rekhi-scheme-lock]):not(.rekhi-scheme-lock),
html[data-ruh-theme="light"] body.rekhi-addons-follow-scheme [data-rekhi-scheme-follow="1"]:not([data-rekhi-scheme-lock]) {
  --rekhi-bg: var(--rekhi-secondary-bg) !important;
  --rekhi-text: var(--rekhi-text-primary) !important;
  --rekhi-subtitle: var(--rekhi-text-secondary) !important;
  --gem-bg: var(--rekhi-secondary-bg) !important;
  --gem-text: var(--rekhi-heading) !important;
  --gem-muted: var(--rekhi-text-secondary) !important;
  --gem-surface: var(--rekhi-surface-bg) !important;
  --gem-surface-rgb: 255, 255, 255 !important;
  background-color: var(--rekhi-bg) !important;
  color: var(--rekhi-text) !important;
}

/* ── Dark ── */
html[data-ruh-theme="dark"] body.rekhi-addons-follow-scheme .rekhi-scheme-aware:not([data-rekhi-scheme-lock]):not(.rekhi-scheme-lock),
html[data-ruh-theme="dark"] body.rekhi-addons-follow-scheme [data-rekhi-scheme-follow="1"]:not([data-rekhi-scheme-lock]) {
  --rekhi-bg: var(--rekhi-secondary-bg) !important;
  --rekhi-text: var(--rekhi-text-primary) !important;
  --rekhi-subtitle: var(--rekhi-text-secondary) !important;
  --gem-bg: var(--rekhi-secondary-bg) !important;
  --gem-text: var(--rekhi-heading) !important;
  --gem-muted: var(--rekhi-text-secondary) !important;
  --gem-surface: var(--rekhi-surface-bg) !important;
  --gem-surface-rgb: 22, 22, 31 !important;
  background-color: var(--rekhi-bg) !important;
  color: var(--rekhi-text) !important;
}

/* Titles / subtitles inside followed addons */
body.rekhi-addons-follow-scheme .rekhi-scheme-aware:not([data-rekhi-scheme-lock]) :is(
  .rekhi-hww-title,
  .rekhi-qa-title,
  .rekhi-wb-title,
  .rekhi-exp-title,
  .rekhi-mp-title,
  .rekhi-fs-title,
  .rekhi-faq-title,
  .rekhi-fp-title,
  .rekhi-ind-title,
  .rekhi-pl-title,
  .rekhi-fsh-title,
  .rekhi-materials-title,
  .rekhi-mc-title,
  .rekhi-testimonials-title,
  .rekhi-factory-tour__title
) {
  color: var(--rekhi-heading) !important;
}

body.rekhi-addons-follow-scheme .rekhi-scheme-aware:not([data-rekhi-scheme-lock]) :is(
  .rekhi-hww-subtitle,
  .rekhi-qa-subtitle,
  .rekhi-wb-subtitle,
  .rekhi-exp-subtitle,
  .rekhi-mp-subtitle,
  .rekhi-fs-subtitle,
  .rekhi-faq-subtitle,
  .rekhi-factory-tour__subtitle
) {
  color: var(--rekhi-subtitle, var(--rekhi-text-secondary)) !important;
}

/* Glass cards — follow glass tokens; accent icons/borders keep --rekhi-accent */
body.rekhi-addons-follow-scheme .rekhi-scheme-aware:not([data-rekhi-scheme-lock]) :is(
  .rekhi-glass,
  .rekhi-hww-glass-card,
  .rekhi-qa-glass,
  .rekhi-wb-glass,
  .rekhi-qa-trust-glass,
  .rekhi-exp-map-glass,
  .rekhi-stat-card.rekhi-glass,
  .rekhi-cert-card.rekhi-glass,
  .rekhi-rfq-cta--glass
) {
  background: var(--rekhi-glass-surface-bg) !important;
  border-color: var(--rekhi-glass-border) !important;
  box-shadow: var(--rekhi-glass-shadow) !important;
  color: var(--rekhi-text-primary);
}

body.rekhi-addons-follow-scheme .rekhi-scheme-aware:not([data-rekhi-scheme-lock]) :is(
  .rekhi-stat-card__label,
  .rekhi-cert-card__desc,
  .rekhi-qa-card-desc,
  .rekhi-wb-card-desc,
  .rekhi-hww-step-desc,
  .rekhi-exp-map-name
) {
  color: var(--rekhi-text-secondary) !important;
}

/* Product / category cards */
body.rekhi-addons-follow-scheme .rekhi-pp-card:not([data-rekhi-scheme-lock]) {
  background: var(--rekhi-surface-bg) !important;
  border-color: var(--rekhi-border) !important;
  color: var(--rekhi-text-primary);
}

/* Home bands stay transparent so page bg follows scheme */
body.rekhi-addons-follow-scheme .rekhi-home-section {
  background: transparent;
  color: var(--rekhi-text-primary);
}

/* Live chat */
html[data-ruh-theme="light"] body.rekhi-addons-follow-scheme .rekhi-live-chat:not([data-rekhi-scheme-lock]) {
  --rekhi-chat-bg: #ffffff;
  --rekhi-chat-text: #111111;
}
html[data-ruh-theme="dark"] body.rekhi-addons-follow-scheme .rekhi-live-chat:not([data-rekhi-scheme-lock]) {
  --rekhi-chat-bg: #12121a;
  --rekhi-chat-text: #f5f5f5;
}

/*
 * Accent preservation note:
 * Do NOT redefine --rekhi-accent / --gem-accent / --accent here.
 * Inline style accents from each addon’s settings panel remain authoritative.
 */
