/*
 * Kai Securities — Accessibility Remediation (CSS)
 * Loaded by kai-accessibility-remediation.php
 *
 * Covers:
 *   - color-contrast backup (in case the failing colour is set via an inline style attribute)
 *   - distinguishable-link (SC 1.4.1) — underline inline text links
 *   - visible keyboard focus indicator (SC 2.4.7, defensive)
 *   - .kai-sr-only visually-hidden utility used by the JS long-descriptions
 */

/* ------------------------------------------------------------------ *
 * A) COLOR CONTRAST (SC 1.4.3) — footer text.
 *
 *    Root cause: the footer template (post-138) colours its text
 *    #FFFFFF8A (white at 54% alpha). Over the #444444 footer background
 *    this composites to ~rgb(169,169,169) = #a9a9a9 = 4.14:1 (fails 4.5:1).
 *    axe reports the *computed* colour, which is why the hex #a9a9a9 does
 *    not appear anywhere in source.
 *
 *    Fix: override every footer selector that declares #FFFFFF8A with a
 *    solid #C0C0C0 (= 5.35:1 on #444444, passes AA for normal text) using
 *    !important. Specificity is raised on the .email link because its
 *    original rule is itself !important.
 *
 *    These 10 selectors are the exact ones declaring #FFFFFF8A in
 *    post-138.css (they cover all 135 flagged footer elements).
 * ------------------------------------------------------------------ */
.elementor-138 .elementor-element.elementor-element-de457ff,
.elementor-138 .elementor-element.elementor-element-1a0140d,
.elementor-138 .elementor-element.elementor-element-0bd8834,
.elementor-138 .elementor-element.elementor-element-8774a17,
.elementor-138 .elementor-element.elementor-element-d662fca,
.elementor-138 .elementor-element.elementor-element-bfdb484,
.elementor-138 .elementor-element.elementor-element-6cd5104,
.elementor-138 .elementor-element.elementor-element-d678ede .elementor-icon-list-text,
.elementor-138 .elementor-element.elementor-element-8258048 .elementor-icon-list-text,
/* links inside those widgets that merely inherit the muted colour.
   (#c0c0c0 still passes even for the otherwise-white .adit link.) */
.elementor-138 .elementor-element.elementor-element-de457ff a,
.elementor-138 .elementor-element.elementor-element-1a0140d a,
.elementor-138 .elementor-element.elementor-element-0bd8834 a,
.elementor-138 .elementor-element.elementor-element-8774a17 a,
.elementor-138 .elementor-element.elementor-element-bfdb484 a,
.elementor-138 .elementor-element.elementor-element-6cd5104 a,
.elementor-138 .elementor-element.elementor-element-d678ede .elementor-icon-list-text a,
.elementor-138 .elementor-element.elementor-element-8258048 .elementor-icon-list-text a {
	color: #c0c0c0 !important;
}

/* The email link's source rule is `.email a { color:#FFFFFF8A !important }`,
   so beat it with higher specificity + !important. */
.elementor-138 .elementor-element.elementor-element-d662fca .email a,
.elementor-138 .elementor-widget-container .email a {
	color: #c0c0c0 !important;
}

/* ------------------------------------------------------------------ *
 * B) DISTINGUISHABLE LINKS (SC 1.4.1)
 *    Inline text links inside content must not rely on colour alone.
 *    Scope to in-paragraph / content links only so buttons, menus, icon
 *    lists and image links (which are visually distinct already) are
 *    left untouched.
 * ------------------------------------------------------------------ */
.elementor-widget-text-editor p a:not(.elementor-button),
.elementor-widget-theme-post-content p a:not(.elementor-button),
.elementor-widget-text-editor li a:not(.elementor-button),
.elementor-widget-theme-post-content li a:not(.elementor-button),
.elementor-widget-text-editor td a:not(.elementor-button),
.elementor-widget-theme-post-content td a:not(.elementor-button) {
	text-decoration: underline;
}

/* Explicit external links flagged by the audit (appear only in body copy). */
a[href*="scores.sebi.gov.in"],
a[target="_new"][href*="aisecurities.com" i] {
	text-decoration: underline !important;
}

/* ------------------------------------------------------------------ *
 * C) VISIBLE FOCUS INDICATOR (SC 2.4.7) — additive, never hides focus.
 * ------------------------------------------------------------------ */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible,
[role="button"]:focus-visible,
[role="link"]:focus-visible {
	outline: 2px solid #0b3d91 !important;
	outline-offset: 2px !important;
}

/* On the dark footer (#444444), use a light outline for adequate contrast. */
footer :focus-visible,
.elementor-location-footer :focus-visible,
.hfe-footer-widget :focus-visible,
[data-elementor-type="footer"] :focus-visible {
	outline-color: #ffffff !important;
}

/* ------------------------------------------------------------------ *
 * D) VISUALLY-HIDDEN utility for JS-injected long descriptions.
 * ------------------------------------------------------------------ */
.kai-sr-only {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}
