/* === Skip to content link === */
.acc-skip-link {
  position: absolute;
  right: -9999px;
  top: 8px;
  background: #000;
  color: #ffe066;
  padding: 10px 18px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  z-index: 10000;
  font-size: 1em;
}
.acc-skip-link:focus {
  right: 12px;
  outline: 3px solid #ffe066;
}

/* === Visible focus indicators (WCAG 2.4.7) === */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #1a73e8 !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.25) !important;
}

/* === Accessibility widget button === */
.acc-widget-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #1a73e8;
  color: #fff;
  border: 3px solid #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  transition: transform 0.2s, background 0.2s;
}
.acc-widget-btn:hover,
.acc-widget-btn:focus {
  background: #0f5fce;
  transform: scale(1.06);
}

/* === Accessibility panel === */
.acc-panel {
  position: fixed;
  bottom: 88px;
  left: 20px;
  width: 320px;
  max-height: 80vh;
  overflow-y: auto;
  background: #fff;
  color: #111;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  padding: 18px;
  z-index: 9999;
  direction: rtl;
  font-family: Arial, sans-serif;
  display: none;
}
.acc-panel.acc-open {
  display: block;
}
.acc-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f0f0f0;
}
.acc-panel-title {
  font-size: 1.15em;
  font-weight: 700;
  margin: 0;
  color: #111;
}
.acc-panel-close {
  background: transparent;
  border: none;
  font-size: 1.4em;
  cursor: pointer;
  color: #555;
  padding: 4px 8px;
  border-radius: 6px;
}
.acc-panel-close:hover {
  background: #f0f0f0;
}
.acc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.acc-option {
  background: #f5f7fa;
  border: 2px solid #e2e6ea;
  border-radius: 10px;
  padding: 10px 8px;
  font-size: 0.92em;
  font-weight: 600;
  color: #222;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
  font-family: inherit;
}
.acc-option:hover {
  background: #e8eef7;
  border-color: #1a73e8;
}
.acc-option.acc-active {
  background: #1a73e8;
  color: #fff;
  border-color: #1a73e8;
}
.acc-reset {
  margin-top: 12px;
  width: 100%;
  background: #d93025;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95em;
}
.acc-reset:hover {
  background: #b3261e;
}
.acc-statement-link {
  display: block;
  text-align: center;
  margin-top: 10px;
  color: #1a73e8;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92em;
}
.acc-statement-link:hover {
  text-decoration: underline;
}

/* === Body-level accessibility modes === */
body.acc-text-lg { font-size: 112% !important; }
body.acc-text-xl { font-size: 125% !important; }
body.acc-text-xxl { font-size: 140% !important; }

body.acc-contrast,
body.acc-contrast * {
  background-color: #000 !important;
  color: #ffe066 !important;
  border-color: #ffe066 !important;
}
body.acc-contrast a,
body.acc-contrast a * {
  color: #4ad6ff !important;
}
body.acc-contrast img {
  filter: grayscale(100%) contrast(120%);
}
body.acc-contrast .acc-panel,
body.acc-contrast .acc-panel *,
body.acc-contrast .acc-widget-btn {
  background-color: #fff !important;
  color: #111 !important;
}
body.acc-contrast .acc-widget-btn {
  background-color: #1a73e8 !important;
  color: #fff !important;
}

body.acc-dark,
body.acc-dark * {
  background-color: #1a1a1a !important;
  color: #f0f0f0 !important;
  border-color: #444 !important;
}
body.acc-dark a {
  color: #66b3ff !important;
}
body.acc-dark img {
  filter: brightness(0.85);
}
body.acc-dark .acc-panel,
body.acc-dark .acc-panel * {
  background-color: #fff !important;
  color: #111 !important;
}
body.acc-dark .acc-widget-btn {
  background-color: #1a73e8 !important;
  color: #fff !important;
}

body.acc-highlight-links a {
  text-decoration: underline !important;
  outline: 2px dashed #1a73e8 !important;
  outline-offset: 2px !important;
  background-color: #fffacd !important;
}

body.acc-readable-font,
body.acc-readable-font * {
  font-family: Arial, "Open Sans", "Helvetica Neue", sans-serif !important;
  letter-spacing: 0.02em !important;
  word-spacing: 0.05em !important;
}

body.acc-spacing,
body.acc-spacing * {
  line-height: 1.9 !important;
  letter-spacing: 0.05em !important;
}

body.acc-no-animations,
body.acc-no-animations *,
body.acc-no-animations *::before,
body.acc-no-animations *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

/* Respect users who have prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 480px) {
  .acc-panel {
    width: calc(100vw - 40px);
    left: 20px;
    right: 20px;
  }
}
