/* Accessibility widget (WCAG 2.1 AA). Port of Indtegrate's AccessibilityWidget styles.
   Added at serve time by lib/a11y.ts only while Admin -> Accessibility has it enabled.
   The widget chrome resets the WordPress theme's button styles (hello-biz paints buttons on
   hover/focus), so every interactive state below sets its own background and colour. */
:root {
  --a11y-font-scale: 1;
  --a11y-blue: #1f3446;
  --a11y-blue-hi: #3c6e91;
  --a11y-blue-fg: #ffffff;
  --a11y-bottom-offset: 0px;
}

/* Text size. The Elementor page sets most sizes in px, so a root font-size change would do almost
   nothing; zoom on the page wrappers scales the text (and layout) the way browser zoom does, while the
   widget itself (a direct child of body) stays put. */
html.a11y-text-scaled body > *:not(.a11y-fab):not(.a11y-panel):not(.a11y-reading-guide-bar) {
  zoom: var(--a11y-font-scale, 1);
}

.a11y-fab, .a11y-panel, .a11y-panel * { box-sizing: border-box; }
.a11y-fab, .a11y-panel button {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  text-transform: none;
  letter-spacing: normal;
  margin: 0;
  box-shadow: none;
  text-decoration: none;
}

.a11y-fab {
  position: fixed;
  left: 20px;
  bottom: calc(20px + var(--a11y-bottom-offset, 0px));
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: 9999px;
  background: var(--a11y-blue);
  color: var(--a11y-blue-fg);
  border: 2px solid rgba(255,255,255,0.15);
  box-shadow: 0 6px 24px -4px rgba(31, 52, 70, 0.55), 0 2px 8px rgba(0,0,0,0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 99998;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.a11y-fab:focus { background: var(--a11y-blue); color: var(--a11y-blue-fg); }
.a11y-fab:hover { background: var(--a11y-blue-hi); color: var(--a11y-blue-fg); transform: scale(1.05); }
.a11y-fab:focus-visible { outline: 3px solid #ffd54a; outline-offset: 3px; }
.a11y-fab svg { display: block; width: 28px; height: 28px; fill: currentColor; }

.a11y-panel {
  position: fixed;
  left: 20px;
  bottom: calc(88px + var(--a11y-bottom-offset, 0px));
  width: min(380px, calc(100vw - 32px));
  max-height: calc(100vh - 120px - var(--a11y-bottom-offset, 0px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #16263a;
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  box-shadow: 0 20px 60px -10px rgba(0,0,0,0.6);
  z-index: 99999;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  text-align: left;
}
.a11y-panel[hidden] { display: none; }
.a11y-panel-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: var(--a11y-blue);
  color: var(--a11y-blue-fg);
  border-radius: 14px 14px 0 0;
}
.a11y-panel .a11y-panel-header h2 {
  margin: 0; padding: 0; font-family: inherit; font-size: 17px; font-weight: 700;
  letter-spacing: 0.01em; line-height: 1.3; color: #fff; text-transform: none;
}
.a11y-panel-actions { display: flex; gap: 6px; align-items: center; }
.a11y-panel .a11y-btn-ghost {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.3;
  cursor: pointer;
}
.a11y-panel .a11y-btn-ghost:focus { background: rgba(255,255,255,0.12); color: #fff; }
.a11y-panel .a11y-btn-ghost:hover { background: rgba(255,255,255,0.22); color: #fff; }
.a11y-panel .a11y-btn-ghost:focus-visible { outline: 2px solid #ffd54a; outline-offset: 2px; }
.a11y-panel .a11y-btn-close { padding: 6px 9px; font-size: 15px; line-height: 1; }

.a11y-panel-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 14px;
}
.a11y-panel .a11y-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 8px;
  min-height: 92px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  border: 2px solid transparent;
  color: #fff;
  cursor: pointer;
  text-align: center;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.2;
  white-space: normal;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.a11y-panel .a11y-tile:focus { background: rgba(255,255,255,0.06); color: #fff; }
.a11y-panel .a11y-tile:hover { background: rgba(255,255,255,0.12); color: #fff; }
.a11y-panel .a11y-tile:focus-visible { outline: 3px solid #ffd54a; outline-offset: 2px; }
.a11y-panel .a11y-tile.is-active,
.a11y-panel .a11y-tile.is-active:hover,
.a11y-panel .a11y-tile.is-active:focus { background: var(--a11y-blue); border-color: var(--a11y-blue-hi); color: #fff; }
.a11y-tile-icon { font-size: 21px; font-weight: 700; line-height: 1; }
.a11y-tile-label { font-weight: 600; }
.a11y-tile-meta { font-size: 11px; opacity: 0.85; font-family: ui-monospace, Menlo, Consolas, monospace; }

.a11y-panel-footer {
  flex: 0 0 auto;
  padding: 12px 18px 16px;
  font-size: 12.5px;
  color: rgba(255,255,255,0.7);
  border-top: 1px solid rgba(255,255,255,0.08);
}
.a11y-panel .a11y-panel-footer p { margin: 4px 0; padding: 0; color: inherit; font-size: inherit; line-height: 1.4; }
.a11y-panel-footer kbd {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-radius: 4px;
  padding: 1px 6px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 11.5px;
}

/* ---- effects on the page ---- */
html[data-a11y-contrast="high"] { filter: contrast(1.4); }
html[data-a11y-contrast="high"] body { background: #000 !important; color: #fff !important; }
html[data-a11y-contrast="high"] a { color: #ffeb3b !important; text-decoration: underline !important; }
/* Filters go on the ROOT element, not body: a filter on body would become the containing block for
   every position:fixed descendant and re-anchor the widget's own FAB, panel and reading-guide bar. */
html[data-a11y-contrast="inverted"] { filter: invert(1) hue-rotate(180deg); }
html[data-a11y-contrast="inverted"] img,
html[data-a11y-contrast="inverted"] video { filter: invert(1) hue-rotate(180deg); }
html[data-a11y-saturation="monochrome"] { filter: grayscale(1); }
html[data-a11y-saturation="desaturate"] { filter: saturate(0.4); }
html.a11y-highlight-links a {
  background: #ffeb3b !important;
  color: #000 !important;
  text-decoration: underline !important;
  text-underline-offset: 2px;
  padding: 0 2px;
  border-radius: 2px;
}
html.a11y-highlight-headings :is(h1,h2,h3,h4,h5,h6) {
  outline: 2px dashed #ffeb3b !important;
  outline-offset: 4px;
}
html.a11y-readable-font,
html.a11y-readable-font body,
html.a11y-readable-font *:not(.a11y-fab svg):not(.a11y-fab svg *) {
  font-family: "Atkinson Hyperlegible", "Verdana", "Arial", sans-serif !important;
}
html.a11y-letter-spacing,
html.a11y-letter-spacing body,
html.a11y-letter-spacing p,
html.a11y-letter-spacing li,
html.a11y-letter-spacing span,
html.a11y-letter-spacing a,
html.a11y-letter-spacing :is(h1,h2,h3,h4,h5,h6) {
  letter-spacing: 0.12em !important;
  word-spacing: 0.16em !important;
}
html.a11y-line-height,
html.a11y-line-height body,
html.a11y-line-height p,
html.a11y-line-height li,
html.a11y-line-height :is(h1,h2,h3,h4,h5,h6) {
  line-height: 1.9 !important;
}
html.a11y-pause-animations *,
html.a11y-pause-animations *::before,
html.a11y-pause-animations *::after {
  animation-duration: 0s !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0s !important;
  scroll-behavior: auto !important;
}
html.a11y-big-cursor,
html.a11y-big-cursor * {
  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 fill='%231f3446' stroke='white' stroke-width='2' d='M6 4 L6 36 L14 28 L20 42 L26 40 L20 26 L32 26 Z'/></svg>") 4 4, auto !important;
}
html.a11y-hide-images img,
html.a11y-hide-images video,
html.a11y-hide-images svg:not(.a11y-fab svg) {
  visibility: hidden !important;
}
html.a11y-hide-images [style*="background-image"],
html.a11y-hide-images .elementor-background-overlay { background-image: none !important; }
.a11y-reading-guide-bar {
  position: fixed;
  left: 0;
  right: 0;
  height: 40px;
  background: rgba(60, 110, 145, 0.25);
  border-top: 2px solid #3c6e91;
  border-bottom: 2px solid #3c6e91;
  pointer-events: none;
  z-index: 99997;
  top: 0;
}
.a11y-fab, .a11y-panel { filter: none !important; }

/* Read Aloud (text-to-speech) */
.a11y-tts-controls {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 14px 14px;
}
.a11y-panel .a11y-tts-btn {
  flex: 1 1 auto;
  min-width: 92px;
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.14);
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
}
.a11y-panel .a11y-tts-btn:focus { background: rgba(255,255,255,0.08); color: #fff; }
.a11y-panel .a11y-tts-btn:hover:not(:disabled) { background: rgba(255,255,255,0.16); color: #fff; }
.a11y-panel .a11y-tts-btn:disabled { opacity: 0.45; cursor: default; }
.a11y-panel .a11y-tts-btn:focus-visible { outline: 3px solid #ffd54a; outline-offset: 2px; }
.a11y-panel .a11y-tts-hint { flex: 1 0 100%; margin: 2px 0 0; font-size: 12px; color: rgba(255,255,255,0.65); }
.a11y-tts-active {
  outline: 3px solid var(--a11y-blue-hi) !important;
  outline-offset: 2px;
  background: rgba(60,110,145,0.16) !important;
  border-radius: 4px;
}
html.a11y-tts :is(p,li,h1,h2,h3,h4,h5,h6,blockquote,figcaption,dd,dt) { cursor: pointer; }

@media (max-width: 480px) {
  .a11y-panel { width: calc(100vw - 24px); left: 12px; bottom: calc(80px + var(--a11y-bottom-offset, 0px)); }
  .a11y-fab { left: 12px; bottom: calc(12px + var(--a11y-bottom-offset, 0px)); width: 52px; height: 52px; }
}
