/* Widget Aksesibilitas — Pengadilan Agama Rantauprapat */

:root {
    --a11y-ink: #14312b;
    --a11y-paper: #ffffff;
    --a11y-accent: #056E4F;
    --a11y-accent-ink: #ffffff;
    --a11y-line: #c9d6d2;
}

/* ---------- Ukuran teks ----------
   Hanya efektif jika CSS situs memakai rem/em. Jika memakai px tetap, lihat catatan di README. */
html.a11y-font-on { font-size: var(--a11y-font-size, 16px); }

/* ---------- Jarak teks lebar (WCAG 1.4.12) ---------- */
html.a11y-spacing body,
html.a11y-spacing p,
html.a11y-spacing li,
html.a11y-spacing td,
html.a11y-spacing th {
    line-height: 1.8 !important;
    letter-spacing: 0.04em !important;
    word-spacing: 0.12em !important;
}
html.a11y-spacing p { margin-bottom: 1.5em; }

/* ---------- Garis bawah tautan ---------- */
html.a11y-links a:not(.a11y-widget a) {
    text-decoration: underline !important;
    text-underline-offset: 0.18em;
}

/* ---------- Kontras tinggi ---------- */
html.a11y-contrast body,
html.a11y-contrast body *:not(img):not(svg):not(video):not(iframe):not(canvas):not(.a11y-widget):not(.a11y-widget *) {
    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 a:not(.a11y-widget a),
html.a11y-contrast a:not(.a11y-widget a) * {
    color: #ffe600 !important;
    text-decoration: underline !important;
}
html.a11y-contrast button:not(.a11y-widget button),
html.a11y-contrast input,
html.a11y-contrast select,
html.a11y-contrast textarea {
    border: 2px solid #fff !important;
}
html.a11y-contrast img { filter: contrast(1.1); }

/* ---------- Widget (kanan bawah) ---------- */
.a11y-widget {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 2147483000;
    font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
    color: #1f2937;
}
.a11y-widget *, .a11y-widget *::before, .a11y-widget *::after { box-sizing: border-box; }
.a11y-widget button { font: inherit; cursor: pointer; }
.a11y-ic { flex: none; }

/* Tombol melayang (pil oranye) */
.a11y-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    padding: 10px 20px;
    border: 3px solid #1f2937;
    border-radius: 999px;
    background: #FF9900;
    color: #1c1917;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
}
.a11y-toggle:hover { background: #E68A00; }

/* Panel */
.a11y-panel {
    position: absolute;
    right: 0;
    bottom: 64px;
    width: min(380px, calc(100vw - 32px));
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    background: #f8f9fb;
    border-radius: 8px;
    box-shadow: 0 10px 32px rgba(0, 0, 0, .35);
}
.a11y-panel[hidden] { display: none; }

.a11y-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #056E4F;
    color: #fff;
    border-radius: 8px 8px 0 0;
}
.a11y-title { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 700; }
.a11y-close {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 3px solid rgba(255, 255, 255, .45);
    border-radius: 10px;
    background: rgba(255, 255, 255, .12);
    color: #fff;
}
.a11y-close:hover { background: rgba(255, 255, 255, .25); }

.a11y-body { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.a11y-body > button {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 46px;
    padding: 10px 16px;
    border: 1.5px solid #056E4F;
    border-radius: 6px;
    background: #fff;
    color: #056E4F;
    font-size: 17px;
    font-weight: 700;
    text-align: left;
}
.a11y-body > button:hover { background: #E6F3EF; }
.a11y-body > button[aria-pressed="true"] { background: #056E4F; border-color: #056E4F; color: #fff; }

/* Kontras tinggi: gaya gelap */
.a11y-body > .a11y-contrast-btn { border-color: #1f2937; color: #1f2937; }
.a11y-body > .a11y-contrast-btn:hover { background: #f1f2f4; }
.a11y-body > .a11y-contrast-btn[aria-pressed="true"] { background: #111827; border-color: #111827; color: #fff; }

/* Bacakan: oranye */
.a11y-body > .a11y-speak { background: #FF9900; border-color: #FF9900; color: #1c1917; }
.a11y-body > .a11y-speak:hover { background: #E68A00; }

/* Reset: teks abu-abu */
.a11y-body > .a11y-reset {
    justify-content: center;
    min-height: 40px;
    border: 0;
    background: transparent;
    color: #6b7280;
    font-weight: 500;
}
.a11y-body > .a11y-reset:hover { background: #eceef1; color: #374151; }

.a11y-widget button:focus-visible { outline: 3px solid #034D37; outline-offset: 2px; }
.a11y-toggle:focus-visible { outline-color: #fff; box-shadow: 0 0 0 5px #034D37; }

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

/* Ajakan memulai suara */
.a11y-unlock {
    position: absolute;
    right: 0;
    bottom: 64px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    width: max-content;
    max-width: calc(100vw - 32px);
    background: #fff;
    color: #1f2937;
    border: 2px solid #056E4F;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .3);
    font-size: 15px;
}
.a11y-unlock button {
    min-height: 38px;
    padding: 4px 12px;
    border: 0;
    border-radius: 6px;
    background: #056E4F;
    color: #fff;
}

@media (max-width: 480px) {
    .a11y-toggle span { display: none; }   /* HP: hanya ikon agar tidak menutupi konten */
    .a11y-toggle { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) { .a11y-widget * { transition: none !important; animation: none !important; } }
@media print { .a11y-widget { display: none; } }