/* ROL Accessibility – frontend */

/* ---------- Screen reader only ---------- */
.rol-a11y-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ---------- Skip links ---------- */
.rol-a11y-skip {
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  z-index: 2147483647;
}
.rol-a11y-skip__link {
  position: absolute !important;
  top: -9999px;
  inset-inline-start: 8px;
  white-space: nowrap;
  padding: 10px 16px !important;
  background: #fff !important;
  color: #000 !important;
  border: 2px solid #000 !important;
  border-radius: 4px;
  text-decoration: underline !important;
}
.rol-a11y-skip__link:focus {
  position: fixed !important;
  top: 8px;
  outline: 3px solid var(--rol-a11y-focus, #ff7a00) !important;
  outline-offset: 2px !important;
}

/* Skip targets receive programmatic focus – no outline needed on the whole region */
[data-rol-a11y-target]:focus { outline: none; }

/* ---------- Visible keyboard focus (automatic fix) ---------- */
html.rol-a11y-focus-fix :focus-visible {
  outline: 3px solid var(--rol-a11y-focus, #ff7a00) !important;
  outline-offset: 2px !important;
}

/* ---------- Keyboard-opened submenus ---------- */
html.rol-a11y-menu-fix .menu-item-has-children.rol-a11y-open > .sub-menu,
html.rol-a11y-menu-fix .menu-item-has-children.rol-a11y-open > ul {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* =========================================================
   Toolbar effects – classes are set on <html> by rol-toolbar.js
   The toolbar itself lives in a Shadow DOM (#rol-a11y-host)
   ========================================================= */

/* Spacing */
html.rol-a11y-ls body *:not(#rol-a11y-host) { letter-spacing: var(--rol-a11y-ls) !important; }
html.rol-a11y-lh body *:not(#rol-a11y-host) { line-height: var(--rol-a11y-lh) !important; }
html.rol-a11y-ws body *:not(#rol-a11y-host) { word-spacing: var(--rol-a11y-ws) !important; }

/* Readable font (icon fonts excluded) */
html.rol-a11y-readable-font body *:not(#rol-a11y-host):not(i):not([class*="icon"]):not([class*="fa-"]):not([class^="fa"]):not(.dashicons):not(.material-icons) {
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif !important;
}

/* Highlight links */
html.rol-a11y-links a[href]:not(.rol-a11y-skip__link) {
  text-decoration: underline !important;
  outline: 2px solid var(--rol-a11y-focus, #ff7a00) !important;
  outline-offset: 2px !important;
}

/* Highlight headings */
html.rol-a11y-titles h1, html.rol-a11y-titles h2, html.rol-a11y-titles h3,
html.rol-a11y-titles h4, html.rol-a11y-titles h5, html.rol-a11y-titles h6,
html.rol-a11y-titles [role="heading"] {
  outline: 2px dashed var(--rol-a11y-color, #1e3a8a) !important;
  outline-offset: 4px !important;
}

/* Strong focus */
html.rol-a11y-strong-focus *:focus {
  outline: 4px solid var(--rol-a11y-focus, #ff7a00) !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 7px #fff !important;
}

/* Dark contrast */
html.rol-a11y-dark,
html.rol-a11y-dark body,
html.rol-a11y-dark body *:not(#rol-a11y-host):not(img):not(video):not(svg):not(svg *) {
  background-color: #000 !important;
  color: #fff !important;
  border-color: #fff !important;
}
html.rol-a11y-dark body a[href]:not(#rol-a11y-host),
html.rol-a11y-dark body a[href] * { color: #ffeb3b !important; }

/* Light contrast */
html.rol-a11y-light,
html.rol-a11y-light body,
html.rol-a11y-light body *:not(#rol-a11y-host):not(img):not(video):not(svg):not(svg *) {
  background-color: #fff !important;
  color: #000 !important;
  border-color: #000 !important;
}
html.rol-a11y-light body a[href]:not(#rol-a11y-host),
html.rol-a11y-light body a[href] * { color: #0000c8 !important; }

/* Hide images */
html.rol-a11y-hide-images body img,
html.rol-a11y-hide-images body picture,
html.rol-a11y-hide-images body video,
html.rol-a11y-hide-images body figure > svg { visibility: hidden !important; }
html.rol-a11y-hide-images body *:not(#rol-a11y-host) { background-image: none !important; }

/* Stop animations
   Animations jump straight to their final state (so entrance animations still show the content),
   looping animations run once and stop, transitions are instant.
   Sliders, videos, Lottie, GIFs etc. are stopped by rol-toolbar.js. */
html.rol-a11y-stop-animations *,
html.rol-a11y-stop-animations *::before,
html.rol-a11y-stop-animations *::after {
  animation-duration: 0.001ms !important;
  animation-delay: 0s !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  transition-delay: 0s !important;
  scroll-behavior: auto !important;
}
/* Elementor scrolling / mouse motion effects and parallax */
html.rol-a11y-stop-animations .elementor-motion-effects-element,
html.rol-a11y-stop-animations .elementor-motion-effects-layer,
html.rol-a11y-stop-animations [data-parallax],
html.rol-a11y-stop-animations .jarallax-img,
html.rol-a11y-stop-animations .rellax {
  transform: none !important;
}

/* Big cursors */
html.rol-a11y-cursor-black,
html.rol-a11y-cursor-black * {
  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 3 L6 40 L15 31 L21 45 L28 42 L22 28 L35 28 Z' fill='%23000' stroke='%23fff' stroke-width='2.5' stroke-linejoin='round'/%3E%3C/svg%3E") 6 3, auto !important;
}
html.rol-a11y-cursor-white,
html.rol-a11y-cursor-white * {
  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 3 L6 40 L15 31 L21 45 L28 42 L22 28 L35 28 Z' fill='%23fff' stroke='%23000' stroke-width='2.5' stroke-linejoin='round'/%3E%3C/svg%3E") 6 3, auto !important;
}

/* Text-to-speech mode: show what will be read */
html.rol-a11y-tts body *:not(#rol-a11y-host):hover { cursor: help; }
html.rol-a11y-tts .rol-a11y-tts-current {
  outline: 3px solid var(--rol-a11y-focus, #ff7a00) !important;
  outline-offset: 2px !important;
}

@media (prefers-reduced-motion: reduce) {
  .rol-a11y-skip__link { transition: none !important; }
}
