/* ===== WDS Accessibility Widget ===== */
:root {
  /* Match contact page form column: --dark + subtle red radial (theme wds-atticxperts) */
  --wds-a11y-accent: #C0392B;
  --wds-a11y-bg: #231F20;
  --wds-a11y-bg-light: rgba(255, 255, 255, 0.08);
  --wds-a11y-text: #ffffff;
  --wds-a11y-text-muted: rgba(255, 255, 255, 0.55);
  --wds-a11y-border: rgba(255, 255, 255, 0.12);
  --wds-a11y-radius: 12px;
  --wds-a11y-panel-w: 340px;
}

/* ── Trigger Button ── */
.wds-a11y-trigger {
  position: fixed;
  bottom: 20px;
  z-index: 999998;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--wds-a11y-accent);
  background: var(--wds-a11y-bg);
  color: var(--wds-a11y-accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.35);
  transition: transform .2s ease, box-shadow .2s ease;
  padding: 0;
  line-height: 1;
}

.wds-a11y-trigger:hover,
.wds-a11y-trigger:focus-visible {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(0,0,0,.45);
}

.wds-a11y-trigger:focus-visible {
  outline: 3px solid var(--wds-a11y-accent);
  outline-offset: 3px;
}

.wds-a11y-trigger--left  { left: 20px; }
.wds-a11y-trigger--right { right: 20px; }

.wds-a11y-trigger svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

/* ── Panel Overlay ── */
.wds-a11y-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 20px;
}

.wds-a11y-overlay[aria-hidden="false"] {
  display: flex;
}

.wds-a11y-overlay--right {
  justify-content: flex-end;
}

.wds-a11y-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: -1;
}

/* ── Panel ── */
.wds-a11y-panel {
  width: var(--wds-a11y-panel-w);
  max-height: calc(100vh - 40px);
  background:
    radial-gradient(circle at top left, rgba(192, 57, 43, 0.1), transparent 42%),
    var(--wds-a11y-bg);
  border-radius: var(--wds-a11y-radius);
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--wds-a11y-text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.4;
}

/* ── Panel Header ── */
.wds-a11y-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--wds-a11y-border);
  flex-shrink: 0;
}

.wds-a11y-header__title {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wds-a11y-header__title svg {
  width: 20px;
  height: 20px;
  fill: var(--wds-a11y-accent);
}

.wds-a11y-close {
  background: none;
  border: none;
  color: var(--wds-a11y-text-muted);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  padding: 4px;
  border-radius: 6px;
  transition: background .15s;
}

.wds-a11y-close:hover,
.wds-a11y-close:focus-visible {
  background: var(--wds-a11y-bg-light);
  color: var(--wds-a11y-text);
}

.wds-a11y-close:focus-visible {
  outline: 2px solid var(--wds-a11y-accent);
  outline-offset: 2px;
}

/* ── Panel Body ── */
.wds-a11y-body {
  overflow-y: auto;
  padding: 14px 18px 18px;
  flex: 1 1 auto;
  scrollbar-width: thin;
  scrollbar-color: var(--wds-a11y-border) transparent;
}

/* ── Section Labels ── */
.wds-a11y-section {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--wds-a11y-accent);
  margin: 16px 0 8px;
}

.wds-a11y-section:first-child {
  margin-top: 0;
}

/* ── Profiles Grid ── */
.wds-a11y-profiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 6px;
}

.wds-a11y-profile {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--wds-a11y-border);
  border-radius: 8px;
  padding: 10px 8px;
  text-align: center;
  cursor: pointer;
  color: var(--wds-a11y-text);
  font-size: 12px;
  font-weight: 600;
  transition: border-color .15s, background .15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.wds-a11y-profile:hover,
.wds-a11y-profile:focus-visible {
  border-color: var(--wds-a11y-accent);
}

.wds-a11y-profile:focus-visible {
  outline: 2px solid var(--wds-a11y-accent);
  outline-offset: 2px;
}

.wds-a11y-profile[aria-pressed="true"] {
  background: var(--wds-a11y-accent);
  border-color: var(--wds-a11y-accent);
  color: #fff;
}

.wds-a11y-profile__icon {
  font-size: 20px;
  line-height: 1;
}

/* ── Feature Rows ── */
.wds-a11y-feature {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--wds-a11y-border);
}

.wds-a11y-feature:last-child {
  border-bottom: none;
}

.wds-a11y-feature__label {
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wds-a11y-feature__icon {
  font-size: 16px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

/* ── Toggle Switch ── */
.wds-a11y-toggle {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.wds-a11y-toggle input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  margin: 0;
  z-index: 1;
}

.wds-a11y-toggle__track {
  position: absolute;
  inset: 0;
  background: var(--wds-a11y-border);
  border-radius: 11px;
  transition: background .2s;
  pointer-events: none;
}

.wds-a11y-toggle__track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s;
}

.wds-a11y-toggle input:checked + .wds-a11y-toggle__track {
  background: var(--wds-a11y-accent);
}

.wds-a11y-toggle input:checked + .wds-a11y-toggle__track::after {
  transform: translateX(18px);
}

.wds-a11y-toggle input:focus-visible + .wds-a11y-toggle__track {
  outline: 2px solid var(--wds-a11y-accent);
  outline-offset: 2px;
}

/* ── Stepper (text size, spacing, line height) ── */
.wds-a11y-stepper {
  display: flex;
  align-items: center;
  gap: 2px;
}

.wds-a11y-stepper__btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--wds-a11y-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--wds-a11y-text);
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background .15s;
}

.wds-a11y-stepper__btn:hover,
.wds-a11y-stepper__btn:focus-visible {
  background: var(--wds-a11y-accent);
  color: #fff;
  border-color: var(--wds-a11y-accent);
}

.wds-a11y-stepper__btn:focus-visible {
  outline: 2px solid var(--wds-a11y-accent);
  outline-offset: 2px;
}

.wds-a11y-stepper__val {
  min-width: 34px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--wds-a11y-text-muted);
}

/* ── Footer ── */
.wds-a11y-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--wds-a11y-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 8px;
}

.wds-a11y-reset {
  background: none;
  border: 1px solid var(--wds-a11y-border);
  color: var(--wds-a11y-text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}

.wds-a11y-reset:hover,
.wds-a11y-reset:focus-visible {
  color: var(--wds-a11y-text);
  border-color: var(--wds-a11y-text);
}

.wds-a11y-reset:focus-visible {
  outline: 2px solid var(--wds-a11y-accent);
  outline-offset: 2px;
}

.wds-a11y-statement {
  color: var(--wds-a11y-accent);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.wds-a11y-statement:hover,
.wds-a11y-statement:focus-visible {
  text-decoration: underline;
}

/* ── Reading Guide ── */
.wds-a11y-reading-guide {
  position: fixed;
  left: 0;
  width: 100%;
  height: 10px;
  background: rgba(192, 57, 43, .35);
  pointer-events: none;
  z-index: 999997;
  display: none;
  transition: top .05s linear;
}

.wds-a11y-reading-guide--active {
  display: block;
}

/* ── Global Accessibility Overrides ── */
html.wds-a11y-text-1 { font-size: 105% !important; }
html.wds-a11y-text-2 { font-size: 115% !important; }
html.wds-a11y-text-3 { font-size: 125% !important; }
html.wds-a11y-text-4 { font-size: 140% !important; }

@font-face {
  font-family: 'OpenDyslexic';
  src: url('../fonts/OpenDyslexic-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

html.wds-a11y-dyslexia,
html.wds-a11y-dyslexia * {
  font-family: 'OpenDyslexic', sans-serif !important;
}

html.wds-a11y-spacing-1 body { letter-spacing: .04em !important; }
html.wds-a11y-spacing-2 body { letter-spacing: .08em !important; }
html.wds-a11y-spacing-3 body { letter-spacing: .14em !important; }

html.wds-a11y-lh-1 body { line-height: 1.8 !important; }
html.wds-a11y-lh-2 body { line-height: 2.0 !important; }
html.wds-a11y-lh-3 body { line-height: 2.4 !important; }

html.wds-a11y-contrast {
  filter: contrast(1.4) !important;
  background: #000 !important;
}

html.wds-a11y-invert {
  filter: invert(1) hue-rotate(180deg) !important;
}

html.wds-a11y-invert img,
html.wds-a11y-invert video,
html.wds-a11y-invert svg,
html.wds-a11y-invert [style*="background-image"] {
  filter: invert(1) hue-rotate(180deg) !important;
}

html.wds-a11y-monochrome {
  filter: grayscale(1) !important;
}

html.wds-a11y-links a {
  text-decoration: underline !important;
  outline: 2px solid var(--wds-a11y-accent) !important;
  outline-offset: 2px !important;
}

html.wds-a11y-big-cursor,
html.wds-a11y-big-cursor * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cpath d='M5 2l20 14-10 2-4 10z' fill='%23000' stroke='%23fff' stroke-width='1.5'/%3E%3C/svg%3E") 4 2, auto !important;
}

html.wds-a11y-no-anim,
html.wds-a11y-no-anim *,
html.wds-a11y-no-anim *::before,
html.wds-a11y-no-anim *::after {
  animation-duration: 0s !important;
  animation-delay: 0s !important;
  transition-duration: 0s !important;
  transition-delay: 0s !important;
  scroll-behavior: auto !important;
}

html.wds-a11y-focus *:focus-visible {
  outline: 3px solid var(--wds-a11y-accent) !important;
  outline-offset: 3px !important;
}

/* ── Responsive ── */
@media (max-width: 400px) {
  :root { --wds-a11y-panel-w: calc(100vw - 24px); }
  .wds-a11y-overlay { padding: 12px; }
}
