/**
 * Microcurves Accessibility Fixes — stylesheet
 * Remediates colour-contrast, non-text-control-contrast, distinguishable-link,
 * focus-visibility and required-field indication findings.
 *
 * All rules are scoped and use !important deliberately: they must override the
 * theme / page-builder inline colours that caused the audit failures. Colours
 * were chosen to meet WCAG 2.1 SC 1.4.3 (>= 4.5:1) — see values below.
 */

/* ==========================================================================
   1. COLOUR CONTRAST  (SC 1.4.3 — 167 findings)
   The theme's brand teal #05abb7 renders at only 2.7:1 on white. Replace it
   with #037a83 (5.1:1 on white; white text on it is also 5.1:1). Grey
   #a1a1a1 -> #6e6e6e (4.9:1). Accent orange #d35400 -> #b8460a (5.4:1).
   ========================================================================== */

:root {
	--mctf-teal: #037a83;      /* was #05abb7 */
	--mctf-teal-dark: #026e75;
	--mctf-grey: #6e6e6e;      /* was #a1a1a1 */
	--mctf-orange: #b8460a;    /* was #d35400 */
	--mctf-focus: #b8460a;
}

/* Text / icon links that used the brand teal (phone, e-mail, file links,
   footer links, "Read and Download" links, etc.). */
a[href^="tel:"],
a[href^="mailto:"],
a[href^="tel:"] i,
a[href^="mailto:"] i,
.textwidget a,
.contact-info a,
.contact-info a i,
td a,
td a i {
	color: var(--mctf-teal) !important;
}

/* Font Awesome brand-teal icons used as decorative colour throughout. */
.fa.fa-phone,
.fa.fa-envelope,
.fa.fa-file,
.fa.fa-map-marker,
.fa.fa-angle-down,
.fa.fa-angle-up {
	color: inherit !important;
}

/* Buttons / badges that put WHITE text on the light teal background
   (#ffffff on #05abb7 == 2.7:1). Darken the background so white passes. */
button,
.wp-block-file a[download] button,
.document-icon-row button,
input[type="submit"],
input[type="button"],
.evf-submit-button,
.everest-forms .evf-submit,
a[style*="05abb7"],
[style*="background:#05abb7"],
[style*="background-color:#05abb7"],
[style*="background: #05abb7"],
[style*="background-color: #05abb7"] {
	background-color: var(--mctf-teal) !important;
	color: #ffffff !important;
	border-color: var(--mctf-teal-dark) !important;
}

/* Muted grey helper text that failed contrast. */
[style*="color:#a1a1a1"],
[style*="color: #a1a1a1"],
.a1a1a1,
small.text-muted {
	color: var(--mctf-grey) !important;
}

/* Accent orange text/links. */
[style*="color:#d35400"],
[style*="color: #d35400"],
a[style*="d35400"] {
	color: var(--mctf-orange) !important;
}

/* ==========================================================================
   2. NON-TEXT CONTROL CONTRAST  (SC 1.4.11 — 41 findings)
   Form fields and buttons whose borders were too faint against the page.
   Give every interactive control a >=3:1 boundary.
   ========================================================================== */

input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]),
select,
textarea,
.input-text,
.everest-forms input,
.everest-forms select,
.everest-forms textarea {
	border: 1px solid #6e6e6e !important;
}

input[type="checkbox"],
input[type="radio"] {
	outline: 1px solid #6e6e6e;
	outline-offset: 0;
}

/* ==========================================================================
   3. DISTINGUISHABLE LINKS  (SC 1.4.1 — 8 findings)
   In-content links (e.g. SEBI URLs) were distinguished by colour alone.
   Underline links that sit inside body content. Navigation, buttons and the
   logo are excluded so we don't clutter the chrome.
   ========================================================================== */

.textwidget a:not(.wp-block-file a):not([role="button"]),
.entry-content a,
.post-content a,
p a[href^="http"],
td a[href^="http"] {
	text-decoration: underline !important;
}

/* Keep icon-only and image links clean. */
.textwidget a:has(> img),
.contact-info a,
a.custom-logo-link,
.logo-image a {
	text-decoration: none !important;
}

/* ==========================================================================
   4. VISIBLE FOCUS  (SC 2.4.7 — supports keyboard remediation)
   Many theme controls removed the focus ring. Restore a strong, consistent
   indicator for every focusable element.
   ========================================================================== */

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
.mctf-toggle:focus-visible,
summary:focus-visible {
	outline: 3px solid var(--mctf-focus) !important;
	outline-offset: 2px !important;
	box-shadow: 0 0 0 2px #ffffff !important;
}

/* Fallback for browsers without :focus-visible. */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
	outline: 3px solid var(--mctf-focus);
	outline-offset: 2px;
}

/* ==========================================================================
   5. SKIP LINK  (SC 2.4.1)
   Hidden until it receives keyboard focus.
   ========================================================================== */

.mctf-skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 100000;
	padding: 12px 20px;
	background: #ffffff;
	color: #037a83;
	font-weight: 700;
	text-decoration: underline;
	border: 2px solid #037a83;
}

.mctf-skip-link:focus {
	left: 8px;
	top: 8px;
}

/* ==========================================================================
   6. REQUIRED-FIELD INDICATION  (SC 3.3.2 — 4 findings)
   A visible, non-colour-only required marker added next to the label by JS.
   ========================================================================== */

.mctf-required-star {
	color: #b8460a;
	font-weight: 700;
	margin-left: 2px;
}

.mctf-required-hint {
	display: block;
	font-size: 0.85em;
	color: #6e6e6e;
	margin-bottom: 8px;
}

/* ==========================================================================
   7. MOVING-CONTENT / MARQUEE CONTROLS  (SC 2.2.2 — 11 findings)
   Styling for the pause/play buttons injected by JS, plus reduced-motion.
   ========================================================================== */

.mctf-motion-toggle {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 6px 8px;
	padding: 6px 12px;
	background: #037a83;
	color: #ffffff;
	border: 2px solid #026e75;
	border-radius: 4px;
	font-size: 14px;
	cursor: pointer;
}

.mctf-motion-toggle:hover {
	background: #026e75;
}

/* Respect the user's OS-level reduced-motion preference. */
@media (prefers-reduced-motion: reduce) {
	marquee {
		/* Rendered engines vary; JS also stops the scroll. */
		animation: none !important;
	}

	.swiper-wrapper {
		transition-duration: 0s !important;
	}
}

/* Utility used by the script to visually hide helper text while keeping it
   available to assistive technology. */
.mctf-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
