/* ============================================================
   Barrierefreiheit-Widget (Schriftgröße, Kontrast, Bewegung)
   Wird auf allen Seiten eingebunden; Zustand in localStorage.
   ============================================================ */
.rfa11y{position:fixed; right:1.1rem; bottom:1.7rem; z-index:150; font-family:'Inter',system-ui,sans-serif}
.rfa11y-btn{position:relative; width:46px; height:46px; border-radius:50%; border:1px solid var(--border-hover);
  background:color-mix(in srgb,var(--bg2) 86%, transparent); backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px);
  color:var(--primary); display:grid; place-items:center; cursor:pointer; box-shadow:0 6px 22px rgba(0,0,0,0.3);
  transition:transform .3s cubic-bezier(0.34,1.56,0.64,1), border-color .3s, color .3s}
.rfa11y-btn:hover{transform:translateY(-2px) scale(1.05); border-color:var(--primary)}
.rfa11y-btn svg{width:23px; height:23px; transition:opacity .25s, transform .3s cubic-bezier(0.16,1,0.3,1)}
/* Button -> X beim Öffnen */
.rfa11y-btn::before, .rfa11y-btn::after{content:""; position:absolute; top:50%; left:50%; width:18px; height:2px; margin:-1px 0 0 -9px; background:currentColor; border-radius:2px; opacity:0; transition:opacity .25s, transform .3s cubic-bezier(0.16,1,0.3,1)}
.rfa11y-btn[aria-expanded="true"] svg{opacity:0; transform:rotate(45deg) scale(.5)}
.rfa11y-btn[aria-expanded="true"]::before{opacity:1; transform:rotate(45deg)}
.rfa11y-btn[aria-expanded="true"]::after{opacity:1; transform:rotate(-45deg)}
.rfa11y-panel{position:absolute; right:0; left:auto; bottom:58px; width:304px; max-width:calc(100vw - 2.2rem);
  background:var(--bg2); border:1px solid var(--border-hover); border-radius:16px; box-shadow:0 24px 60px rgba(0,0,0,0.42);
  padding:1.3rem; animation:rfaIn .35s cubic-bezier(0.16,1,0.3,1)}
.rfa11y-panel[hidden]{display:none}
@keyframes rfaIn{from{opacity:0; transform:translateY(10px) scale(.98)} to{opacity:1; transform:none}}
.rfa11y-head{display:flex; align-items:center; justify-content:space-between; margin-bottom:0.5rem}
.rfa11y-title{font-family:'Red Hat Display',sans-serif; font-weight:700; font-size:1.05rem; letter-spacing:-0.02em; color:var(--fg)}
.rfa11y-close{border:none; background:none; color:var(--fg2); font-size:1.35rem; line-height:1; cursor:pointer; width:28px; height:28px; border-radius:50%}
.rfa11y-close:hover{color:var(--primary)}
.rfa11y-intro{font-size:0.78rem; color:var(--fg3); line-height:1.5; margin-bottom:1.1rem}
.rfa11y-sec{margin-bottom:1.1rem}
.rfa11y-lbl{font-family:'JetBrains Mono',monospace; font-size:0.6rem; letter-spacing:0.12em; text-transform:uppercase; color:var(--fg3); margin-bottom:0.6rem}
.rfa11y-seg{display:flex; gap:0.4rem}
.rfa11y-seg button{flex:1; padding:0.5rem 0.3rem; border:1px solid var(--border); border-radius:9px; background:transparent; color:var(--fg2); font-size:0.8rem; font-family:inherit; cursor:pointer; transition:border-color .25s, color .25s, background .25s}
.rfa11y-seg button[aria-checked="true"]{border-color:var(--primary); color:var(--primary); background:var(--primary-dim)}
.rfa11y-seg button:hover{color:var(--fg)}
.rfa11y-row{display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:0.5rem 0; color:var(--fg); font-size:0.9rem; cursor:pointer}
.rfa11y-switch{position:relative; width:42px; height:24px; border-radius:999px; border:1px solid var(--border-hover); background:var(--bg3); cursor:pointer; flex-shrink:0; transition:background .25s, border-color .25s}
.rfa11y-switch[aria-checked="true"]{background:var(--primary); border-color:var(--primary)}
.rfa11y-knob{position:absolute; top:2px; left:2px; width:18px; height:18px; border-radius:50%; background:var(--fg); transition:transform .25s cubic-bezier(0.34,1.56,0.64,1), background .25s}
.rfa11y-switch[aria-checked="true"] .rfa11y-knob{transform:translateX(18px); background:var(--primary-on)}
.rfa11y-reset{width:100%; padding:0.55rem; border:1px solid var(--border); border-radius:9px; background:transparent; color:var(--fg2); font-size:0.82rem; font-family:inherit; cursor:pointer; transition:border-color .25s, color .25s}
.rfa11y-reset:hover{border-color:var(--primary); color:var(--primary)}

/* ===== Zustände (auf <html>) ===== */
html.rfa-font-sm{font-size:90%}
html.rfa-font-lg{font-size:116%}
/* Erhöhter Kontrast — höhere Spezifität als :root[data-theme] */
:root.rfa-contrast[data-theme="dark"]{--fg2:#D2CBC0; --fg3:#A69D91; --border:rgba(176,154,106,0.32); --border-hover:rgba(176,154,106,0.58)}
:root.rfa-contrast[data-theme="light"]{--fg2:#33271C; --fg3:#52422F; --border:rgba(44,30,20,0.32); --border-hover:rgba(44,30,20,0.58)}
:root.rfa-contrast a[href]{text-underline-offset:3px}
/* Bewegung reduzieren */
html.rfa-motion *, html.rfa-motion *::before, html.rfa-motion *::after{
  animation-duration:0.001ms!important; animation-iteration-count:1!important; transition-duration:0.001ms!important; scroll-behavior:auto!important}

@media (max-width:520px){ .rfa11y{right:0.8rem; bottom:1.2rem} }
