/* Abliven Access: the display settings panel, and the visitor's choices.
   Every choice is scoped away from the panel itself (.abl-a-ui), so the
   panel stays readable whatever the visitor picks. */

/* ---------------------------------------------------------------
   Choices
--------------------------------------------------------------- */

html.abl-a-lines body :not(:where(.abl-a-ui, .abl-a-ui *)) { line-height: 1.8 !important; }
html.abl-a-lines body p:not(.abl-a-ui *) { margin-bottom: 1.6em !important; }

html.abl-a-letters body :not(:where(.abl-a-ui, .abl-a-ui *)) { letter-spacing: .12em !important; word-spacing: .16em !important; }

@font-face { font-family: "Abliven Easy"; src: url("fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Abliven Easy"; src: url("fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Abliven Dyslexic"; src: url("fonts/opendyslexic-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Abliven Dyslexic"; src: url("fonts/opendyslexic-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

html.abl-a-font-easy body :not(:where(.abl-a-ui, .abl-a-ui *, i, code, pre, kbd, samp, .dashicons, .material-icons, [class*="icon"], [class*="fa-"], [class^="fa "], [class*="eicon"])) {
	font-family: "Abliven Easy", Verdana, Tahoma, "Segoe UI", Arial, sans-serif !important;
}
html.abl-a-font-dyslexic body :not(:where(.abl-a-ui, .abl-a-ui *, i, code, pre, kbd, samp, .dashicons, .material-icons, [class*="icon"], [class*="fa-"], [class^="fa "], [class*="eicon"])) {
	font-family: "Abliven Dyslexic", "Comic Sans MS", Verdana, sans-serif !important;
}

/* Colour vision. The filters are drawn by the script into the page. A
   greyscale choice takes over, since it removes colour altogether. */
html.abl-a-vision-protan { filter: url("#abl-a-f-protan"); }
html.abl-a-vision-deutan { filter: url("#abl-a-f-deutan"); }
html.abl-a-vision-tritan { filter: url("#abl-a-f-tritan"); }

/* Larger cursor, with a matching hand over links and buttons. */
html.abl-a-cursor, html.abl-a-cursor body * {
	cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' stroke='%23fff' stroke-width='1.3' stroke-linejoin='round' d='M5 2.8v17.4l4.6-4.4 2.9 6.4 3-1.4-2.9-6.3h6.2z'/%3E%3C/svg%3E") 8 4, auto !important;
}
html.abl-a-cursor body :is(a, button, [role="button"], summary, label, select, input[type="checkbox"], input[type="radio"], input[type="submit"]) {
	cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' stroke='%23fff' stroke-width='1.2' stroke-linejoin='round' d='M9 2.5a1.6 1.6 0 0 1 1.6 1.6V11l.7-.2a1.6 1.6 0 0 1 1.9 1.1l.1.3.6-.2a1.6 1.6 0 0 1 2 1l.2.4.5-.1a1.6 1.6 0 0 1 1.9 1.3l.6 3.3a5 5 0 0 1-1 4l-.8 1H9.6l-4-5.3a1.6 1.6 0 0 1 2.3-2.2l-.5-.4V4.1A1.6 1.6 0 0 1 9 2.5z'/%3E%3C/svg%3E") 14 4, pointer !important;
}
html.abl-a-cursor body :is(input[type="text"], input[type="email"], input[type="search"], input[type="tel"], input[type="url"], input[type="number"], input[type="password"], textarea) { cursor: text !important; }

html.abl-a-links body a:not(.abl-a-ui *) { text-decoration: underline !important; text-decoration-thickness: 2px !important; text-underline-offset: .18em !important; }

html.abl-a-focus body :focus-visible:not(.abl-a-ui *) { outline: 3px solid #FFBF47 !important; outline-offset: 2px !important; box-shadow: 0 0 0 6px #0B0C0C !important; }

/* Animations end at once, on their final frame, so nothing that fades in
   is left invisible. */
html.abl-a-motion *:not(.abl-a-ui *), html.abl-a-motion *::before, html.abl-a-motion *::after {
	animation-duration: .001ms !important;
	animation-delay: 0s !important;
	animation-iteration-count: 1 !important;
	transition: none !important;
	scroll-behavior: auto !important;
}

html.abl-a-colour-grey { filter: grayscale(1); }

/* High contrast: white on black, yellow links. */
html.abl-a-colour-contrast, html.abl-a-colour-contrast body { background: #000 !important; }
html.abl-a-colour-contrast body :not(:where(.abl-a-ui, .abl-a-ui *, img, video, picture, source, iframe, canvas, svg, svg *)) {
	background-color: #000 !important;
	background-image: none !important;
	color: #fff !important;
	border-color: #fff !important;
	text-shadow: none !important;
	box-shadow: none !important;
}
html.abl-a-colour-contrast body a:not(.abl-a-ui *), html.abl-a-colour-contrast body a:not(.abl-a-ui *) * { color: #FFEB3B !important; }
html.abl-a-colour-contrast body :is(button, input, select, textarea):not(.abl-a-ui *) { border: 1px solid #fff !important; }
html.abl-a-colour-contrast body ::placeholder { color: #D0D0D0 !important; opacity: 1 !important; }

/* Dark: soft light text on near black. Pictures are left as they are. */
html.abl-a-colour-dark, html.abl-a-colour-dark body { background: #121417 !important; }
html.abl-a-colour-dark body :not(:where(.abl-a-ui, .abl-a-ui *, img, video, picture, source, iframe, canvas, svg, svg *)) {
	background-color: #121417 !important;
	color: #E8EAED !important;
	border-color: #5F6368 !important;
	text-shadow: none !important;
}
html.abl-a-colour-dark body a:not(.abl-a-ui *), html.abl-a-colour-dark body a:not(.abl-a-ui *) * { color: #8AB4F8 !important; }
html.abl-a-colour-dark body :is(button, input, select, textarea):not(.abl-a-ui *) { background-color: #202124 !important; }
html.abl-a-colour-dark body ::placeholder { color: #9AA0A6 !important; opacity: 1 !important; }

.abl-a-band {
	position: fixed;
	left: 0;
	right: 0;
	top: 0;
	height: 36px;
	pointer-events: none;
	z-index: 2147483000;
	background: rgba(255, 235, 59, .16);
	border-top: 2px solid #0D2440;
	border-bottom: 2px solid #0D2440;
	will-change: transform;
}

/* ---------------------------------------------------------------
   The panel. Set in full so a theme's own button and heading
   styles cannot change it.
--------------------------------------------------------------- */

#abl-access {
	--abl-btn: #0D2440;
	--abl-off: 20px;
	--abl-ink: #0F172A;
	--abl-ink2: #475569;
	--abl-edge: #CBD5E1;
	--abl-soft: #F1F5F9;
	--abl-go: #0369A1;
	position: fixed;
	bottom: var(--abl-off);
	z-index: 2147483001;
	font: 400 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	color: var(--abl-ink);
	letter-spacing: normal;
	word-spacing: normal;
	text-transform: none;
	text-align: left;
}
#abl-access.abl-a-right { right: var(--abl-off); }
#abl-access.abl-a-left { left: var(--abl-off); }
#abl-access *, #abl-access *::before, #abl-access *::after { box-sizing: border-box; font-family: inherit; letter-spacing: normal; word-spacing: normal; text-transform: none; line-height: 1.45; }
#abl-access [hidden] { display: none !important; }

#abl-access .abl-a-open {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	margin: 0;
	padding: 0;
	border: 2px solid #fff;
	border-radius: 50%;
	background: var(--abl-btn);
	color: #fff;
	box-shadow: 0 4px 14px rgba(15, 23, 42, .28);
	cursor: pointer;
	min-width: 0;
	min-height: 0;
}
#abl-access .abl-a-open:hover { filter: brightness(1.15); }
#abl-access .abl-a-open:focus-visible,
#abl-access .abl-a-panel :focus-visible { outline: 3px solid #FFBF47; outline-offset: 2px; box-shadow: 0 0 0 5px #0B0C0C; }
#abl-access .abl-a-open[aria-expanded="true"] { box-shadow: 0 0 0 3px var(--abl-btn), 0 4px 14px rgba(15, 23, 42, .28); }

#abl-access .abl-a-panel {
	position: absolute;
	bottom: 64px;
	width: 340px;
	max-height: min(640px, calc(100vh - 110px));
	overflow-y: auto;
	overscroll-behavior: contain;
	background: #fff;
	color: var(--abl-ink);
	border: 1px solid var(--abl-edge);
	border-radius: 16px;
	box-shadow: 0 18px 50px rgba(15, 23, 42, .25);
	padding: 0 0 12px;
}
#abl-access.abl-a-right .abl-a-panel { right: 0; }
#abl-access.abl-a-left .abl-a-panel { left: 0; }

#abl-access .abl-a-head {
	position: sticky;
	top: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 14px 12px 10px 18px;
	background: #fff;
	border-bottom: 1px solid var(--abl-soft);
}
#abl-access h2 { margin: 0; padding: 0; font-size: 18px; font-weight: 700; color: var(--abl-ink); border: 0; background: none; }
#abl-access h2:focus { outline: none; }
#abl-access h2:focus-visible { outline: 3px solid #FFBF47; outline-offset: 2px; }
#abl-access h3, #abl-access legend { margin: 0 0 6px; padding: 0; font-size: 12.5px; font-weight: 700; color: var(--abl-ink2); text-transform: uppercase; letter-spacing: .05em; border: 0; background: none; }
#abl-access .abl-a-close {
	display: flex; align-items: center; justify-content: center;
	width: 36px; height: 36px; margin: 0; padding: 0;
	border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--abl-ink); cursor: pointer; min-width: 0; min-height: 0;
}
#abl-access .abl-a-close:hover { background: var(--abl-soft); }
#abl-access .abl-a-intro { margin: 10px 18px 4px; font-size: 14px; color: var(--abl-ink2); }

#abl-access .abl-a-sec { margin: 12px 18px 0; padding: 12px 0 0; border: 0; border-top: 1px solid var(--abl-soft); min-width: 0; }
#abl-access fieldset.abl-a-sec { padding-top: 12px; }
#abl-access .abl-a-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; }
#abl-access .abl-a-row label, #abl-access .abl-a-label { font-size: 15px; color: var(--abl-ink); cursor: pointer; margin: 0; padding: 0; font-weight: 500; }
#abl-access .abl-a-label { cursor: default; }

/* Switches: real checkboxes, drawn as switches. */
#abl-access input[type="checkbox"] {
	-webkit-appearance: none;
	appearance: none;
	position: relative;
	flex: 0 0 44px;
	width: 44px;
	height: 24px;
	margin: 0;
	border: 2px solid #64748B;
	border-radius: 999px;
	background: #fff;
	cursor: pointer;
	transition: background-color .15s;
}
#abl-access input[type="checkbox"]::after {
	content: "";
	position: absolute;
	top: 2px;
	left: 2px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #64748B;
	transition: transform .15s;
}
#abl-access input[type="checkbox"]:checked { background: var(--abl-go); border-color: var(--abl-go); }
#abl-access input[type="checkbox"]:checked::after { background: #fff; transform: translateX(20px); }

#abl-access .abl-a-stepper { display: inline-flex; align-items: center; gap: 6px; }
#abl-access .abl-a-step {
	width: 44px; height: 36px; margin: 0; padding: 0;
	border: 1px solid #64748B; border-radius: 8px; background: #fff; color: var(--abl-ink);
	font-size: 14px; font-weight: 700; cursor: pointer; min-width: 0; min-height: 0;
}
#abl-access .abl-a-step--big { font-size: 17px; }
#abl-access .abl-a-step:hover:not(:disabled) { background: var(--abl-soft); }
#abl-access .abl-a-step:disabled { color: #94A3B8; border-color: var(--abl-edge); cursor: not-allowed; }
#abl-access .abl-a-size { min-width: 48px; text-align: center; font-weight: 700; font-size: 15px; }

#abl-access .abl-a-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#abl-access .abl-a-chip { position: relative; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 10px; border: 1px solid var(--abl-edge); border-radius: 10px; }
#abl-access .abl-a-chip:has(input:checked) { border: 2px solid var(--abl-go); background: #F0F9FF; }
#abl-access .abl-a-chip input[type="radio"] { margin: 0; width: 18px; height: 18px; accent-color: var(--abl-go); cursor: pointer; flex: 0 0 18px; }
#abl-access .abl-a-chip label { font-size: 14.5px; cursor: pointer; margin: 0; padding: 0; font-weight: 500; color: var(--abl-ink); }
#abl-access .abl-a-chip label::after { content: ""; position: absolute; inset: 0; }

#abl-access .abl-a-foot { margin: 14px 18px 0; padding-top: 12px; border-top: 1px solid var(--abl-soft); }
#abl-access .abl-a-reset {
	width: 100%; min-height: 42px; margin: 0; padding: 0 14px;
	border: 1px solid #64748B; border-radius: 10px; background: #fff; color: var(--abl-ink);
	font-size: 15px; font-weight: 600; cursor: pointer;
}
#abl-access .abl-a-reset:hover { background: var(--abl-soft); }
#abl-access .abl-a-sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

#abl-access .abl-a-note { margin: 0 0 8px; font-size: 13.5px; color: var(--abl-ink2); }
#abl-access .abl-a-acts { display: flex; gap: 8px; flex-wrap: wrap; }
#abl-access .abl-a-act {
	flex: 1 1 auto; min-height: 42px; margin: 0; padding: 0 14px;
	border: 1px solid var(--abl-go); border-radius: 10px; background: var(--abl-go); color: #fff;
	font-size: 15px; font-weight: 600; cursor: pointer;
}
#abl-access .abl-a-act:hover { background: #075985; }
#abl-access .abl-a-act--ghost { background: #fff; color: var(--abl-ink); border-color: #64748B; }
#abl-access .abl-a-act--ghost:hover { background: var(--abl-soft); }
#abl-access .abl-a-disclaimer { margin: 12px 0 0; font-size: 12.5px; color: var(--abl-ink2); }
#abl-access .abl-a-by { display: inline-block; margin-top: 6px; font-size: 12.5px; font-weight: 600; color: var(--abl-go); text-decoration: underline; text-underline-offset: .15em; }
#abl-access .abl-a-by:hover { color: #075985; }

/* A lapsed licence: a quiet marker, never a control. */
#abl-access.abl-a-inactive { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; background: #F1F5F9; border: 1px solid #CBD5E1; color: #475569; font-size: 12.5px; font-weight: 600; box-shadow: 0 2px 6px rgba(15, 23, 42, .12); }
#abl-access.abl-a-inactive .abl-a-dot { width: 8px; height: 8px; border-radius: 50%; background: #94A3B8; }

@media (max-width: 600px) {
	#abl-access.abl-a-nomobile { display: none; }
	#abl-access .abl-a-panel { position: fixed; left: 8px !important; right: 8px !important; bottom: calc(var(--abl-off) + 64px); width: auto; max-height: calc(100vh - 100px); }
}

@media (forced-colors: active) {
	#abl-access .abl-a-open, #abl-access .abl-a-panel, #abl-access .abl-a-step, #abl-access .abl-a-reset, #abl-access input[type="checkbox"] { border: 2px solid ButtonText; }
	#abl-access input[type="checkbox"]::after { background: ButtonText; }
	#abl-access input[type="checkbox"]:checked { background: Highlight; }
	.abl-a-band { border-color: Highlight; background: transparent; }
}

@media print {
	#abl-access, .abl-a-band { display: none !important; }
}
