/* KOÜ UI Kit: erişilebilirlik menüsü. tokens.css varsa renkleri oradan alır. */

/* --- Ayarların sayfaya etkisi --------------------------------------------- */
/* Kit ölçüleri px olduğu için kök yazı boyutu yerine zoom kullanılır; menü büyümez */
html[data-a11y-text="1"] body > *:not(.kou-a11y):not([style*="contents"]),
html[data-a11y-text="1"] body > [style*="contents"] > * { zoom: 1.15; }
html[data-a11y-text="2"] body > *:not(.kou-a11y):not([style*="contents"]),
html[data-a11y-text="2"] body > [style*="contents"] > * { zoom: 1.3; }
html[data-a11y-text="3"] body > *:not(.kou-a11y):not([style*="contents"]),
html[data-a11y-text="3"] body > [style*="contents"] > * { zoom: 1.5; }

html[data-a11y-line="1"] body > *:not(.kou-a11y), html[data-a11y-line="1"] body > *:not(.kou-a11y) * { line-height: 1.8 !important; }
html[data-a11y-line="2"] body > *:not(.kou-a11y), html[data-a11y-line="2"] body > *:not(.kou-a11y) * { line-height: 2.2 !important; }
html[data-a11y-letter="1"] body > *:not(.kou-a11y), html[data-a11y-letter="1"] body > *:not(.kou-a11y) * { letter-spacing: .06em !important; word-spacing: .08em !important; }
html[data-a11y-letter="2"] body > *:not(.kou-a11y), html[data-a11y-letter="2"] body > *:not(.kou-a11y) * { letter-spacing: .12em !important; word-spacing: .16em !important; }

html[data-a11y-align="left"] body > *:not(.kou-a11y) :is(p, li, dd, dt, h1, h2, h3, h4, h5, h6, td, th, label) { text-align: left !important; }
html[data-a11y-align="center"] body > *:not(.kou-a11y) :is(p, li, dd, dt, h1, h2, h3, h4, h5, h6) { text-align: center !important; }

html[data-a11y-contrast] {
  --text: #000; --secondary: #111; --muted-text: #222; --placeholder: #444; --muted: #333;
  --bg: #fff; --tile: #fff; --line: #000; --line-hover: #000; --input-border: #000;
  --green: #04471F; --green-text: #04471F; --green-hover: #022E14; --green-pressed: #011F0D;
  --green-soft: #fff; --green-line: #04471F; --focus: #000;
  --warn-text: #4A2F00; --error-text: #6B0000; --error-icon: #8B0000;
}

html[data-a11y-dark] {
  color-scheme: dark;
  --text: #ECECEC; --secondary: #D0D0D0; --muted-text: #AFAFAF; --placeholder: #A0A0A0; --muted: #8F8F8F;
  --bg: #121413; --tile: #1C1F1D; --line: #343A36; --line-hover: #4A524D; --input-border: #7D857F;
  --green: #2FCB78; --green-text: #5BD896; --green-hover: #86E4B2; --green-pressed: #A9EDC9;
  --green-soft: #12331F; --green-line: #2C6B47; --focus: #86E4B2; --focus-text-bg: #12331F;
  --action: #077F40; --action-hover: #066B36; --action-pressed: #055A2D;
  --warn-bg: #33280F; --warn-line: #6E5518; --warn-text: #F5CF7A;
  --error-bg: #3A1717; --error-line: #7A2E2E; --error-text: #FFB4AE; --error-icon: #FF8A80;
}
html[data-a11y-dark] body { background: var(--bg); color: var(--text); }
html[data-a11y-dark][data-a11y-contrast] {
  --text: #fff; --secondary: #fff; --muted-text: #eee; --placeholder: #ccc; --muted: #ccc;
  --bg: #000; --tile: #000; --line: #fff; --line-hover: #fff; --input-border: #fff;
  --green: #7CFFB2; --green-text: #7CFFB2; --green-hover: #B5FFD4; --green-soft: #000; --focus: #fff;
  --warn-text: #FFD87A; --error-text: #FFC2BD; --error-icon: #FFC2BD;
}

html[data-a11y-links] body > *:not(.kou-a11y) a[href] {
  text-decoration: underline !important; text-decoration-thickness: 2px !important;
  outline: 2px dashed currentColor; outline-offset: 2px;
}

html[data-a11y-dyslexia] body > *:not(.kou-a11y),
html[data-a11y-dyslexia] body > *:not(.kou-a11y) :not(code, pre, code *, pre *) {
  font-family: "KOU Disleksi", Verdana, sans-serif !important;
}

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

html[data-a11y-cursor], html[data-a11y-cursor] * { cursor: url("../img/a11y-imlec.svg") 4 2, auto !important; }
html[data-a11y-cursor] :is(a[href], button, summary, select, label[for], [role="button"], input[type="checkbox"], input[type="radio"], input[type="submit"], input[type="file"]),
html[data-a11y-cursor] :is(a[href], button, summary) * { cursor: url("../img/a11y-el.svg") 21 2, pointer !important; }

/* Sarı halka + siyah çerçeve: açık ve koyu zeminde görünür */
html[data-a11y-focus] body :focus-visible {
  outline: 4px solid #000 !important; outline-offset: 2px !important; box-shadow: 0 0 0 9px #FFD400 !important;
}

/* Yer korunur, düzen kaymaz. İkon SVG'lerine ve menüye dokunulmaz */
html[data-a11y-images] body > *:not(.kou-a11y) :is(img, picture, video, [role="img"]),
html[data-a11y-images] body > :is(img, picture, video) { visibility: hidden !important; }
html[data-a11y-images] body > *:not(.kou-a11y), html[data-a11y-images] body > *:not(.kou-a11y) * { background-image: none !important; }

/* --- Menü ----------------------------------------------------------------- */
.kou-a11y { font: 400 14px/1.4 var(--font, system-ui, sans-serif); letter-spacing: normal; text-align: left; }
.kou-a11y *, .kou-a11y *::before { box-sizing: border-box; }
.kou-a11y [hidden] { display: none !important; }
.kou-a11y button { font: inherit; cursor: pointer; }
.kou-a11y button:focus-visible { outline: 3px solid var(--focus, #066B36); outline-offset: 2px; }

.a11y-trigger {
  position: fixed; left: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 2147483000;
  width: 52px; height: 52px; display: grid; place-items: center; padding: 0;
  border: 2px solid #fff; border-radius: 50%; background: var(--action, #077F40); color: #fff;
  box-shadow: var(--shadow-overlay, 0 8px 24px rgb(0 0 0 / .22));
}
.a11y-trigger .a11y-person { width: 28px; height: 28px; fill: currentColor; }

.a11y-panel {
  position: fixed; left: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 2147483001;
  width: min(400px, calc(100vw - 32px)); max-height: calc(100dvh - 100px);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg, #fff); color: var(--text, #2B2B2B);
  border: 1px solid var(--line, #E6E6E6); border-radius: var(--radius-lg, 14px);
  box-shadow: var(--shadow-overlay, 0 16px 40px rgb(0 0 0 / .22));
}
.a11y-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px; background: #055A2D; color: #fff; }
.kou-a11y .a11y-head h2 { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.3; color: inherit; }
.kou-a11y .a11y-head p { margin: 2px 0 0; font-size: 12px; color: inherit; }
.kou-a11y .a11y-icon-button { width: 40px; height: 40px; flex: none; border: 0; border-radius: 50%; background: #fff; color: #055A2D; font-size: 24px; line-height: 1; }
.kou-a11y .a11y-head button:focus-visible { outline-color: #fff; }
.a11y-body { overflow-y: auto; min-height: 0; }
.a11y-profiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 12px 12px 0; }
.kou-a11y .a11y-profile { min-height: 44px; padding: 8px; font-weight: 600; font-size: 12.5px; background: var(--bg, #fff); color: inherit; border: 1px solid var(--input-border, #949494); border-radius: var(--radius, 10px); }
.kou-a11y .a11y-profile[aria-pressed="true"] { background: var(--action, #077F40); border-color: var(--action, #077F40); color: #fff; }
.a11y-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 12px; }
.kou-a11y .a11y-card {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 6px;
  min-height: 112px; padding: 12px 6px; text-align: center; overflow-wrap: anywhere;
  background: var(--bg, #fff); color: inherit; border: 2px solid var(--line, #E6E6E6); border-radius: var(--radius, 10px);
}
.kou-a11y .a11y-card.is-on { border-color: var(--action, #077F40); background: var(--green-soft, #E7F6EE); }
.a11y-icon { width: 30px; height: 30px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.a11y-notice { margin: 0; padding: 10px 12px; font-size: 12.5px; background: var(--warn-bg, #FFF8E8); color: var(--warn-text, #8A5A00); }
.a11y-label { font-weight: 600; font-size: 12.5px; }
.a11y-value { font-size: 11.5px; color: var(--muted-text, #6E6E6E); }
.a11y-foot { padding: 12px; border-top: 1px solid var(--line, #E6E6E6); }
.kou-a11y .a11y-reset { width: 100%; min-height: 44px; background: var(--bg, #fff); color: inherit; font-weight: 600; border: 1px solid var(--input-border, #949494); border-radius: var(--radius, 10px); }
.a11y-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.a11y-mask {
  position: fixed; left: 0; right: 0; top: calc(var(--a11y-y, 50vh) - 60px); height: 120px;
  z-index: 2147482000; pointer-events: none; box-shadow: 0 0 0 100vmax rgb(0 0 0 / .6);
}
.a11y-guide {
  position: fixed; left: 0; right: 0; top: calc(var(--a11y-y, 50vh) + 14px); height: 6px;
  z-index: 2147482001; pointer-events: none; background: #000; border-block: 2px solid #FFD400;
}

html[data-a11y-dark] .a11y-card.is-on { border-color: var(--green) !important; }
.a11y-sizes { display: flex; gap: 8px; padding: 12px 12px 0; }
.kou-a11y .a11y-size { flex: 1; min-height: 36px; font-weight: 600; font-size: 12.5px; background: var(--bg, #fff); color: inherit; border: 1px solid var(--input-border, #949494); border-radius: 999px; }
.kou-a11y .a11y-size[aria-pressed="true"] { background: var(--action, #077F40); border-color: var(--action, #077F40); color: #fff; }

.a11y-panel[data-size="mini"] { width: min(300px, calc(100vw - 32px)); }
.kou-a11y .a11y-panel[data-size="mini"] .a11y-card { min-height: 76px; padding: 8px 4px; gap: 2px; }
.a11y-panel[data-size="mini"] .a11y-icon { width: 22px; height: 22px; }
.a11y-panel[data-size="mini"] .a11y-label { font-size: 11px; }
.a11y-panel[data-size="xl"] { width: min(560px, calc(100vw - 32px)); }
.kou-a11y .a11y-panel[data-size="xl"] .a11y-card { min-height: 144px; }
.a11y-panel[data-size="xl"] .a11y-icon { width: 42px; height: 42px; }
.a11y-panel[data-size="xl"] .a11y-label { font-size: 16px; }
.a11y-panel[data-size="xl"] .a11y-value { font-size: 14px; }
.kou-a11y .a11y-panel[data-size="xl"] :is(.a11y-profile, .a11y-size, .a11y-reset) { font-size: 15px; }

/* --- Görünüm -------------------------------------------------------------- */
.a11y-panel { --a11y-surface: #F3F5F4; border: 0; border-radius: 22px; box-shadow: 0 0 0 1px rgb(0 0 0 / .08), 0 24px 60px -16px rgb(0 0 0 / .35); }
html[data-a11y-dark] .a11y-panel { --a11y-surface: #0B0D0C; box-shadow: 0 0 0 1px #343A36, 0 24px 60px -16px #000; }
html[data-a11y-contrast] .a11y-panel { --a11y-surface: var(--bg); box-shadow: 0 0 0 2px var(--text); }
.a11y-head { padding: 18px 18px 18px 20px; background: linear-gradient(135deg, #077F40, #044322); }
.kou-a11y .a11y-icon-button { width: 36px; height: 36px; background: rgb(255 255 255 / .16); color: #fff; }
.kou-a11y .a11y-icon-button:hover { background: rgb(255 255 255 / .28); }
.a11y-body { background: var(--a11y-surface); padding-bottom: 4px; }
.kou-a11y .a11y-section { margin: 0; padding: 16px 16px 0; font-size: 12px; font-weight: 600; line-height: 1.4; color: var(--muted-text, #5F6561); }

.a11y-sizes { gap: 4px; margin: 12px 12px 0; padding: 4px; background: var(--bg, #fff); border-radius: 999px; }
.kou-a11y .a11y-size { min-height: 32px; border: 0; background: transparent; }

.a11y-profiles { padding-top: 8px; }
.kou-a11y .a11y-profile { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 10px; text-align: left; border: 2px solid transparent; border-radius: 14px; }
.a11y-profile-icon { box-sizing: content-box !important; width: 20px; height: 20px; flex: none; padding: 8px; border-radius: 10px; background: var(--green-soft, #E7F6EE); color: var(--green-text, #077F40); fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.kou-a11y .a11y-profile[aria-pressed="true"] .a11y-profile-icon { background: rgb(255 255 255 / .18); color: #fff; }

.a11y-grid { padding-top: 8px; }
.kou-a11y .a11y-card { position: relative; border-color: transparent; border-radius: 16px; transition: transform .15s, border-color .15s, box-shadow .15s; }
.kou-a11y .a11y-card.is-on { border-color: var(--action, #077F40); }
.kou-a11y .a11y-card.is-on::after {
  content: "✓"; position: absolute; top: 6px; right: 6px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--action, #077F40); color: #fff; font-size: 11px; line-height: 18px;
}
@media (hover: hover) {
  .kou-a11y :is(.a11y-card, .a11y-profile):hover { box-shadow: 0 6px 16px -8px rgb(0 0 0 / .3); }
  .kou-a11y .a11y-card:hover { transform: translateY(-1px); }
}
.a11y-foot { background: var(--bg, #fff); }
.kou-a11y .a11y-reset { border-radius: 999px; }
.a11y-panel[data-size="mini"] .a11y-profile-icon { width: 16px; height: 16px; padding: 5px; }
.kou-a11y .a11y-panel[data-size="mini"] .a11y-profile { min-height: 44px; gap: 6px; padding: 6px; font-size: 11px; }
.a11y-panel[data-size="xl"] .a11y-profile-icon { width: 26px; height: 26px; }

/* Profiller tek satırda: ikon üstte, ad altta */
.a11y-profiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.kou-a11y .a11y-profiles .a11y-profile { flex-direction: column; justify-content: flex-start; gap: 6px; padding: 8px 2px; text-align: center; font-size: 11px; line-height: 1.25; }
.kou-a11y .a11y-panel[data-size="mini"] .a11y-profiles .a11y-profile { gap: 4px; padding: 6px 1px; font-size: 9.5px; }
.kou-a11y .a11y-panel[data-size="xl"] .a11y-profiles .a11y-profile { font-size: 14px; }

@media (max-width: 420px) { .a11y-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media print { .kou-a11y { display: none; } }

@font-face { font-family: "KOU Disleksi"; font-weight: 400; font-display: swap; src: url("../fonts/opendyslexic-latin-400-normal.woff2") format("woff2"); }

@font-face { font-family: "KOU Disleksi"; font-weight: 700; font-display: swap; src: url("../fonts/opendyslexic-latin-700-normal.woff2") format("woff2"); }

/* Logo yazısı siyah: karanlık zeminde açık altlık verilir */
html[data-a11y-dark] img[src*="kou-lockup"] { background: #fff; border-radius: 8px; box-shadow: 0 0 0 8px #fff; }

/* Çok dar ekranda XL profil adları sığsın */
@media (max-width: 420px) { .kou-a11y .a11y-panel[data-size="xl"] .a11y-profiles .a11y-profile { font-size: 10.5px; } }

/* Rengi doğrudan yazılmış açık yüzeyler (görsel üstündeki giriş kartı, tanıtım kutusu) */
html[data-a11y-dark] body :is(.panel, .kh-card, .auth-card, .top > a) { background-color: var(--bg) !important; }
html[data-a11y-dark] body .tile { background-color: var(--tile) !important; }
