/*!
 * NMR Capital — Accessibility Fixes (front end)
 * WCAG 2.1 AA remediation. Structure, focus and link affordances only:
 * all colour-contrast repairs are applied at runtime by nmr-a11y.js so that
 * intentionally light-on-dark text is never overridden.
 */

:root {
	--nmr-green-on-light: #4a6f40; /* 5.77:1 on #ffffff */
	--nmr-green-on-dark: #90b983;  /* 5.21:1 on #2e3b40 */
	--nmr-focus: #1b3a12;
	--nmr-focus-halo: #ffffff;
	--nmr-highlight: #4a6f40;
}

/* -------------------------------------------------------------------------
 * Visually hidden utility (text exposed to assistive tech only)
 * ---------------------------------------------------------------------- */

.nmr-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;
}

/* -------------------------------------------------------------------------
 * SC 2.4.1 — Skip to main content
 * ---------------------------------------------------------------------- */

.nmr-skip-link {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 999999;
	display: inline-block;
	padding: 14px 22px;
	background: #ffffff;
	color: #1b3a12;
	font: 700 16px/1.3 inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
	border: 2px solid #1b3a12;
	border-radius: 0 0 6px 0;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
	transform: translateY(-120%);
	transition: transform 0.15s ease-in-out;
}

.nmr-skip-link:focus,
.nmr-skip-link:focus-visible {
	transform: translateY(0);
	outline: 3px solid #1b3a12;
	outline-offset: 3px;
}

/* Neutralise any earlier inline skip-link styling that may still be cached. */
.eu-skip-link {
	display: none !important;
}

/* -------------------------------------------------------------------------
 * SC 2.4.7 — Visible focus indicator on every interactive element
 * ---------------------------------------------------------------------- */

a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible,
.et_pb_button:focus-visible,
.slick-slide:focus-visible,
.slick-dots li button:focus-visible {
	outline: 3px solid var(--nmr-focus) !important;
	outline-offset: 2px !important;
	box-shadow: 0 0 0 6px var(--nmr-focus-halo), 0 0 0 9px var(--nmr-focus) !important;
	border-radius: 2px;
}

/* Browsers without :focus-visible support (and forced keyboard mode). */
.nmr-using-keyboard a:focus,
.nmr-using-keyboard button:focus,
.nmr-using-keyboard [role="button"]:focus,
.nmr-using-keyboard input:focus,
.nmr-using-keyboard select:focus,
.nmr-using-keyboard textarea:focus,
.nmr-using-keyboard [tabindex]:focus {
	outline: 3px solid var(--nmr-focus) !important;
	outline-offset: 2px !important;
	box-shadow: 0 0 0 6px var(--nmr-focus-halo), 0 0 0 9px var(--nmr-focus) !important;
}

/* On dark sections the dark ring would vanish — flip the halo. */
.nmr-on-dark a:focus-visible,
.nmr-on-dark button:focus-visible,
.nmr-on-dark [tabindex]:focus-visible,
.nmr-using-keyboard .nmr-on-dark a:focus,
.nmr-using-keyboard .nmr-on-dark button:focus {
	outline-color: #ffffff !important;
	box-shadow: 0 0 0 6px #1b2226, 0 0 0 9px #ffffff !important;
}

/* Divi hides focus outlines on menu items in places — undo that. */
#main-header a:focus,
.et-menu a:focus,
.et_mobile_menu a:focus,
.et_pb_menu a:focus {
	outline-style: solid !important;
}

/* -------------------------------------------------------------------------
 * Destination highlight — the target a focused in-page link points at
 * ---------------------------------------------------------------------- */

.nmr-target-preview {
	outline: 3px dashed var(--nmr-highlight) !important;
	outline-offset: -3px !important;
	background-image: linear-gradient(rgba(74, 111, 64, 0.08), rgba(74, 111, 64, 0.08));
}

.nmr-target-active {
	outline: 4px solid var(--nmr-highlight) !important;
	outline-offset: -4px !important;
	animation: nmr-target-pulse 1.6s ease-out 1;
}

@keyframes nmr-target-pulse {
	0%   { box-shadow: 0 0 0 0 rgba(74, 111, 64, 0.55); }
	70%  { box-shadow: 0 0 0 18px rgba(74, 111, 64, 0); }
	100% { box-shadow: 0 0 0 0 rgba(74, 111, 64, 0); }
}

/* The skip-link / anchor destination must never be given a focus ring that
   looks clickable, but it still needs to be obviously "you are here". */
[tabindex="-1"]:focus {
	outline: none;
}

[tabindex="-1"].nmr-target-active:focus {
	outline: 4px solid var(--nmr-highlight) !important;
}

/* -------------------------------------------------------------------------
 * SC 1.4.1 — Links must be distinguishable from surrounding text
 * ---------------------------------------------------------------------- */

.entry-content a:not([class*="et_pb_button"]):not(.et_pb_promo_button):not([class*="et_pb_more_button"]),
.et-l--footer a:not([class*="et_pb_button"]),
#main-content .et_pb_text_inner a:not([class*="et_pb_button"]) {
	text-decoration: underline;
	text-underline-offset: 2px;
	text-decoration-thickness: 1px;
}

.entry-content a:not([class*="et_pb_button"]):hover,
.entry-content a:not([class*="et_pb_button"]):focus,
.et-l--footer a:not([class*="et_pb_button"]):hover,
.et-l--footer a:not([class*="et_pb_button"]):focus,
#main-content .et_pb_text_inner a:not([class*="et_pb_button"]):hover,
#main-content .et_pb_text_inner a:not([class*="et_pb_button"]):focus {
	text-decoration-thickness: 3px;
	text-underline-offset: 3px;
}

/* Never underline the logo, images-as-links or module wrappers. */
.entry-content a:has(img),
.entry-content a img,
.et_pb_menu__logo a {
	text-decoration: none;
}

/* -------------------------------------------------------------------------
 * SC 2.2.2 — Carousel pause / play control
 * ---------------------------------------------------------------------- */

.nmr-carousel-controls {
	display: flex;
	justify-content: center;
	margin: 0 0 12px;
	padding: 0;
}

.nmr-carousel-toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 9px 18px;
	background: #ffffff;
	color: #1b3a12;
	font: 600 14px/1.2 inherit;
	letter-spacing: 0.01em;
	border: 2px solid #1b3a12;
	border-radius: 999px;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.nmr-carousel-toggle:hover {
	background: #1b3a12;
	color: #ffffff;
}

.nmr-carousel-toggle::before {
	content: "";
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 6px 0 6px 10px;
	border-color: transparent transparent transparent currentColor;
}

.nmr-carousel-toggle[aria-pressed="false"]::before {
	width: 10px;
	height: 12px;
	border: 0;
	background: currentColor;
	-webkit-clip-path: polygon(0 0, 35% 0, 35% 100%, 0 100%, 0 0, 65% 0, 100% 0, 100% 100%, 65% 100%, 65% 0);
	clip-path: polygon(0 0, 35% 0, 35% 100%, 0 100%, 0 0, 65% 0, 100% 0, 100% 100%, 65% 100%, 65% 0);
}

/* Remove the older inline pause button if that snippet is still present. */
.eu-carousel-pause {
	display: none !important;
}

/* Slick controls need a real hit area and a visible focus ring. */
.slick-dots li button,
.slick-prev,
.slick-next,
.pac-dcm-arrow {
	cursor: pointer;
}

.slick-dots li button {
	min-width: 24px;
	min-height: 24px;
}

/* -------------------------------------------------------------------------
 * Reduced motion
 * ---------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.nmr-skip-link,
	.nmr-target-active {
		transition: none !important;
		animation: none !important;
	}

	.slick-slide,
	.slick-track {
		transition-duration: 1ms !important;
		animation-duration: 1ms !important;
	}
}

/* -------------------------------------------------------------------------
 * Forced colours / Windows High Contrast
 * ---------------------------------------------------------------------- */

@media (forced-colors: active) {
	.nmr-skip-link,
	.nmr-carousel-toggle {
		border: 2px solid ButtonText;
	}

	a:focus-visible,
	button:focus-visible,
	[tabindex]:focus-visible {
		outline: 3px solid Highlight !important;
	}
}
