/* ==========================================================================
   WCAG 2.2 AA Erişilebilirlik Stilleri - Batman Üniversitesi
   Bu dosya WCAG 2.2 Seviye AA gereksinimlerini karşılamak için hazırlanmıştır.
   Kapsanan başarı kriterleri:
   - 1.4.3  Kontrast (AA)
   - 1.4.10 Yeniden Akış (AA)
   - 1.4.11 Metin Olmayan Kontrast (AA)
   - 1.4.12 Metin Aralığı (AA)
   - 1.4.13 Üzerine Gelindiğinde veya Odaklandığında İçerik (AA)
   - 2.1.1  Klavye (A)
   - 2.4.3  Odak Sırası (A)
   - 2.4.7  Görünür Odak (AA)
   - 2.4.11 Odak Görünümü (AA) — WCAG 2.2
   - 2.4.13 Odak Görünümü (Geliştirilmiş — WCAG 2.2'de güncellendi)
   - 2.5.7  Sürükleme Hareketleri (AA) — WCAG 2.2
   - 2.5.8  Hedef Boyutu (Minimum 24x24 CSS px) — WCAG 2.2
   - 3.2.6  Tutarlı Yardım (A) — WCAG 2.2
   - 3.3.7  Yedek Giriş (A) — WCAG 2.2
   ========================================================================== */

/* ----- 2.4.7 / 2.4.11 / 2.4.13 — Görünür Odak (extra.css içindeki *:focus{outline:none !important} kuralını ezer) ----- */
*:focus {
    outline: revert !important;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible,
[role="button"]:focus-visible,
[role="link"]:focus-visible,
[role="tab"]:focus-visible,
[role="menuitem"]:focus-visible,
[contenteditable]:focus-visible {
    outline: 3px solid #ffbf47 !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 5px rgba(255, 191, 71, 0.35) !important;
    border-radius: 2px;
}

/* Klavye ile gezinmeyen mouse kullanıcılarında outline kaldırılır,
   ancak klavye odağında (focus-visible) her zaman görünür kalır. */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
[role="button"]:focus:not(:focus-visible) {
    outline: none !important;
    box-shadow: none !important;
}

/* ----- Skip Link (Ana içeriğe geç) — A 2.4.1 Blokları Atla ----- */
.skip-link {
    position: absolute !important;
    left: -9999px;
    top: 0;
    z-index: 100000;
    background: #003366;
    color: #ffffff !important;
    padding: 12px 18px;
    border-radius: 0 0 4px 4px;
    font-weight: 700;
    text-decoration: none;
    font-size: 16px;
    line-height: 1.4;
}

.skip-link:focus,
.skip-link:focus-visible {
    left: 16px !important;
    top: 0 !important;
    outline: 3px solid #ffbf47 !important;
    outline-offset: 2px !important;
    text-decoration: underline;
}

/* ----- Ekran Okuyucu Metni (sr-only) ----- */
.sr-only,
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.sr-only-focusable:focus,
.sr-only-focusable:active {
    position: static !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    overflow: visible !important;
    clip: auto !important;
    white-space: normal !important;
}

/* ----- 2.5.8 Hedef Boyutu (Minimum) — Tıklanabilir hedefler 24x24 CSS px ----- */
a,
button,
[role="button"],
[role="link"],
input[type="button"],
input[type="submit"],
input[type="reset"],
input[type="checkbox"],
input[type="radio"],
select,
summary {
    min-height: 24px;
}

/* İkon butonları (sosyal medya, prev/next, üst-sayfa-don gibi) için en az 44x44 hedef
   - Yan yana sıkışık yerleştirilenler için bile minimum boyut sağlanır. */
.upstairs,
.sub-social a,
.menu-button a,
.carousel-control-prev,
.carousel-control-next,
.sp-arrow,
.customPrevBtn,
.customNextBtn,
.customPrevBtn2,
.customNextBtn2,
.customPrevBtn3,
.customNextBtn3,
.navbar-toggler,
.acceptcookies {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ----- 1.4.3 Kontrast (Asgari) için yardımcı sınıflar ----- */
.text-on-dark { color: #ffffff !important; }
.text-on-light { color: #1d1d1d !important; }

/* Cookie alert WCAG 2.2 — kontrast iyileştirmesi */
.cookiealert {
    background-color: #003366 !important;
    color: #ffffff !important;
}

.cookiealert a {
    color: #ffffff !important;
    text-decoration: underline !important;
}

.cookiealert a:hover,
.cookiealert a:focus-visible {
    color: #ffe066 !important;
    background-color: rgba(0, 0, 0, 0.2);
}

.cookiealert .acceptcookies {
    background-color: #ffffff !important;
    color: #003366 !important;
    border-color: #ffffff !important;
    font-weight: 700 !important;
    padding: 8px 18px !important;
}

.cookiealert .acceptcookies:focus-visible {
    outline: 3px solid #ffbf47 !important;
    outline-offset: 2px !important;
}

/* ----- 2.5.7 Sürükleme Hareketleri — owl-carousel sürükleme yerine düğmeler zaten var ----- */
/* owl-carousel'in mouseDrag:false ayarı zaten yapılmış. Eklenmiş custom prev/next butonları
   sürüklemeyi gerektirmeyen tek pointer alternatifi sunar. */

/* ----- Üst sayfaya dön butonu görünür hale getirildiğinde ----- */
.upstairs {
    background-color: #003366;
    color: #ffffff !important;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    cursor: pointer;
}

.upstairs i {
    color: #ffffff !important;
}

.upstairs:hover,
.upstairs:focus-visible {
    background-color: #ffbf47;
}

.upstairs:hover i,
.upstairs:focus-visible i {
    color: #1d1d1d !important;
}

/* ----- Carousel slide kontrol okları kontrast ----- */
.carousel-control-prev i,
.carousel-control-next i,
.sp-arrow i {
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

/* ----- Form alanları erişilebilir ----- */
input:invalid {
    border-color: #b30000 !important;
}

input[aria-invalid="true"] {
    border-color: #b30000 !important;
    background-color: #fff5f5;
}

input::placeholder,
textarea::placeholder {
    color: #595959;
    opacity: 1;
}

/* ----- 2.3.3 Animasyon — kullanıcı tercihine saygı ----- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }

    .carousel {
        animation: none !important;
    }
}

/* ----- 1.4.12 Metin Aralığı (kullanıcı stil sayfası ile override edilebilir) ----- */
p, li, dd, dt {
    line-height: 1.5;
}

/* ----- Yüksek kontrast / forced-colors modu için ----- */
@media (forced-colors: active) {
    .skip-link {
        border: 1px solid CanvasText;
    }

    a:focus-visible,
    button:focus-visible,
    input:focus-visible {
        outline: 3px solid Highlight !important;
    }
}

/* ----- 1.4.10 Yeniden Akış: 320 CSS px genişliğinde yatay kaydırmaya neden olmamalı.
   Mevcut body inline style 'overflow-x: hidden' iç içe sticky pozisyonları engelleyebilir,
   ancak şu an için bunu değiştirmiyoruz; yine de yakınlaştırma için max-width sınırı koyalım. */
img, table, pre, code {
    max-width: 100%;
}

/* ----- "...buradan tıklayın" benzeri jenerik link metinleri için ekstra bağlam ----- */
a[aria-label] {
    /* aria-label kullanılan linkler için ekran okuyucular için yeterli bağlam sağlanır */
}

/* ----- Aramada dropdown listesi rol ve sınır ----- */
.BoxActive,
.BoxMobActive {
    border: 1px solid #003366;
}

.BoxActive a,
.BoxMobActive a {
    font-size: 13px !important;
    color: #1d1d1d;
    padding: 6px 8px;
    display: block;
    min-height: 32px;
}

.BoxActive a:focus-visible,
.BoxMobActive a:focus-visible,
.BoxActive a:hover,
.BoxMobActive a:hover {
    background-color: #ffe066;
    color: #003366 !important;
    text-decoration: underline;
}

/* ----- Menü açılışlarında klavye odak yönetimi ----- */
.openMenu a:focus-visible,
.dropdown-menu a:focus-visible {
    background-color: #ffe066 !important;
    color: #003366 !important;
}

/* ----- Resimli linkler için kontrast outline ----- */
img:focus-visible,
a:focus-visible img {
    outline: 3px solid #ffbf47;
    outline-offset: 2px;
}

/* ----- 2.4.11 Odak Görünümü (WCAG 2.2) — odak kesilmesin diye scroll-margin ----- */
:target,
:focus-visible {
    scroll-margin-top: 100px;
    scroll-margin-bottom: 100px;
}

/* ----- Gizli radio butonlu tab arayüzü için odak görünümü (haberler/ihaleler) ----- */
.tabsMain label:has(+ input[type="radio"]:focus-visible),
.tabsMain label:has(+ input[type="radio"]:focus) {
    outline: 3px solid #ffbf47;
    outline-offset: 2px;
    background-color: rgba(255, 191, 71, 0.15);
}

/* :has() desteklemeyen tarayıcılar için yedek: input odaklandığında parent etrafına outline */
.tabsMain input[type="radio"]:focus-visible {
    outline: 3px solid #ffbf47;
    outline-offset: 2px;
    width: auto !important;
    height: auto !important;
}

/* ----- Seçili tab (radio:checked) label için görsel ipucu ----- */
.tabsMain input[type="radio"]:checked + .news label,
.tabsMain input[type="radio"]:checked ~ * label[for] {
    font-weight: 700;
}

/* ----- aria-current="page" için belirgin görsel vurgu ----- */
[aria-current="page"] {
    font-weight: 700;
    text-decoration: underline;
}

/* ----- Önemli: Bootstrap'in nav-link rengi WCAG kontrastı için ----- */
.navbar-light .navbar-nav .nav-link {
    color: #1d1d1d;
}

.text-white,
.cookiealert {
    color: #ffffff !important;
}
