/* ==========================================================================
   JNARDDC Accessibility Panel (UX4G / GIGW style)
   Used by Site1.Master (English) and Site2.Master (Hindi) with js/a11y-widget.js
   ========================================================================== */

/* ---------- Header trigger (top bar) ---------- */
.a11y-header-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 2px 10px;
    margin-left: 10px;
    border: 1px solid #00507a;
    border-radius: 4px;
    background: #f0f0f0;
    color: #002f4b;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

    .a11y-header-btn:hover,
    .a11y-header-btn:focus-visible {
        background: #002f4b;
        color: #fff;
    }

    .a11y-header-btn .fa-universal-access {
        font-size: 18px;
    }

/* ---------- Floating side trigger ---------- */
.a11y-fab {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10040;
    width: 48px;
    height: 48px;
    border: 2px solid #fff;
    border-right: 0;
    border-radius: 8px 0 0 8px;
    background: #002f4b;
    color: #fff;
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .3);
}

    .a11y-fab:hover,
    .a11y-fab:focus-visible {
        background: #00507a;
    }

/* ---------- Backdrop + panel ---------- */
#a11yWidget .a11y-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10050;
    background: rgba(0, 0, 0, .35);
}

#a11yWidget .a11y-panel {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 10060;
    width: 420px;
    width: min(420px, 100vw);
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    background: #f3f5fa;
    color: #1b1b1b;
    box-shadow: -4px 0 24px rgba(0, 0, 0, .3);
    transform: translateX(105%);
    transition: transform .25s ease;
    visibility: hidden;
}

#a11yWidget.a11y-open .a11y-panel {
    transform: translateX(0);
    visibility: visible;
}

#a11yWidget .a11y-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: linear-gradient(to right, #002f4b, #00507a);
    color: #fff;
}

#a11yWidget .a11y-title {
    margin: 0;
    flex: 1;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

#a11yWidget .a11y-kbd {
    padding: 4px 10px;
    border-radius: 14px;
    background: #fff;
    color: #002f4b;
    font-size: 12px;
    font-weight: 700;
    font-family: inherit;
}

#a11yWidget .a11y-close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
}

    #a11yWidget .a11y-close:hover,
    #a11yWidget .a11y-close:focus-visible {
        background: rgba(255, 255, 255, .2);
        outline: 2px solid #fff;
        outline-offset: 1px;
    }

#a11yWidget .a11y-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
}

#a11yWidget .a11y-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

#a11yWidget .a11y-tile {
    position: relative;
    width: 100%;
    min-height: 96px;
    padding: 12px 6px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 2px solid transparent;
    border-radius: 10px;
    background: #fff;
    color: #1b1b1b;
    font-size: 13px;
    line-height: 1.25;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

    #a11yWidget .a11y-tile:hover {
        border-color: #9bb4c9;
    }

    #a11yWidget .a11y-tile:focus-visible {
        outline: 3px solid #f59e0b;
        outline-offset: 2px;
    }

    #a11yWidget .a11y-tile[aria-pressed="true"] {
        border-color: #00507a;
        background: #e3eef7;
    }

    #a11yWidget .a11y-tile:disabled {
        cursor: not-allowed;
        opacity: .45;
    }

#a11yWidget .a11y-tile-icon {
    font-size: 24px;
    line-height: 1;
    color: #002f4b;
    font-weight: 700;
}

#a11yWidget .a11y-tile-check {
    position: absolute;
    top: 6px;
    right: 6px;
    color: #00507a;
    font-size: 15px;
    display: none;
}

#a11yWidget .a11y-tile[aria-pressed="true"] .a11y-tile-check {
    display: block;
}

#a11yWidget .a11y-dots {
    display: flex;
    gap: 4px;
    position: absolute;
    bottom: 6px;
}

    #a11yWidget .a11y-dots span {
        width: 14px;
        height: 4px;
        border-radius: 2px;
        background: #cfd8e3;
    }

        #a11yWidget .a11y-dots span.on {
            background: #00507a;
        }

#a11yWidget .a11y-foot {
    padding: 12px 16px;
    border-top: 1px solid #dde3ec;
    background: #fff;
}

#a11yWidget .a11y-reset {
    width: 100%;
    min-height: 44px;
    border: 0;
    border-radius: 8px;
    background: #002f4b;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

    #a11yWidget .a11y-reset:hover,
    #a11yWidget .a11y-reset:focus-visible {
        background: #00507a;
    }

#a11yWidget .a11y-sr {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
}

/* The panel keeps its own typography whatever the page settings are */
#a11yWidget,
#a11yWidget * {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", Arial, sans-serif !important;
    letter-spacing: normal !important;
    word-spacing: normal !important;
    box-sizing: border-box;
}

    #a11yWidget .a11y-tile-icon.fa-solid,
    #a11yWidget .fa-solid {
        font-family: "Font Awesome 6 Free" !important;
    }

#a11yWidget .a11y-grid,
#a11yWidget .a11y-tile {
    line-height: 1.25 !important;
}

/* Phones: floating button at the bottom-right so it never covers the menu button or headings */
@media (max-width: 767.98px) {
    .a11y-fab {
        top: auto;
        bottom: 84px;
        transform: none;
    }
}

@media (max-width: 480px) {
    #a11yWidget .a11y-tile {
        min-height: 88px;
        font-size: 12px;
    }

    .a11y-fab {
        width: 42px;
        height: 42px;
        font-size: 22px;
    }
}

/* ==========================================================================
   Page adjustments applied by the panel (classes on <html>)
   ========================================================================== */

/* Text spacing */
html.a11y-spacing-1 body *:not(i) { letter-spacing: .05em !important; word-spacing: .1em !important; }
html.a11y-spacing-2 body *:not(i) { letter-spacing: .1em !important; word-spacing: .2em !important; }
html.a11y-spacing-3 body *:not(i) { letter-spacing: .15em !important; word-spacing: .3em !important; }

/* Line height */
html.a11y-lh-1 body * { line-height: 1.6 !important; }
html.a11y-lh-2 body * { line-height: 1.9 !important; }
html.a11y-lh-3 body * { line-height: 2.2 !important; }

/* Dyslexia friendly font (icon fonts are left alone) */
html.a11y-dyslexia body *:not(i):not([class*="fa-"]) {
    font-family: "OpenDyslexic", "Comic Sans MS", "Verdana", "Noto Sans Devanagari", sans-serif !important;
    font-style: normal !important;
}

html.a11y-dyslexia body p,
html.a11y-dyslexia body li,
html.a11y-dyslexia body td {
    letter-spacing: .04em;
    word-spacing: .12em;
}

/* Highlight links */
html.a11y-links body a:not(#a11yWidget a) {
    text-decoration: underline !important;
    text-underline-offset: 3px;
    background-color: #fff200 !important;
    color: #000 !important;
    outline: 2px solid #000;
    outline-offset: 1px;
}

    html.a11y-links body a:not(#a11yWidget a) * {
        color: #000 !important;
    }

/* Big cursor */
html.a11y-cursor,
html.a11y-cursor body * {
    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='M6 3 L6 41 L16 31 L23 46 L30 43 L23 28 L37 28 Z' fill='%23000' stroke='%23fff' stroke-width='3' stroke-linejoin='round'/%3E%3C/svg%3E") 6 3, auto !important;
}

/* Pause animations */
html.a11y-pause *,
html.a11y-pause *::before,
html.a11y-pause *::after {
    animation-play-state: paused !important;
    transition: none !important;
    scroll-behavior: auto !important;
}

/* Hide images */
html.a11y-hide-img body img:not(#a11yWidget img),
html.a11y-hide-img body picture,
html.a11y-hide-img body video,
html.a11y-hide-img body [role="img"] {
    visibility: hidden !important;
}

html.a11y-hide-img body *:not(#a11yWidget *) {
    background-image: none !important;
}

/* Invert colours: keep photos and videos looking natural */
html.a11y-invert body img,
html.a11y-invert body video,
html.a11y-invert body picture,
html.a11y-invert body iframe {
    filter: invert(1) hue-rotate(180deg);
}

/* Text to speech: outline the text that will be read on click */
html.a11y-tts body :is(p, h1, h2, h3, h4, h5, h6, li, td, th, dt, dd, figcaption, a, button, label, img, [role="tab"], [role="menuitem"], [role="button"]):not(#a11yWidget *):hover {
    outline: 2px dashed #00507a;
    outline-offset: 2px;
    cursor: pointer;
}

/* ADHD reading mask */
.a11y-mask {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 10030;
    background: rgba(0, 0, 0, .6);
    pointer-events: none;
}

.a11y-mask-top { top: 0; }
.a11y-mask-bottom { bottom: 0; }

.a11y-mask-line {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 10031;
    height: 3px;
    background: #f59e0b;
    pointer-events: none;
}

@media print {
    #a11yWidget,
    .a11y-fab,
    .a11y-header-btn,
    .a11y-mask,
    .a11y-mask-line {
        display: none !important;
    }
}
