/**
 * Accessibility layer: hover states, keyboard focus states and the skip link.
 *
 * Every interactive element gets a hover cue that isn't color alone, and a
 * focus ring that stays visible on both light and dark sections
 * (WCAG 2.2: 1.4.1, 1.4.11, 2.4.7, 2.4.11).
 */

:root {
	--focus-ring-outer: #111111;
	--focus-ring-inner: #ffffff;
	--focus-ring-width: 3px;
	--hover-lift: -3px;
	--hover-speed: 0.2s;
	/* Height of the sticky header, so focused/anchored content never hides under it */
	--sticky-header-offset: calc(var(--logo-header) * 826 / 1801 + 1.6rem);
}

html {
	scroll-padding-top: calc(var(--sticky-header-offset) + 2rem);
}

/* ---------------------------------------------------------------------------
 * Focus ring: dark outer ring + white inner ring = visible on any background
 * ------------------------------------------------------------------------ */

body.bricks-is-frontend :focus-visible {
	outline: var(--focus-ring-width) solid var(--focus-ring-outer);
	outline-offset: var(--focus-ring-width);
	box-shadow: 0 0 0 var(--focus-ring-width) var(--focus-ring-inner);
}

/* Inside clipped containers (sliders, mobile menu) draw the ring inward so it isn't cut off */
body.bricks-is-frontend .splide__track :focus-visible,
body.bricks-is-frontend .bricks-mobile-menu-wrapper :focus-visible {
	outline-offset: calc(var(--focus-ring-width) * -2);
	box-shadow: inset 0 0 0 calc(var(--focus-ring-width) * 2) var(--focus-ring-inner);
}

/* Skip-link target (page H1) gets focus programmatically; a lighter ring is enough */
body.bricks-is-frontend h1[tabindex="-1"]:focus-visible {
	outline-offset: 0.4rem;
	box-shadow: none;
}

/* ---------------------------------------------------------------------------
 * Skip link: hidden until focused, then a visible button above the header
 * ------------------------------------------------------------------------ */

body.bricks-is-frontend .skip-link:focus,
body.bricks-is-frontend .skip-link:focus-visible {
	position: fixed;
	top: 1rem;
	left: 1rem;
	z-index: 100000;
	padding: 1.2rem 2rem;
	background: var(--focus-ring-outer);
	color: var(--white);
	font-family: var(--font-heading);
	font-size: 1.4rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	text-decoration: underline;
	border-radius: var(--radius-s);
}

/* ---------------------------------------------------------------------------
 * Buttons: lift a few pixels on hover
 * ------------------------------------------------------------------------ */

body.bricks-is-frontend .bricks-button,
body.bricks-is-frontend .gform_wrapper .gform_button,
body.bricks-is-frontend .bricks-mobile-menu-toggle,
body.bricks-is-frontend .brx-submenu-toggle > button,
body.bricks-is-frontend .header__logo-link,
body.bricks-is-frontend .audience-card {
	transition: transform var(--hover-speed) ease, background-color var(--hover-speed) ease,
		color var(--hover-speed) ease, box-shadow var(--hover-speed) ease;
}

body.bricks-is-frontend .bricks-button:hover,
body.bricks-is-frontend .gform_wrapper .gform_button:hover,
body.bricks-is-frontend .bricks-mobile-menu-toggle:hover,
body.bricks-is-frontend .brx-submenu-toggle > button:hover,
body.bricks-is-frontend .header__logo-link:hover,
body.bricks-is-frontend .audience-card:hover {
	transform: translateY(var(--hover-lift));
}

/* Slider arrows are already vertically centered with a transform */
body.bricks-is-frontend .splide__arrow {
	transition: transform var(--hover-speed) ease, opacity var(--hover-speed) ease;
}

body.bricks-is-frontend .splide__arrow:hover:not(:disabled) {
	transform: translateY(calc(-50% + var(--hover-lift)));
}

/* ---------------------------------------------------------------------------
 * Inline text links: underlined at rest, underline removed on hover
 * ------------------------------------------------------------------------ */

body.bricks-is-frontend :is(.brxe-post-content, .brxe-text, .brxe-text-basic, .gform_wrapper) a:not(.bricks-button),
body.bricks-is-frontend .contact-info__link,
body.bricks-is-frontend .footer__social-link,
body.bricks-is-frontend .footer__legal-link {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

body.bricks-is-frontend :is(.brxe-post-content, .brxe-text, .brxe-text-basic, .gform_wrapper) a:not(.bricks-button):hover,
body.bricks-is-frontend .contact-info__link:hover,
body.bricks-is-frontend .footer__social-link:hover,
body.bricks-is-frontend .footer__legal-link:hover {
	text-decoration: none;
}

/* ---------------------------------------------------------------------------
 * Standalone links (menus, card titles, back links): underline appears on hover
 * ------------------------------------------------------------------------ */

body.bricks-is-frontend .brxe-nav-menu .bricks-nav-menu a,
body.bricks-is-frontend .bricks-mobile-menu a,
body.bricks-is-frontend .footer__link,
body.bricks-is-frontend .post-card__title a,
body.bricks-is-frontend .post-article__back {
	text-decoration: none;
	text-decoration-thickness: 2px;
	text-underline-offset: 0.3em;
}

body.bricks-is-frontend .brxe-nav-menu .bricks-nav-menu a:hover,
body.bricks-is-frontend .bricks-mobile-menu a:hover,
body.bricks-is-frontend .footer__link:hover,
body.bricks-is-frontend .post-card__title a:hover,
body.bricks-is-frontend .post-article__back:hover {
	text-decoration-line: underline;
}

/* FAQ accordion triggers are div[role=button]: underline the question on hover */
body.bricks-is-frontend .accordion-title-wrapper {
	cursor: pointer;
}

body.bricks-is-frontend .accordion-title-wrapper:hover :is(h2, h3, h4) {
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 0.25em;
}

/* ---------------------------------------------------------------------------
 * Reduced motion: no lift, use an underline as the non-color hover cue instead
 * ------------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
	body.bricks-is-frontend .bricks-button:hover,
	body.bricks-is-frontend .gform_wrapper .gform_button:hover,
	body.bricks-is-frontend .bricks-mobile-menu-toggle:hover,
	body.bricks-is-frontend .brx-submenu-toggle > button:hover,
	body.bricks-is-frontend .header__logo-link:hover,
	body.bricks-is-frontend .audience-card:hover {
		transform: none;
	}

	body.bricks-is-frontend .splide__arrow:hover:not(:disabled) {
		transform: translateY(-50%);
	}

	body.bricks-is-frontend .bricks-button:hover,
	body.bricks-is-frontend .gform_wrapper .gform_button:hover {
		text-decoration: underline;
		text-underline-offset: 0.25em;
	}

	body.bricks-is-frontend .bricks-mobile-menu-toggle:hover,
	body.bricks-is-frontend .brx-submenu-toggle > button:hover,
	body.bricks-is-frontend .header__logo-link:hover,
	body.bricks-is-frontend .audience-card:hover,
	body.bricks-is-frontend .splide__arrow:hover:not(:disabled) {
		outline: 2px solid currentColor;
		outline-offset: 2px;
	}
}
