/*
 * Page-wide adjustments. Each is a class on <html>, set by early.js from the
 * visitor's saved choices. The toolbar itself lives in a shadow root and is
 * not touched by these rules, except where noted.
 *
 * #sat-host is the toolbar's host element; it is excluded wherever a rule
 * would otherwise recolour or restyle it.
 */

/* Interim text size for first paint (rem-based text only). toolbar.js swaps
 * these for exact per-element sizes. */
html.sat-text-1 { font-size: 125%; }
html.sat-text-2 { font-size: 150%; }
html.sat-text-3 { font-size: 175%; }
html.sat-text-4 { font-size: 200%; }

/* High contrast */
html.sat-contrast-dark body,
html.sat-contrast-dark body *:not(#sat-host):not(img):not(video):not(svg):not(svg *):not(canvas):not(iframe) {
	background-color: #000 !important;
	background-image: none !important;
	color: #fff !important;
	border-color: #fff !important;
	text-shadow: none !important;
	box-shadow: none !important;
}
html.sat-contrast-dark a:not(#sat-host),
html.sat-contrast-dark a:not(#sat-host) * {
	color: #ffff00 !important;
	text-decoration: underline !important;
}
html.sat-contrast-light body,
html.sat-contrast-light body *:not(#sat-host):not(img):not(video):not(svg):not(svg *):not(canvas):not(iframe) {
	background-color: #fff !important;
	background-image: none !important;
	color: #000 !important;
	border-color: #000 !important;
	text-shadow: none !important;
	box-shadow: none !important;
}
html.sat-contrast-light a:not(#sat-host),
html.sat-contrast-light a:not(#sat-host) * {
	color: #0000ee !important;
	text-decoration: underline !important;
}

/* Colour. Filters go on the root so fixed elements keep their place. */
html.sat-gray { filter: grayscale(1); }
html.sat-lowsat { filter: saturate(0.5); }

/* Links */
html.sat-ul a:not(#sat-host) { text-decoration: underline !important; }
html.sat-hl a:not(#sat-host) {
	background-color: #ffeb3b !important;
	color: #000 !important;
	outline: 2px solid #000 !important;
	text-decoration: underline !important;
}

/* Text spacing: the WCAG 1.4.12 values */
html.sat-spacing body *:not(#sat-host) {
	line-height: 1.5 !important;
	letter-spacing: 0.12em !important;
	word-spacing: 0.16em !important;
}
html.sat-spacing body p:not(#sat-host) { margin-bottom: 2em !important; }

/* Readable font: a system stack. Icon fonts are left alone or their glyphs
 * turn into empty boxes. */
html.sat-font body *:not(#sat-host):not(i):not([class*="icon"]):not([class*="fa-"]):not([class^="fa"]):not(.dashicons):not(.material-icons):not(svg):not(svg *) {
	font-family: Verdana, Tahoma, "Trebuchet MS", sans-serif !important;
}

html.sat-left body *:not(#sat-host) { text-align: left !important; }

/* Stop animations. toolbar.js also pauses video and audio. */
html.sat-nomotion *:not(#sat-host),
html.sat-nomotion *:not(#sat-host)::before,
html.sat-nomotion *:not(#sat-host)::after {
	animation: none !important;
	transition: none !important;
	scroll-behavior: auto !important;
}

/* Big cursor */
html.sat-cursor-black,
html.sat-cursor-black * {
	cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'><path d='M6 3 L6 38 L15 30 L22 45 L29 42 L22 28 L34 28 Z' fill='black' stroke='white' stroke-width='3' stroke-linejoin='round'/></svg>") 6 3, auto !important;
}
html.sat-cursor-white,
html.sat-cursor-white * {
	cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'><path d='M6 3 L6 38 L15 30 L22 45 L29 42 L22 28 L34 28 Z' fill='white' stroke='black' stroke-width='3' stroke-linejoin='round'/></svg>") 6 3, auto !important;
}

/* Stronger focus outline */
html.sat-focus :focus-visible {
	outline: 4px solid #ffbf00 !important;
	outline-offset: 3px !important;
	box-shadow: 0 0 0 7px #000 !important;
}

/* Skip link: off-screen until it takes focus. */
.sat-skip {
	position: absolute;
	left: 8px;
	top: -100px;
	z-index: 2147483002;
	padding: 12px 18px;
	background: #111;
	color: #fff;
	font: 600 16px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	text-decoration: none;
	border-radius: 0 0 8px 8px;
	border: 2px solid #fff;
}
.sat-skip:focus {
	top: 0;
	outline: 3px solid #ffbf00;
	outline-offset: 2px;
}
