/* ============================================================
   ACCESSIBILITY WIDGET — CSS 
   Dipakai di semua halaman melalui <link rel="stylesheet">
   ============================================================ */
.a11y-toggle-btn {
  position: fixed;
  left: 24px;
  bottom: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.35);
  z-index: 99998;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.a11y-toggle-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.6);
  animation: a11yPulse 2s infinite;
  z-index: -1;
  pointer-events: none;
}

.a11y-toggle-btn:hover {
  transform: scale(1.08) translateY(-2px);
  background: linear-gradient(135deg, #60a5fa, #2563eb);
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.45);
}

.a11y-toggle-btn:focus-visible {
  outline: 3px solid #60a5fa;
  outline-offset: 2px;
}

.a11y-toggle-btn svg {
  width: 28px;
  height: 28px;
  stroke: #ffffff;
  fill: none;
  transition: transform 0.3s ease;
}

.a11y-toggle-btn:hover svg {
  transform: rotate(15deg);
}

@keyframes a11yPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7);
  }

  70% {
    box-shadow: 0 0 0 12px rgba(37, 99, 235, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
  }
}

.a11y-panel {
  position: fixed;
  left: 24px;
  bottom: 96px;
  width: 320px;
  max-height: 78vh;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(0, 0, 0, 0.05);
  z-index: 99999;
  padding: 24px;
  display: none;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  box-sizing: border-box;
}

.a11y-panel * {
  box-sizing: border-box;
}

.a11y-panel.open {
  display: block;
  animation: a11yFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes a11yFadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.a11y-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.a11y-header-text h2 {
  font-size: 22px;
  font-weight: 700;
  color: #2d3748;
  margin: 0;
  line-height: 1.2;
}

.a11y-close-btn {
  background: #f7fafc;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #718096;
  transition: all 0.2s;
  padding: 0;
}

.a11y-close-btn:hover {
  background: #edf2f7;
  color: #1a202c;
}

.a11y-close-btn svg {
  width: 16px;
  height: 16px;
}

.a11y-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.a11y-list-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  color: #2d3748;
}

.a11y-list-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

.a11y-list-item svg {
  width: 20px;
  height: 20px;
  color: #4a5568;
  stroke-width: 2;
  transition: color 0.2s ease;
}

.a11y-list-item span {
  font-size: 15px;
  font-weight: 500;
  color: #2d3748;
}

.a11y-list-item.active {
  background: #ebf8ff;
  color: #2b6cb0;
}

.a11y-list-item.active svg {
  color: #2b6cb0;
}

.a11y-list-item.active span {
  color: #2b6cb0;
  font-weight: 600;
}

/* Specific styling for Reset action */
.a11y-list-item.a11y-reset-action:hover {
  background: #fff5f5;
  color: #c53030;
}

.a11y-list-item.a11y-reset-action:hover svg {
  color: #c53030;
}

.a11y-list-item.a11y-reset-action:hover span {
  color: #c53030;
}

/* TTS Section layout */
.a11y-tts-wrapper {
  margin: 4px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding: 4px 0;
}

.a11y-tts-controls {
  display: none;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
  background: #f7fafc;
  border: 1px solid #edf2f7;
  border-radius: 8px;
  padding: 8px;
}

.a11y-tts-controls.active {
  display: flex;
}

.a11y-tts-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 6px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #ffffff;
  color: #4a5568;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.a11y-tts-btn:hover {
  background: #f7fafc;
  border-color: #cbd5e1;
  color: #1a202c;
}

.a11y-tts-btn svg {
  width: 14px;
  height: 14px;
}

.a11y-tts-status {
  font-size: 11px;
  color: #718096;
  margin-top: 6px;
  text-align: center;
  font-style: italic;
  min-height: 16px;
}

/* TTS Hover Highlight Effect */
.a11y-tts-highlight {
  outline: 2px dashed #3b82f6 !important;
  outline-offset: 2px !important;
  background-color: rgba(59, 130, 246, 0.06) !important;
  transition: outline 0.1s ease, background-color 0.1s ease;
}

/* Page Filter & A11y Effect Classes */
html.a11y-grayscale {
  filter: grayscale(1);
}

html.a11y-negative-contrast {
  filter: invert(1) hue-rotate(180deg);
}

html.a11y-negative-contrast img,
html.a11y-negative-contrast video {
  filter: invert(1) hue-rotate(180deg);
}

html.a11y-high-contrast body {
  background: #000 !important;
  color: #fff !important;
}

html.a11y-high-contrast a {
  color: #ffd400 !important;
}

html.a11y-high-contrast .card,
html.a11y-high-contrast .news-card,
html.a11y-high-contrast .service-card {
  background: #111 !important;
  border-color: #333 !important;
}

html.a11y-light-bg body,
html.a11y-light-bg main,
html.a11y-light-bg header,
html.a11y-light-bg footer,
html.a11y-light-bg section,
html.a11y-light-bg article,
html.a11y-light-bg div:not(.a11y-panel):not(.a11y-panel *),
html.a11y-light-bg nav,
html.a11y-light-bg .card,
html.a11y-light-bg .container,
html.a11y-light-bg .row,
html.a11y-light-bg .content,
html.a11y-light-bg .wrapper {
  background-color: #ffffff !important;
  background-image: none !important;
  color: #111111 !important;
}

html.a11y-light-bg a {
  color: #0056b3 !important;
}

html.a11y-light-bg h1,
html.a11y-light-bg h2,
html.a11y-light-bg h3,
html.a11y-light-bg h4,
html.a11y-light-bg h5,
html.a11y-light-bg h6,
html.a11y-light-bg p,
html.a11y-light-bg span,
html.a11y-light-bg li,
html.a11y-light-bg label {
  color: #111111 !important;
}

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

html.a11y-readable-font body,
html.a11y-readable-font * {
  font-family: Arial, Helvetica, sans-serif !important;
}

/* A11y Panel High Contrast Adaptation */
html.a11y-high-contrast .a11y-panel {
  background: #000000 !important;
  border-color: #ffd400 !important;
  color: #ffffff !important;
}

html.a11y-high-contrast .a11y-panel h2,
html.a11y-high-contrast .a11y-panel h3,
html.a11y-high-contrast .a11y-panel p,
html.a11y-high-contrast .a11y-panel span,
html.a11y-high-contrast .a11y-scale-value,
html.a11y-high-contrast .a11y-tts-label,
html.a11y-high-contrast .a11y-tts-status {
  color: #ffffff !important;
}

html.a11y-high-contrast .a11y-list-item,
html.a11y-high-contrast .a11y-tts-btn,
html.a11y-high-contrast .a11y-close-btn,
html.a11y-high-contrast .a11y-tts-controls {
  background: #111111 !important;
  border: 1px solid #555555 !important;
  color: #ffffff !important;
}

html.a11y-high-contrast .a11y-list-item:hover,
html.a11y-high-contrast .a11y-tts-btn:hover,
html.a11y-high-contrast .a11y-close-btn:hover {
  background: #222222 !important;
}

html.a11y-high-contrast .a11y-list-item.active {
  background: #222222 !important;
  border-color: #ffd400 !important;
  color: #ffd400 !important;
}

html.a11y-high-contrast .a11y-list-item.active span {
  color: #ffd400 !important;
}

html.a11y-high-contrast .a11y-list-item svg {
  color: #ffffff !important;
}

html.a11y-high-contrast .a11y-list-item.active svg {
  color: #ffd400 !important;
}

html.a11y-high-contrast .a11y-tts-wrapper {
  border-top-color: #555555 !important;
  border-bottom-color: #555555 !important;
}

@media (max-width: 720px) {
  .a11y-toggle-btn {
    left: 16px;
    bottom: 16px;
    width: 48px;
    height: 48px;
  }

  .a11y-panel {
    left: 16px;
    right: 16px;
    width: auto;
    bottom: 74px;
    padding: 14px;
    max-height: 70vh;
    border-radius: 14px;
  }

  .a11y-header {
    margin-bottom: 8px;
  }

  .a11y-header-text h2 {
    font-size: 17px;
  }

  .a11y-close-btn {
    width: 28px;
    height: 28px;
  }

  .a11y-list {
    gap: 2px;
  }

  .a11y-list-item {
    padding: 8px 10px;
    gap: 10px;
    border-radius: 6px;
  }

  .a11y-list-item svg {
    width: 18px;
    height: 18px;
  }

  .a11y-list-item span {
    font-size: 13.5px;
  }

  .a11y-tts-wrapper {
    margin: 2px 0;
    padding: 2px 0;
  }

  .a11y-tts-controls {
    padding: 6px;
    gap: 6px;
    margin-top: 4px;
  }

  .a11y-tts-btn {
    padding: 6px 4px;
    font-size: 10.5px;
  }
}