/* ============================================================
   ERİŞİLEBİLİRLİK EKLENTİSİ
   Tüm sayfa kuralları #a11y-widget'ı hariç tutar; eklenti kendi
   görünümünü her modda korur.
   ============================================================ */

/* ---------- Ana içeriğe atla bağlantısı ---------- */
.a11y-skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 100001;
  padding: 12px 20px;
  background: #0a2342;
  color: #fff !important;
  font: 600 16px/1.2 Roboto, Arial, sans-serif;
  border-radius: 0 0 8px 8px;
  text-decoration: none;
  transition: top 0.15s;
}
.a11y-skip-link:focus {
  top: 0;
  outline: 3px solid #f59e0b;
  outline-offset: 2px;
}

/* ---------- Eklenti kabuğu ---------- */
#a11y-widget,
#a11y-widget * {
  box-sizing: border-box;
  font-family: Roboto, Arial, sans-serif;
  letter-spacing: normal;
  word-spacing: normal;
  line-height: 1.3;
  text-transform: none;
}

.a11y-toggle {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 100000;
  width: 56px;
  height: 56px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #0a2342;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(10, 35, 66, 0.35);
  transition: transform 0.15s, background-color 0.15s;
}
.a11y-toggle:hover {
  background: #1a3d6e;
  transform: scale(1.06);
}
.a11y-toggle:focus-visible {
  outline: 3px solid #f59e0b;
  outline-offset: 3px;
}
.a11y-toggle svg {
  width: 32px;
  height: 32px;
}
.a11y-toggle-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #22a8c8;
  border: 2px solid #fff;
  display: none;
}
.a11y-toggle.is-active .a11y-toggle-badge {
  display: block;
}

.a11y-panel {
  position: fixed;
  left: 16px;
  bottom: 84px;
  z-index: 100000;
  width: 380px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 104px);
  display: flex;
  flex-direction: column;
  background: #fff;
  color: #1e2d3d;
  border: 1px solid #d1dce8;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(10, 35, 66, 0.25);
  overflow: hidden;
}
.a11y-panel[hidden] {
  display: none;
}

.a11y-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: #0a2342;
  color: #fff;
}
.a11y-panel-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
}
.a11y-icon-btn {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.a11y-icon-btn:hover {
  background: rgba(255, 255, 255, 0.24);
}
.a11y-icon-btn svg {
  width: 20px;
  height: 20px;
}

.a11y-panel-body {
  padding: 14px;
  overflow-y: auto;
  background: #f4f7fb;
}

.a11y-section-label {
  margin: 4px 2px 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase !important;
  letter-spacing: 0.06em !important;
  color: #5a6a7e;
}

/* Yazı boyutu ayarı */
.a11y-stepper {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
  background: #fff;
  border: 1px solid #d1dce8;
  border-radius: 10px;
}
.a11y-stepper-label {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
}
.a11y-stepper-value {
  min-width: 52px;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: #0e7490;
}
.a11y-stepper button {
  width: 40px;
  height: 40px;
  border: 1px solid #d1dce8;
  border-radius: 8px;
  background: #edf2f8;
  color: #0a2342;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.a11y-stepper button:hover:not(:disabled) {
  background: #e0f5fb;
  border-color: #0e7490;
}
.a11y-stepper button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.a11y-stepper svg {
  width: 18px;
  height: 18px;
}

/* Seçenek kutucukları */
.a11y-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.a11y-tile {
  position: relative;
  min-height: 86px;
  padding: 10px 6px;
  border: 2px solid #d1dce8;
  border-radius: 10px;
  background: #fff;
  color: #1e2d3d;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}
.a11y-tile:hover {
  border-color: #22a8c8;
}
.a11y-tile svg {
  width: 26px;
  height: 26px;
  color: #0a2342;
}
.a11y-tile[aria-pressed="true"] {
  border-color: #0e7490;
  background: #e0f5fb;
}
.a11y-tile[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #0e7490 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 11px no-repeat;
}

.a11y-panel button:focus-visible {
  outline: 3px solid #f59e0b;
  outline-offset: 2px;
}

.a11y-reset {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 10px;
  background: #0a2342;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}
.a11y-reset:hover {
  background: #1a3d6e;
}
.a11y-reset svg {
  width: 18px;
  height: 18px;
}

.a11y-credit {
  margin: 12px 4px 2px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  color: #5a6a7e;
}

.a11y-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Okuma rehberi */
.a11y-guide {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  height: 12px;
  margin-top: -6px;
  z-index: 99998;
  pointer-events: none;
  background: rgba(245, 158, 11, 0.35);
  border-top: 3px solid #f59e0b;
  border-bottom: 3px solid #0a2342;
  display: none;
}
html.a11y-guide-on .a11y-guide {
  display: block;
}

/* Sesli okumada okunan öğe */
.a11y-speaking {
  outline: 3px solid #f59e0b !important;
  outline-offset: 2px !important;
  background-color: rgba(245, 158, 11, 0.18) !important;
}

@media (max-width: 480px) {
  .a11y-toggle {
    left: 12px;
    bottom: 12px;
    width: 50px;
    height: 50px;
  }
  .a11y-panel {
    left: 12px;
    bottom: 72px;
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 88px);
  }
  .a11y-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================================
   SAYFAYA UYGULANAN MODLAR
   ============================================================ */

/* Renk filtreleri: eklentiyi etkilememek için body'nin diğer çocuklarına uygulanır */
html.a11y-color-invert body > *:not(#a11y-widget) {
  filter: invert(1) hue-rotate(180deg);
}
html.a11y-color-invert body > *:not(#a11y-widget) img,
html.a11y-color-invert body > *:not(#a11y-widget) video,
html.a11y-color-invert body > *:not(#a11y-widget) iframe {
  filter: invert(1) hue-rotate(180deg);
}
html.a11y-color-gray body > *:not(#a11y-widget) {
  filter: grayscale(1);
}
html.a11y-color-lowsat body > *:not(#a11y-widget) {
  filter: saturate(0.4);
}

/* Koyu kontrast */
html.a11y-color-dark body,
html.a11y-color-dark body *:not(#a11y-widget):not(#a11y-widget *) {
  background-color: #000 !important;
  color: #fff !important;
  border-color: #fff !important;
  text-shadow: none !important;
  box-shadow: none !important;
}
html.a11y-color-dark body *:not(#a11y-widget):not(#a11y-widget *):not([class*="icon"]) {
  background-image: none !important;
}
html.a11y-color-dark body img:not(#a11y-widget):not(#a11y-widget *) {
  background-color: transparent !important;
}
html.a11y-color-dark body a:not(#a11y-widget):not(#a11y-widget *),
html.a11y-color-dark body a:not(#a11y-widget):not(#a11y-widget *) * {
  color: #ffeb3b !important;
}
html.a11y-color-dark body button:not(#a11y-widget):not(#a11y-widget *),
html.a11y-color-dark body input:not(#a11y-widget):not(#a11y-widget *),
html.a11y-color-dark body select:not(#a11y-widget):not(#a11y-widget *),
html.a11y-color-dark body textarea:not(#a11y-widget):not(#a11y-widget *) {
  border: 2px solid #fff !important;
}

/* Açık kontrast */
html.a11y-color-light body,
html.a11y-color-light body *:not(#a11y-widget):not(#a11y-widget *) {
  background-color: #fff !important;
  color: #000 !important;
  border-color: #000 !important;
  text-shadow: none !important;
  box-shadow: none !important;
}
html.a11y-color-light body *:not(#a11y-widget):not(#a11y-widget *):not([class*="icon"]) {
  background-image: none !important;
}
html.a11y-color-light body img:not(#a11y-widget):not(#a11y-widget *) {
  background-color: transparent !important;
}
html.a11y-color-light body a:not(#a11y-widget):not(#a11y-widget *),
html.a11y-color-light body a:not(#a11y-widget):not(#a11y-widget *) * {
  color: #0000c8 !important;
}
html.a11y-color-light body button:not(#a11y-widget):not(#a11y-widget *),
html.a11y-color-light body input:not(#a11y-widget):not(#a11y-widget *),
html.a11y-color-light body select:not(#a11y-widget):not(#a11y-widget *),
html.a11y-color-light body textarea:not(#a11y-widget):not(#a11y-widget *) {
  border: 2px solid #000 !important;
}

/* Açık zeminde beyaza boyanmış logolar ve slider okları koyulaştırılır */
html.a11y-color-light .school-logo-img,
html.a11y-color-light .huawei-icon {
  filter: brightness(0) !important;
}
html.a11y-color-light body .carousel-control-prev-icon:not(#a11y-widget):not(#a11y-widget *),
html.a11y-color-light body .carousel-control-next-icon:not(#a11y-widget):not(#a11y-widget *) {
  background-color: transparent !important;
  filter: invert(1) !important;
}

/* Okunaklı yazı tipi (simge fontları korunur) */
html.a11y-font body *:not(#a11y-widget):not(#a11y-widget *):not(i):not([class*="fa-"]):not([class*="bi-"]):not([class*="icon"]) {
  font-family: "Atkinson Hyperlegible", Verdana, Tahoma, Arial, sans-serif !important;
}

/* Metin aralığı (WCAG 1.4.12 değerleri) */
html.a11y-spacing body *:not(#a11y-widget):not(#a11y-widget *) {
  line-height: 1.6 !important;
  letter-spacing: 0.12em !important;
  word-spacing: 0.16em !important;
}
html.a11y-spacing body p:not(#a11y-widget):not(#a11y-widget *) {
  margin-bottom: 2em !important;
}

/* Bağlantıları vurgula */
html.a11y-links body a:not(#a11y-widget):not(#a11y-widget *) {
  text-decoration: underline !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: 3px !important;
  outline: 2px solid #f59e0b !important;
  outline-offset: 1px !important;
  background-color: #fff8e1 !important;
  color: #0a2342 !important;
}

/* Başlıkları vurgula */
html.a11y-headings body :is(h1, h2, h3, h4, h5, h6, [role="heading"]):not(#a11y-widget):not(#a11y-widget *) {
  outline: 2px dashed #0e7490 !important;
  outline-offset: 4px !important;
  background-color: #e0f5fb !important;
  color: #0a2342 !important;
}

/* Güçlü odak göstergesi */
html.a11y-focus body *:not(#a11y-widget):not(#a11y-widget *):focus {
  outline: 4px solid #f59e0b !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 8px #0a2342 !important;
}

/* Büyük imleç */
html.a11y-cursor,
html.a11y-cursor * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'%3E%3Cpath d='M4 2l15 9.5-6.5 1.2L9 19z' fill='black' stroke='white' stroke-width='1.4' stroke-linejoin='round'/%3E%3C/svg%3E") 6 3, auto !important;
}

/* Animasyonları durdur */
html.a11y-motion *,
html.a11y-motion *::before,
html.a11y-motion *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}

/* Görselleri gizle */
html.a11y-images body :is(img, picture, video, iframe):not(#a11y-widget):not(#a11y-widget *) {
  visibility: hidden !important;
}
html.a11y-images body *:not(#a11y-widget):not(#a11y-widget *) {
  background-image: none !important;
}
