/*!
 * RH AIF Accessibility - global design-token corrections
 * WCAG 2.1 SC 1.4.3 Contrast (Minimum), Level AA
 *
 * These are the site-wide colour tokens that were failing on every page at
 * once. Fixing them here rather than element by element keeps the correction
 * in a single place and covers pages that were not part of the scan.
 *
 * Hue and saturation are preserved throughout; only lightness moves, and only
 * by the smallest amount that clears the threshold on the lightest background
 * the token is used against.
 */

/* ---------------------------------------------------------------------------
   Elementor global body-text colour
   ---------------------------------------------------------------------------
   The Elementor kit defines --e-global-color-text: #7A7A7A and applies it to
   every text-editor widget, which is what renders the article bodies on the
   blog pages. Measured against the page backgrounds actually in use:

       #7A7A7A on #FFFFFF  4.29:1   fail
       #7A7A7A on #FAF8F4  4.05:1   fail
       #7A7A7A on #F5F5F5  3.94:1   fail
       #7A7A7A on #F5EEDE  3.71:1   fail
       #7A7A7A on #EDE8DF  3.52:1   fail

   #686868 is the nearest neutral of the same hue that clears 4.5:1 on all of
   them (4.57:1 on the darkest of those tints, 5.57:1 on white).

   Only the custom property is redefined. Elementor's own rule
   (`.elementor-widget-text-editor { color: var(--e-global-color-text) }`)
   keeps its original specificity, so every page-level rule that deliberately
   colours a paragraph - the hero subheadings on the dark green bands, for
   example - still wins exactly as it does today. Adding element-level rules
   here instead would outrank those and repaint text the design had already
   set correctly.
   -------------------------------------------------------------------------- */
:root,
body.rh-a11y-on,
body.rh-a11y-on.elementor-kit-8 {
	--e-global-color-text: #686868;
}

/* ---------------------------------------------------------------------------
   Elementor global link colour on dark sections
   ---------------------------------------------------------------------------
   `.elementor-kit-8 a { color: #444444 }` outranks the page-level rules that
   colour links inside the dark green bands, so those links render at 1.26:1
   against #1E3A2F and 1.28:1 against #1A3A2A.

   The correct remedy is to let the designed colour win again rather than to
   invent a new one; that is handled per component in rh-a11y-intent.css. This
   rule only covers links that inherit their colour from a dark ancestor.
   -------------------------------------------------------------------------- */
body.rh-a11y-on .aif-footer a:not([class]),
body.rh-a11y-on .legal-band a:not([class]),
body.rh-a11y-on .aif-footer-disclaimer a:not([class]) {
	color: inherit;
	text-decoration: underline;
}

/* ---------------------------------------------------------------------------
   Non-text contrast for form and focus affordances
   WCAG 2.1 SC 1.4.11 Non-text Contrast, Level AA
   -------------------------------------------------------------------------- */
body.rh-a11y-on .aif-footer-contact-icon {
	border-color: rgba(232, 185, 74, 0.75);
}

body.rh-a11y-on .aif-footer-social-link {
	border-color: rgba(232, 185, 74, 0.7);
}
