/*!
 * RH AIF Accessibility - structure, focus and keyboard affordances
 *
 * SC 2.4.1 Bypass Blocks (A)
 * SC 2.4.7 Focus Visible (AA)
 * SC 1.4.11 Non-text Contrast (AA)
 * SC 2.1.1 Keyboard (A)
 * SC 1.3.1 Info and Relationships (A)
 *
 * Nothing in this file affects the resting appearance of the page. Every rule
 * either applies to a state that only exists during keyboard interaction, or
 * to markup this plugin itself adds.
 */

/* ---------------------------------------------------------------------------
   Skip to main content - SC 2.4.1
   ---------------------------------------------------------------------------
   The site is built on the Elementor Canvas template, which renders no theme
   header and therefore no skip link. Hidden until focused; on focus it is
   pinned to the top-left in the site's own palette.
   -------------------------------------------------------------------------- */
.rh-a11y-skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	width: 1px;
	height: 1px;
	overflow: hidden;
	z-index: 2147483647;
}

.rh-a11y-skip-link:focus,
.rh-a11y-skip-link:focus-visible {
	position: fixed;
	left: 16px;
	top: 16px;
	width: auto;
	height: auto;
	padding: 14px 22px;
	overflow: visible;
	background: #1a3a2a;
	color: #ffffff;
	font: 700 15px/1.3 'Poppins', 'Inter', Arial, sans-serif;
	letter-spacing: 0.04em;
	text-decoration: none;
	border-radius: 4px;
	box-shadow: 0 0 0 3px #ffdd00, 0 0 0 6px #0b1f17;
}

[id='rh-a11y-main'] {
	scroll-margin-top: 96px;
}

/* ---------------------------------------------------------------------------
   Focus visible - SC 2.4.7, SC 1.4.11
   ---------------------------------------------------------------------------
   Two of the page templates suppress the focus ring outright:

       .faq-outer button.faq-question:focus { outline: none !important; }
       nav.tab-bar button.tab-btn:focus     { outline: none !important; }

   and the remaining templates rely on the browser default, which disappears
   against the dark green bands. The indicator below is a two-tone ring: the
   yellow band carries the contrast on dark backgrounds, the dark halo carries
   it on light ones, so at least one band always clears 3:1 against whatever
   sits behind it.
   -------------------------------------------------------------------------- */
body.rh-a11y-on a:focus-visible,
body.rh-a11y-on button:focus-visible,
body.rh-a11y-on input:focus-visible,
body.rh-a11y-on select:focus-visible,
body.rh-a11y-on textarea:focus-visible,
body.rh-a11y-on summary:focus-visible,
body.rh-a11y-on [tabindex]:focus-visible,
body.rh-a11y-on [contenteditable='true']:focus-visible,
body.rh-a11y-on .faq-outer button.faq-question:focus-visible,
body.rh-a11y-on nav.tab-bar button.tab-btn:focus-visible,
body.rh-a11y-on .aif-faq-question:focus-visible,
body.rh-a11y-on .rh-a11y-scrollable:focus-visible {
	outline: 3px solid #ffdd00 !important;
	outline-offset: 2px !important;
	box-shadow: 0 0 0 6px #0b1f17 !important;
	border-radius: 2px;
}

/* Browsers without :focus-visible still get a visible ring. */
@supports not selector(:focus-visible) {
	body.rh-a11y-on a:focus,
	body.rh-a11y-on button:focus,
	body.rh-a11y-on input:focus,
	body.rh-a11y-on select:focus,
	body.rh-a11y-on textarea:focus,
	body.rh-a11y-on [tabindex]:focus {
		outline: 3px solid #ffdd00 !important;
		outline-offset: 2px !important;
		box-shadow: 0 0 0 6px #0b1f17 !important;
	}
}

/* Keep the ring clear of clipping ancestors on the FAQ accordions. */
body.rh-a11y-on .faq-outer button.faq-question:focus-visible,
body.rh-a11y-on .aif-faq-question:focus-visible {
	position: relative;
	z-index: 2;
}

/* ---------------------------------------------------------------------------
   Scrollable regions - SC 2.1.1, SC 2.1.3
   ---------------------------------------------------------------------------
   Reported against `.mv-chain` (crude-oil page) and `.heatmap-wrap`
   (small-caps page): both scroll horizontally but contain nothing focusable,
   so a keyboard user cannot reach the content that is off-screen.

   rh-a11y.js gives every such container tabindex="0", role="region" and an
   accessible name taken from its own heading. The rules here only supply the
   focus affordance; scroll behaviour and layout are unchanged.
   -------------------------------------------------------------------------- */
body.rh-a11y-on .rh-a11y-scrollable {
	scrollbar-width: auto;
}

body.rh-a11y-on .rh-a11y-scrollable:focus {
	outline: 3px solid #ffdd00;
	outline-offset: 2px;
}

/* ---------------------------------------------------------------------------
   List structure repair - SC 1.3.1
   ---------------------------------------------------------------------------
   Reported against the WordPress navigation block on /sample-page/, whose
   <ul> has a direct <ul> child. rh-a11y.js wraps the stray child in an <li>;
   `display: contents` keeps the wrapper out of the layout entirely so the
   flex row renders exactly as before.
   -------------------------------------------------------------------------- */
.rh-a11y-li-wrap {
	display: contents;
	list-style: none;
	margin: 0;
	padding: 0;
}

/* ---------------------------------------------------------------------------
   Dialog focus management support - SC 2.1.2, SC 2.4.3
   -------------------------------------------------------------------------- */
body.rh-a11y-dialog-open {
	overflow: hidden;
}

/* ---------------------------------------------------------------------------
   Screen-reader-only helper used for the names this plugin adds.
   -------------------------------------------------------------------------- */
.rh-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;
	white-space: nowrap !important;
	border: 0 !important;
}

/* ---------------------------------------------------------------------------
   Respect a reduced-motion preference for the transitions the templates add.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	body.rh-a11y-on *,
	body.rh-a11y-on *::before,
	body.rh-a11y-on *::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
		scroll-behavior: auto !important;
	}
}
