/* ============================================================
   BoldNewEra — Accessibility Widget
   ============================================================ */

/* ── Widget container ──────────────────────────────────────── */
#a11y-widget {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  font-family: 'Poppins', sans-serif;
}

/* ── Toggle-knop ───────────────────────────────────────────── */
#a11y-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(255, 115, 3, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin-left: auto;
}

#a11y-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(255, 115, 3, 0.6);
}

#a11y-toggle:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
}

/* ── Panel ──────────────────────────────────────────────────── */
#a11y-panel {
  position: absolute;
  bottom: calc(100% + 0.75rem);
  right: 0;
  width: 284px;
  max-width: calc(100vw - 1rem);
  background: var(--navy-mid);
  border: 1px solid rgba(160, 133, 255, 0.25);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transform-origin: bottom right;
  animation: a11y-in 0.2s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

#a11y-panel[hidden] {
  display: none;
}

@keyframes a11y-in {
  from { opacity: 0; transform: scale(0.92) translateY(8px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);   }
}

/* ── Panel header ───────────────────────────────────────────── */
.a11y-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid rgba(160, 133, 255, 0.12);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gray-light, #8b99b4);
}

#a11y-reset {
  background: none;
  border: 1px solid rgba(139, 153, 180, 0.25);
  color: var(--gray, #8b99b4);
  font-family: 'Poppins', sans-serif;
  font-size: 0.7rem;
  padding: 0.18rem 0.55rem;
  border-radius: 100px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

#a11y-reset:hover {
  border-color: var(--orange);
  color: var(--orange);
}

#a11y-reset:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* ── Knoppen grid ───────────────────────────────────────────── */
.a11y-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding: 0.875rem;
}

.a11y-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 0.4rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(160, 133, 255, 0.1);
  border-radius: var(--radius-sm);
  color: var(--gray-light, #8b99b4);
  font-family: 'Poppins', sans-serif;
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.3;
  text-align: center;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}

.a11y-btn:hover {
  background: rgba(160, 133, 255, 0.1);
  border-color: rgba(160, 133, 255, 0.3);
  color: #fff;
}

.a11y-btn[aria-pressed="true"] {
  background: rgba(255, 115, 3, 0.15);
  border-color: var(--orange);
  color: var(--orange);
}

.a11y-btn:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.a11y-btn-icon {
  font-size: 1.15rem;
  font-weight: 700;
}


/* ============================================================
   Feature: Grotere tekst
   ============================================================ */
html.a11y--text-larger {
  font-size: 20px;
}

/* ============================================================
   Feature: Kleinere tekst
   ============================================================ */
html.a11y--text-smaller {
  font-size: 13px;
}

/* ============================================================
   Feature: Hoog contrast
   Harde kleuren (geen var()) — WCAG AAA vereist zwart/geel
   ============================================================ */
html.a11y--high-contrast,
html.a11y--high-contrast body {
  background: #000 !important;
  color: #fff !important;
}

html.a11y--high-contrast h1,
html.a11y--high-contrast h2,
html.a11y--high-contrast h3,
html.a11y--high-contrast h4,
html.a11y--high-contrast h5,
html.a11y--high-contrast h6,
html.a11y--high-contrast p,
html.a11y--high-contrast li,
html.a11y--high-contrast span,
html.a11y--high-contrast label,
html.a11y--high-contrast td,
html.a11y--high-contrast th {
  color: #fff !important;
}

html.a11y--high-contrast .card,
html.a11y--high-contrast .nav,
html.a11y--high-contrast .nav.scrolled,
html.a11y--high-contrast .dienst-card,
html.a11y--high-contrast .step-card,
html.a11y--high-contrast .trust-bar,
html.a11y--high-contrast .footer,
html.a11y--high-contrast .cta-section,
html.a11y--high-contrast section {
  background: #000 !important;
  border-color: #fff !important;
}

html.a11y--high-contrast .btn-primary,
html.a11y--high-contrast .btn-secondary,
html.a11y--high-contrast .btn-ghost,
html.a11y--high-contrast .btn {
  background: #ff0 !important;
  color: #000 !important;
  border: 2px solid #ff0 !important;
  box-shadow: none !important;
}

html.a11y--high-contrast .section-label,
html.a11y--high-contrast .orange-text,
html.a11y--high-contrast .hero-badge,
html.a11y--high-contrast .tag {
  color: #ff0 !important;
  border-color: #ff0 !important;
  background: transparent !important;
}

html.a11y--high-contrast #a11y-toggle {
  background: #ff0;
  color: #000;
  box-shadow: none;
}

html.a11y--high-contrast #a11y-panel {
  background: #000;
  border-color: #fff;
}

html.a11y--high-contrast .a11y-btn {
  background: #000;
  border-color: #fff;
  color: #fff;
}

html.a11y--high-contrast .a11y-btn[aria-pressed="true"] {
  background: #ff0;
  color: #000;
  border-color: #ff0;
}

/* ============================================================
   Feature: Links zichtbaar
   ============================================================ */
html.a11y--links-visible a:not(#a11y-toggle):not(.a11y-btn):not(#a11y-reset) {
  text-decoration: underline !important;
  text-underline-offset: 3px;
  color: var(--cyan) !important;
}

html.a11y--links-visible a:hover:not(#a11y-toggle):not(.a11y-btn):not(#a11y-reset) {
  color: var(--orange) !important;
}

/* ============================================================
   Feature: Stop animaties
   ============================================================ */
html.a11y--stop-animations *,
html.a11y--stop-animations *::before,
html.a11y--stop-animations *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}

/* ============================================================
   Feature: Meer regelafstand
   ============================================================ */
html.a11y--line-height p,
html.a11y--line-height li,
html.a11y--line-height h1,
html.a11y--line-height h2,
html.a11y--line-height h3,
html.a11y--line-height h4 {
  line-height: 2 !important;
}

/* ============================================================
   Feature: Links uitlijnen (tekst)
   ============================================================ */
html.a11y--align-left p,
html.a11y--align-left h1,
html.a11y--align-left h2,
html.a11y--align-left h3,
html.a11y--align-left h4,
html.a11y--align-left li {
  text-align: left !important;
}

/* ============================================================
   TTS sectie — geïntegreerd in het accessibility panel
   ============================================================ */

.a11y-divider {
  height: 1px;
  background: rgba(0, 201, 167, 0.15);
  margin: 0;
}

.a11y-tts {
  padding: 0.75rem 0.875rem 0.875rem;
}

.a11y-tts-header {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--teal, #00c9a7);
  margin-bottom: 0.6rem;
}

#tts-selection-hint {
  display: inline-block;
  font-size: 0.58rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  color: var(--gray, #8b99b4);
  margin-left: 0.3rem;
}

.tts-controls {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
}

.tts-btn {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex: 1;
  justify-content: center;
  padding: 0.45rem 0.25rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(0, 201, 167, 0.15);
  border-radius: var(--radius-sm, 10px);
  color: var(--gray-light, #c5cedf);
  font-family: 'Poppins', sans-serif;
  font-size: 0.63rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
  white-space: nowrap;
}

.tts-btn:hover:not(:disabled) {
  background: rgba(0, 201, 167, 0.12);
  border-color: rgba(0, 201, 167, 0.4);
  color: #fff;
}

.tts-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.tts-btn:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.tts-btn-play:not(:disabled) {
  background: rgba(0, 201, 167, 0.15);
  border-color: var(--teal, #00c9a7);
  color: var(--teal, #00c9a7);
}

.tts-settings {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.tts-label {
  font-size: 0.68rem;
  color: var(--gray, #8b99b4);
  display: flex;
  justify-content: space-between;
}

.tts-settings input[type="range"] {
  width: 100%;
  accent-color: var(--teal, #00c9a7);
  cursor: pointer;
  height: 4px;
  border-radius: 2px;
}

.tts-settings input[type="range"]:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Hoog contrast override voor TTS-sectie */
html.a11y--high-contrast .a11y-divider {
  background: #fff;
}

html.a11y--high-contrast .a11y-tts-header {
  color: #ff0;
}

html.a11y--high-contrast .tts-btn {
  background: #000;
  border-color: #fff;
  color: #fff;
}

html.a11y--high-contrast .tts-btn-play:not(:disabled) {
  background: #ff0;
  border-color: #ff0;
  color: #000;
}

/* Light mode overrides */
[data-theme="light"] .a11y-tts-header {
  color: #00a082;
}

[data-theme="light"] #tts-selection-hint {
  color: #52668a;
}

[data-theme="light"] .tts-btn {
  background: #f4f6fa;
  border-color: rgba(0, 160, 130, 0.15);
  color: #34466a;
}

[data-theme="light"] .tts-btn:hover:not(:disabled) {
  background: rgba(0, 160, 130, 0.08);
  border-color: rgba(0, 160, 130, 0.35);
  color: #122235;
}
