/* Accessibility options (inc/a11y.php): the button, the panel and the visitor settings. */

:root {
	--a11y-ink: #001f4b;      /* PLI navy, palette1 */
	--a11y-yellow: #ffcd00;   /* palette2 */
	--a11y-white: #fff;
	--a11y-line: #5b6b80;     /* 5.6:1 on white */
	--a11y-gutter: 16px;
	--a11y-size: 48px;
}
@media (min-width: 768px) {
	:root {
		--a11y-gutter: 24px;
	}
}

/* Button: fixed bottom left, 48 by 48. Navy with a white ring, so its edge holds 3:1 or more everywhere:
   navy on white 16:1, white ring on the navy footer 16:1, navy on the yellow bands 11:1.
   Second in the tab order (it prints right after the skip link). */

.pli-a11y-btn {
	position: fixed;
	bottom: var(--a11y-gutter);
	left: var(--a11y-gutter);
	z-index: 900;
	display: grid;
	place-items: center;
	width: var(--a11y-size);
	height: var(--a11y-size);
	margin: 0;
	padding: 0;
	background: var(--a11y-ink);
	border: 2px solid var(--a11y-white);
	border-radius: 50%;
	box-shadow: 0 2px 10px rgb(0 18 43 / 0.35);
	color: var(--a11y-white);
	font-family: var(--global-body-font-family);
	letter-spacing: normal;
	text-transform: none; /* the theme uppercases buttons, and Chrome reads that into the name */
	cursor: pointer;
}
.pli-a11y-btn[hidden] {
	display: none;
}
.pli-a11y-btn:hover {
	background: #01163c;
}
.pli-a11y-btn:focus-visible {
	outline: 3px solid var(--a11y-yellow);
	outline-offset: 2px;
	box-shadow: 0 0 0 7px var(--a11y-ink);
}
.pli-a11y-btn__icon {
	display: block;
}
/* The name shows beside the button on hover and keyboard focus. */
.pli-a11y-btn__text {
	position: absolute;
	left: calc(100% + 10px);
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}
.pli-a11y-btn:hover .pli-a11y-btn__text,
.pli-a11y-btn:focus-visible .pli-a11y-btn__text {
	width: auto;
	height: auto;
	padding: 6px 12px;
	clip-path: none;
	background: var(--a11y-ink);
	border: 1px solid var(--a11y-white);
	border-radius: 4px;
	color: var(--a11y-white);
	font-family: var(--global-body-font-family);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
}

/* Room under the footer so the button never covers its last line, and focus never scrolls under it. */
.site-footer .site-bottom-footer-wrap .site-footer-row-container-inner {
	padding-bottom: calc(var(--a11y-size) + 2 * var(--a11y-gutter));
}
html {
	scroll-padding-bottom: calc(var(--a11y-size) + 2 * var(--a11y-gutter));
}

/* Panel. Sized in px so the text size setting does not resize it. */

.pli-a11y {
	position: fixed;
	inset: auto auto calc(var(--a11y-size) + var(--a11y-gutter) + 12px) var(--a11y-gutter);
	box-sizing: border-box;
	width: min(368px, 100vw - 2 * var(--a11y-gutter));
	max-width: none; /* the browser's dialog default would cap it and leave the right gutter wider on phones */
	max-height: calc(100dvh - var(--a11y-size) - var(--a11y-gutter) - 24px);
	margin: 0;
	padding: 16px 20px 20px;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--a11y-white);
	border: 1px solid var(--a11y-line);
	border-radius: 8px;
	box-shadow: 0 12px 32px rgb(0 18 43 / 0.25);
	color: var(--global-palette13, #1a1a1a);
	font-family: var(--global-body-font-family);
	font-size: 16px;
	line-height: 1.4;
}
.pli-a11y::backdrop {
	background: rgb(0 18 43 / 0.45);
}
.pli-a11y *,
.pli-a11y *::before,
.pli-a11y *::after {
	box-sizing: border-box;
}
.pli-a11y__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 12px;
}
.pli-a11y .pli-a11y__title {
	margin: 0;
	color: var(--a11y-ink);
	font-family: var(--global-body-font-family);
	font-size: 20px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0;
	text-transform: none;
}
.pli-a11y button,
.pli-a11y__size {
	min-height: var(--a11y-size);
	margin: 0;
	border: 1px solid var(--a11y-line);
	border-radius: 6px;
	background: var(--a11y-white);
	color: var(--a11y-ink);
	font-family: inherit;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.3;
	text-transform: none;
	letter-spacing: 0;
	cursor: pointer;
}
.pli-a11y button:hover,
.pli-a11y__size:hover {
	border-color: var(--a11y-ink);
	background: var(--global-palette7, #edf2f7);
}
.pli-a11y button:focus-visible,
.pli-a11y a:focus-visible,
.pli-a11y__size:has(:focus-visible) {
	outline: 3px solid var(--a11y-ink);
	outline-offset: 2px;
	box-shadow: none;
}
.pli-a11y .pli-a11y__close {
	display: grid;
	place-items: center;
	flex: none;
	width: var(--a11y-size);
	padding: 0;
}
.pli-a11y__sizes {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}
.pli-a11y__legend {
	margin: 0 0 8px;
	padding: 0;
	color: var(--a11y-ink);
	font-size: 16px;
	font-weight: 700;
}
.pli-a11y__seg {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 8px;
}
.pli-a11y__size {
	position: relative;
	display: grid;
	place-items: center;
	padding: 4px 6px;
	text-align: center;
}
.pli-a11y__size input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}
.pli-a11y__size:has(:checked) {
	background: var(--a11y-ink);
	border-color: var(--a11y-ink);
	color: var(--a11y-white);
}
.pli-a11y__list {
	display: grid;
	gap: 8px;
	margin: 20px 0;
	padding: 0;
	list-style: none;
}
.pli-a11y__list li {
	margin: 0;
	padding: 0;
}
.pli-a11y .pli-a11y__toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	width: 100%;
	padding: 8px 12px 8px 16px;
	text-align: left;
}
.pli-a11y__state {
	flex: none;
	min-width: 52px;
	padding: 2px 8px;
	border: 1px solid var(--a11y-line);
	border-radius: 999px;
	color: #3d4b5c;
	font-size: 14px;
	text-align: center;
}
.pli-a11y [aria-pressed="true"] > .pli-a11y__state {
	background: var(--a11y-ink);
	border-color: var(--a11y-ink);
	color: var(--a11y-white);
}
.pli-a11y [aria-pressed="true"] .pli-a11y__off,
.pli-a11y [aria-pressed="false"] .pli-a11y__on {
	display: none;
}
.pli-a11y__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 16px;
}
.pli-a11y .pli-a11y__reset {
	padding: 0 20px;
	border-color: var(--a11y-ink);
}
.pli-a11y .pli-a11y__link {
	display: inline-flex;
	align-items: center;
	min-height: var(--a11y-size);
	color: var(--global-palette12, #1159af);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: underline;
	text-underline-offset: 0.18em;
}
@media (max-width: 479px) {
	.pli-a11y {
		inset: auto var(--a11y-gutter) calc(var(--a11y-size) + var(--a11y-gutter) + 12px);
		width: auto;
		padding-inline: 16px;
	}
}
@media print {
	.pli-a11y-btn {
		display: none;
	}
}
@media (forced-colors: active) {
	.pli-a11y-btn,
	.pli-a11y__size:has(:checked),
	.pli-a11y [aria-pressed="true"] > .pli-a11y__state {
		border: 2px solid ButtonText;
	}
	.pli-a11y__size:has(:checked) {
		outline: 2px solid Highlight;
	}
}

/* Text size. This theme sets nearly all text in px, so growing the root font size would only grow
   spacing. Instead each text element is zoomed (zoom grows text and its own padding, and the line
   still wraps inside the same box). Nested text elements reset to 1 so sizes never compound.
   List items that hold blocks (cards, slides, menus) are skipped; their text gets zoomed inside. */

:root.a11y-text-larger {
	--a11y-zoom: 1.125;
}
:root.a11y-text-largest {
	--a11y-zoom: 1.25;
}
:root:is(.a11y-text-larger, .a11y-text-largest) :where(
	p, dt, dd, h1, h2, h3, h4, h5, h6, blockquote, figcaption, label, legend, caption, th, td, time, address,
	input, select, textarea, button, .kt-btn-inner-text, .kb-count-up-number, .menu-item > a, .kadence-breadcrumbs,
	li:not(.menu-item, .splide__slide, .slick-slide, .kb-query-item, .kb-post-list-item):not(:has(> :is(div, figure, article, section, header, footer, p, h1, h2, h3, h4, h5, h6, ul, ol, dl, blockquote, table, form, img, picture, iframe)))
) {
	zoom: var(--a11y-zoom);
}
:root:is(.a11y-text-larger, .a11y-text-largest) :where(
	p, dt, dd, h1, h2, h3, h4, h5, h6, blockquote, figcaption, label, legend, caption, th, td, time, address,
	input, select, textarea, button, .kt-btn-inner-text, .kb-count-up-number, .menu-item > a, .kadence-breadcrumbs, li
) :where(
	p, dt, dd, h1, h2, h3, h4, h5, h6, blockquote, figcaption, label, legend, caption, th, td, time, address,
	input, select, textarea, button, .kt-btn-inner-text, .kb-count-up-number, .menu-item > a, .kadence-breadcrumbs, li
) {
	zoom: 1;
}
:root:is(.a11y-text-larger, .a11y-text-largest) :is(.pli-a11y-btn, .pli-a11y, .pli-a11y *) {
	zoom: 1;
}
/* Clamped titles show in full when text is larger. */
:root:is(.a11y-text-larger, .a11y-text-largest) :is(h1, h2, h3, h4, p) {
	-webkit-line-clamp: none !important;
	line-clamp: none !important;
}

/* Readable headings: Atkinson Hyperlegible Next (SIL Open Font License) instead of wide Montserrat,
   sentence case as typed, normal letter spacing. Long words hyphenate instead of overflowing. */

@font-face {
	font-family: "PLI Readable";
	font-style: normal;
	font-weight: 200 800;
	font-display: swap;
	src: url("../fonts/atkinson-hyperlegible-next-latin.woff2") format("woff2");
}
:root.a11y-readable-headings :is(h1, h2, h3, h4, h5, h6, .pli-eyebrow, .kb-count-up-title) {
	font-family: "PLI Readable", var(--global-body-font-family) !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	hyphens: auto;
	overflow-wrap: break-word;
	hyphenate-limit-chars: 10 4 4;
}

/* High contrast: greys become ink, edges get stronger, photo washes get darker, and the blue
   buttons and links move to a darker blue (white on #005a9c is 7.1:1, was 4.5:1). */

:root.a11y-contrast {
	--global-palette6: #1a1a1a;
	--global-palette11: #005a9c;
	--global-palette13: #000;
	--global-palette15: var(--a11y-line);
	--a11y-line: #1a1a1a;
}
:root.a11y-contrast body {
	color: #000;
}
:root.a11y-contrast :is(.kb-advanced-slide-overlay, .kt-row-layout-overlay, .kb-blocks-bg-overlay) {
	opacity: 0.92 !important;
}
:root.a11y-contrast .kb-advanced-slide-overlay {
	background: rgb(0 18 43 / 0.88) !important;
}
:root.a11y-contrast :is(input, select, textarea):not([type="submit"], [type="button"], [type="radio"], [type="checkbox"]) {
	border-color: #1a1a1a !important;
}

/* Underlined links (also part of high contrast). Buttons, the logo and image-only links are left alone. */

:root:is(.a11y-underline-links, .a11y-contrast) a:not(.kb-button, .wp-block-button__link, .button, .custom-logo-link, .brand, .skip-link, .social-button, .splide__pagination__page) {
	text-decoration-line: underline !important;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

/* Reduce motion: what style.css does for the system setting, plus the pieces that move by script
   (rescues ticker, partner logos, hero slider and count-ups stop in a11y.js and the listeners). */

:root.a11y-reduce-motion *,
:root.a11y-reduce-motion *::before,
:root.a11y-reduce-motion *::after {
	animation-delay: 0s !important;
	animation-duration: 0.01ms !important;
	animation-iteration-count: 1 !important;
	transition-delay: 0s !important;
	transition-duration: 0.01ms !important;
	scroll-behavior: auto !important;
}
:root.a11y-reduce-motion [data-aos] {
	opacity: 1 !important;
	transform: none !important;
}
:root.a11y-reduce-motion :is(.press-row, .blog-card, .kb-query-item, .press-img > .kt-inside-inner-col):is(:hover, :focus-within),
:root.a11y-reduce-motion :is(.press-row, .blog-card, .kb-query-item):is(:hover, :focus-within) :is(img, .kt-inside-inner-col) {
	transform: none !important;
}
:root.a11y-reduce-motion .lshowcase-flex {
	animation: none !important;
}
