:root {
  --user-font-size: 1rem;
}

body.accessibility-zoom-active :not(.sow-slider-base):not(.sow-slider-base *):not(.sow-slider-image-wrapper):not(.sow-slider-image-wrapper *):not(.sow-slider-image-container):not(.sow-slider-image-container *) {
  font-size: var(--user-font-size) !important;
}

#accessibility-toggle {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: #ffffff;
  width: 33px;
  height: 33px;
  border-radius: 50%;
  z-index: 9999;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.2);
  padding: 0;
  transform: none;
}

#accessibility-toggle img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(0, 120, 215, 0.7);
}

#accessibility-menu {
  position: fixed;
  bottom: 70px;
  left: 10px;
  background: rgba(255, 255, 255, 0.90);
  border: 1px solid #ccc;
  padding: 10px 20px;
  min-width: 200px;
  max-width: 240px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  font-family: Arial, sans-serif;
  font-size: 1.2rem;
  line-height: 1.5;
  border-radius: 25px;
  opacity: 0;
  transform: translateY(20px);
  transform-origin: bottom left;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#accessibility-menu.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#accessibility-menu h3 {
  margin-top: 0;
  margin-bottom: 5px;
  font-size: 1.2rem;
  font-weight: bold;
  color: #0078d7;
  display: block;
  width: 100%;
  text-align: left;
}

#accessibility-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#accessibility-menu li {
  margin: 10px 0;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding-left: 2px;
}

#accessibility-menu li span {
  display: inline-block;
  width: 1.6em;
  text-align: center;
  flex-shrink: 0;
}

html.grayscale {
  filter: grayscale(100%);
}
html.high-contrast {
  filter: contrast(200%);
}
html.negative-contrast {
  filter: invert(100%);
}

html.light-bg,
html.light-bg body,
html.light-bg .site,
html.light-bg .site-content,
html.light-bg .entry-content,
html.light-bg .panel-grid,
html.light-bg .panel-row-style,
html.light-bg .sow-slider-image-cover {
  background-color: #ffffff !important;
  color: #000000 !important;
}
html.light-bg a {
  color: #0000ee !important;
}

html.underline-links a {
  text-decoration: underline !important;
}

html.readable-font *,
html.readable-font *::before,
html.readable-font *::after {
  font-family: Arial, sans-serif !important;
}

.accessibility-logo {
  width: 100%;
  margin: 0;
  text-align: left;
  padding: 0;
  margin-bottom: 10px;
}

.accessibility-logo img {
  max-width: 150px;
  height: auto;
  display: block;
  margin: 0;
}

@media screen and (max-width: 767px) {
  #accessibility-toggle {
    top: auto;
    bottom: 20px;
    left: 10px;
  }

  #accessibility-menu {
    top: auto;
    bottom: 70px;
    left: 10px;
    transform-origin: bottom left;
  }

  #accessibility-menu.show {
    transform: translateY(0);
  }
}

/* === Icon Animations === */

/* 1) Pop */
@keyframes icon-pop {
  0%   { transform: scale(5) rotate(0); }
  50%  { transform: scale(2.9) rotate(15deg); }
  100% { transform: scale(1) rotate(0); }
}
#accessibility-toggle.pop { animation: icon-pop 0.5s ease-in-out both; }

/* 2) Bounce */
@keyframes icon-bounce {
  0%,20%,50%,80%,100% { transform: translateY(0); }
  40%                  { transform: translateY(-10px); }
  60%                  { transform: translateY(-5px); }
}
#accessibility-toggle.bounce { animation: icon-bounce 0.6s ease; }

/* 3) Shake */
@keyframes icon-shake {
  0%,100% { transform: translateX(0); }
  10%,30%,50%,70%,90% { transform: translateX(-5px); }
  20%,40%,60%,80%     { transform: translateX(5px); }
}
#accessibility-toggle.shake { animation: icon-shake 0.5s ease-in-out; }

/* 4) Pulse */
@keyframes icon-pulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.9); }
  100% { transform: scale(1); }
}
#accessibility-toggle.pulse { animation: icon-pulse 0.28s ease-in-out; }

/* 5) Swing */
@keyframes icon-swing {
  20%  { transform: rotate(15deg); }
  40%  { transform: rotate(-10deg); }
  60%  { transform: rotate(5deg); }
  80%  { transform: rotate(-5deg); }
  100% { transform: rotate(0); }
}
#accessibility-toggle.swing {
  transform-origin: top center;
  animation: icon-swing 1s ease;
}

/* 6) Flip */
@keyframes icon-flip {
  0%   { transform: perspective(400px) rotateY(0); }
  50%  { transform: perspective(400px) rotateY(180deg); }
  100% { transform: perspective(400px) rotateY(0); }
}
#accessibility-toggle.flip { animation: icon-flip 0.7s ease-in-out; }
#accessibility-menu,
#accessibility-menu * {
  font-size: 16px !important;
  line-height: 1.4 !important;
}
#accessibility-menu.text-sm,
#accessibility-menu.text-sm * {
  font-size: 13px !important;
}

#accessibility-menu.text-md,
#accessibility-menu.text-md * {
  font-size: 15px !important;
}

#accessibility-menu.text-lg,
#accessibility-menu.text-lg * {
  font-size: 17px !important;
}

#accessibility-menu.text-xl,
#accessibility-menu.text-xl * {
  font-size: 19px !important;
}
#accessibility-menu,
#accessibility-menu * {
  color: var(--popup-text-color, #000) !important;
}