/*!
 * Intersky agency accessibility widget — trei-group build (v2.1.3 template).
 * Self-contained: uses hard-coded palette matching site's primary (#5271FF) and accent (#3D5AE0).
 * Positioned bottom-right (opposite the FAB WhatsApp+Call on the left).
 */

/* Toggle button */
#a11y-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2147483000;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #5271FF;
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
#a11y-toggle:hover,
#a11y-toggle:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
}
#a11y-toggle:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 3px;
}
#a11y-toggle svg { width: 28px; height: 28px; }

/* Panel — slides in from the right edge.
 * v2.1.3: uses transform: translateX(100%) instead of a fixed right: -Xpx offset.
 * translateX(100%) moves the element by ITS OWN width (320px, 90vw, 100vw — doesn't
 * matter), so one rule works at every viewport size, no per-breakpoint offset fix
 * needed. Also adds visibility/pointer-events as defense-in-depth so the closed
 * panel can never intercept clicks/taps even if a layout quirk affects the transform. */
#a11y-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  max-width: 90vw;
  height: 100vh;
  background: #ffffff;
  color: #1a2332;
  z-index: 2147483001;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
  overflow-y: auto;
  padding: 24px 20px 32px;
  transform: translateX(100%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.3s ease, visibility 0.3s ease;
  font-family: 'Josefin Sans', system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  box-sizing: border-box;
  direction: ltr;
  text-align: left;
}
#a11y-panel.open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

#a11y-panel h2 {
  font-size: 1.2rem;
  color: #5271FF;
  margin: 0 0 16px;
  font-weight: 700;
}
#a11y-panel .a11y-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: #1a2332;
  padding: 4px 8px;
  border-radius: 6px;
}
#a11y-panel .a11y-close:hover,
#a11y-panel .a11y-close:focus-visible { background: #f0f5f9; }
#a11y-panel .a11y-close:focus-visible { outline: 2px solid #5271FF; outline-offset: 2px; }

/* Action buttons */
#a11y-panel .a11y-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: #f5f8fb;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  color: #1a2332;
  font-family: inherit;
  transition: background 0.12s ease, border-color 0.12s ease;
}
#a11y-panel .a11y-btn:hover { background: #e8ecff; }
#a11y-panel .a11y-btn:focus-visible {
  outline: 2px solid #5271FF;
  outline-offset: 1px;
  border-color: #5271FF;
}

/* Report block */
#a11y-panel .a11y-report {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
  font-size: 0.88rem;
  color: #5a6b7e;
  line-height: 1.65;
}
#a11y-panel .a11y-report strong { color: #1a2332; }
#a11y-panel .a11y-report a { color: #5271FF; font-weight: 600; text-decoration: underline; }

#a11y-panel .a11y-statement-link { margin-top: 14px; }
#a11y-panel .a11y-statement-link a {
  color: #5271FF;
  font-size: 0.9rem;
  text-decoration: underline;
}

/* State classes applied to <html> */
html.a11y-contrast { filter: contrast(1.3); }
html.a11y-invert   { filter: invert(1) hue-rotate(180deg); }
html.a11y-grayscale img,
html.a11y-grayscale .elementor-widget-image img,
html.a11y-grayscale [style*="background-image"] { filter: grayscale(1); }
html.a11y-underline a { text-decoration: underline !important; }
html.a11y-no-anim *,
html.a11y-no-anim *::before,
html.a11y-no-anim *::after {
  animation-duration: 0ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0ms !important;
  scroll-behavior: auto !important;
}
html.a11y-readable body,
html.a11y-readable body * {
  font-family: Arial, 'Josefin Sans', sans-serif !important;
  letter-spacing: 0.3px;
}

/* Print — hide the widget */
@media print {
  #a11y-toggle,
  #a11y-panel { display: none !important; }
}

/* Small screens — full-width panel.
 * v2.1.3: the closed/open offset is handled by transform: translateX(100%) in
 * the base rule above — it self-adjusts to the element's width, so we only need
 * to override the width itself here. No `right` offset override required. */
@media (max-width: 480px) {
  #a11y-panel { width: 100vw; max-width: 100vw; }
  #a11y-toggle { width: 48px; height: 48px; bottom: 16px; right: 16px; }
  #a11y-toggle svg { width: 24px; height: 24px; }
}

/* Accessibility statement page (used by /accessibility/) */
.a11y-page {
  padding: 64px 24px 96px;
  max-width: 820px;
  margin: 0 auto;
  font-family: 'Josefin Sans', system-ui, -apple-system, sans-serif;
  color: #1a2332;
  line-height: 1.75;
  direction: ltr;
  text-align: left;
}
.a11y-page h1 {
  color: #16233e;
  margin: 0 0 24px;
  font-size: 2rem;
  font-weight: 800;
}
.a11y-page h2 {
  color: #5271FF;
  margin: 32px 0 12px;
  font-size: 1.25rem;
  font-weight: 700;
}
.a11y-page p { margin: 0 0 14px; }
.a11y-page ul { margin: 0 0 14px; padding-left: 22px; }
.a11y-page li { margin: 0 0 8px; }
.a11y-page a {
  color: #5271FF;
  font-weight: 600;
  text-decoration: underline;
}
.a11y-page .a11y-back-home {
  display: inline-block;
  margin-top: 32px;
  padding: 12px 24px;
  background: #5271FF;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
}
.a11y-page .a11y-back-home:hover { background: #3D5AE0; }

/* Skip-link.
 * v2.1.2 fix: the old `left: -9999px` pattern (LTR mirror of the RTL bug found at
 * biodecor: `right: -9999px`) still contributes to the document's scrollable
 * width even while "offscreen", forcing horizontal overflow that cascades into
 * wrong auto-fit grid column counts, cut-off hero titles, and hidden gallery
 * images. Fix: standard visually-hidden pattern that removes the element from
 * layout entirely while keeping it available to screen readers and keyboard
 * users, then restores it to a visible position on :focus. */
.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link:focus {
  position: fixed;
  top: 8px;
  left: 8px;
  width: auto;
  height: auto;
  padding: 10px 16px;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  background: #5271FF;
  color: #fff;
  z-index: 2147483002;
  font-weight: 700;
  text-decoration: none;
}
