/* Permanent MarketCam text policy. Shared by front end and block editor.
 * Layout styles and image/logo pixels remain untouched.
 * New custom strong-color surfaces use mc-surface-dark; light nested surfaces
 * use mc-surface-light. WordPress palette background classes work automatically.
 * !important is intentional here: the site-wide policy must outrank legacy
 * component colors and WordPress's generated text-palette utility rules.
 */
:root,
.editor-styles-wrapper {
  --mc-text-color: #000000;
  --mc-emphasis-color: #FF0084;
  --mc-pink: #FF0084;
}
body,
.editor-styles-wrapper {
  color: #000000;
  font-weight: 400;
}

/* Text weight is a site-wide role, independent of component size or color. */
:is(.wp-site-blocks, .editor-styles-wrapper)
:is(p,li,dt,dd,blockquote,figcaption,caption,td,input,textarea,select) {
  font-weight: 400 !important;
}
:is(.wp-site-blocks, .editor-styles-wrapper)
:is(strong,b,.has-bold-font-weight) {
  font-weight: inherit !important;
}
:is(.wp-site-blocks, .editor-styles-wrapper)
:is(h1,h2,h3,h4,h5,h6,.mc-title,.mc-subtitle,.mc-card-title,.mc-feature-title,
    .mc-buying-published,.mc-buying-transition p,.mc-buying-more,.mc-buying-equity,
    .mc-buying-formats span,.mc-buying-actions span,
    .marketcam-evidence-eyebrow,.marketcam-evidence-number,.marketcam-evidence-label,
    .marketcam-work-label,.wp-block-post-title,.wp-block-query-title,
    .wp-block-site-title,.wp-block-navigation-item,.wp-block-navigation-item__content,
    .wp-element-button,.wp-block-button__link,.mc-ai-example-cta,.mc-report-tabs button) {
  font-weight: 600 !important;
}
:is(.wp-site-blocks, .editor-styles-wrapper)
:is(h1,h2,h3,h4,h5,h6,.mc-title,.mc-subtitle,.mc-card-title,.mc-feature-title)
:is(span,strong,b,em,mark,.has-bold-font-weight) {
  font-weight: 600 !important;
}

/* Text elements inherit the nearest surface's text token. Decorative SVGs and
 * aria-hidden icon content retain their existing approved colors. */
:is(.wp-site-blocks, .editor-styles-wrapper)
:is(h1,h2,h3,h4,h5,h6,p,li,dt,dd,blockquote,figcaption,caption,th,td,label,legend,summary,small,a,button,input,textarea,select):not(svg):not(svg *):not([aria-hidden="true"]):not([aria-hidden="true"] *) {
  color: var(--mc-text-color, #000000) !important;
  -webkit-text-fill-color: currentColor;
}
:is(.wp-site-blocks, .editor-styles-wrapper)
:is(h1,h2,h3,h4,h5,h6,p,li,dt,dd,blockquote,figcaption,caption,th,td,label,legend,summary,a,button)
:is(span,strong,em,b,i,small,mark):not(svg):not(svg *):not([aria-hidden="true"]):not([aria-hidden="true"] *) {
  color: var(--mc-text-color, #000000) !important;
  -webkit-text-fill-color: currentColor;
}

/* Strong surfaces: existing controls plus reusable site/editor surface classes.
 * Variables inherit into every depth of nested text, including hover states. */
:is(.wp-site-blocks, .editor-styles-wrapper)
:is(.mc-surface-dark,.has-pink-background-color,.has-navy-background-color,
    .has-black-background-color,.has-ink-background-color,
    .wp-element-button,.wp-block-button__link,.mc-ai-example-cta,.mc-step-number) {
  --mc-text-color: #FFFFFF;
  --mc-emphasis-color: #FFFFFF;
  color: #FFFFFF !important;
  -webkit-text-fill-color: currentColor;
}

/* Restore black within a light card nested inside a strong surface. */
:is(.wp-site-blocks, .editor-styles-wrapper)
:is(.mc-surface-light,.has-white-background-color) {
  --mc-text-color: #000000;
  --mc-emphasis-color: #FF0084;
  color: #000000 !important;
}

/* Pink is opt-in inline emphasis, never an automatically recolored headline.
 * On strong backgrounds the same emphasis token resolves to white. */
:is(.wp-site-blocks, .editor-styles-wrapper)
:is(h1,h2,h3,h4,h5,h6,.mc-subtitle)
:is(.mc-emphasis,.has-pink-color) {
  color: var(--mc-emphasis-color, #FF0084) !important;
  -webkit-text-fill-color: currentColor;
}
