/* =========================================================
   Fitur ramah disabilitas (halaman publik)
   ========================================================= */

/* ---------- Selalu aktif ---------- */
:focus-visible {
    outline: 3px solid #ffbf00 !important;
    outline-offset: 2px;
}

#main:focus {
    outline: none !important;
}

/* Submenu juga terbuka saat dinavigasi dengan keyboard */
@media (min-width: 992px) {
    .navbar .dropdown:focus-within > ul {
        opacity: 1;
        top: 100%;
        visibility: visible;
    }

    .navbar .dropdown .dropdown:focus-within > ul {
        opacity: 1;
        top: 0;
        left: 100%;
        visibility: visible;
    }
}

@media (min-width: 992px) and (max-width: 1366px) {
    .navbar .dropdown .dropdown:focus-within > ul {
        left: -100%;
    }
}

/* ---------- Tombol dan panel ---------- */
#a11y-root .a11y-skip {
    position: fixed;
    top: -100px;
    left: 10px;
    z-index: 100002;
    background: #000;
    color: #fff;
    padding: 12px 18px;
    border-radius: 6px;
    font: 600 15px/1.3 Arial, sans-serif;
}

#a11y-root .a11y-skip:focus {
    top: 10px;
}

#a11y-root .a11y-toggle {
    position: fixed;
    left: 18px;
    bottom: 18px;
    z-index: 100000;
    width: 54px;
    height: 54px;
    padding: 0;
    border-radius: 50%;
    border: 2px solid #fff;
    background: #0b5c8e;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
    cursor: pointer;
}

#a11y-root .a11y-panel {
    position: fixed;
    left: 18px;
    bottom: 82px;
    z-index: 100001;
    width: 340px;
    max-width: calc(100vw - 36px);
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    padding: 14px;
    background: #fff;
    color: #111827;
    border: 2px solid #0b5c8e;
    border-radius: 12px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, .28);
    font: 400 14px/1.4 Arial, sans-serif;
    text-align: left;
}

#a11y-root .a11y-panel[hidden] {
    display: none;
}

#a11y-root .a11y-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

#a11y-root .a11y-title {
    font-size: 17px;
    font-weight: 700;
}

#a11y-root .a11y-label {
    font-weight: 700;
    margin: 10px 0 6px;
}

#a11y-root .a11y-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

#a11y-root .a11y-grid-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

#a11y-root .a11y-panel button {
    min-height: 44px;
    padding: 6px 8px;
    border: 1px solid #94a3b8;
    border-radius: 8px;
    background: #f8fafc;
    color: #111827;
    font: 400 13px/1.3 Arial, sans-serif;
    cursor: pointer;
}

#a11y-root .a11y-panel button[aria-pressed="true"] {
    background: #0b5c8e;
    border-color: #0b5c8e;
    color: #fff;
    font-weight: 700;
}

#a11y-root .a11y-panel button:disabled {
    opacity: .45;
    cursor: not-allowed;
}

#a11y-root .a11y-panel .a11y-close {
    min-width: 44px;
    font-size: 24px;
    line-height: 1;
}

#a11y-root .a11y-panel .a11y-reset {
    width: 100%;
    margin-top: 12px;
    border-color: #b91c1c;
    color: #b91c1c;
    font-weight: 700;
}

#a11y-root .a11y-status {
    margin-top: 6px;
    font-size: 12px;
}

#a11y-root .a11y-hint {
    margin-top: 8px;
    font-size: 11.5px;
    color: #475569;
}

/* ---------- Ukuran teks (pengukuran tanpa transisi) ---------- */
html.a11y-measuring *,
html.a11y-measuring *::before,
html.a11y-measuring *::after {
    transition: none !important;
}

/* ---------- Hitam putih ---------- */
#a11y-root .a11y-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2147483646;
    pointer-events: none;
}

html.a11y-gray #a11y-root .a11y-overlay {
    display: block;
    -webkit-backdrop-filter: grayscale(100%);
    backdrop-filter: grayscale(100%);
}

/* ---------- Kontras tinggi ---------- */
html.a11y-contrast body,
html.a11y-contrast body *:not(img):not(video):not(iframe):not(.a11y-keep):not(.a11y-keep *):not([class*="jdih-widget"]):not([class*="jdih-widget"] *),
html.a11y-contrast body *:not([class*="jdih-widget"]):not([class*="jdih-widget"] *)::before,
html.a11y-contrast body *:not([class*="jdih-widget"]):not([class*="jdih-widget"] *)::after {
    background-color: #000 !important;
    background-image: none !important;
    color: #fff !important;
    border-color: #fff !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

html.a11y-contrast body a:not(.a11y-keep *),
html.a11y-contrast body a *:not(img):not(.a11y-keep *) {
    color: #ffea00 !important;
}

/* Logo berwarna gelap tetap terbaca di latar hitam */
html.a11y-contrast .img-logo {
    background-color: #fff;
    border-radius: 6px;
    padding: 4px 8px;
}

html.a11y-contrast body div.modal-backdrop.fade.show {
    background-color: #333 !important;
}

html.a11y-contrast body #a11y-root .a11y-overlay,
html.a11y-contrast body #a11y-root .a11y-guide {
    background-color: transparent !important;
}

html.a11y-contrast body #a11y-root .a11y-guide {
    border-color: #ffea00 !important;
}

html.a11y-contrast body #a11y-root .a11y-panel button[aria-pressed="true"] {
    background-color: #ffea00 !important;
    color: #000 !important;
}

/* ---------- Sorot tautan ---------- */
html.a11y-links body a:not(#a11y-root a) {
    text-decoration: underline !important;
    text-decoration-thickness: 2px !important;
    text-underline-offset: 3px;
    outline: 2px dashed #d97706;
    outline-offset: 1px;
}

/* ---------- Huruf mudah dibaca ---------- */
html.a11y-readable body,
html.a11y-readable body *:not(i):not([class*="bi-"]):not([class*="fa-"]):not([class*="bx"]) {
    font-family: Verdana, Tahoma, Arial, sans-serif !important;
    font-style: normal !important;
}

/* ---------- Jarak teks ---------- */
html.a11y-spacing body *:not(i):not(#a11y-root):not(#a11y-root *) {
    line-height: 1.9 !important;
    letter-spacing: .08em !important;
    word-spacing: .16em !important;
}

/* ---------- Hentikan animasi ---------- */
html.a11y-still {
    scroll-behavior: auto !important;
}

html.a11y-still *,
html.a11y-still *::before,
html.a11y-still *::after {
    animation-duration: .001s !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition: none !important;
    scroll-behavior: auto !important;
}

html.a11y-still [data-aos] {
    opacity: 1 !important;
    transform: none !important;
}

.a11y-marquee-text {
    display: none;
    padding: 0 10px;
}

html.a11y-still marquee {
    display: none;
}

html.a11y-still .a11y-marquee-text {
    display: block;
}

/* ---------- Kursor besar ---------- */
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 48 48'%3E%3Cpath d='M4 2v38l10-9 7 15 8-4-7-14h14z' fill='%23000' stroke='%23fff' stroke-width='3'/%3E%3C/svg%3E") 4 2, auto !important;
}

html.a11y-cursor a,
html.a11y-cursor a *,
html.a11y-cursor button,
html.a11y-cursor button *,
html.a11y-cursor [role="button"],
html.a11y-cursor select {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M4 2v38l10-9 7 15 8-4-7-14h14z' fill='%23ffea00' stroke='%23000' stroke-width='3'/%3E%3C/svg%3E") 4 2, pointer !important;
}

/* ---------- Garis bantu baca ---------- */
#a11y-root .a11y-guide {
    display: none;
    position: fixed;
    left: 0;
    top: 50%;
    width: 100%;
    height: 14px;
    z-index: 2147483645;
    border-top: 3px solid #d97706;
    border-bottom: 3px solid #d97706;
    pointer-events: none;
}

html.a11y-guide-on #a11y-root .a11y-guide {
    display: block;
}

/* ---------- Preferensi sistem ---------- */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto !important;
    }
}

@media print {
    #a11y-root {
        display: none !important;
    }
}
