/* ============================================================
   Accessibility toolbar + cookie banner
   Shared across index, impressum, datenschutz, barrierefreiheit
   ============================================================ */

:root {
  --a11y-bg: #ffffff;
  --a11y-fg: #131420;
  --a11y-muted: #6b6e80;
  --a11y-line: rgba(19, 20, 32, 0.10);
  --a11y-accent: #1F3A8E;
}

/* ---------- Font size scaling ---------- */
html[data-font="lg"]   { font-size: 112.5%; }
html[data-font="xl"]   { font-size: 125%; }

/* ---------- High contrast mode ---------- */
html[data-contrast="high"] body,
html[data-contrast="high"] {
  background: #ffffff !important;
}
html[data-contrast="high"] body,
html[data-contrast="high"] p,
html[data-contrast="high"] li,
html[data-contrast="high"] span,
html[data-contrast="high"] a,
html[data-contrast="high"] h1,
html[data-contrast="high"] h2,
html[data-contrast="high"] h3,
html[data-contrast="high"] h4,
html[data-contrast="high"] h5,
html[data-contrast="high"] h6,
html[data-contrast="high"] strong,
html[data-contrast="high"] dt,
html[data-contrast="high"] dd {
  color: #000000 !important;
}
html[data-contrast="high"] a {
  text-decoration: underline !important;
}
html[data-contrast="high"] .btn,
html[data-contrast="high"] button.btn-primary,
html[data-contrast="high"] .btn-primary {
  background: #000000 !important;
  color: #ffffff !important;
  border: 2px solid #000000 !important;
}
html[data-contrast="high"] *:focus-visible {
  outline: 3px solid #000000 !important;
  outline-offset: 2px !important;
}

/* ---------- Reduce motion (forced via toggle) ---------- */
html[data-motion="reduced"] *,
html[data-motion="reduced"] *::before,
html[data-motion="reduced"] *::after {
  transition-duration: 0s !important;
  animation-duration: 0s !important;
  animation-iteration-count: 1 !important;
  scroll-behavior: auto !important;
}

/* ---------- Skip link ---------- */
.a11y-skip {
  position: absolute;
  left: 8px; top: 8px;
  padding: 10px 16px;
  background: #131420;
  color: #ffffff;
  border-radius: 8px;
  font-size: 14px;
  z-index: 9999;
  transform: translateY(-200%);
  transition: transform 160ms ease-out;
}
.a11y-skip:focus {
  transform: translateY(0);
  outline: 2px solid #C8102E;
  outline-offset: 2px;
}

/* ============================================================
   Sticky a11y toggle button
   ============================================================ */
.a11y-fab {
  position: fixed;
  right: 20px; bottom: 20px;
  width: 56px; height: 56px;
  border-radius: 999px;
  border: 1px solid var(--a11y-line);
  background: var(--a11y-bg);
  color: var(--a11y-fg);
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: 0 18px 40px -16px rgba(19, 20, 32, 0.28),
              0 2px 4px rgba(19, 20, 32, 0.06);
  z-index: 9000;
  transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1),
              box-shadow 200ms ease;
}
.a11y-fab:hover {
  transform: translateY(-1px);
  box-shadow: 0 24px 50px -16px rgba(19, 20, 32, 0.32),
              0 2px 6px rgba(19, 20, 32, 0.08);
}
.a11y-fab:active { transform: scale(0.97); }
.a11y-fab svg { width: 26px; height: 26px; stroke: currentColor; }

/* ---------- Panel ---------- */
.a11y-panel {
  position: fixed;
  right: 20px; bottom: 88px;
  width: min(340px, calc(100vw - 40px));
  background: var(--a11y-bg);
  color: var(--a11y-fg);
  border: 1px solid var(--a11y-line);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 30px 60px -20px rgba(19, 20, 32, 0.30),
              0 4px 8px rgba(19, 20, 32, 0.06);
  z-index: 9001;
  opacity: 0;
  transform: translateY(8px) scale(0.97);
  transform-origin: bottom right;
  pointer-events: none;
  transition: opacity 180ms cubic-bezier(0.23, 1, 0.32, 1),
              transform 180ms cubic-bezier(0.23, 1, 0.32, 1);
  font-family: "Inter", "Geist", system-ui, -apple-system, sans-serif;
}
.a11y-panel[data-open="true"] {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.a11y-panel h3 {
  font-size: 15px;
  font-weight: 500;
  margin: 0 0 4px;
  color: var(--a11y-fg);
}
.a11y-panel p.a11y-lead {
  font-size: 12.5px;
  color: var(--a11y-muted);
  margin: 0 0 18px;
  line-height: 1.5;
}
.a11y-group {
  display: grid; gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--a11y-line);
}
.a11y-group + .a11y-group { margin-top: 14px; }
.a11y-group .lbl {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--a11y-muted);
  font-weight: 500;
}
.a11y-segmented {
  display: grid; grid-auto-flow: column;
  grid-auto-columns: 1fr;
  border: 1px solid var(--a11y-line);
  border-radius: 10px;
  overflow: hidden;
}
.a11y-segmented button {
  background: transparent;
  border: 0;
  padding: 9px 8px;
  font-size: 13px;
  font-family: inherit;
  color: var(--a11y-fg);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
  border-right: 1px solid var(--a11y-line);
}
.a11y-segmented button:last-child { border-right: 0; }
.a11y-segmented button[aria-pressed="true"] {
  background: var(--a11y-fg);
  color: #ffffff;
}
.a11y-toggle {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.a11y-toggle span { font-size: 13.5px; }
.a11y-switch {
  position: relative;
  width: 40px; height: 22px;
  border-radius: 999px;
  background: rgba(19, 20, 32, 0.18);
  border: 0;
  cursor: pointer;
  transition: background 200ms ease;
  flex-shrink: 0;
}
.a11y-switch::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 999px;
  background: #ffffff;
  transition: transform 200ms cubic-bezier(0.23, 1, 0.32, 1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
}
.a11y-switch[aria-checked="true"] { background: var(--a11y-fg); }
.a11y-switch[aria-checked="true"]::after { transform: translateX(18px); }

.a11y-reset {
  margin-top: 16px;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: 1px solid var(--a11y-line);
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  color: var(--a11y-muted);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}
.a11y-reset:hover { background: rgba(19,20,32,0.04); color: var(--a11y-fg); }

/* ============================================================
   Cookie banner (TTDSG/DSGVO konform)
   ============================================================ */
.cc-banner {
  position: fixed;
  left: 20px; right: 20px; bottom: 20px;
  max-width: 720px;
  margin: 0 auto;
  background: #ffffff;
  color: var(--a11y-fg);
  border: 1px solid var(--a11y-line);
  border-radius: 18px;
  padding: 22px 24px;
  box-shadow: 0 30px 60px -20px rgba(19, 20, 32, 0.30);
  z-index: 9500;
  font-family: "Inter", "Geist", system-ui, -apple-system, sans-serif;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity 220ms cubic-bezier(0.23, 1, 0.32, 1),
              transform 220ms cubic-bezier(0.23, 1, 0.32, 1);
}
.cc-banner[data-open="true"] {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.cc-banner h3 {
  font-size: 16px;
  font-weight: 500;
  margin: 0 0 6px;
}
.cc-banner p {
  font-size: 13.5px;
  color: var(--a11y-muted);
  line-height: 1.55;
  margin: 0 0 16px;
}
.cc-banner p a {
  color: var(--a11y-fg);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cc-actions {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: flex-end;
}
.cc-actions button {
  padding: 11px 18px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1),
              background 200ms ease, color 200ms ease;
  border: 1px solid var(--a11y-line);
  background: #ffffff;
  color: var(--a11y-fg);
}
.cc-actions button:active { transform: scale(0.97); }
.cc-actions button.is-primary {
  background: #131420;
  color: #ffffff;
  border-color: #131420;
}
.cc-actions button.is-primary:hover { background: #2a2c3b; }

@media (max-width: 520px) {
  .cc-banner { padding: 18px; }
  .cc-actions { justify-content: stretch; }
  .cc-actions button { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  .a11y-fab, .a11y-panel, .cc-banner, .a11y-switch::after {
    transition: none !important;
  }
}
