/*
 * Accessibility menu. Sizes are in rem against the theme's 10px root (html.small-font), so the
 * panel grows with the text-size setting like the rest of the site.
 */

/* The trigger keeps the old link's look; it is a <button> now, so reset the button styles. */
button.open-accessibility {
	padding: 0;
	border: 0;
	background: none;
	font-family: inherit;
	line-height: inherit;
	cursor: pointer;
}

.a11y {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 1000;
	width: 28rem;
	padding: 1.6rem;
	border: 2px solid #000;
	background: #fff;
	color: #000;
	font-size: 1.8rem;
	line-height: 1.4;
	text-align: right;
	box-shadow: 0 0.6rem 2rem rgba(0, 0, 0, 0.25);
}

.ltr .a11y {
	right: 0;
	left: auto;
	text-align: left;
}

.a11y[hidden] {
	display: none;
}

.a11y-ttl {
	margin: 0 0 1.2rem;
	font-size: 2rem;
	font-weight: 700;
}

.a11y-sizes {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin: 0 0 1rem;
	padding: 0;
	border: 0;
}

.a11y-sizes legend {
	float: right;
	margin: 0 0 0 auto;
	padding: 0;
	border: 0;
	font-size: inherit;
}

.ltr .a11y-sizes legend {
	float: left;
	margin: 0 auto 0 0;
}

.a11y button {
	min-width: 4.4rem;
	min-height: 4.4rem;
	padding: 0.6rem 1.2rem;
	border: 2px solid #000;
	background: #fff;
	color: #000;
	font-family: inherit;
	font-size: inherit;
	line-height: 1.2;
	cursor: pointer;
}

.a11y button:hover {
	background: #eee;
}

.a11y button[aria-pressed="true"] {
	background: #000;
	color: #fff;
}

.a11y button:focus-visible,
button.open-accessibility:focus-visible {
	outline: 3px solid #000 !important;
	outline-offset: 2px;
	box-shadow: 0 0 0 5px #fff;
}

.a11y-sizes button {
	padding: 0;
	font-weight: 700;
}

.a11y-sizes [data-a11y-size="small-font"] { font-size: 1.6rem; }
.a11y-sizes [data-a11y-size="medium-font"] { font-size: 2.2rem; }
.a11y-sizes [data-a11y-size="large-font"] { font-size: 2.8rem; }

.a11y-list {
	display: grid;
	gap: 0.6rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.a11y-list button {
	width: 100%;
	text-align: inherit;
}

.a11y-foot {
	display: flex;
	justify-content: space-between;
	gap: 0.6rem;
	margin-top: 1rem;
}

/* Mobile: the trigger lives in the slide-out menu; the panel opens as a sheet over the page. */
.a11y-mobile {
	display: block;
	margin: 1.5rem auto 0;
	padding: 1rem 2rem;
	border: 2px solid currentColor;
	background: none;
	color: inherit;
	font-family: inherit;
	font-size: 2rem;
}

@media (max-width: 768px) {
	.a11y {
		position: fixed;
		top: auto;
		right: 1rem;
		bottom: 1rem;
		left: 1rem;
		width: auto;
		max-height: 85vh;
		overflow-y: auto;
	}
}

/* ---------- The settings ---------- */

/* Highlight links: underlined, yellow background, black text, outlined. */
html.a11y-links a,
html.a11y-links a * {
	color: #000 !important;
	text-decoration: underline !important;
}

html.a11y-links a {
	background-color: #ffeb3b !important;
	outline: 2px solid #000 !important;
	outline-offset: 1px;
}

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

/* Respect the operating system's reduced-motion setting even without the menu. */
@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;
	}
}


/* ---------- Site-wide basics (2026 refactor) ---------- */

/* Skip link: hidden until focused with the keyboard, then shown at the top of the page. */
.skip-link {
	position: absolute;
	top: -100px;
	right: 1rem;
	z-index: 100000;
	padding: 1rem 2rem;
	background: #000;
	color: #fff !important;
	font-size: 1.8rem;
}

.skip-link:focus {
	position: fixed;
	top: 1rem;
}

.ltr .skip-link {
	right: auto;
	left: 1rem;
}

#top_wrapper:focus,
#top_wrapper:focus-visible {
	outline: 0 !important;
	box-shadow: none;
}

/*
 * Keyboard focus. The theme forced a faint grey outline colour on everything (and removed it on
 * some fields), so focus was hard or impossible to see. Shown only for keyboard focus.
 */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible,
[role="button"]:focus-visible {
	outline: 2px solid #000 !important;
	outline-offset: 2px;
	box-shadow: 0 0 0 4px #fff;
}

footer a:focus-visible,
footer button:focus-visible,
footer input:focus-visible {
	outline-color: #fff !important;
	box-shadow: 0 0 0 4px #000;
}
