/**
 * Five Capital Accessibility Remediation
 * Presentation-layer fixes.
 */

/* -------------------------------------------------------------------------
 * Screen-reader-only utility
 *
 * Used by the injected <caption> elements and by the JS pass when it has to
 * expose a heading that the theme hid with display:none.
 * ---------------------------------------------------------------------- */

.fc-a11y-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;
	clip-path: inset(50%) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* -------------------------------------------------------------------------
 * Link underlines  (SC 1.4.1 Use of Colour)
 *
 * Every link gets a visible underline so it is not identified by colour
 * alone. Navigation is excluded per the brief: menus are already identified
 * by position and grouping.
 * ---------------------------------------------------------------------- */

a {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
	text-decoration-skip-ink: auto;
}

/* Keep the underline on hover/focus, just make it heavier. */
a:hover,
a:focus {
	text-decoration: underline;
	text-decoration-thickness: 2px;
}

/* --- Exclusions: navigation --------------------------------------------- */

nav a,
[role="navigation"] a,
.menu-item > a,
.sub-menu a,
.elementor-nav-menu a,
.elementor-nav-menu--main a,
.elementor-nav-menu--dropdown a,
.hfe-nav-menu a,
.elementor-location-header .elementor-nav-menu a,
#site-navigation a,
.main-navigation a,
.menu-toggle,
.breadcrumb a,
.breadcrumbs a {
	text-decoration: none;
}

nav a:hover,
nav a:focus,
[role="navigation"] a:hover,
[role="navigation"] a:focus,
.elementor-nav-menu a:hover,
.elementor-nav-menu a:focus {
	/* Hover/focus still gets an underline for a non-colour affordance. */
	text-decoration: underline;
	text-decoration-thickness: 2px;
}

/* --- Exclusions: things that are not really "link text" ------------------ */

/* Buttons, image links, icon links and logos are identified by their shape
   or graphic, so an underline would be visual noise (and would strike
   through images in some browsers). */
a.elementor-button,
a.elementor-button-link,
a.wp-block-button__link,
a[role="button"],
a.button,
a.btn,
a.elementor-icon,
a.elementor-social-icon,
a.elementor-item,
a.elementor-post__thumbnail__link,
a.elementor-icon-list-item,
.elementor-icon-list-item a,
.elementor-social-icons-wrapper a,
.elementor-widget-image a,
.elementor-widget-theme-site-logo a,
.site-logo a,
.custom-logo-link,
a:has(> img),
a:has(> svg),
a:has(> picture),
a:has(> .elementor-icon),
a:has(> i:only-child) {
	text-decoration: none;
}

/* Buttons keep a non-colour affordance on interaction. */
a.elementor-button:hover,
a.elementor-button:focus,
a[role="button"]:hover,
a[role="button"]:focus {
	text-decoration: underline;
	text-decoration-thickness: 2px;
}

/* The skip link is visually hidden until focused; no underline needed. */
.skip-link,
.screen-reader-text {
	text-decoration: none;
}

/* -------------------------------------------------------------------------
 * Focus visibility  (SC 2.4.7 Focus Visible)
 *
 * A consistent, high-contrast focus ring on every focusable element, so
 * keyboard users can always see where they are. :focus-visible keeps it off
 * for mouse users.
 * ---------------------------------------------------------------------- */

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 {
	outline: 3px solid #005fcc !important;
	outline-offset: 2px !important;
	border-radius: 2px;
}

/* Fallback for browsers without :focus-visible support. */
@supports not selector(:focus-visible) {
	a:focus,
	button:focus,
	input:focus,
	select:focus,
	textarea:focus,
	[tabindex]:focus {
		outline: 3px solid #005fcc !important;
		outline-offset: 2px !important;
	}
}

/* -------------------------------------------------------------------------
 * Skip link  (SC 2.4.1 Bypass Blocks)
 *
 * The audit confirmed a working skip link exists. This guarantees it becomes
 * visible when focused, which is the part that is usually missed.
 * ---------------------------------------------------------------------- */

.skip-link:focus,
.fc-a11y-skip-link:focus {
	position: fixed !important;
	top: 8px !important;
	left: 8px !important;
	z-index: 100000 !important;
	width: auto !important;
	height: auto !important;
	padding: 12px 20px !important;
	clip: auto !important;
	clip-path: none !important;
	background: #ffffff !important;
	color: #10202e !important;
	font-size: 16px !important;
	font-weight: 700 !important;
	text-decoration: underline !important;
	border: 3px solid #005fcc !important;
	border-radius: 4px !important;
}

/* -------------------------------------------------------------------------
 * Reduced motion  (SC 2.2.2 Pause, Stop, Hide)
 *
 * The audit flagged infinitely-animating elements and carousels with no
 * prefers-reduced-motion handling.
 * ---------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* -------------------------------------------------------------------------
 * Text spacing tolerance  (SC 1.4.12)
 *
 * Elementor headings and buttons frequently clip when users override text
 * spacing. Allowing content to grow prevents that.
 * ---------------------------------------------------------------------- */

.elementor-heading-title,
.elementor-button-text,
.elementor-icon-list-text {
	overflow-wrap: break-word;
	overflow: visible;
}
