/* Accessibility & Cookie Consent – accessibility panel and page adjustments.
 * The plugin UI (.aacc-ui) uses px units so text scaling does not resize it, and is excluded from every page adjustment. */

/* ---------- Shared UI reset ---------- */
.aacc-ui,
.aacc-ui *,
.aacc-ui *::before,
.aacc-ui *::after {
	box-sizing: border-box;
	letter-spacing: normal;
	word-spacing: normal;
	text-transform: none;
	text-shadow: none;
}
.aacc-ui [hidden] { display: none !important; }
.aacc-sr {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	overflow: hidden !important;
	clip: rect(0 0 0 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* ---------- Trigger ---------- */
.aacc-a11y {
	--aacc-gap: 24px;
	font: 400 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--aacc-text, #1d2327);
}
.aacc-a11y__trigger {
	position: fixed;
	z-index: 2147483600;
	bottom: calc(var(--aacc-gap) + var(--aacc-offset-bottom, 0px));
	left: var(--aacc-gap);
	display: grid;
	place-items: center;
	width: 56px;
	height: 56px;
	margin: 0;
	padding: 0;
	border: 2px solid var(--aacc-accent-text, #fff);
	border-radius: 50%;
	background: var(--aacc-accent, #16181d);
	color: var(--aacc-accent-text, #fff);
	box-shadow: 0 4px 16px rgba(0, 0, 0, .28);
	cursor: pointer;
	transition: transform .15s ease, bottom .2s ease;
}
.aacc-a11y--right .aacc-a11y__trigger { left: auto; right: var(--aacc-gap); }
.aacc-a11y__trigger:hover { transform: scale(1.06); }
.aacc-ui :focus-visible {
	outline: 3px solid var(--aacc-link, #1a56db) !important;
	outline-offset: 2px !important;
}
.aacc-a11y__trigger:focus-visible { outline-color: var(--aacc-accent, #16181d) !important; outline-offset: 3px !important; }

/* ---------- Panel ---------- */
.aacc-a11y__panel {
	position: fixed;
	z-index: 2147483601;
	top: 16px;
	bottom: calc(var(--aacc-gap) + 56px + 16px + var(--aacc-offset-bottom, 0px));
	left: 16px;
	width: 340px;
	max-width: calc(100vw - 32px);
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 16px 20px 18px;
	border-radius: 18px;
	background: var(--aacc-bg, #fff);
	color: var(--aacc-text, #1d2327);
	box-shadow: 0 12px 48px rgba(0, 0, 0, .3);
	animation: aacc-slide-in .2s ease-out;
}
.aacc-a11y--right .aacc-a11y__panel { left: auto; right: 16px; }
@keyframes aacc-slide-in {
	from { opacity: 0; transform: translateY(12px); }
	to { opacity: 1; transform: none; }
}
.aacc-a11y__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 4px;
}
.aacc-a11y .aacc-a11y__title {
	margin: 0;
	padding: 0;
	font-weight: 700;
	font-size: 18px;
	line-height: 1.3;
	font-family: inherit;
	color: inherit;
}
.aacc-a11y__close {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	margin: 0 -8px 0 0;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: inherit;
	cursor: pointer;
}
.aacc-a11y__close:hover { background: rgba(0, 0, 0, .06); }
.aacc-a11y .aacc-a11y__section {
	margin: 18px 0 8px;
	padding: 0;
	font-weight: 700;
	font-size: 12px;
	line-height: 1.3;
	font-family: inherit;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: inherit;
	opacity: .72;
}
.aacc-a11y__profiles {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}
.aacc-a11y button.aacc-a11y__profile,
.aacc-a11y button.aacc-a11y__step,
.aacc-a11y button.aacc-a11y__toggle,
.aacc-a11y button.aacc-a11y__reset {
	margin: 0;
	font-weight: 600;
	font-size: 15px;
	line-height: 1.25;
	font-family: inherit;
	color: inherit;
	cursor: pointer;
	border: 1px solid rgba(0, 0, 0, .16);
	border-radius: 8px;
	background: rgba(0, 0, 0, .035);
	text-align: left;
	min-height: 44px;
}
.aacc-a11y button.aacc-a11y__profile { padding: 10px 12px; }
.aacc-a11y button.aacc-a11y__profile[aria-pressed="true"] {
	background: var(--aacc-accent, #16181d);
	border-color: var(--aacc-accent, #16181d);
	color: var(--aacc-accent-text, #fff);
}
.aacc-a11y__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 8px;
}
.aacc-a11y__label { font-weight: 600; }
.aacc-a11y__stepper { display: inline-flex; gap: 6px; }
.aacc-a11y button.aacc-a11y__step {
	min-width: 48px;
	padding: 8px 10px;
	text-align: center;
	background: transparent;
}
.aacc-a11y button.aacc-a11y__step--value { border-color: transparent; font-weight: 700; }
.aacc-a11y button.aacc-a11y__step--wide { min-width: 120px; }
.aacc-a11y button.aacc-a11y__step:disabled { opacity: .4; cursor: not-allowed; }
.aacc-a11y .aacc-a11y__toggles {
	display: grid;
	gap: 8px;
	margin: 10px 0 0;
	padding: 0;
	list-style: none;
}
.aacc-a11y .aacc-a11y__toggles li { margin: 0; padding: 0; }
.aacc-a11y .aacc-a11y__toggles li::before,
.aacc-a11y .aacc-a11y__toggles li::marker { content: none; }
.aacc-a11y button.aacc-a11y__toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	padding: 10px 14px;
	background: transparent;
	font-weight: 500;
}
.aacc-a11y__check {
	position: relative;
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	border: 2px solid currentColor;
	border-radius: 5px;
}
.aacc-a11y button.aacc-a11y__toggle[aria-checked="true"] {
	border-color: var(--aacc-accent, #16181d);
	box-shadow: inset 0 0 0 1px var(--aacc-accent, #16181d);
}
.aacc-a11y button.aacc-a11y__toggle[aria-checked="true"] .aacc-a11y__check {
	background: var(--aacc-accent, #16181d);
	border-color: var(--aacc-accent, #16181d);
}
.aacc-a11y button.aacc-a11y__toggle[aria-checked="true"] .aacc-a11y__check::after {
	content: "";
	position: absolute;
	left: 6px;
	top: 1px;
	width: 6px;
	height: 12px;
	border: solid var(--aacc-accent-text, #fff);
	border-width: 0 2.5px 2.5px 0;
	transform: rotate(45deg);
}
.aacc-a11y button.aacc-a11y__reset {
	width: 100%;
	margin-top: 16px;
	padding: 12px;
	text-align: center;
	border-color: transparent;
	background: rgba(0, 0, 0, .08);
}
.aacc-a11y button:hover:not(:disabled) { filter: brightness(.96); }
.aacc-a11y__note {
	margin: 10px 0 0;
	font-size: 13px;
	text-align: center;
	opacity: .75;
}

@media (max-width: 600px) {
	.aacc-a11y { --aacc-gap: 16px; }
	.aacc-a11y__trigger { width: 48px; height: 48px; }
	.aacc-a11y__trigger svg { width: 24px; height: 24px; }
	.aacc-a11y__panel,
	.aacc-a11y--right .aacc-a11y__panel {
		top: auto;
		left: 8px;
		right: 8px;
		bottom: 8px;
		width: auto;
		max-width: none;
		max-height: calc(100dvh - 16px);
	}
}

/* Panel follows dark mode / contrast of the page. */
html.aacc-dark .aacc-a11y__panel { background: #1c1d21; color: #f0f0f0; }
html.aacc-dark .aacc-a11y button.aacc-a11y__profile,
html.aacc-dark .aacc-a11y button.aacc-a11y__step,
html.aacc-dark .aacc-a11y button.aacc-a11y__toggle,
html.aacc-dark .aacc-a11y button.aacc-a11y__reset { border-color: rgba(255, 255, 255, .25); background-color: rgba(255, 255, 255, .06); }
html.aacc-dark .aacc-a11y button.aacc-a11y__profile[aria-pressed="true"],
html.aacc-dark .aacc-a11y button.aacc-a11y__toggle[aria-checked="true"] .aacc-a11y__check { background: #f0f0f0; border-color: #f0f0f0; color: #111; }
html.aacc-dark .aacc-a11y button.aacc-a11y__toggle[aria-checked="true"] { border-color: #f0f0f0; box-shadow: inset 0 0 0 1px #f0f0f0; }
html.aacc-dark .aacc-a11y button.aacc-a11y__toggle[aria-checked="true"] .aacc-a11y__check::after { border-color: #111; }
html.aacc-contrast .aacc-a11y button.aacc-a11y__profile,
html.aacc-contrast .aacc-a11y button.aacc-a11y__step,
html.aacc-contrast .aacc-a11y button.aacc-a11y__toggle { border-width: 2px; border-color: currentColor; }

@media (prefers-reduced-motion: reduce) {
	.aacc-a11y__panel { animation: none; }
	.aacc-a11y__trigger { transition: none; }
	.aacc-a11y__trigger:hover { transform: none; }
}
html.aacc-anim .aacc-a11y__panel { animation: none; }

/* ---------- Page adjustments ---------- */

/* Text size: 100% base for the first paint, then the script sets the exact px value. */
html.aacc-fs { font-size: calc(100% * var(--aacc-scale, 1)) !important; }

/* Saturation (filter on the root element does not break fixed positioning). */
html.aacc-sat-low { filter: saturate(.5); }
html.aacc-sat-high { filter: saturate(1.8); }
html.aacc-sat-mono { filter: grayscale(1); }

/* Text spacing (WCAG 1.4.12). */
html.aacc-spacing body *:not(.aacc-ui, .aacc-ui *) {
	letter-spacing: .12em !important;
	word-spacing: .16em !important;
}
html.aacc-spacing body :is(p, li, dd, dt, td, th, blockquote, figcaption, label, span, a):not(.aacc-ui *) { line-height: 1.6 !important; }
html.aacc-spacing body p:not(.aacc-ui *) { margin-bottom: 2em !important; }

/* High contrast and dark mode share the same color override; the values change. */
html.aacc-contrast {
	--aacc-x-bg: #fff;
	--aacc-x-fg: #000;
	--aacc-x-link: #0030b8;
	--aacc-x-border: #000;
}
html.aacc-dark {
	--aacc-x-bg: #121316;
	--aacc-x-fg: #ececec;
	--aacc-x-link: #9cc3ff;
	--aacc-x-border: #5f6368;
}
html.aacc-dark.aacc-contrast {
	--aacc-x-bg: #000;
	--aacc-x-fg: #fff;
	--aacc-x-link: #ffef00;
	--aacc-x-border: #fff;
}
html.aacc-contrast,
html.aacc-dark,
html.aacc-contrast body,
html.aacc-dark body {
	background: var(--aacc-x-bg) !important;
	color: var(--aacc-x-fg) !important;
}
html.aacc-contrast body *:not(.aacc-ui, .aacc-ui *, img, video, picture, svg, svg *, iframe),
html.aacc-dark body *:not(.aacc-ui, .aacc-ui *, img, video, picture, svg, svg *, iframe) {
	background-color: var(--aacc-x-bg) !important;
	background-image: none !important;
	color: var(--aacc-x-fg) !important;
	border-color: var(--aacc-x-border) !important;
	text-shadow: none !important;
	box-shadow: none !important;
}
html.aacc-contrast body :is(a, a *):not(.aacc-ui *),
html.aacc-dark body :is(a, a *):not(.aacc-ui *) {
	color: var(--aacc-x-link) !important;
}
html.aacc-contrast body a:not(.aacc-ui *) { text-decoration: underline !important; }
html.aacc-contrast body :is(button, input, select, textarea, .wp-element-button, .wp-block-button__link):not(.aacc-ui *) {
	border: 2px solid var(--aacc-x-border) !important;
}
html.aacc-contrast body :focus-visible:not(.aacc-ui *) { outline: 3px solid var(--aacc-x-link) !important; outline-offset: 2px !important; }

/* Highlight links and headings. */
html.aacc-links body a:not(.aacc-ui *) {
	text-decoration: underline !important;
	text-decoration-thickness: 2px !important;
	text-underline-offset: .2em !important;
	outline: 3px solid #f2b200 !important;
	outline-offset: 2px !important;
}
html.aacc-headings body :is(h1, h2, h3, h4, h5, h6, [role="heading"]):not(.aacc-ui *) {
	outline: 3px dashed #1a73e8 !important;
	outline-offset: 4px !important;
}

/* Hide images. */
html.aacc-images body :is(img, picture, video, svg[role="img"], .wp-block-cover__image-background):not(.aacc-ui *) {
	visibility: hidden !important;
}
html.aacc-images body *:not(.aacc-ui, .aacc-ui *) { background-image: none !important; }

/* Stop animations (end states are kept). */
html.aacc-anim *:not(.aacc-ui *),
html.aacc-anim *::before,
html.aacc-anim *::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;
}

/* Readable font (system fonts, no downloads); icon fonts are left alone. */
html.aacc-font body *:not(.aacc-ui, .aacc-ui *, i, [class*="icon"], [class*="dashicons"], [class*="fa-"], [aria-hidden="true"], code, pre, kbd) {
	font-family: Verdana, Tahoma, "Segoe UI", "Helvetica Neue", Arial, sans-serif !important;
}

/* Big cursor. */
html.aacc-cursor,
html.aacc-cursor * {
	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='M6 3l30 27H22l8 15-6 3-8-15-10 9z' fill='%23000' stroke='%23fff' stroke-width='3' stroke-linejoin='round'/%3E%3C/svg%3E") 6 3, auto !important;
}
html.aacc-cursor :is(a, button, [role="button"], [role="switch"], label, select, summary, input[type="checkbox"], input[type="radio"], input[type="submit"]),
html.aacc-cursor :is(a, button, [role="button"], [role="switch"], label, summary) * {
	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='M6 3l30 27H22l8 15-6 3-8-15-10 9z' fill='%231a56db' stroke='%23fff' stroke-width='3' stroke-linejoin='round'/%3E%3C/svg%3E") 6 3, pointer !important;
}
html.aacc-cursor :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; }

/* Reading guide and reading mask. */
.aacc-guide-bar {
	position: fixed;
	z-index: 2147483300;
	top: -7px;
	left: 0;
	right: 0;
	height: 14px;
	pointer-events: none;
	background: rgba(255, 214, 0, .35);
	border-top: 3px solid #111;
	border-bottom: 3px solid #ffd600;
	will-change: transform;
}
.aacc-mask-layer {
	--aacc-mask-y: 33vh;
	--aacc-mask-h: 110px;
	position: fixed;
	z-index: 2147483300;
	inset: 0;
	pointer-events: none;
}
.aacc-mask__top,
.aacc-mask__bottom {
	position: absolute;
	left: 0;
	right: 0;
	background: rgba(0, 0, 0, .62);
}
.aacc-mask__top { top: 0; height: max(0px, calc(var(--aacc-mask-y) - var(--aacc-mask-h) / 2)); }
.aacc-mask__bottom { bottom: 0; top: calc(var(--aacc-mask-y) + var(--aacc-mask-h) / 2); }
