/* ═══════════════════════════════════════════════════════════
   ZugangWP — Topbar Accessibility Toolbar
   Fixed slim bar at top, expands on click. Icon-driven UI.
   100% DSGVO-konform: No cookies, no external resources.
   ═══════════════════════════════════════════════════════════ */

/* ─── Topbar (always visible) ──────────────────────────── */
#zwp-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999999;
  height: 56px;
  background: #1f7a6f;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 16px;
  font-family: -apple-system, system-ui, 'Segoe UI', sans-serif;
  transition: transform 0.3s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

/* Push page content down */
body.zwp-topbar-active {
  margin-top: 38px !important;
}

/* WP admin bar offset */
body.admin-bar.zwp-topbar-active #zwp-topbar {
  top: 32px;
}
@media (max-width: 782px) {
  body.admin-bar.zwp-topbar-active #zwp-topbar { top: 46px; }
}

/* ─── Icon Buttons (topbar) ────────────────────────────── */
.zwp-tb-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 38px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.7);
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
  font-size: 13px;
  position: relative;
}
.zwp-tb-btn:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}
.zwp-tb-btn:focus-visible {
  outline: 2px solid #d4b86a;
  outline-offset: 1px;
}
.zwp-tb-btn.active {
  background: rgba(42,157,143,0.3);
  color: #2a9d8f;
}
.zwp-tb-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

/* Tooltip */
.zwp-tb-btn::after {
  content: attr(data-tip);
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 10px;
  background: #0d1b2a;
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  margin-top: 4px;
  z-index: 10;
}
.zwp-tb-btn:hover::after {
  opacity: 1;
}

/* ─── Divider ──────────────────────────────────────────── */
.zwp-tb-div {
  width: 1px;
  height: 22px;
  background: rgba(255,255,255,0.15);
  margin: 0 4px;
}

/* ─── Font size controls in topbar ─────────────────────── */
.zwp-tb-font {
  display: flex;
  align-items: center;
  gap: 1px;
}
.zwp-tb-font .zwp-tb-btn {
  width: 28px;
  font-weight: 700;
  font-family: inherit;
}
.zwp-tb-font .zwp-tb-val {
  color: rgba(255,255,255,0.5);
  font-size: 10px;
  font-weight: 600;
  min-width: 30px;
  text-align: center;
}

/* ─── Brand mark (left side) ───────────────────────────── */
.zwp-tb-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: auto;
  padding-right: 8px;
  cursor: default;
}
.zwp-tb-brand svg {
  width: 18px;
  height: 22px;
}
.zwp-tb-brand span {
  font-size: 11px;
  font-weight: 700; color: #fff;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.02em;
}

/* ─── Reset + Close (right side) ───────────────────────── */
.zwp-tb-right {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding-left: 8px;
}
.zwp-tb-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 38px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.4);
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s;
}
.zwp-tb-close:hover {
  background: rgba(239,68,68,0.2);
  color: #ef4444;
}
.zwp-tb-close:focus-visible {
  outline: 2px solid #d4b86a;
  outline-offset: 1px;
}

/* ─── Collapsed state (just a small tab) ───────────────── */
#zwp-topbar.collapsed {
  transform: translateY(-100%);
}
#zwp-topbar-tab {
  position: fixed;
  top: 0;
  right: 20px;
  z-index: 999998;
  background: #1f7a6f;
  color: rgba(255,255,255,0.7);
  border: none;
  border-radius: 0 0 6px 6px;
  padding: 4px 12px 5px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: none;
  align-items: center;
  gap: 5px;
  font-family: -apple-system, system-ui, sans-serif;
  transition: all 0.2s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
#zwp-topbar-tab:hover {
  background: #1f3356;
  color: #fff;
}
#zwp-topbar-tab:focus-visible {
  outline: 2px solid #d4b86a;
  outline-offset: 1px;
}
#zwp-topbar.collapsed + #zwp-topbar-tab {
  display: flex;
}
body.admin-bar #zwp-topbar-tab { top: 32px; }
@media (max-width: 782px) {
  body.admin-bar #zwp-topbar-tab { top: 46px; }
}

body.zwp-topbar-collapsed {
  margin-top: 0 !important;
}

/* ─── Applied Accessibility Styles ─────────────────────── */
body.zwp-high-contrast { filter: contrast(1.5) !important; }
body.zwp-high-contrast * { border-color: #000 !important; }

body.zwp-dark-mode { background: #1a1a2e !important; color: #e0e0e0 !important; }
body.zwp-dark-mode * { background-color: inherit; color: inherit; }
body.zwp-dark-mode a { color: #64b5f6 !important; }
body.zwp-dark-mode img { opacity: 0.85; }
body.zwp-dark-mode #zwp-topbar { background: #0a0a14; }

body.zwp-dyslexia-font, body.zwp-dyslexia-font * {
  font-family: 'OpenDyslexic', 'Comic Sans MS', 'Verdana', sans-serif !important;
  letter-spacing: 0.05em !important;
  word-spacing: 0.12em !important;
}

body.zwp-highlight-links a {
  outline: 3px solid #d4b86a !important;
  outline-offset: 2px !important;
  text-decoration: underline !important;
}

body.zwp-big-cursor, body.zwp-big-cursor * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M8 4l28 20H20l8 16-4 2-8-16-8 8z' fill='%23000' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E") 4 4, auto !important;
}

body.zwp-stop-animations, body.zwp-stop-animations * {
  animation: none !important;
  transition: none !important;
}

#zwp-reading-guide {
  position: fixed;
  left: 0;
  right: 0;
  height: 12px;
  background: rgba(212,184,106,0.25);
  border-top: 2px solid rgba(212,184,106,0.5);
  border-bottom: 2px solid rgba(212,184,106,0.5);
  pointer-events: none;
  z-index: 999997;
  display: none;
}
body.zwp-reading-guide #zwp-reading-guide { display: block; }

/* ─── Responsive ───────────────────────────────────────── */
@media (max-width: 580px) {
  .zwp-tb-brand span { display: none; }
  .zwp-tb-btn::after { display: none; }
  .zwp-tb-font .zwp-tb-val { display: none; }
}

/* ─── Reduced Motion ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  #zwp-topbar { transition-duration: 0.01ms; }
}

/* ─── Print ────────────────────────────────────────────── */
@media print {
  #zwp-topbar, #zwp-topbar-tab, #zwp-reading-guide { display: none !important; }
  body.zwp-topbar-active { margin-top: 0 !important; }
}
body { padding-top: 62px !important; }
