#accessibility-toggle {
  position: fixed;
  bottom: 80px;
  left: 20px;
  z-index: 1001;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #e96b56;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: background 0.2s, transform 0.2s;
}

#accessibility-toggle:hover {
  background: #e6573f;
  transform: scale(1.1);
}

#accessibility-toggle i {
  font-size: 24px;
}

#accessibility-panel {
  position: fixed;
  top: 0;
  left: -340px;
  width: 320px;
  height: 100vh;
  background: #fff;
  z-index: 1002;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.2);
  transition: left 0.3s ease;
  overflow-y: auto;
  font-family: "Noto Sans Hebrew", sans-serif;
  direction: rtl;
}

#accessibility-panel.open {
  left: 0;
}

#accessibility-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1001;
}

#accessibility-overlay.show {
  display: block;
}

.access-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #e96b56;
  color: #fff;
}

.access-panel-header h3 {
  margin: 0;
  font-size: 18px;
}

.access-panel-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.access-panel-body {
  padding: 16px 20px;
}

.access-option {
  padding: 12px 0;
  border-bottom: 1px solid #eee;
}

.access-option:last-child {
  border-bottom: none;
}

.access-option label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #333;
}

.access-option-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.access-option-buttons button {
  padding: 6px 16px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #f8f8f8;
  cursor: pointer;
  font-family: "Noto Sans Hebrew", sans-serif;
  font-size: 13px;
  transition: background 0.2s;
}

.access-option-buttons button:hover {
  background: #e96b56;
  color: #fff;
  border-color: #e96b56;
}

.access-option-buttons button.active {
  background: #e96b56;
  color: #fff;
  border-color: #e96b56;
}

.access-toggle-btn {
  padding: 8px 20px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #f8f8f8;
  cursor: pointer;
  font-family: "Noto Sans Hebrew", sans-serif;
  font-size: 13px;
  transition: background 0.2s;
  width: 100%;
  text-align: center;
}

.access-toggle-btn:hover {
  background: #e96b56;
  color: #fff;
  border-color: #e96b56;
}

.access-toggle-btn.active {
  background: #e96b56;
  color: #fff;
  border-color: #e96b56;
}

.access-reset {
  margin-top: 16px;
  padding: 10px 20px;
  background: #545454;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: "Noto Sans Hebrew", sans-serif;
  font-size: 14px;
  width: 100%;
  transition: background 0.2s;
}

.access-reset:hover {
  background: #333;
}

/* Font size classes — scale via CSS custom property */
html.font-size-small {
  --font-scale: 0.8;
}

html.font-size-large {
  --font-scale: 1.2;
}

html.font-size-xlarge {
  --font-scale: 1.5;
}

/* Apply font scaling to all text elements */
body.font-size-small,
body.font-size-large,
body.font-size-xlarge {
  font-size: calc(16px * var(--font-scale)) !important;
}

body.font-size-small h1,
body.font-size-large h1,
body.font-size-xlarge h1 {
  font-size: calc(2.5rem * var(--font-scale)) !important;
}

body.font-size-small h2,
body.font-size-large h2,
body.font-size-xlarge h2 {
  font-size: calc(2rem * var(--font-scale)) !important;
}

body.font-size-small h3,
body.font-size-large h3,
body.font-size-xlarge h3 {
  font-size: calc(1.75rem * var(--font-scale)) !important;
}

body.font-size-small h4,
body.font-size-large h4,
body.font-size-xlarge h4 {
  font-size: calc(1.5rem * var(--font-scale)) !important;
}

body.font-size-small h5,
body.font-size-large h5,
body.font-size-xlarge h5 {
  font-size: calc(1.25rem * var(--font-scale)) !important;
}

body.font-size-small h6,
body.font-size-large h6,
body.font-size-xlarge h6 {
  font-size: calc(1rem * var(--font-scale)) !important;
}

body.font-size-small p,
body.font-size-large p,
body.font-size-xlarge p,
body.font-size-small a,
body.font-size-large a,
body.font-size-xlarge a,
body.font-size-small li,
body.font-size-large li,
body.font-size-xlarge li,
body.font-size-small span,
body.font-size-large span,
body.font-size-xlarge span,
body.font-size-small strong,
body.font-size-large strong,
body.font-size-xlarge strong,
body.font-size-small label,
body.font-size-large label,
body.font-size-xlarge label,
body.font-size-small .biggerText,
body.font-size-large .biggerText,
body.font-size-xlarge .biggerText,
body.font-size-small .biggerText2,
body.font-size-large .biggerText2,
body.font-size-xlarge .biggerText2,
body.font-size-small .icon-box,
body.font-size-large .icon-box,
body.font-size-xlarge .icon-box,
body.font-size-small .info-box,
body.font-size-large .info-box,
body.font-size-xlarge .info-box,
body.font-size-small .navbar a,
body.font-size-large .navbar a,
body.font-size-xlarge .navbar a,
body.font-size-small .footer-contact,
body.font-size-large .footer-contact,
body.font-size-xlarge .footer-contact,
body.font-size-small .footer-info,
body.font-size-large .footer-info,
body.font-size-xlarge .footer-info {
  font-size: calc(1rem * var(--font-scale)) !important;
}

/* High contrast */
body.high-contrast {
  background: #000 !important;
  color: #fff !important;
}

body.high-contrast * {
  background: transparent !important;
  color: #fff !important;
  border-color: #fff !important;
}

body.high-contrast a {
  color: #ffeb3b !important;
  text-decoration: underline !important;
}

body.high-contrast #header {
  background: #000 !important;
  border-bottom: 2px solid #fff !important;
}

body.high-contrast #topbar {
  background: #000 !important;
  border-bottom: 1px solid #fff !important;
}

body.high-contrast #footer {
  background: #000 !important;
}

body.high-contrast img {
  filter: brightness(0.8);
}

body.high-contrast .access-panel-header {
  background: #000 !important;
  border-bottom: 2px solid #fff !important;
}

body.high-contrast #accessibility-panel {
  background: #000 !important;
}

body.high-contrast #accessibility-toggle {
  background: #ffeb3b !important;
  color: #000 !important;
}

/* Grayscale */
body.grayscale {
  filter: grayscale(100%);
}

body.grayscale #accessibility-panel {
  filter: grayscale(0%);
}

body.grayscale #accessibility-toggle {
  filter: grayscale(0%);
}

/* Underline links */
body.underline-links a {
  text-decoration: underline !important;
}

/* Reduce motion */
body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

body.reduce-motion {
  scroll-behavior: auto !important;
}

/* Focus highlight */
body.focus-highlight *:focus {
  outline: 3px solid #e96b56 !important;
  outline-offset: 2px;
}

/* Skip link */
.skip-to-content {
  position: absolute;
  top: -100px;
  right: 0;
  background: #e96b56;
  color: #fff;
  padding: 12px 24px;
  z-index: 10000;
  font-size: 16px;
  font-weight: bold;
  text-decoration: none;
  border-radius: 0 0 4px 4px;
  transition: top 0.2s;
}

.skip-to-content:focus {
  top: 0;
}

@media (max-width: 768px) {
  #accessibility-panel {
    width: 280px;
    left: -300px;
  }

  #accessibility-toggle {
    bottom: 80px;
    left: 12px;
    width: 42px;
    height: 42px;
  }

  #accessibility-toggle i {
    font-size: 20px;
  }
}
