/* =====================================================================
   Erişilebilirlik: sesli okuma düğmesi, yüksek kontrast, okuma dostu yazı,
   satır aralığı, güçlü odak çerçevesi. Sınıflar <html> üzerine konur
   (erisim.js ve her sayfanın <head> betiği).
   ===================================================================== */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Sesli okuma ---- */
.sesli-btn[hidden] { display: none !important; }
.sesli-btn.okuyor, .sesli-btn[aria-pressed="true"] { background: var(--primary); color: var(--primary-ink); }
.sesli-btn.okuyor svg path:not(:first-child) { animation: sesli-dalga 1s ease-in-out infinite alternate; }
@keyframes sesli-dalga { from { opacity: .35; } to { opacity: 1; } }
.sesli-yuzen { position: fixed; left: 16px; bottom: 16px; z-index: 90; width: 48px; height: 48px; border-radius: 50%;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow); display: grid; place-items: center; cursor: pointer; }
.sesli-yuzen svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.konu-dinle { display: inline-flex; align-items: center; gap: 6px; }
.konu-dinle[aria-pressed="true"] { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }

/* ---- En büyük yazı boyutu (diğer boyutlar panel.css'te) ---- */
html[data-font="enbuyuk"] { font-size: 150%; }

/* ---- Satır aralığı ---- */
html[data-satir="genis"] body :is(p, li, dd, td, th, label, small, blockquote, .konu-govde) { line-height: 1.85 !important; }
html[data-satir="cokgenis"] body :is(p, li, dd, td, th, label, small, blockquote, .konu-govde) { line-height: 2.2 !important; }
html[data-satir="cokgenis"] body p { margin-bottom: 1em; }

/* ---- Okuma dostu yazı (disleksi): yalın harfler, geniş harf ve sözcük aralığı ---- */
html.disleksi body, html.disleksi body *:not(svg):not(svg *):not(kbd):not(code) {
  font-family: Verdana, Tahoma, "Segoe UI", Arial, sans-serif !important;
  letter-spacing: .035em !important; word-spacing: .14em !important; font-style: normal !important;
}
html.disleksi body :is(p, li) { text-align: left !important; }

/* ---- Güçlü odak çerçevesi ---- */
html.guclu-odak *:focus-visible, html.yuksek-kontrast *:focus-visible {
  outline: 3px solid #ffbf00 !important; outline-offset: 3px !important; box-shadow: 0 0 0 6px #000 !important;
}

/* ---- Yüksek kontrast (açık) ---- */
html.yuksek-kontrast {
  --bg: #ffffff; --bg-alt: #ffffff; --surface: #ffffff; --text: #000000; --muted: #1a1a1a;
  --border: #000000; --primary: #0000b8; --primary-ink: #ffffff; --primary-soft: #ffffff;
  --accent: #0000b8; --accent-soft: #ffffff; --navy: #000000; --navy-2: #000000;
  --green: #005a1f; --green-soft: #ffffff; --amber: #6b3a00; --amber-soft: #ffffff; --live: #b00020;
  --shadow: none;
}
/* ---- Yüksek kontrast (koyu) ---- */
html.yuksek-kontrast[data-theme="dark"] {
  --bg: #000000; --bg-alt: #000000; --surface: #000000; --text: #ffffff; --muted: #f0f0f0;
  --border: #ffffff; --primary: #ffe14d; --primary-ink: #000000; --primary-soft: #000000;
  --accent: #ffe14d; --accent-soft: #000000; --navy: #000000; --navy-2: #000000;
  --green: #6dff9c; --green-soft: #000000; --amber: #ffc266; --amber-soft: #000000; --live: #ff8a9a;
}
@media (prefers-color-scheme: dark) {
  html.yuksek-kontrast:not([data-theme="light"]) {
    --bg: #000000; --bg-alt: #000000; --surface: #000000; --text: #ffffff; --muted: #f0f0f0;
    --border: #ffffff; --primary: #ffe14d; --primary-ink: #000000; --primary-soft: #000000;
    --accent: #ffe14d; --accent-soft: #000000; --navy: #000000; --navy-2: #000000;
    --green: #6dff9c; --green-soft: #000000; --amber: #ffc266; --amber-soft: #000000; --live: #ff8a9a;
  }
}
html.yuksek-kontrast body { background: var(--bg); color: var(--text); }
html.yuksek-kontrast body :is(.card, .btn, button, input, select, textarea, dialog, .chip, .ki-f, .ki-kutu) { border: 2px solid var(--border) !important; }
html.yuksek-kontrast body .muted { color: var(--muted) !important; }
html.yuksek-kontrast main a:not(.btn) { text-decoration: underline !important; text-underline-offset: 3px; }
html.yuksek-kontrast body * { text-shadow: none !important; }
html.yuksek-kontrast img { filter: contrast(1.15); }

/* Ayarlar › Erişilebilirlik alt başlığı */
.set-alt { font-size: 1rem; margin: 22px 0 6px; padding-top: 16px; border-top: 1px solid var(--border); }
html.yuksek-kontrast body .top-search input { border: 0 !important; }

/* ---- Sesle yazma / sesle cevap ---- */
.mik-btn { display: inline-flex; align-items: center; gap: 6px; margin: 6px 0 2px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.mik-btn:hover { border-color: var(--primary); color: var(--primary); }
.mik-btn.dinliyor, .q-mik.dinliyor { background: var(--live); border-color: var(--live); color: #fff; }
.mik-btn.dinliyor span[aria-hidden], .q-mik.dinliyor span { animation: sesli-dalga .8s ease-in-out infinite alternate; }
.q-mik { margin-left: 4px; }

/* ---- Kısayol listesi ---- */
.kisayol-dlg { max-width: 560px; width: calc(100% - 32px); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.kisayol-dlg::backdrop { background: rgba(0, 0, 0, .5); }
.kisayol-dlg h2 { margin: 0 0 12px; font-size: 1.2rem; }
.kisayol-dlg table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.kisayol-dlg th, .kisayol-dlg td { text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
.kisayol-dlg td:first-child { white-space: nowrap; }
.kisayol-dlg kbd, .set-card kbd { font: inherit; font-size: .82em; padding: 1px 6px; border: 1px solid var(--border); border-radius: 5px; background: var(--bg-alt); }
.kisayol-dlg form { margin-top: 16px; text-align: right; }
.ks-liste { margin: 8px 0 0; padding-left: 18px; font-size: .9rem; line-height: 1.8; }

/* ---- Grafik özeti ---- */
.grafik-ozet { margin: 10px 0 4px; font-size: .9rem; color: var(--text); background: var(--bg-alt); border-radius: var(--radius-sm); padding: 8px 12px; }

/* ---- Odak çerçevesi her zaman görünür (WCAG 2.4.7) ----
   Bazı alanlarda "outline: none" vardı; klavyeyle gezinen kişi nerede olduğunu göremiyordu. */
body :is(input, textarea, select):focus-visible:not(:is(.top-search, .tb-search, .search-input-row, .help-search, .ai-form) *) {
  outline: 2px solid var(--primary) !important; outline-offset: 2px !important;
}
body :is(.top-search, .tb-search, .search-input-row, .help-search, .ai-form):focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.dp:focus-visible { outline: 3px solid var(--primary) !important; outline-offset: 2px; }
.lc-hit:focus-visible { stroke: var(--primary); stroke-width: 2; }
#tOzet:focus { outline: none; }
#tOzet:focus-visible .test-score { outline: 2px solid var(--primary); outline-offset: 3px; }

/* ---- Yazı boyutu, hareket, bağlantı tercihleri (panel.css'i yüklemeyen herkese açık sayfalar için de) ---- */
html[data-font="kucuk"] { font-size: 93.75%; }
html[data-font="buyuk"] { font-size: 112.5%; }
html[data-font="cokbuyuk"] { font-size: 125%; }
html.reduce-motion *, html.reduce-motion *::before, html.reduce-motion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
html.ul-links main a:not(.btn) { text-decoration: underline; text-underline-offset: 2px; }

/* ---- ♿ düğmesi ve üst çubuğu olmayan sayfalarda yüzen düğmeler ---- */
.erisim-btn svg, .erisim-yuzen svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.erisim-btn circle { fill: currentColor; stroke: none; }
.erisim-yuzen { position: fixed; left: 16px; bottom: 16px; z-index: 90; display: flex; flex-direction: column; gap: 10px; }
.erisim-yuzen .icon-btn { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow); }
.erisim-yuzen .icon-btn svg { width: 22px; height: 22px; }
.erisim-yuzen .icon-btn:hover { border-color: var(--primary); color: var(--primary); }
@media print { .erisim-yuzen { display: none; } }

/* ---- Hızlı erişilebilirlik paneli ---- */
.erisim-panel { width: min(440px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow: auto; padding: 20px 22px;
  border: 1px solid var(--border); border-radius: var(--radius, 16px); background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.erisim-panel::backdrop { background: rgba(0, 0, 0, .5); }
.ep-bas { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ep-bas h2 { margin: 0; font-size: 1.2rem; }
.ep-x { width: 36px; height: 36px; border: 0; border-radius: 10px; background: var(--bg-alt); color: var(--text); font: inherit; cursor: pointer; }
.ep-grup { border: 0; margin: 14px 0 0; padding: 0; }
.ep-grup legend { font-weight: 700; font-size: .92rem; margin-bottom: 6px; padding: 0; }
.ep-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.ep-seg label { position: relative; }
.ep-seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.ep-seg span { display: inline-block; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; font-size: .88rem; font-weight: 600; }
.ep-seg input:checked + span { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.ep-seg input:focus-visible + span { outline: 3px solid var(--primary); outline-offset: 2px; }
.ep-anahtar { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 2px; }
.ep-anahtar label { display: flex; align-items: center; gap: 10px; padding: 8px 4px; font-weight: 600; font-size: .95rem; cursor: pointer; border-radius: 8px; }
.ep-anahtar label:hover { background: var(--bg-alt); }
.ep-anahtar input { width: 20px; height: 20px; accent-color: var(--primary); margin: 0; }
.ep-not { margin: 14px 0 0; font-size: .85rem; color: var(--muted); line-height: 1.6; }
.ep-not kbd { font: inherit; font-size: .82em; padding: 0 5px; border: 1px solid var(--border); border-radius: 5px; background: var(--bg-alt); }
.ep-alt { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.erisim-panel .btn { cursor: pointer; }
