/*! AWX Accessibility Toolbar 0.1.2 | page-level styles | GPL-2.0-or-later */

/* ---------- Host element: reserves the bar's space from first paint ---------- */
#awxa-root {
  display: block;
  position: relative;
  z-index: 99990;
  zoom: var(--awxa-unzoom, 1);
}
#awxa-root[data-layout="bar"] {
  min-height: 48px;
  background: #fff;
}
#awxa-root[data-layout="bar"][data-theme="dark"] {
  background: #1f2328;
}
#awxa-root[data-layout="bar"][data-sticky] {
  position: sticky;
  top: 0;
}

/* ---------- Skip link (only added when the theme has none) ---------- */
.awxa-skip {
  position: absolute;
  left: 8px;
  top: -200px;
  z-index: 99999;
  padding: 12px 16px;
  background: #000;
  color: #fff;
  font: 600 16px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  text-decoration: underline;
  border-radius: 0 0 6px 6px;
}
.awxa-skip:focus {
  top: 0;
  outline: 3px solid #ffbf47;
  outline-offset: 2px;
}

/* ---------- Colour filters ---------- */
html[data-awxa-contrast="mono"] { filter: grayscale(1); }
html[data-awxa-contrast="lowsat"] { filter: saturate(.5); }
html[data-awxa-contrast="highsat"] { filter: saturate(2); }
html[data-awxa-contrast="invert"] {
  filter: invert(1) hue-rotate(180deg);
  background-color: #fff;
}
/* Put photos and video back the right way round. */
html[data-awxa-contrast="invert"] :is(img, video, canvas, iframe) {
  filter: invert(1) hue-rotate(180deg);
}

/* ---------- Dark contrast ---------- */
html[data-awxa-contrast="dark"] { background: #000 !important; }
html[data-awxa-contrast="dark"] body,
html[data-awxa-contrast="dark"] body :not(#awxa-root, img, picture, video, canvas, iframe, svg, svg *, :empty) {
  background-color: #000 !important;
  background-image: none !important;
  color: #fff !important;
  border-color: #fff !important;
  box-shadow: none !important;
  text-shadow: none !important;
}
html[data-awxa-contrast="dark"] body :is(a, a *):not(#awxa-root, img, picture, video, canvas, iframe, svg, svg *, :empty) {
  color: #ffe600 !important;
}
html[data-awxa-contrast="dark"] body a:not(#awxa-root) {
  text-decoration: underline !important;
}
html[data-awxa-contrast="dark"] body :is(input, textarea, select, button):not(#awxa-root) {
  background-color: #000 !important;
  color: #fff !important;
  border: 1px solid #fff !important;
  accent-color: #ffe600;
}
html[data-awxa-contrast="dark"] body ::placeholder { color: #d0d0d0 !important; opacity: 1 !important; }
html[data-awxa-contrast="dark"] body :focus-visible {
  outline: 3px solid #ffe600 !important;
  outline-offset: 2px !important;
}

/* ---------- Light contrast ---------- */
html[data-awxa-contrast="light"] { background: #fff !important; }
html[data-awxa-contrast="light"] body,
html[data-awxa-contrast="light"] body :not(#awxa-root, img, picture, video, canvas, iframe, svg, svg *, :empty) {
  background-color: #fff !important;
  background-image: none !important;
  color: #000 !important;
  border-color: #000 !important;
  box-shadow: none !important;
  text-shadow: none !important;
}
html[data-awxa-contrast="light"] body :is(a, a *):not(#awxa-root, img, picture, video, canvas, iframe, svg, svg *, :empty) {
  color: #00309e !important;
}
html[data-awxa-contrast="light"] body a:not(#awxa-root) {
  text-decoration: underline !important;
}
html[data-awxa-contrast="light"] body :is(input, textarea, select, button):not(#awxa-root) {
  background-color: #fff !important;
  color: #000 !important;
  border: 1px solid #000 !important;
  accent-color: #00309e;
}
html[data-awxa-contrast="light"] body ::placeholder { color: #444 !important; opacity: 1 !important; }
html[data-awxa-contrast="light"] body :focus-visible {
  outline: 3px solid #00309e !important;
  outline-offset: 2px !important;
}

/* ---------- See-through images ----------
   The script marks images whose ink would vanish against the forced
   background (a dark logo on black, a white logo on white). They get a
   plain backing; the shadow widens it a little without moving anything. */
html[data-awxa-contrast="dark"] body img[data-awxa-ink="dark"] {
  background-color: #fff !important;
  box-shadow: 0 0 0 4px #fff !important;
  border-radius: 2px;
}
html[data-awxa-contrast="light"] body img[data-awxa-ink="light"] {
  background-color: #000 !important;
  box-shadow: 0 0 0 4px #000 !important;
  border-radius: 2px;
}

/* ---------- Highlight links and headings ---------- */
html[data-awxa-links] body a[href]:not(#awxa-root) {
  outline: 3px solid #c2410c !important;
  outline-offset: 2px !important;
  text-decoration: underline !important;
}
html[data-awxa-headings] body :is(h1, h2, h3, h4, h5, h6, [role="heading"]):not(#awxa-root) {
  outline: 3px solid #1a56db !important;
  outline-offset: 4px !important;
}
html[data-awxa-contrast="dark"][data-awxa-links] body a[href]:not(#awxa-root) { outline-color: #ff9d5c !important; }
html[data-awxa-contrast="dark"][data-awxa-headings] body :is(h1, h2, h3, h4, h5, h6, [role="heading"]):not(#awxa-root) { outline-color: #8ab4ff !important; }

/* ---------- Line height and letter spacing ---------- */
html[data-awxa-lh="1"] { --awxa-lh: 1.6; }
html[data-awxa-lh="2"] { --awxa-lh: 1.8; }
html[data-awxa-lh="3"] { --awxa-lh: 2.1; }
html[data-awxa-lh="4"] { --awxa-lh: 2.5; }
html[data-awxa-lh] body :not(#awxa-root) {
  line-height: var(--awxa-lh) !important;
}
html[data-awxa-ls="1"] { --awxa-ls: .04em; --awxa-ws: .06em; }
html[data-awxa-ls="2"] { --awxa-ls: .08em; --awxa-ws: .12em; }
html[data-awxa-ls="3"] { --awxa-ls: .12em; --awxa-ws: .16em; }
html[data-awxa-ls="4"] { --awxa-ls: .18em; --awxa-ws: .24em; }
html[data-awxa-ls] body :not(#awxa-root) {
  letter-spacing: var(--awxa-ls) !important;
  word-spacing: var(--awxa-ws) !important;
}

/* ---------- Read-aloud highlighting ---------- */
::highlight(awxa-sentence) { background-color: #fff3a3; color: #000; }
::highlight(awxa-word) { background-color: #ffbf47; color: #000; }
[data-awxa-reading] {
  outline: 3px solid #ffbf47 !important;
  outline-offset: 3px !important;
}

@media print {
  #awxa-root, .awxa-skip { display: none !important; }
}
