/* =========================================
   1. CORE VARIABLES & THEME
   ========================================= */
:root {
    --a11y-primary: #121212;       /* Modern Blue */
    --a11y-primary-dark: #35352f;
    --a11y-bg-panel: rgba(255, 255, 255, 0.95);
    --a11y-text-main: #1e293b;
    --a11y-text-sub: #64748b;
    --a11y-border: #e2e8f0;
    --a11y-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* =========================================
   2. FLOATING TRIGGER BUTTON
   ========================================= */
#a11y-trigger {
    position: fixed;
    bottom: 30px;
    /* right: 30px; */
    left: 30px;
    width: 56px;
    height: 56px;
    background: var(--a11y-primary);
    border-radius: 50%;
    cursor: pointer;
    z-index: 10000;
    box-shadow: 0 4px 15px rgba(0,0,0,.18);
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#a11y-trigger:hover {
    transform: scale(1.1) rotate(10deg);
    background: var(--a11y-primary-dark);
}

#a11y-trigger svg {
    width: 46px;
    height: 46px;
    color: white;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

/* =========================================
   3. MAIN PANEL
   ========================================= */
#a11y-panel {
    position: fixed;
    top: 20px;
    /* right: 20px; */
    /* right: 20px; */
    left: 20px;
    width: 380px;
    max-height: calc(100vh - 40px);
    background: var(--a11y-bg-panel);
    backdrop-filter: blur(10px); /* Efek kaca buram */
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: var(--a11y-shadow);
    border: 1px solid var(--a11y-border);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#a11y-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Header */
.a11y-header {
    padding: 16px 20px;
    background: white;
    border-bottom: 1px solid var(--a11y-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.a11y-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--a11y-text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.a11y-close {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--a11y-text-sub);
    padding: 4px;
    border-radius: 8px;
    transition: background 0.2s;
    display: flex;
}

.a11y-close:hover {
    background: #f1f5f9;
    color: var(--a11y-text-main);
}

.a11y-close svg { 
    stroke:currentColor; stroke-width:2; fill:none;
    width: 24px; height: 24px; stroke-width: 2; color: var(--a11y-text-sub);}
.a11y-close svg:hover { color: var(--a11y-text-main);}

/* Grid Content */
.a11y-content {
    overflow-y: auto;
    padding: 16px;
    max-height: 70vh;
}

.a11y-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

/* Buttons */
.a11y-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid var(--a11y-border);
    padding: 16px 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    min-height: 90px;
    position: relative;
    user-select: none;
}

.a11y-btn:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.a11y-btn.active {
    background: #ffed00; /* Light Blue Bg */
    border-color: var(--a11y-primary);
    color: var(--a11y-primary);
}

/* Icon Styles */
.a11y-icon-box {
    width: 32px;
    height: 32px;
    margin-bottom: 10px;
    color: var(--a11y-text-sub);
    transition: color 0.2s;
}

.a11y-btn.active .a11y-icon-box {
    color: var(--a11y-primary);
}

.a11y-icon-box svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.a11y-btn span {
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--a11y-text-main);
}

.a11y-btn.active span {
    color: var(--a11y-primary);
}

/* Reset Button Special Style */
.a11y-btn[data-action="reset"] {
    align-items: center;
    grid-column: span 3;
    flex-direction: row;
    gap: 10px;
    min-height: 50px;
    background: #fef2f2;
    border-color: #fecaca;
    color: #ef4444;
}
.a11y-btn[data-action="reset"]:hover {
    background: #fee2e2;
}
.a11y-btn[data-action="reset"] .a11y-icon-box {
    width: 20px;
    height: 20px;
    margin-bottom: 0;
    color: #ef4444;
}
.a11y-btn[data-action="reset"] span{
    color: #ef4444;
}

/* Indicators (Dots) */
.a11y-indicators {
    position: absolute;
    bottom: 6px;
    display: flex;
    gap: 3px;
}
.a11y-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: #cbd5e1;
    transition: all 0.3s;
}
.a11y-dot.active {
    background-color: var(--a11y-primary);
    transform: scale(1.2);
}

/* =========================================
   4. POPUPS (Dictionary & Tooltips)
   ========================================= */
.a11y-dict-modal {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 320px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    padding: 20px;
    z-index: 10002;
    display: none;
    border: 1px solid var(--a11y-border);
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: sans-serif;
}
.a11y-dict-modal.active { display: block; }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.a11y-dict-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.a11y-dict-word { font-size: 20px; font-weight: 800; color: var(--a11y-primary); text-transform: capitalize; }
.a11y-dict-def { font-size: 14px; line-height: 1.6; color: #4b5563; }
.a11y-dict-close { background: none; border: none; cursor: pointer; color: #9ca3af; padding: 0; }

.a11y-tooltip-box {
    position: fixed;
    background: #1e293b;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    z-index: 99999;
    pointer-events: none;
    max-width: 250px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    font-family: sans-serif;
}

/* =========================================
   5. FUNCTIONAL HELPERS (Same as before)
   ========================================= */
/* 1. BADGE VERSION */
.a11y-badge {
    font-size: 10px;
    background: #fff000;
    color: var(--a11y-primary);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    font-weight: 800;
    border: 1px solid #d9ce00;
    vertical-align: middle;
}

/* 2. NEW FUNCTIONAL CLASSES */

/* Text Spacing */
html.a11y-spacing-medium * { letter-spacing: 0.05em !important; word-spacing: 0.1em !important; line-height: 1.6 !important; }
html.a11y-spacing-wide * { letter-spacing: 0.1em !important; word-spacing: 0.2em !important; line-height: 2 !important; }

/* Saturation */



/* Page Structure Modal */
.a11y-structure-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    max-width: 90%;
    max-height: 80vh;
    background: white;
    z-index: 10005;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--a11y-border);
    display: none;
    flex-direction: column;
    font-family: sans-serif;
}
.a11y-structure-modal.active { display: flex; }

.a11y-struct-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    border-radius: 12px 12px 0 0;
}
.a11y-struct-header h3 { margin: 0; font-size: 16px; color: var(--a11y-primary); }

.a11y-struct-content {
    padding: 20px;
    overflow-y: auto;
}
.a11y-struct-item {
    display: block;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
    color: var(--a11y-text-main);
    text-decoration: none;
    transition: color 0.2s;
}
.a11y-struct-item:hover { color: var(--a11y-primary); padding-left: 5px; }
.a11y-tag-label {
    background: #e2e8f0;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 4px;
    margin-right: 8px;
    color: #475569;
    font-weight: bold;
}


/* Footer Styles */
.a11y-footer {
    padding: 12px;
    text-align: center;
    font-size: 11px;
    color: var(--a11y-text-sub); /* Menggunakan variabel warna abu-abu */
    background: #f8fafc;
    border-top: 1px solid var(--a11y-border);
    margin-top: auto; /* Memastikan footer selalu di bawah jika menggunakan flex */
}

/* Update Pengecualian Hide Images (Agar footer tidak hilang saat mode Hide Images) */
html.a11y-hide-images .a11y-footer {
    opacity: 1 !important;
    visibility: visible !important;
}
/* NYX presentation and keyboard operation. */
#a11y-trigger{left:auto;right:22px;bottom:24px;z-index:100010;background:#ffed00;border-color:#121212;color:#121212}
#a11y-trigger:hover{background:#fff456;transform:scale(1.05)}
#a11y-trigger svg{stroke:#121212;width:36px;height:36px}
#a11y-panel{left:auto;right:20px;z-index:100011;background:#f5f3eb;max-height:calc(100dvh - 32px);top:16px}
#a11y-panel *,#a11y-trigger *,.a11y-structure-modal *{box-sizing:border-box;letter-spacing:normal;word-spacing:normal}
#a11y-panel h2,.a11y-structure-modal h2{font:700 19px/1.3 var(--alt-font,sans-serif);margin:0;color:#121212;display:flex;align-items:center;gap:8px}
#a11y-heading svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2}
#a11y-panel button,.a11y-structure-modal button{font-family:inherit;text-transform:none;letter-spacing:normal;margin:0;color:#121212;line-height:1.4}
#a11y-panel .a11y-btn{width:100%;min-width:0;font-size:12px;box-shadow:none}
#a11y-panel .a11y-btn span{font-size:12px;line-height:1.3}
#a11y-panel .a11y-btn.active{background:#ffed00;border-color:#ffed00;color:#121212}
#a11y-panel .a11y-btn .a11y-indicators{display:flex;gap:4px;margin-top:8px}
#a11y-panel .a11y-btn .a11y-dot{width:5px;height:5px;border-radius:50%;background:#d3d1c7}
#a11y-panel .a11y-btn .a11y-dot.active{background:#121212}
#a11y-panel .a11y-btn[data-action=reset]{color:#121212;background:#ffed00;border-color:#ffed00}
#a11y-panel .a11y-btn[data-action=reset] span{color:#121212}
#a11y-panel .a11y-btn[data-action=reset] .a11y-icon-box{color:#121212}
#a11y-panel .a11y-footer{background:#edece3;color:#55534c}
#a11y-panel[hidden],#a11y-struct-modal[hidden],.a11y-tooltip-box[hidden]{display:none!important}
#a11y-struct-modal{z-index:100012}
#a11y-struct-modal .a11y-struct-close{background:transparent;border:0;padding:5px}
#a11y-struct-modal .a11y-struct-close svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2}
#a11y-struct-modal .a11y-struct-item{width:100%;background:transparent;border:0;border-bottom:1px solid #ddd;text-align:left;padding:12px 0;font-size:14px}
#a11y-panel button:focus-visible,#a11y-trigger:focus-visible,#a11y-struct-modal button:focus-visible{outline:3px solid #121212;outline-offset:3px}
#a11y-panel button:disabled{opacity:.45;cursor:not-allowed}
html.nyx-a11y-filtered .wp-site-blocks{filter:var(--nyx-a11y-filter)}
html.nyx-a11y-textSize-1 .wp-site-blocks :is(p,li,label,input,textarea){font-size:1.15em!important}
html.nyx-a11y-textSize-2 .wp-site-blocks :is(p,li,label,input,textarea){font-size:1.3em!important}
html.nyx-a11y-lineHeight-1 .wp-site-blocks :is(p,li,label){line-height:1.8!important}
html.nyx-a11y-lineHeight-2 .wp-site-blocks :is(p,li,label){line-height:2.2!important}
html.nyx-a11y-textSpacing-1 .wp-site-blocks :is(p,li,h1,h2,h3,label){letter-spacing:.04em!important;word-spacing:.08em!important}
html.nyx-a11y-textSpacing-2 .wp-site-blocks :is(p,li,h1,h2,h3,label){letter-spacing:.08em!important;word-spacing:.15em!important}
html.a11y-highlight-links .wp-site-blocks a{background:#fff000!important;color:#121212!important;text-decoration:underline!important;outline:1px solid #8a8000}
html.a11y-dyslexia .wp-site-blocks *{font-family:Arial,Verdana,sans-serif!important}
html.a11y-cursor-big *{cursor:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 24 24"><path fill="black" stroke="white" d="M7 2l12 11.2-5.8.5 3.3 7.3-2.2.9-3.2-7.4-4.4 4V2z"/></svg>'),auto!important}
html.a11y-hide-images .wp-site-blocks :is(img,svg,video),html.a11y-hide-images #nyx-snow{visibility:hidden!important}
html.a11y-pause-anim .wp-site-blocks *{animation-play-state:paused!important;transition:none!important;scroll-behavior:auto!important}
html.a11y-pause-anim .wp-site-blocks [data-anime]{opacity:1!important;transform:none!important}
html.a11y-pause-anim .nyx-footer-walk{visibility:hidden}
@media(max-width:600px){#a11y-panel{right:10px;left:10px;width:auto;top:10px;max-height:calc(100dvh - 20px)}#a11y-trigger{right:14px;bottom:18px;width:48px;height:48px}.a11y-grid{gap:8px}.a11y-content{padding:12px}#a11y-panel .a11y-btn{padding:12px 5px;min-height:88px}}
@media(prefers-reduced-motion:reduce){#a11y-trigger,#a11y-panel,.a11y-btn{transition:none!important}}
/* Neutralize the theme's generic section spacing inside the floating dialogs. */
#a11y-panel,#a11y-struct-modal{padding:0;margin:0}
#a11y-panel .a11y-content{min-height:0;flex:1 1 auto;overscroll-behavior:contain}
#a11y-panel .a11y-header,#a11y-panel .a11y-footer{flex-shrink:0}
/* Keep the accessibility entry point at the middle of the left edge. */
#a11y-trigger{left:10px;right:auto;top:50%;bottom:auto;transform:translateY(-50%)}
#a11y-trigger:hover{transform:translateY(-50%) scale(1.05)}
#a11y-panel{left:18px;right:auto}
@media(max-width:600px){#a11y-trigger{left:10px;right:auto;top:50%;bottom:auto}#a11y-panel{left:10px;right:10px;width:auto}}
/* Clear white accessibility symbol on the NYX orange button. */
#a11y-trigger,#a11y-trigger:hover,#a11y-trigger:focus-visible{background:#ee5307;color:#fff;border:2px solid #fff;box-shadow:none}
#a11y-trigger svg{width:36px;height:36px;fill:none;stroke:#fff;stroke-width:2.3;stroke-linecap:butt;stroke-linejoin:round}
#a11y-trigger svg path{fill:none;stroke:#fff;stroke-width:2.3}
@media(max-width:600px){#a11y-trigger svg{width:31px;height:31px}}
/* Hide the floating accessibility entry point on phones. */
@media(max-width:767px){#a11y-trigger{display:none}}
/* Compact semicircular tab attached to the viewport's left edge. */
#a11y-trigger{left:0;width:44px;height:88px;border:2px solid #fff;border-left:0;border-radius:0 44px 44px 0;padding:0 6px 0 2px;justify-content:center;transform:translateY(-50%)}
#a11y-trigger:hover{transform:translateY(-50%);background:#ee5307}
#a11y-trigger svg{width:30px;height:30px;flex-shrink:0}
/* Smaller tab: slide in once, keep its edge fixed during hover. */
#a11y-trigger{width:36px;height:72px;border:0;border-radius:0 36px 36px 0;padding:0 5px 0 1px;animation:nyx-a11y-tab-enter .55s .25s both cubic-bezier(.22,1,.36,1);transition:background-color .2s}
#a11y-trigger:hover,#a11y-trigger:focus-visible{border:0;transform:translateY(-50%);box-shadow:none}
#a11y-trigger svg{width:27px;height:27px}
#a11y-trigger:hover svg{animation:nyx-a11y-icon-nod .45s ease-in-out}
@keyframes nyx-a11y-tab-enter{from{transform:translate(-100%,-50%)}to{transform:translate(0,-50%)}}
@keyframes nyx-a11y-icon-nod{0%,100%{transform:rotate(0)}35%{transform:rotate(-9deg)}70%{transform:rotate(7deg)}}
@media(prefers-reduced-motion:reduce){#a11y-trigger,#a11y-trigger:hover svg{animation:none}}
/* Compact NYX yellow tab with a centered black symbol. */
#a11y-trigger,#a11y-trigger:hover,#a11y-trigger:focus-visible{width:30px;height:60px;padding:0;border:0;border-radius:0 30px 30px 0;background:#ffed00;color:#121212;display:flex;align-items:center;justify-content:center}
#a11y-trigger svg{width:24px;height:24px;stroke:#121212;fill:none;margin:0}
#a11y-trigger svg path{stroke:#121212;fill:none}
@media(max-width:767px){#a11y-trigger{display:none}}
/* Flatten the tab vertically to reduce empty space around the symbol. */
#a11y-trigger,#a11y-trigger:hover,#a11y-trigger:focus-visible{width:30px;height:42px;border-radius:0 30px 30px 0 / 0 21px 21px 0}
/* Rectangular edge tab with rounded right corners. */
#a11y-trigger,#a11y-trigger:hover,#a11y-trigger:focus-visible{width:36px;height:42px;border-radius:0 10px 10px 0}
#a11y-trigger svg{width:30px;height:30px}
