/* ==========================================================
   Erişilebilirlik widget'ı
   ========================================================== */
.a11y-root {
  --a11y-accent: #8a4fcf;
  --a11y-soft: color-mix(in srgb, var(--a11y-accent) 10%, #fff);
  position: fixed; inset: 0; z-index: 2147483000; pointer-events: none;
  font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: #1f1f24; letter-spacing: 0; text-align: left;
}
.a11y-root *, .a11y-root *::before, .a11y-root *::after { box-sizing: border-box; }
.a11y-root [hidden] { display: none !important; }
.a11y-root button { font: inherit; color: inherit; margin: 0; cursor: pointer; }
.a11y-root :focus-visible { outline: 2px solid var(--a11y-accent); outline-offset: 2px; }
.a11y-ico { flex: none; display: block; }

/* Açma butonu */
.a11y-root .a11y-trigger {
  position: absolute; pointer-events: auto;
  display: grid; place-items: center;
  width: 56px; height: 56px; padding: 0;
  border: 3px solid #fff; border-radius: 50%;
  background: var(--a11y-accent); color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  transition: scale .2s;
}
.a11y-trigger:hover { scale: 1.07; }
.a11y-root[data-pos="top-left"] .a11y-trigger { top: 20px; left: 20px; }
.a11y-root[data-pos="top-right"] .a11y-trigger { top: 20px; right: 20px; }
.a11y-root[data-pos="center-left"] .a11y-trigger { top: 50%; left: 20px; translate: 0 -50%; }
.a11y-root[data-pos="center-right"] .a11y-trigger { top: 50%; right: 20px; translate: 0 -50%; }
.a11y-root[data-pos="bottom-left"] .a11y-trigger { bottom: 20px; left: 20px; }
.a11y-root[data-pos="bottom-right"] .a11y-trigger { bottom: 20px; right: 20px; }

/* Panel */
.a11y-panel {
  position: absolute; pointer-events: auto;
  top: 16px; bottom: 16px; right: 16px;
  display: flex; flex-direction: column;
  width: min(432px, calc(100vw - 32px));
  background: #fff; border-radius: 14px; overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
  animation: a11y-in .18s ease-out;
}
.a11y-root[data-pos$="left"] .a11y-panel { right: auto; left: 16px; }
@keyframes a11y-in { from { opacity: 0; transform: translateY(8px); } }

.a11y-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 12px 12px 18px; background: #f3f2f6; }
.a11y-head h2 { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.3; color: #1f1f24; }
.a11y-x { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 8px; background: transparent; }
.a11y-x:hover { background: #e6e4ec; }

.a11y-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 18px; }

/* Dil seçimi */
.a11y-lang { position: relative; }
.a11y-langbtn { display: flex; align-items: center; gap: 10px; width: 100%; height: 48px; padding: 0 14px; border: 1px solid #d6d5dd; border-radius: 10px; background: #fff; font-size: 15px !important; font-weight: 600; text-align: left; }
.a11y-langbtn > .a11y-ico { margin-left: auto; }
.a11y-langbtn[aria-expanded="true"] > .a11y-ico { rotate: 180deg; }
.a11y-flag { flex: none; width: 24px; height: 24px; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); }
.a11y-langlist { position: absolute; z-index: 2; top: calc(100% + 4px); left: 0; right: 0; margin: 0; padding: 4px; list-style: none; background: #fff; border: 1px solid #d6d5dd; border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .12); }
.a11y-langlist button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 6px; background: transparent; font-weight: 500; text-align: left; }
.a11y-langlist button:hover, .a11y-langlist [aria-selected="true"] { background: var(--a11y-soft); }

/* Başlıklar */
.a11y-label { margin: 18px 0 8px; font-size: 14px; font-weight: 500; color: #3a3a42; }
.a11y-h { margin: 22px 0 10px; font-size: 19px; font-weight: 600; color: #1f1f24; }

/* Konum */
.a11y-pos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.a11y-pos button { display: flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 8px; border: 1px solid #d6d5dd; border-radius: 6px; background: #fff; font-size: 13.5px; font-weight: 600; }
.a11y-pos button:hover { background: var(--a11y-soft); }
.a11y-pos button.on { background: var(--a11y-accent); border-color: var(--a11y-accent); color: #fff; }

/* Ana anahtar */
.a11y-master { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 42px; margin-top: 10px; border: 0; border-radius: 6px; background: var(--a11y-accent); color: #fff !important; font-weight: 600; }
.a11y-master:hover { filter: brightness(1.08); }
.a11y-master[aria-pressed="false"] { background: #fff; color: var(--a11y-accent) !important; box-shadow: inset 0 0 0 2px var(--a11y-accent); }
.a11y-note { margin: 8px 0 0; font-size: 13px; color: #55555e; }

/* Kartlar */
.a11y-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 8px; }
.a11y-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  width: 100%; min-height: 96px; padding: 14px 8px;
  border: 1px solid #d6d5dd; border-radius: 6px; background: #fff;
  text-align: center; transition: background .15s, border-color .15s;
}
.a11y-card:hover { background: var(--a11y-soft); }
.a11y-card.on { border-color: var(--a11y-accent); box-shadow: inset 0 0 0 1px var(--a11y-accent); background: var(--a11y-soft); }
.a11y-card--row { flex-direction: row; min-height: 36px; padding: 8px; gap: 8px; }
.a11y-name { font-size: 14px; font-weight: 600; line-height: 1.25; }
.a11y-val { font-size: 13.5px; font-weight: 600; color: #3a3a42; }
.a11y-card.on .a11y-val { color: var(--a11y-accent); }
.a11y-bars { display: flex; gap: 3px; margin-top: 4px; }
.a11y-bars i { flex: 1; height: 4px; border-radius: 2px; background: #d9d8df; }
.a11y-bars i.on { background: var(--a11y-accent); }

/* Alt butonlar */
.a11y-foot { display: grid; gap: 8px; margin-top: 20px; }
.a11y-foot button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 12px; border: 0; border-radius: 6px; background: var(--a11y-soft); color: var(--a11y-accent); font-weight: 600; }
.a11y-foot button:hover { filter: brightness(.97); }

@media (max-width: 480px) {
  .a11y-panel, .a11y-root[data-pos$="left"] .a11y-panel { top: 0; bottom: 0; left: 0; right: 0; width: 100%; border-radius: 0; }
  .a11y-trigger { width: 50px; height: 50px; }
}

/* ==========================================================
   Sayfaya uygulanan düzenlemeler (widget hariç)
   ========================================================== */
html.a11y-lh-1 body *:not(.a11y-root, .a11y-root *, h1, h2, h3, h4, h5, h6, h1 *, h2 *, h3 *) { line-height: 1.5 !important; }
html.a11y-lh-2 body *:not(.a11y-root, .a11y-root *, h1, h2, h3, h4, h5, h6, h1 *, h2 *, h3 *) { line-height: 1.75 !important; }
html.a11y-lh-3 body *:not(.a11y-root, .a11y-root *, h1, h2, h3, h4, h5, h6, h1 *, h2 *, h3 *) { line-height: 2 !important; }

html.a11y-ls-1 body *:not(.a11y-root, .a11y-root *) { letter-spacing: .04em !important; }
html.a11y-ls-2 body *:not(.a11y-root, .a11y-root *) { letter-spacing: .08em !important; }
html.a11y-ls-3 body *:not(.a11y-root, .a11y-root *) { letter-spacing: .12em !important; }

html.a11y-font body *:not(.a11y-root, .a11y-root *) { font-family: Verdana, Tahoma, "Segoe UI", Arial, sans-serif !important; }

html.a11y-titles :is(h1, h2, h3, h4, h5, h6, [role="heading"]):not(.a11y-root *) { outline: 2px dashed var(--a11y-hl, #8a4fcf) !important; outline-offset: 4px !important; }

html.a11y-links :is(a, button, [role="button"]):not(.a11y-root, .a11y-root *) { outline: 2px solid #f2b705 !important; outline-offset: 2px !important; text-decoration: underline !important; text-underline-offset: 3px !important; }

html.a11y-pause *:not(.a11y-root, .a11y-root *), html.a11y-pause *::before, html.a11y-pause *::after { animation: none !important; transition: none !important; }
html.a11y-pause { scroll-behavior: auto !important; }

html.a11y-align-left body *:not(.a11y-root, .a11y-root *) { text-align: left !important; }
html.a11y-align-center body *:not(.a11y-root, .a11y-root *) { text-align: center !important; }
html.a11y-align-right body *:not(.a11y-root, .a11y-root *) { text-align: right !important; }
html.a11y-align-justify body *:not(.a11y-root, .a11y-root *) { text-align: justify !important; }

html.a11y-cursor-black, html.a11y-cursor-black * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 24 24'%3E%3Cpath d='m4 4 7.07 17 2.51-7.39L21 11.07z' fill='%23000' stroke='%23fff' stroke-width='1.2' stroke-linejoin='round'/%3E%3C/svg%3E") 7 7, auto !important;
}
html.a11y-cursor-white, html.a11y-cursor-white * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 24 24'%3E%3Cpath d='m4 4 7.07 17 2.51-7.39L21 11.07z' fill='%23fff' stroke='%23000' stroke-width='1.2' stroke-linejoin='round'/%3E%3C/svg%3E") 7 7, auto !important;
}

html.a11y-hideimg :is(img, picture, video, canvas):not(.a11y-root *) { visibility: hidden !important; }
html.a11y-hideimg [style*="background-image"]:not(.a11y-root *) { background-image: none !important; background-color: #d9d9d9 !important; }

/* Yüksek kontrast — koyu */
html.a11y-contrast-dark { --bg: #000; --white: #000; --ink: #fff; --text: #fff; --muted: #ddd; --line: #fff; color-scheme: dark; }
html.a11y-contrast-dark body, html.a11y-contrast-dark body *:not(.a11y-root, .a11y-root *) { background-color: #000 !important; color: #fff !important; border-color: #fff !important; box-shadow: none !important; }
html.a11y-contrast-dark a:not(.a11y-root *), html.a11y-contrast-dark a:not(.a11y-root *) * { color: #ffd84d !important; }
/* Yüksek kontrast — açık */
html.a11y-contrast-bright { --bg: #fff; --white: #fff; --ink: #000; --text: #000; --muted: #000; --line: #000; }
html.a11y-contrast-bright body, html.a11y-contrast-bright body *:not(.a11y-root, .a11y-root *) { background-color: #fff !important; color: #000 !important; border-color: #000 !important; box-shadow: none !important; }
html.a11y-contrast-bright a:not(.a11y-root *), html.a11y-contrast-bright a:not(.a11y-root *) * { color: #0033cc !important; }
/* Ters renk: kök elemana filtre uygulanır (JS), görseller ve widget geri çevrilir */
html.a11y-contrast-invert :is(img, video, picture, [style*="background-image"]):not(.a11y-root *),
html.a11y-contrast-invert .a11y-root { filter: invert(1) hue-rotate(180deg); }
