/* ====================================================
   FKDC — accessibility.css
   Custom accessibility classes toggled via JS
   ==================================================== */

/* -------------------------------------------------------
   1. HIGH CONTRAST
   ------------------------------------------------------- */
/* -------------------------------------------------------
   1. CONTRAST LEVELS
   ------------------------------------------------------- */
/* Level 1: Invert Colors */
body.acc-contrast-1 {
    background-color: #fff !important;
}
body.acc-contrast-1 .acc-filter-layer {
    display: block;
    backdrop-filter: invert(1) hue-rotate(180deg);
}
body.acc-contrast-1 img, 
body.acc-contrast-1 video,
body.acc-contrast-1 .hero-bg,
body.acc-contrast-1 [style*="background-image"] {
    filter: invert(1) hue-rotate(180deg) !important;
}

/* Level 2: Dark Contrast */
body.acc-contrast-2,
body.acc-contrast-2 section,
body.acc-contrast-2 header,
body.acc-contrast-2 footer,
body.acc-contrast-2 .container-fluid,
body.acc-contrast-2 .container {
    background-color: #000000 !important;
    background-image: none !important;
    color:            #ffffff !important;
}
body.acc-contrast-2 *:not(i):not(.bi) {
    color: #ffffff !important;
    border-color: #444 !important;
}
body.acc-contrast-2 a, 
body.acc-contrast-2 a * { 
    color: #ffff00 !important; 
    text-decoration: underline !important; 
}
/* Yellow buttons become black with white text in Dark Contrast */
body.acc-contrast-2 .btn-primary,
body.acc-contrast-2 .btn-success,
body.acc-contrast-2 .btn-warning,
body.acc-contrast-2 .acc-btn.active,
body.acc-contrast-2 .btn-primary *,
body.acc-contrast-2 .btn-success *,
body.acc-contrast-2 .btn-warning * { 
    background-color: #000000 !important; 
    color: #ffffff !important; 
    border: 2px solid #ffffff !important; 
}
body.acc-contrast-2 .news-card,
body.acc-contrast-2 .dok-card,
body.acc-contrast-2 .card,
body.acc-contrast-2 article,
body.acc-contrast-2 .dok-card-horizontal { 
    background-color: #000000 !important; 
    background-image: none !important;
    border: 2px solid #ffffff !important; 
}
body.acc-contrast-2 .news-card *,
body.acc-contrast-2 .dok-card *,
body.acc-contrast-2 .dok-card-horizontal * {
    color: #ffffff !important;
}
body.acc-contrast-2 i, 
body.acc-contrast-2 .bi,
body.acc-contrast-2 .bi::before { 
    color: #ffff00 !important; 
}
/* Handle Logos - Keep them visible and bright */
body.acc-contrast-2 img:not(.navbar-brand img):not(.partner-logo img):not(.site-logo) {
    filter: brightness(0.7) !important;
    transition: filter 0.3s ease;
}
body.acc-contrast-2 img:hover {
    filter: brightness(1) !important;
}
body.acc-contrast-2 .navbar-brand img,
body.acc-contrast-2 .partner-logo img,
body.acc-contrast-2 .site-logo,
body.acc-contrast-2 .footer-logo img {
    filter: brightness(1) contrast(1) !important;
    background-color: #fff !important; 
    padding: 5px !important;
    border-radius: 4px !important;
}
body.acc-contrast-2 .hero-slider,
body.acc-contrast-2 .hero-bg {
    filter: brightness(0.6) !important;
}

/* Level 3: Light Contrast */
body.acc-contrast-3,
body.acc-contrast-3 section,
body.acc-contrast-3 header,
body.acc-contrast-3 footer,
body.acc-contrast-3 .container-fluid,
body.acc-contrast-3 .container {
    background-color: #ffffff !important;
    background-image: none !important;
    color:            #000000 !important;
}
body.acc-contrast-3 *:not(i):not(.bi) {
    color: #000000 !important;
    border-color: #ccc !important;
}
body.acc-contrast-3 a,
body.acc-contrast-3 a * { 
    color: #0000ee !important; 
    text-decoration: underline !important; 
    font-weight: 700 !important; 
}
body.acc-contrast-3 .btn-primary,
body.acc-contrast-3 .btn-success,
body.acc-contrast-3 .btn-primary *,
body.acc-contrast-3 .btn-success * { 
    background-color: #000 !important; 
    color: #fff !important; 
    border-color: #000 !important; 
}
body.acc-contrast-3 .news-card,
body.acc-contrast-3 .dok-card,
body.acc-contrast-3 .card,
body.acc-contrast-3 article { 
    background-color: #fff !important; 
    border: 2px solid #000 !important; 
}
body.acc-contrast-3 i, 
body.acc-contrast-3 .bi { 
    color: #000 !important; 
}

/* -------------------------------------------------------
   2. HIGHLIGHT LINKS
   ------------------------------------------------------- */
body.highlight-links a {
    text-decoration:  underline dashed 2px !important;
    text-underline-offset: 3px !important;
    background:       rgba(255, 255, 0, 0.25) !important;
    padding:          0 3px !important;
    border-radius:    2px !important;
}

/* -------------------------------------------------------
   3. TEXT SIZE LEVELS
   ------------------------------------------------------- */
body.acc-font-size-1, body.acc-font-size-1 p, body.acc-font-size-1 li, body.acc-font-size-1 a:not(.acc-btn), body.acc-font-size-1 span, body.acc-font-size-1 .nav-link, body.acc-font-size-1 .footer-links a, body.acc-font-size-1 .footer-contact { font-size: 1.2rem !important; }
body.acc-font-size-2, body.acc-font-size-2 p, body.acc-font-size-2 li, body.acc-font-size-2 a:not(.acc-btn), body.acc-font-size-2 span, body.acc-font-size-2 .nav-link, body.acc-font-size-2 .footer-links a, body.acc-font-size-2 .footer-contact { font-size: 1.5rem !important; }
body.acc-font-size-3, body.acc-font-size-3 p, body.acc-font-size-3 li, body.acc-font-size-3 a:not(.acc-btn), body.acc-font-size-3 span, body.acc-font-size-3 .nav-link, body.acc-font-size-3 .footer-links a, body.acc-font-size-3 .footer-contact { font-size: 1.8rem !important; }
body.acc-font-size-4, body.acc-font-size-4 p, body.acc-font-size-4 li, body.acc-font-size-4 a:not(.acc-btn), body.acc-font-size-4 span, body.acc-font-size-4 .nav-link, body.acc-font-size-4 .footer-links a, body.acc-font-size-4 .footer-contact { font-size: 2.1rem !important; }

/* Special adjustment for headings */
body[class*="acc-font-size-"] h1 { font-size: 3.5rem !important; }
body[class*="acc-font-size-"] h2 { font-size: 3rem !important; }
body[class*="acc-font-size-"] h3 { font-size: 2.5rem !important; }

/* -------------------------------------------------------
   4. TEXT SPACING LEVELS
   ------------------------------------------------------- */
body.acc-spacing-1 p, body.acc-spacing-1 li, body.acc-spacing-1 span { letter-spacing: 0.05em !important; word-spacing: 0.1em !important; }
body.acc-spacing-2 p, body.acc-spacing-2 li, body.acc-spacing-2 span { letter-spacing: 0.1em !important; word-spacing: 0.2em !important; }
body.acc-spacing-3 p, body.acc-spacing-3 li, body.acc-spacing-3 span { letter-spacing: 0.2em !important; word-spacing: 0.4em !important; }

/* -------------------------------------------------------
   5. PAUSE ANIMATIONS
   ------------------------------------------------------- */
body.pause-animations *,
body.pause-animations *::before,
body.pause-animations *::after {
    animation:          none !important;
    transition:         none !important;
    transition-duration: 0.001ms !important;
    animation-duration:  0.001ms !important;
}

/* -------------------------------------------------------
   6. HIDE IMAGES
   ------------------------------------------------------- */
body.hide-images img {
    visibility: hidden !important;
    opacity: 0 !important;
}
body.hide-images .hero-bg,
body.hide-images [style*="background-image"] {
    background-image: none !important;
    background-color: #2d2d2d !important;
}
body.hide-images .hero-bg__img {
    opacity: 0 !important;
}

/* -------------------------------------------------------
   7. DYSLEXIA FRIENDLY
   ------------------------------------------------------- */
body.dyslexia-friendly {
    font-family:    'OpenDyslexic', Arial, sans-serif !important;
}
body.dyslexia-friendly p { text-align: left !important; }

/* -------------------------------------------------------
   8. CURSOR & AIDS
   ------------------------------------------------------- */
body.acc-cursor-1,
body.acc-cursor-1 * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath fill='%23000' stroke='%23fff' stroke-width='1.5' d='M4 2l18 12.5-8.5 1-4.5 8.5z'/%3E%3C/svg%3E") 4 2, auto !important;
}

/* Reading Mask */
#acc-reading-mask {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 10000;
    display: none;
    background: rgba(0, 0, 0, 0.7);
    mask: linear-gradient(to bottom, black 0%, black var(--mask-top, 40%), transparent var(--mask-top, 40%), transparent var(--mask-bottom, 60%), black var(--mask-bottom, 60%), black 100%);
    -webkit-mask: linear-gradient(to bottom, black 0%, black var(--mask-top, 40%), transparent var(--mask-top, 40%), transparent var(--mask-bottom, 60%), black var(--mask-bottom, 60%), black 100%);
}

/* Reading Guide */
#acc-reading-guide {
    position: fixed;
    left: 0; right: 0;
    height: 4px;
    background: #ff0000;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
    pointer-events: none;
    z-index: 10000;
    display: none;
    transform: translateY(-50%);
}

/* -------------------------------------------------------
   9. LINE HEIGHT LEVELS
   ------------------------------------------------------- */
body.acc-line-height-1 p, body.acc-line-height-1 li { line-height: 1.5 !important; }
body.acc-line-height-2 p, body.acc-line-height-2 li { line-height: 1.75 !important; }
body.acc-line-height-3 p, body.acc-line-height-3 li { line-height: 2 !important; }

/* -------------------------------------------------------
   10. TEXT ALIGN LEVELS
   ------------------------------------------------------- */
/* Level 1: Left */
body.acc-text-align-1 p, body.acc-text-align-1 li, body.acc-text-align-1 td, body.acc-text-align-1 h1, body.acc-text-align-1 h2, body.acc-text-align-1 h3, body.acc-text-align-1 h4, body.acc-text-align-1 h5, body.acc-text-align-1 h6, body.acc-text-align-1 div:not(.acc-panel):not(.acc-btn), body.acc-text-align-1 section, body.acc-text-align-1 .text-center {
    text-align: left !important;
}
body.acc-text-align-1 .justify-content-center { justify-content: flex-start !important; }
body.acc-text-align-1 .mx-auto { margin-left: 0 !important; margin-right: auto !important; }

/* Level 2: Right */
body.acc-text-align-2 p, body.acc-text-align-2 li, body.acc-text-align-2 td, body.acc-text-align-2 h1, body.acc-text-align-2 h2, body.acc-text-align-2 h3, body.acc-text-align-2 h4, body.acc-text-align-2 h5, body.acc-text-align-2 h6, body.acc-text-align-2 div:not(.acc-panel):not(.acc-btn), body.acc-text-align-2 section, body.acc-text-align-2 .text-center {
    text-align: right !important;
}
body.acc-text-align-2 .justify-content-center { justify-content: flex-end !important; }
body.acc-text-align-2 .mx-auto { margin-left: auto !important; margin-right: 0 !important; }

/* Level 3: Center */
body.acc-text-align-3 p, body.acc-text-align-3 li, body.acc-text-align-3 td, body.acc-text-align-3 h1, body.acc-text-align-3 h2, body.acc-text-align-3 h3, body.acc-text-align-3 h4, body.acc-text-align-3 h5, body.acc-text-align-3 h6, body.acc-text-align-3 div:not(.acc-panel):not(.acc-btn), body.acc-text-align-3 section {
    text-align: center !important;
}
body.acc-text-align-3 .justify-content-start, body.acc-text-align-3 .justify-content-end { justify-content: center !important; }
body.acc-text-align-3 .ms-auto, body.acc-text-align-3 .me-auto { margin-left: auto !important; margin-right: auto !important; }

/* Level 4: Justify */
body.acc-text-align-4 p, body.acc-text-align-4 li, body.acc-text-align-4 div:not(.acc-panel):not(.acc-btn) {
    text-align: justify !important;
    text-justify: inter-word !important;
}

/* -------------------------------------------------------
   11. LOW SATURATION
   ------------------------------------------------------- */
body.saturation .acc-filter-layer {
    display: block;
    backdrop-filter: saturate(0.3);
}

/* -------------------------------------------------------
   12. SHOW TOOLTIPS (KETERANGAN ALAT)
   ------------------------------------------------------- */
body.show-tooltips [title]::after {
    content: " [" attr(title) "] ";
    background-color: #f8fafc !important;
    color: #0f172a !important;
    font-size: 0.85rem !important;
    padding: 0.15rem 0.35rem !important;
    margin-left: 0.3rem !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 4px !important;
    display: inline-block !important;
    font-weight: 600 !important;
    font-family: Arial, sans-serif !important;
}

/* ====================================================
   ACCESSIBILITY WIDGET PANEL UI
   ==================================================== */
.acc-panel {
    position:   fixed;
    top:        80px;
    left:       -360px;  /* hidden by default */
    width:      340px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    background: #ffffff;
    border-radius: 0 16px 16px 0;
    box-shadow: 4px 0 40px rgba(0,0,0,.15);
    z-index:    9999;
    transition: left .35s cubic-bezier(.4,0,.2,1);
    border-right: 4px solid #fcd640;
}
.acc-filter-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9998; /* Below panel and button */
    display: none;
}

.acc-panel.open {
    left: 0;
}

.acc-panel__header {
    display:      flex;
    align-items:  center;
    justify-content: space-between;
    background:   #fcd640;
    color:        #1a1a2e;
    padding:      1rem 1.25rem;
    font-weight:  700;
    font-size:    1rem;
    border-radius: 0 12px 0 0;
}

.acc-panel__close {
    background:  transparent;
    border:      none;
    color:       #1a1a2e;
    font-size:   1.1rem;
    cursor:      pointer;
    padding:     4px 8px;
    border-radius: 6px;
    transition:  background .2s;
    line-height: 1;
}
.acc-panel__close:hover { background: rgba(0,0,0,.1); }

.acc-panel__body { padding: 1.25rem; }

.acc-grid {
    display:               grid;
    grid-template-columns: 1fr 1fr;
    gap:                   .65rem;
    margin-bottom:         1rem;
}

.acc-btn {
    background:    #f8faf9;
    border:        2px solid #e2e8f0;
    border-radius: 12px;
    padding:       .85rem .5rem;
    display:       flex;
    flex-direction: column;
    align-items:   center;
    gap:           .4rem;
    font-size:     .75rem;
    font-weight:   600;
    color:         #2d2d2d;
    cursor:        pointer;
    transition:    all .2s;
    text-align:    center;
    line-height:   1.2;
    position:      relative;
    overflow:      hidden;
}
.acc-btn i { font-size: 1.4rem; color: #d1a700; margin-bottom: 2px; }

/* Level Indicator Dots */
.acc-btn__levels {
    display: flex;
    gap: 3px;
    margin-top: 4px;
}
.acc-btn__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #cbd5e0;
    transition: background .2s;
}
.acc-btn.active .acc-btn__dot.filled {
    background: #fff;
}
.acc-btn:not(.active) .acc-btn__dot.filled {
    background: #fcd640;
}

.acc-btn:hover {
    background:   #fff9e6;
    border-color: #fcd640;
    transform: translateY(-2px);
}
.acc-btn.active,
.acc-btn[aria-pressed="true"] {
    background:   #fcd640;
    border-color: #fcd640;
    color:        #1a1a2e;
    box-shadow: 0 4px 12px rgba(252, 214, 64, 0.3);
}
.acc-btn.active i { color: #1a1a2e; }

.acc-reset-btn {
    width:        100%;
    background:   #f5a623;
    border:       none;
    color:        #fff;
    padding:      .75rem;
    border-radius: 8px;
    font-weight:  700;
    font-size:    .9rem;
    cursor:       pointer;
    transition:   background .2s;
}
.acc-reset-btn:hover { background: #e0911a; }

.acc-overlay {
    display:    none;
    position:   fixed;
    inset:      0;
    background: rgba(0,0,0,.4);
    z-index:    9998;
}
.acc-overlay.show { display: block; }

/* -------------------------------------------------------
   Skip to Content (a11y)
   ------------------------------------------------------- */
.skip-link {
    position:    absolute;
    top:         -100%;
    left:        1rem;
    background:  #2d8c4e;
    color:       #fff;
    padding:     .75rem 1.5rem;
    border-radius: 0 0 8px 8px;
    font-weight: 700;
    z-index:     10000;
    transition:  top .15s;
}
.skip-link:focus { top: 0; color: #fff; }

/* ====================================================
   FLOATING ACCESSIBILITY BUTTON
   ==================================================== */
.btn-acc-floating {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9999;
    background: #fcd640;
    color: #1a1a2e;
    border: none;
    border-radius: 0 50px 50px 0;
    width: 50px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    box-shadow: 4px 0 15px rgba(0,0,0,0.15);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding-right: 5px;
}

.btn-acc-floating:hover {
    width: 65px;
    background: #f5a623;
}

.btn-acc-floating i {
    transition: transform 0.3s;
}

.btn-acc-floating:hover i {
    transform: scale(1.1) rotate(10deg);
}

/* Responsive adjustment for mobile */
@media (max-width: 768px) {
    .btn-acc-floating {
        width: 45px;
        height: 55px;
        font-size: 1.4rem;
    }
}

/* Glassmorphism effect for the button when contrast is not high */
body:not(.acc-contrast-2):not(.acc-contrast-3) .btn-acc-floating {
    backdrop-filter: blur(5px);
    background: rgba(252, 214, 64, 0.9);
}

/* ====================================================
   LANGUAGE FLAG STYLES
   ==================================================== */
.lang-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.2);
    transition: all 0.2s;
    background: #eee;
    padding: 0;
}

.lang-flag img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lang-flag:hover {
    transform: scale(1.15);
    border-color: #fcd640;
    background: #fff;
}

.lang-flag.active {
    border-color: #fcd640;
    box-shadow: 0 0 8px rgba(252, 214, 64, 0.4);
    pointer-events: none;
    background: #fff;
}
