/* =========================================================
   Berpel — Erişilebilirlik Merkezi paneli + kullanıcı tercihleri
   palette-a11y.css'ten SONRA yüklenir.
   ========================================================= */

/* ---------- Kullanıcı tercihleri ---------- */
html[data-bp-fs="sm"] { font-size: 90%; }
html[data-bp-fs="lg"] { font-size: 115%; }
html[data-bp-fs="xl"] { font-size: 130%; }

html[data-bp-links] a:not(.bp-btn) {
  text-decoration: underline !important;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}
html[data-bp-links] a.bp-btn { outline: 2px solid currentColor; outline-offset: 2px; }

html[data-bp-dyslexia] body,
html[data-bp-dyslexia] :is(p, li, a, span, td, th, label, input, textarea, h1, h2, h3, h4, h5, h6) {
  font-family: Verdana, Tahoma, "Trebuchet MS", sans-serif !important;
  letter-spacing: .04em;
  word-spacing: .14em;
}
html[data-bp-dyslexia] :is(p, li) { line-height: 1.9; max-width: 68ch; }

html[data-bp-spacing] :is(p, li, dd, blockquote) {
  line-height: 1.9 !important;
  letter-spacing: .12em !important;
  word-spacing: .16em !important;
  margin-bottom: 1.2em;
}

html[data-bp-focus] :is(a, button, input, select, textarea, [tabindex]):focus {
  outline: 4px solid var(--bp-yellow-ink, #ffcc00) !important;
  outline-offset: 3px !important;
  border-radius: 4px;
}

html[data-bp-motion] *,
body.bp-reduce-motion * {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
  scroll-behavior: auto !important;
}

/* Okuma kılavuzu şeridi */
.bp-reading-guide {
  position: fixed; left: 0; right: 0; height: 44px; top: 0;
  border-top: 2px solid var(--bp-amber-400, #ffcc00);
  border-bottom: 2px solid var(--bp-amber-400, #ffcc00);
  background: rgba(255, 204, 0, .10);
  pointer-events: none; z-index: 9998;
}

/* ---------- Panel ---------- */
.bp-a11y-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(380px, 92vw);
  z-index: 9997; display: flex; flex-direction: column; gap: 18px;
  padding: 22px 20px 28px;
  background: color-mix(in oklab, var(--bp-surface) 92%, transparent);
  backdrop-filter: blur(14px);
  border-left: 1px solid var(--bp-border);
  border-radius: 0; box-shadow: -24px 0 60px rgba(0, 0, 0, .45);
  overflow-y: auto; overscroll-behavior: contain;
  transform: translateX(100%); transition: transform .32s cubic-bezier(.22, .8, .3, 1);
}
.bp-a11y-panel { transition: transform .32s cubic-bezier(.22, .8, .3, 1); }
.bp-a11y-panel.is-open { transform: translateX(0); right: 0; }

.bp-a11y-panel__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.bp-a11y-panel h4 { margin: 0 0 4px; font-size: 1.15rem; color: var(--bp-text); }
.bp-a11y-panel > .bp-a11y-panel__head p { margin: 0; font-size: .84rem; color: var(--bp-text-2); }
.bp-a11y-close {
  flex: 0 0 auto; width: 36px; height: 36px; display: grid; place-items: center;
  background: var(--bp-surface-2); border: 1px solid var(--bp-border); color: var(--bp-text);
  border-radius: 10px; cursor: pointer;
}
.bp-a11y-close svg { width: 18px; height: 18px; }
.bp-a11y-close:hover { background: var(--bp-yellow); color: var(--bp-on-yellow); border-color: var(--bp-yellow); }

.bp-a11y-group { margin: 0; }
.bp-a11y-group > strong {
  display: flex; align-items: center; gap: 8px;
  font-size: .74rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--bp-text-3); margin-bottom: 10px;
}
.bp-a11y-ico svg { width: 15px; height: 15px; display: block; }

/* Tema kartları */
.bp-a11y-theme { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bp-a11y-theme button {
  display: grid; gap: 2px; text-align: left; padding: 14px;
  background: var(--bp-surface-2); border: 1px solid var(--bp-border); border-radius: 14px;
  color: var(--bp-text); cursor: pointer; font-family: inherit;
}
.bp-a11y-theme__ico svg { width: 22px; height: 22px; color: var(--bp-yellow-ink); margin-bottom: 6px; }
.bp-a11y-theme__t { font-weight: 700; font-size: .95rem; }
.bp-a11y-theme__d { font-size: .74rem; color: var(--bp-text-3); line-height: 1.35; }
.bp-a11y-theme button.is-active {
  border-color: var(--bp-yellow-ink);
  box-shadow: inset 0 0 0 1px var(--bp-yellow-ink), 0 8px 24px rgba(255, 204, 0, .12);
  background: var(--bp-yellow-soft);
}

/* Metin boyutu */
.bp-a11y-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.bp-a11y-options button {
  display: grid; gap: 2px; place-items: center; padding: 10px 4px;
  background: var(--bp-surface-2); border: 1px solid var(--bp-border); color: var(--bp-text);
  border-radius: 12px; cursor: pointer; font-family: inherit;
}
.bp-a11y-options button b { font-size: .95rem; }
.bp-a11y-options button small { font-size: .68rem; color: var(--bp-text-3); }
.bp-a11y-options button.is-active {
  background: var(--bp-yellow); color: var(--bp-on-yellow); border-color: var(--bp-yellow);
}
.bp-a11y-options button.is-active small { color: var(--bp-on-yellow); opacity: .8; }

/* Satırlar */
.bp-a11y-row {
  display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px;
  padding: 11px 12px; margin-bottom: 8px;
  background: var(--bp-surface-2); border: 1px solid var(--bp-border); border-radius: 14px;
}
.bp-a11y-row__ico {
  width: 40px; height: 40px; display: grid; place-items: center;
  background: var(--bp-bg-2); border-radius: 11px; color: var(--bp-yellow-ink);
}
.bp-a11y-row__ico svg { width: 19px; height: 19px; }
.bp-a11y-row__txt { display: grid; gap: 1px; min-width: 0; }
.bp-a11y-row__txt b { font-size: .92rem; color: var(--bp-text); }
.bp-a11y-row__txt small { font-size: .74rem; color: var(--bp-text-3); line-height: 1.3; }

/* Switch */
.bp-a11y-switch {
  width: 52px; height: 30px; border-radius: 999px; border: 1px solid var(--bp-border);
  background: var(--bp-bg-2); position: relative; cursor: pointer; padding: 0;
  transition: background .2s, border-color .2s;
}
.bp-a11y-switch span {
  position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--bp-text-3); transition: transform .2s, background .2s;
}
.bp-a11y-switch.is-on { background: var(--bp-yellow); border-color: var(--bp-yellow); }
.bp-a11y-switch.is-on span { transform: translateX(22px); background: var(--bp-on-yellow); }

/* Oynat butonu */
.bp-a11y-play {
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
  background: var(--bp-yellow); color: var(--bp-on-yellow); border: none;
  font-size: .82rem; font-weight: 700; line-height: 1;
}
.bp-a11y-play:hover { background: var(--bp-yellow-2); }

/* Hız kaydırıcı */
.bp-a11y-row--range { grid-template-columns: 1fr; gap: 8px; }
.bp-a11y-row--range label { font-size: .8rem; color: var(--bp-text-2); display: flex; justify-content: space-between; }
.bp-a11y-row--range output { color: var(--bp-yellow-ink); font-weight: 700; }
.bp-a11y-row--range input[type="range"] { width: 100%; accent-color: var(--bp-yellow); }

.bp-a11y-status { font-size: .78rem; color: var(--bp-text-2); margin: 6px 2px 0; min-height: 1em; }

.bp-a11y-panel__reset {
  width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.bp-a11y-panel__reset svg { width: 16px; height: 16px; }
.bp-a11y-panel__note { font-size: .76rem; color: var(--bp-text-3); text-align: center; margin: 0; }

/* klavye kısayolları kılavuzu (daima görünür) */
.bp-a11y-shortcuts { margin-top: 4px; }
.bp-a11y-shortcuts > strong {
  display: flex; align-items: center; gap: 8px;
  font-size: .8rem; font-weight: 700; color: var(--bp-text-1);
  margin: 0 0 10px;
}
.bp-a11y-shortcuts > strong .bp-a11y-ico { width: 17px; height: 17px; display: inline-flex; }
.bp-a11y-shortcuts ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.bp-a11y-shortcuts li {
  display: flex; align-items: center; gap: 12px;
  font-size: .78rem; color: var(--bp-text-2);
}
.bp-a11y-shortcuts li > span:first-child {
  display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto;
  min-width: 86px;
}
.bp-a11y-shortcuts li > span:last-child { color: var(--bp-text-2); }
.bp-a11y-shortcuts kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 24px; padding: 0 6px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .72rem; font-weight: 600; line-height: 1;
  color: var(--bp-text-1);
  background: var(--bp-surface-2, rgba(255,255,255,.06));
  border: 1px solid var(--bp-border, rgba(255,255,255,.16));
  border-bottom-width: 2px; border-radius: 6px;
}
[data-theme="light"] .bp-a11y-shortcuts kbd {
  background: rgba(15,18,22,.05);
  border-color: rgba(15,18,22,.18);
}

@media (max-width: 480px) {
  .bp-a11y-panel { width: 100vw; padding: 18px 16px 26px; }
  .bp-a11y-theme { grid-template-columns: 1fr; }
}
