/**
 * Accessibility layer (ADA / WCAG 2.1 AA).
 *  - Skip link, visible keyboard focus, reduced-motion support.
 *  - Mode classes toggled by accessibility.js on <html>:
 *      a11y-text, a11y-contrast, a11y-links, a11y-motion, a11y-spacing
 */

/* ---- Skip link: hidden until keyboard-focused ---- */
.lbn-skip-link {
	position: fixed;
	inset-block-start: -100px;
	inset-inline-start: 1rem;
	z-index: 9999;
	background: #0A1628;
	color: #fff;
	padding: 0.75rem 1.5rem;
	border-radius: 0 0 0.5rem 0.5rem;
	font-weight: 600;
	transition: inset-block-start 0.2s ease;
}
.lbn-skip-link:focus {
	inset-block-start: 0;
	outline: 3px solid #C8102E;
	outline-offset: 2px;
}

/* ---- Visible keyboard focus everywhere (WCAG 2.4.7) ---- */
:focus-visible {
	outline: 3px solid #C8102E !important;
	outline-offset: 2px !important;
	border-radius: 2px;
}
.bg-navy :focus-visible,
footer :focus-visible {
	outline-color: #fff !important;
}

/* ---- prefers-reduced-motion: honour the OS setting (WCAG 2.3.3) ---- */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
	.lbn-animate,
	.lbn-fade {
		opacity: 1 !important;
		transform: none !important;
	}
	.lbn-parallax {
		transform: none !important;
	}
}

/* ---- Mode: reduce motion (user toggle, same effect as the media query) ---- */
html.a11y-motion *,
html.a11y-motion *::before,
html.a11y-motion *::after {
	animation-duration: 0.01ms !important;
	animation-iteration-count: 1 !important;
	transition-duration: 0.01ms !important;
	scroll-behavior: auto !important;
}
html.a11y-motion .lbn-animate,
html.a11y-motion .lbn-fade {
	opacity: 1 !important;
	transform: none !important;
}
html.a11y-motion .lbn-parallax {
	transform: none !important;
}

/* ---- Mode: larger text (rem-based sizes scale ~15%) ---- */
html.a11y-text {
	font-size: 115%;
}
/* px-locked tiny labels get an explicit bump too */
html.a11y-text .text-\[8px\],
html.a11y-text .text-\[9px\],
html.a11y-text .text-\[10px\],
html.a11y-text .text-\[11px\] {
	font-size: 14px !important;
}

/* ---- Mode: high contrast ----
   NOTE: no CSS filter on body/main — a filter turns the element into a
   containing block, which breaks every position:fixed descendant (this
   widget, the fixed header, the video modal). Colors are strengthened
   directly instead. */
html.a11y-contrast body {
	color: #0A1628;
}
html.a11y-contrast .text-navy\/40,
html.a11y-contrast .text-navy\/55,
html.a11y-contrast .text-navy\/60,
html.a11y-contrast .text-navy\/70,
html.a11y-contrast .text-navy\/72,
html.a11y-contrast .text-navy\/75 {
	color: #0A1628 !important;
}
html.a11y-contrast .text-white\/40,
html.a11y-contrast .text-white\/55,
html.a11y-contrast .text-white\/60,
html.a11y-contrast .text-white\/70,
html.a11y-contrast .text-white\/75,
html.a11y-contrast .text-white\/80 {
	color: #ffffff !important;
}
html.a11y-contrast main .text-slate-400,
html.a11y-contrast main .text-slate-500,
html.a11y-contrast main .text-gray-500 {
	color: #1e293b !important;
}
html.a11y-contrast .bg-navy .text-gray-300,
html.a11y-contrast .bg-navy .text-slate-400 {
	color: #ffffff !important;
}

/* ---- Mode: underline links ---- */
html.a11y-links main a,
html.a11y-links footer a,
html.a11y-links header a {
	text-decoration: underline !important;
	text-underline-offset: 3px;
}

/* ---- Mode: reading spacing (dyslexia-friendly, WCAG 1.4.12) ---- */
html.a11y-spacing main p,
html.a11y-spacing main li {
	line-height: 2 !important;
	letter-spacing: 0.02em;
	word-spacing: 0.1em;
	margin-bottom: 1.2em;
}
html[dir="rtl"].a11y-spacing main p,
html[dir="rtl"].a11y-spacing main li {
	letter-spacing: 0 !important; /* never space Arabic letterforms */
}

/* =================== Widget =================== */
.lbn-a11y {
	position: fixed;
	inset-block-end: 1.25rem;
	inset-inline-start: 1.25rem;
	z-index: 1000;
	font-family: inherit;
}
.lbn-a11y__btn {
	inline-size: 3.25rem;
	block-size: 3.25rem;
	border-radius: 9999px;
	background: #0A1628;
	color: #fff;
	border: 2px solid rgba(255, 255, 255, 0.25);
	box-shadow: 0 8px 24px rgba(10, 22, 40, 0.35);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: transform 0.2s ease, background 0.2s ease;
}
.lbn-a11y__btn:hover {
	background: #C8102E;
	transform: scale(1.06);
}
.lbn-a11y__btn svg {
	inline-size: 1.5rem;
	block-size: 1.5rem;
}
.lbn-a11y__panel {
	position: absolute;
	inset-block-end: 4rem;
	inset-inline-start: 0;
	inline-size: 16.5rem;
	background: #fff;
	border: 1px solid rgba(10, 22, 40, 0.12);
	border-radius: 1rem;
	box-shadow: 0 20px 50px rgba(10, 22, 40, 0.25);
	padding: 0.75rem;
}
.lbn-a11y__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.25rem 0.5rem 0.6rem;
	border-bottom: 1px solid rgba(10, 22, 40, 0.08);
	margin-bottom: 0.5rem;
}
.lbn-a11y__title {
	font-weight: 700;
	color: #0A1628;
	font-size: 0.95rem;
}
.lbn-a11y__close {
	inline-size: 2rem;
	block-size: 2rem;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 9999px;
	color: rgba(10, 22, 40, 0.55);
	background: transparent;
	border: 0;
	cursor: pointer;
}
.lbn-a11y__close:hover {
	background: rgba(10, 22, 40, 0.06);
	color: #C8102E;
}
.lbn-a11y__close svg {
	inline-size: 1rem;
	block-size: 1rem;
}
.lbn-a11y__opt {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	inline-size: 100%;
	background: transparent;
	border: 0;
	border-radius: 0.6rem;
	padding: 0.6rem 0.6rem;
	font-size: 0.9rem;
	color: #0A1628;
	cursor: pointer;
	text-align: start;
}
.lbn-a11y__opt:hover {
	background: rgba(10, 22, 40, 0.05);
}
.lbn-a11y__switch {
	flex: 0 0 auto;
	inline-size: 2.1rem;
	block-size: 1.2rem;
	border-radius: 9999px;
	background: rgba(10, 22, 40, 0.2);
	position: relative;
	transition: background 0.2s ease;
}
.lbn-a11y__switch::after {
	content: "";
	position: absolute;
	inset-block-start: 2px;
	inset-inline-start: 2px;
	inline-size: 0.85rem;
	block-size: 0.85rem;
	border-radius: 9999px;
	background: #fff;
	transition: transform 0.2s ease;
}
.lbn-a11y__opt[aria-pressed="true"] .lbn-a11y__switch {
	background: #C8102E;
}
.lbn-a11y__opt[aria-pressed="true"] .lbn-a11y__switch::after {
	transform: translateX(0.9rem);
}
[dir="rtl"] .lbn-a11y__opt[aria-pressed="true"] .lbn-a11y__switch::after {
	transform: translateX(-0.9rem);
}
.lbn-a11y__reset {
	inline-size: 100%;
	margin-top: 0.5rem;
	padding: 0.55rem;
	border: 1px solid rgba(10, 22, 40, 0.15);
	border-radius: 0.6rem;
	background: transparent;
	color: rgba(10, 22, 40, 0.7);
	font-size: 0.82rem;
	cursor: pointer;
}
.lbn-a11y__reset:hover {
	border-color: #C8102E;
	color: #C8102E;
}
@media print {
	.lbn-a11y {
		display: none;
	}
}
