/* ==========================================================================
   Kleyman accessibility widget — pairs with inc/accessibility.php and
   assets/js/a11y.js. The widget layer is a fixed, click-through full-viewport
   box so it can be re-filtered (invert) without breaking its fixed children.
   ========================================================================== */

.ka11y {
	position: fixed; inset: 0; z-index: 10005; pointer-events: none; /* above header (10000) + lightbox (10002), below preloader */
	font-family: 'Ploni', -apple-system, 'Segoe UI', Arial, sans-serif;
	--ka11y-navy: #0C163A; --ka11y-blue: #0C163A; --ka11y-green: #11793A; --ka11y-gold: #FFC400;
	--ka11y-lift: 0px;
}
.ka11y *, .ka11y *::before, .ka11y *::after { box-sizing: border-box; }

/* ---------- Toggle ---------- */
.ka11y__toggle {
	position: absolute; inset-inline-end: 24px; bottom: calc(24px + var(--ka11y-lift));
	width: 56px; height: 56px; border-radius: 50%; border: 0; padding: 0; margin: 0;
	display: grid; place-items: center; cursor: pointer; pointer-events: auto;
	color: #fff; background: var(--ka11y-blue);
	box-shadow: 0 10px 26px rgba(12, 22, 58, .32), inset 0 0 0 2px rgba(255, 255, 255, .22);
	transition: transform .25s cubic-bezier(.2, .7, .2, 1), background-color .2s ease, bottom .3s ease, box-shadow .25s ease;
}
.ka11y__toggle:hover { transform: translateY(-3px) scale(1.04); background: #1B2B5E; box-shadow: 0 14px 30px rgba(12, 22, 58, .38), inset 0 0 0 2px rgba(255, 255, 255, .3); }
.ka11y__toggle:focus-visible { outline: 3px solid var(--ka11y-gold); outline-offset: 3px; }
.ka11y.is-open .ka11y__toggle { background: #1B2B5E; }
.ka11y__toggle svg { display: block; }
.ka11y__dot {
	position: absolute; top: 3px; inset-inline-start: 3px; width: 13px; height: 13px; border-radius: 50%;
	background: var(--ka11y-green); box-shadow: 0 0 0 2.5px #fff; transform: scale(0); transition: transform .25s ease;
}
.ka11y.has-active .ka11y__dot { transform: scale(1); }

/* ---------- Panel ---------- */
.ka11y__panel {
	position: absolute; inset-inline-end: 24px; bottom: calc(92px + var(--ka11y-lift));
	width: 384px; max-height: calc(100vh - 120px - var(--ka11y-lift)); max-height: calc(100dvh - 120px - var(--ka11y-lift));
	display: flex; flex-direction: column; pointer-events: auto;
	background: #fff; color: var(--ka11y-navy); border-radius: 22px; overflow: hidden; text-align: right;
	box-shadow: 0 30px 70px rgba(12, 22, 58, .3), 0 0 0 1px rgba(12, 22, 58, .06);
	opacity: 0; transform: translateY(14px) scale(.97); transform-origin: bottom left;
	transition: opacity .2s ease, transform .25s cubic-bezier(.2, .7, .2, 1);
}
.ka11y__panel[hidden] { display: none; }
.ka11y__panel.is-in { opacity: 1; transform: none; }

.ka11y__head {
	display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
	padding: 20px 22px 18px; color: #fff;
	background: linear-gradient(120deg, var(--ka11y-navy) 0%, #13286a 70%, var(--ka11y-blue) 140%);
}
.ka11y__title { margin: 0; font-size: 21px; font-weight: 700; line-height: 1.2; color: #fff; letter-spacing: 0; }
.ka11y__sub { margin: 4px 0 0; font-size: 13.5px; line-height: 1.4; color: rgba(255, 255, 255, .72); }
.ka11y__close {
	flex: none; width: 36px; height: 36px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
	display: grid; place-items: center; color: #fff; background: rgba(255, 255, 255, .12); transition: background-color .2s ease;
}
.ka11y__close:hover { background: rgba(255, 255, 255, .24); }
.ka11y__close:focus-visible { outline: 3px solid var(--ka11y-gold); outline-offset: 2px; }

.ka11y__body { padding: 16px 18px 6px; overflow-y: auto; overscroll-behavior: contain; }

.ka11y__size {
	display: flex; align-items: center; justify-content: space-between; gap: 10px;
	padding: 10px 12px 10px 10px; border-radius: 14px; background: #F2F5FB;
}
.ka11y__size-label { font-size: 15.5px; font-weight: 600; }
.ka11y__size-ctrl { display: flex; align-items: center; gap: 6px; }
.ka11y__size-val { min-width: 52px; text-align: center; font-size: 15px; font-weight: 700; font-family: -apple-system, 'Segoe UI', Arial, sans-serif; }
.ka11y__size-btn {
	width: 44px; height: 40px; border-radius: 11px; border: 1.5px solid rgba(12, 22, 58, .14); background: #fff; cursor: pointer;
	font-size: 16px; font-weight: 700; line-height: 1; font-family: inherit; color: var(--ka11y-navy); transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}
.ka11y__size-btn:hover:not(:disabled) { border-color: var(--ka11y-blue); color: var(--ka11y-blue); }
.ka11y__size-btn:disabled { opacity: .35; cursor: not-allowed; }
.ka11y__size-btn:focus-visible { outline: 3px solid var(--ka11y-gold); outline-offset: 2px; }

.ka11y__group { margin: 16px 2px 8px; font-size: 12.5px; font-weight: 700; letter-spacing: .04em; color: #6B7591; }

.ka11y__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ka11y__opt {
	position: relative; display: flex; align-items: center; gap: 10px; min-height: 54px; width: 100%;
	padding: 10px 12px; margin: 0; border-radius: 14px; cursor: pointer; text-align: right;
	border: 1.5px solid rgba(12, 22, 58, .1); background: #fff; color: var(--ka11y-navy);
	font-size: 14.5px; font-weight: 600; line-height: 1.25; font-family: inherit;
	transition: border-color .2s ease, background-color .2s ease, transform .15s ease;
}
.ka11y__opt:hover { border-color: rgba(12, 22, 58, .45); background: #F7F9FE; }
.ka11y__opt:active { transform: scale(.98); }
.ka11y__opt:focus-visible { outline: 3px solid var(--ka11y-gold); outline-offset: 2px; }
.ka11y__opt-icon {
	flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
	background: #EEF2FA; color: var(--ka11y-blue); transition: background-color .2s ease, color .2s ease;
}
.ka11y__opt-icon svg { width: 21px; height: 21px; }
.ka11y__opt-label { flex: 1; min-width: 0; }
.ka11y__opt-check {
	position: absolute; top: 7px; inset-inline-end: 7px; width: 16px; height: 16px; border-radius: 50%;
	background: var(--ka11y-green); transform: scale(0); transition: transform .2s ease;
}
.ka11y__opt-check::after {
	content: ''; position: absolute; left: 5px; top: 3px; width: 4px; height: 7px;
	border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.ka11y__opt[aria-pressed="true"] { border-color: var(--ka11y-blue); background: #EEF3FD; }
.ka11y__opt[aria-pressed="true"] .ka11y__opt-icon { background: var(--ka11y-blue); color: #fff; }
.ka11y__opt[aria-pressed="true"] .ka11y__opt-check { transform: scale(1); }

.ka11y__foot {
	display: flex; align-items: center; justify-content: space-between; gap: 10px;
	padding: 14px 18px 16px; border-top: 1px solid rgba(12, 22, 58, .08); background: #FAFBFD;
}
.ka11y__reset {
	display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; border-radius: 999px; cursor: pointer;
	border: 1.5px solid rgba(12, 22, 58, .14); background: #fff; color: var(--ka11y-navy); font-size: 14.5px; font-weight: 600; line-height: 1; font-family: inherit;
	transition: border-color .2s ease, color .2s ease;
}
.ka11y__reset:hover { border-color: #D33; color: #D33; }
.ka11y__reset:focus-visible, .ka11y__link:focus-visible { outline: 3px solid var(--ka11y-gold); outline-offset: 2px; }
.ka11y__link { font-size: 14.5px; font-weight: 600; color: var(--ka11y-blue); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Reading guide + image description tip ---------- */
.ka11y__guide {
	position: absolute; top: 0; left: 0; right: 0; height: 12px; display: none;
	background: rgba(255, 196, 0, .35); border-block: 2px solid var(--ka11y-navy); will-change: transform;
}
html.ka11y-guide .ka11y__guide { display: block; }
.ka11y-alt-tip {
	position: absolute; max-width: 290px; padding: 8px 12px; border-radius: 10px; pointer-events: none;
	background: var(--ka11y-navy); color: #fff; font-size: 14.5px; line-height: 1.4; box-shadow: 0 8px 22px rgba(0, 0, 0, .3);
}
.ka11y-alt-tip[hidden] { display: none; }

/* Step aside while a full-screen layer owns the bottom edge (lightbox thumbs,
   meeting / preview modals, cookie preferences, mobile filter sheet). */
body:has(.kleyman-lightbox.is-open) .ka11y,
body:has(.kleyman-meeting.is-open) .ka11y,
body:has(.kleyman-preview-modal.is-open) .ka11y,
body:has(.kleyman-cookie-modal.is-open) .ka11y { z-index: 900; }
@media (max-width: 860px) {
	body:has(.kleyman-pf__backdrop:not([hidden])) .ka11y__toggle,
	body:has(.kleyman-lightbox.is-open) .ka11y__toggle { opacity: 0; pointer-events: none; }
}

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
	.ka11y__toggle { width: 48px; height: 48px; inset-inline-end: 16px; bottom: calc(16px + var(--ka11y-lift)); }
	.ka11y__toggle svg { width: 24px; height: 24px; }
	.ka11y__panel {
		inset-inline: 0; bottom: 0; width: auto; border-radius: 22px 22px 0 0;
		max-height: 86vh; max-height: 86dvh; transform-origin: bottom center; transform: translateY(30px);
	}
	.ka11y__opt { min-height: 52px; font-size: 14px; padding: 9px 10px; gap: 8px; }
	.ka11y__opt-icon { width: 30px; height: 30px; }
	.ka11y__foot { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
}

/* ==========================================================================
   Modes — applied to <html>. Everything excludes the widget itself.
   ========================================================================== */

/* Grayscale / invert (page-wide filters; widget re-inverted to stay legible) */
html.ka11y-gray { filter: grayscale(1); }
html.ka11y-invert { filter: invert(1) hue-rotate(180deg); }
html.ka11y-gray.ka11y-invert { filter: grayscale(1) invert(1); }
html.ka11y-invert img, html.ka11y-invert video, html.ka11y-invert iframe, html.ka11y-invert picture,
html.ka11y-invert canvas, html.ka11y-invert .leaflet-tile-pane, html.ka11y-invert .ka11y { filter: invert(1) hue-rotate(180deg); }
html.ka11y-invert picture img { filter: none; }

/* Dark high contrast */
html.ka11y-contrast body, html.ka11y-contrast body :not(.ka11y):not(.ka11y *):not(svg *) {
	background-color: #000 !important; color: #fff !important; border-color: #fff !important; text-shadow: none !important; box-shadow: none !important;
}
html.ka11y-contrast body a:not(.ka11y *), html.ka11y-contrast body a:not(.ka11y *) * { color: #FFE14D !important; }
html.ka11y-contrast body button:not(.ka11y *), html.ka11y-contrast body .kleyman-btn { outline: 1.5px solid #fff; }
html.ka11y-contrast body .ka11y-clear.ka11y-clear.ka11y-clear, html.ka11y-light body .ka11y-clear.ka11y-clear.ka11y-clear { background-color: transparent !important; }
html.ka11y-contrast body img, html.ka11y-contrast body video, html.ka11y-contrast body picture { background-color: transparent !important; }
html.ka11y-contrast body ::placeholder { color: #ccc !important; }

/* Light high contrast */
html.ka11y-light body, html.ka11y-light body :not(.ka11y):not(.ka11y *):not(svg *) {
	background-color: #fff !important; color: #000 !important; border-color: #000 !important; text-shadow: none !important;
}
html.ka11y-light body a:not(.ka11y *), html.ka11y-light body a:not(.ka11y *) * { color: #0033B3 !important; }
/* The wordmark is white — give it a navy plate so it survives the white page. */
html.ka11y-light body a.kleyman-logo.kleyman-logo.kleyman-logo { background-color: #0C163A !important; border-radius: 12px; padding: 4px 12px; }
html.ka11y-light body img, html.ka11y-light body video, html.ka11y-light body picture { background-color: transparent !important; }

/* Readable font */
html.ka11y-font body :not(.ka11y):not(.ka11y *):not(svg):not(svg *) {
	font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif !important; font-weight: inherit;
}
html.ka11y-font body :is(p, li, span, a, label, input, textarea, select, td):not(.ka11y *) { font-weight: 500 !important; }
html.ka11y-font body :is(h1, h2, h3, h4, h5, h6, strong, b):not(.ka11y *) { font-weight: 700 !important; }

/* Text spacing (WCAG 1.4.12 values) */
html.ka11y-spacing body :not(.ka11y):not(.ka11y *):not(svg):not(svg *) { letter-spacing: .06em !important; word-spacing: .16em !important; }
html.ka11y-spacing body :is(p, li, dd, dt, blockquote, td, th, label, figcaption):not(.ka11y *) { line-height: 1.9 !important; }
html.ka11y-spacing body :is(p):not(.ka11y *) { margin-bottom: 1.4em; }

/* Highlight links */
html.ka11y-links body a:not(.ka11y *) {
	text-decoration: underline !important; text-decoration-thickness: 2px !important; text-underline-offset: 3px !important;
	outline: 2px dashed #FFC400 !important; outline-offset: 2px !important;
}

/* Highlight headings */
html.ka11y-headings body :is(h1, h2, h3, h4, h5, h6):not(.ka11y *) {
	outline: 2px solid #11793A !important; outline-offset: 5px !important; background-color: rgba(17, 121, 58, .12) !important;
}

/* Image descriptions: mark images that have one */
html.ka11y-alt body img[alt]:not([alt=""]):not(.ka11y *) { outline: 2px dashed #0C163A; outline-offset: -4px; }

/* Stop animations (the boot script also flips prefers-reduced-motion) */
html.ka11y-still *:not(.ka11y):not(.ka11y *), html.ka11y-still *::before, html.ka11y-still *::after {
	animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important;
	transition-duration: .001ms !important; transition-delay: 0s !important; scroll-behavior: auto !important;
}
html.ka11y-still { scroll-behavior: auto !important; }
html.ka11y-still .kleyman-cube-cursor, html.ka11y-cursor .kleyman-cube-cursor { display: none !important; }
html.ka11y-still body.kleyman-cube-cursor-active, html.ka11y-still body.kleyman-cube-cursor-active * { cursor: auto !important; }
html.ka11y-still body.kleyman-cube-cursor-active :is(a, button, [role="button"], label, select) { cursor: pointer !important; }
html.ka11y-still body.kleyman-cube-cursor-active :is(input, textarea) { cursor: text !important; }

/* Large cursor */
html.ka11y-cursor, html.ka11y-cursor body, html.ka11y-cursor body * {
	cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M8 4l30 18-13 3-7 14z' fill='%23000' stroke='%23fff' stroke-width='3' stroke-linejoin='round'/%3E%3C/svg%3E") 8 4, auto !important;
}
html.ka11y-cursor body :is(a, button, [role="button"], label, select, summary) , html.ka11y-cursor body :is(a, button) * {
	cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M8 4l30 18-13 3-7 14z' fill='%231755C0' stroke='%23fff' stroke-width='3' stroke-linejoin='round'/%3E%3C/svg%3E") 8 4, pointer !important;
}

/* Strong focus ring */
html.ka11y-focus *:focus, html.ka11y-focus *:focus-visible {
	outline: 3px solid #FFC400 !important; outline-offset: 3px !important; box-shadow: 0 0 0 7px #0C163A !important;
}
