/* ==========================================================================
   Floating accessibility launcher + options panel
   ========================================================================== */
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-display: swap; src: url("../fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 700; font-display: swap; src: url("../fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); }

:root {
	--a11y-blue: #1A56C9;        /* white on this = 6.4:1 */
	--a11y-blue-dark: #123F96;
	--a11y-gap: 24px;
	--a11y-size: 56px;
	--fi-launcher-space: calc(var(--a11y-size) + var(--a11y-gap) + 8px);
}

/* Keep keyboard focus clear of the launcher (WCAG 2.4.11) and leave room at the very bottom. */
html { scroll-padding-bottom: calc(var(--fi-cookie-space, 0px) + var(--fi-launcher-space) + 0.5rem); }
.site-footer { padding-bottom: var(--fi-launcher-space); }

.a11y-widget { position: fixed; z-index: 950; bottom: calc(var(--a11y-gap) + var(--fi-cookie-space, 0px) + env(safe-area-inset-bottom, 0px)); left: var(--a11y-gap); }
.a11y-widget--right { left: auto; right: var(--a11y-gap); }

/* The round launcher */
.a11y-launcher {
	display: grid;
	place-items: center;
	width: var(--a11y-size);
	height: var(--a11y-size);
	padding: 0;
	border: 3px solid #FFFFFF;
	border-radius: 50%;
	background: var(--a11y-blue);
	color: #FFFFFF;
	cursor: pointer;
	box-shadow: 0 0 0 1px rgba(0,0,0,.35), 0 6px 18px rgba(0,0,0,.35);
	transition: background-color .15s ease, transform .15s ease;
	-webkit-tap-highlight-color: transparent;
}
.a11y-launcher svg { width: 34px; height: 34px; display: block; }
.a11y-launcher:hover { background: var(--a11y-blue-dark); transform: scale(1.06); }
.a11y-launcher:focus { outline: none; }
.a11y-launcher:focus-visible {
	outline: 3px solid #FFF200;
	outline-offset: 3px;
	box-shadow: 0 0 0 9px #0F1113, 0 6px 18px rgba(0,0,0,.35);
}
.a11y-launcher[aria-expanded="true"] { background: var(--a11y-blue-dark); }
.a11y-launcher.is-active::after {
	/* small dot shows that options are switched on */
	content: "";
	position: absolute;
	top: -2px;
	right: -2px;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #FFF200;
	border: 2px solid #0F1113;
}
.a11y-launcher { position: relative; }

/* The panel */
.a11y-panel {
	position: absolute;
	bottom: calc(var(--a11y-size) + 12px);
	left: 0;
	width: min(360px, calc(100vw - 2 * var(--a11y-gap)));
	max-height: calc(100vh - var(--a11y-size) - var(--a11y-gap) - var(--fi-cookie-space, 0px) - 32px);
	overflow-y: auto;
	overscroll-behavior: contain;
	background: #FFFFFF;
	color: #1B1E22;
	border: 1px solid #767E86;
	border-top: 5px solid var(--a11y-blue);
	border-radius: 10px;
	box-shadow: 0 24px 60px rgba(0,0,0,.45);
	font-family: "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
	font-size: 1rem;
	line-height: 1.4;
	text-align: left;
	--fi-focus: #1A56C9;
	--fi-focus-halo: #FFFFFF;
}
.a11y-widget--right .a11y-panel { left: auto; right: 0; }
.a11y-panel[hidden] { display: none; }
.a11y-panel :focus-visible { outline: 3px solid var(--a11y-blue); outline-offset: 2px; box-shadow: 0 0 0 5px #FFFFFF; }

.a11y-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 10px 18px; border-bottom: 1px solid #D5D8DC; position: sticky; top: 0; background: #FFFFFF; z-index: 1; }
.a11y-panel__title { margin: 0; font-family: inherit; font-size: 1.15rem; font-weight: 700; letter-spacing: 0; text-transform: none; color: #1B1E22; }
.a11y-panel__close { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid #767E86; border-radius: 50%; background: #FFFFFF; color: #1B1E22; cursor: pointer; flex: none; }
.a11y-panel__close:hover { background: #EEF0F2; }

.a11y-panel__body { padding: 14px 18px; display: grid; gap: 14px; }

.a11y-size__label { margin: 0 0 6px; font-weight: 700; font-size: .95rem; }
.a11y-size__row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.a11y-size__btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 10px; min-height: 48px; border: 1px solid #767E86; border-radius: 8px; background: #EEF0F2; color: #1B1E22; font-family: inherit; font-weight: 700; font-size: 1rem; line-height: 1; cursor: pointer; }
.a11y-size__btn:hover { background: #D5D8DC; }
.a11y-size__btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.a11y-size__value { text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

.a11y-options { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.a11y-option {
	position: relative;
	display: grid;
	grid-template-rows: auto auto 1fr;
	gap: 4px;
	width: 100%;
	height: 100%;
	min-height: 96px;
	padding: 10px 10px 10px 12px;
	border: 1px solid #767E86;
	border-radius: 8px;
	background: #FFFFFF;
	color: #1B1E22;
	font: inherit;
	text-align: left;
	cursor: pointer;
}
.a11y-option svg { color: var(--a11y-blue); }
.a11y-option__name { font-weight: 700; font-size: .95rem; }
.a11y-option__desc { font-size: .8rem; color: #4A5158; line-height: 1.3; }
.a11y-option:hover { border-color: var(--a11y-blue); background: #F3F7FF; }
.a11y-option[aria-pressed="true"] { background: var(--a11y-blue); border-color: var(--a11y-blue); color: #FFFFFF; }
.a11y-option[aria-pressed="true"] svg, .a11y-option[aria-pressed="true"] .a11y-option__desc { color: #FFFFFF; }
.a11y-option__state { position: absolute; top: 8px; right: 8px; width: 18px; height: 18px; border: 2px solid currentColor; border-radius: 50%; }
.a11y-option[aria-pressed="true"] .a11y-option__state { background: #FFFFFF; box-shadow: inset 0 0 0 3px var(--a11y-blue); }

.a11y-panel__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px 16px; border-top: 1px solid #D5D8DC; }
.a11y-reset { min-height: 44px; padding: 0 16px; border: 2px solid #1B1E22; border-radius: 8px; background: #FFFFFF; color: #1B1E22; font-family: inherit; font-weight: 700; font-size: .95rem; cursor: pointer; }
.a11y-reset:hover { background: #1B1E22; color: #FFFFFF; }
.a11y-statement { display: inline-flex; align-items: center; min-height: 44px; color: #123F96; font-weight: 600; }

@media (max-width: 479.98px) {
	:root { --a11y-gap: 16px; --a11y-size: 52px; }
	.a11y-options { grid-template-columns: 1fr; }
	.a11y-option { min-height: 52px; grid-template-columns: 24px 1fr; grid-template-rows: auto; align-items: center; column-gap: 10px; padding-right: 36px; }
	.a11y-option__state { top: 50%; transform: translateY(-50%); }
}

@media (forced-colors: active) {
	.a11y-launcher, .a11y-option, .a11y-panel { border: 2px solid ButtonText; }
	.a11y-option[aria-pressed="true"] { outline: 3px solid Highlight; }
}

@media print { .a11y-widget { display: none !important; } }

/* ==========================================================================
   Visitor-selected display modes (classes on <html>)
   The widget itself is excluded so its own controls stay usable.
   ========================================================================== */

/* High contrast */
html.a11y-contrast body *:not(.a11y-widget):not(.a11y-widget *):not(svg):not(svg *):not(img) {
	background-color: #000000 !important;
	background-image: none !important;
	color: #FFFFFF !important;
	border-color: #FFFFFF !important;
	text-shadow: none !important;
	box-shadow: none !important;
}
html.a11y-contrast body { background: #000000 !important; }
html.a11y-contrast body a:not(.a11y-widget *),
html.a11y-contrast body a:not(.a11y-widget *) * { color: #FFF200 !important; text-decoration: underline !important; }
html.a11y-contrast .fi-btn:not(.a11y-widget *), html.a11y-contrast .wp-block-button__link { border: 2px solid #FFF200 !important; }
html.a11y-contrast .fi-hero.has-image::before, html.a11y-contrast .fi-hero__img { display: none !important; }

/* Light background */
html.a11y-light body *:not(.a11y-widget):not(.a11y-widget *):not(svg):not(svg *):not(img):not(.custom-logo-link) {
	background-color: #FFFFFF !important;
	background-image: none !important;
	color: #111111 !important;
	border-color: #555555 !important;
	box-shadow: none !important;
}
html.a11y-light body { background: #FFFFFF !important; }
html.a11y-light body a:not(.a11y-widget *) { color: #0B3D91 !important; }
html.a11y-light .fi-btn:not(.a11y-widget *), html.a11y-light .wp-block-button__link { border: 2px solid #111111 !important; }
html.a11y-light .custom-logo-link { background-color: #0F1113 !important; padding: 6px 10px; display: inline-block; border-radius: 4px; }
html.a11y-light .fi-hero.has-image::before, html.a11y-light .fi-hero__img { display: none !important; }
html.a11y-light .fi-eyebrow::before, html.a11y-light .site-header::after { background: #111111 !important; }

/* Highlight links */
html.a11y-links body a:not(.a11y-widget *) {
	outline: 2px solid currentColor !important;
	outline-offset: 2px;
	text-decoration: underline !important;
	text-decoration-thickness: 3px !important;
}
html.a11y-links body a:not(.a11y-widget *):not(.fi-btn):not(.wp-block-button__link):not(.fi-portal-card):not(.custom-logo-link) {
	background-color: #FFF200 !important;
	color: #000000 !important;
}

/* Readable font */
html.a11y-font body, html.a11y-font body *:not(.a11y-widget *):not(svg):not(svg *) {
	font-family: "Atkinson Hyperlegible", Verdana, Tahoma, Arial, sans-serif !important;
	text-transform: none !important;
	letter-spacing: 0.01em !important;
	font-style: normal !important;
}

/* Text spacing (WCAG 1.4.12 values) */
html.a11y-spacing body *:not(.a11y-widget *) {
	line-height: 1.8 !important;
	letter-spacing: 0.12em !important;
	word-spacing: 0.16em !important;
}
html.a11y-spacing body p:not(.a11y-widget *) { margin-bottom: 2em !important; }

/* Stop animations */
html.a11y-motion { scroll-behavior: auto !important; }
html.a11y-motion *, html.a11y-motion *::before, html.a11y-motion *::after {
	animation: none !important;
	transition: none !important;
}

/* Large cursor */
html.a11y-cursor, html.a11y-cursor * {
	cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'%3E%3Cpath d='M4 2l16 9-7 2-3 7z' fill='%23000' stroke='%23fff' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E") 6 3, auto !important;
}
html.a11y-cursor a, html.a11y-cursor a *, html.a11y-cursor button, html.a11y-cursor button *, html.a11y-cursor label, html.a11y-cursor select {
	cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'%3E%3Cpath d='M4 2l16 9-7 2-3 7z' fill='%231A56C9' stroke='%23fff' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E") 6 3, pointer !important;
}

.a11y-size__glyph { font-size: 1.15rem; }
.a11y-size__value { min-width: 4ch; }
.a11y-option { min-height: 84px; grid-template-rows: auto 1fr; }
@media (max-width: 479.98px) {
	.a11y-option { min-height: 52px; grid-template-columns: 24px 1fr; grid-template-rows: auto; align-items: center; column-gap: 10px; padding-right: 36px; }
}
.a11y-options li:last-child:nth-child(odd) { grid-column: 1 / -1; }
.a11y-options li:last-child:nth-child(odd) .a11y-option { min-height: 0; }

/* Larger text sizes: let the header wrap instead of running off the screen */
.site-bar__inner { flex-wrap: wrap; }
.site-nav .menu { flex-wrap: wrap; }
.site-utility__inner { flex-wrap: wrap; }
