/* ============================================================================
   Institutional Accessibility Suite (WCAG 2.1 AA & GIGW Standards)
   Swami Ramanand Bharati Vidyamandir & Junior College, Tasgaon
   ============================================================================ */

/* 1. Skip to Content (Screen Reader & Keyboard Accessibility) */
.a11y-skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    background: #000000;
    color: #ffd54f !important;
    padding: 10px 18px;
    font-weight: 800;
    font-size: 0.95rem;
    z-index: 99999;
    border-radius: 0 0 10px 10px;
    border: 2px solid #ffd54f;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    text-decoration: none;
    transition: top 0.2s ease;
}
.a11y-skip-link:focus {
    top: 0;
    outline: 3px solid #f59e0b;
}

/* 2. Top Bar Quick Font Resizer Buttons */
.a11y-top-resizer {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50px;
    padding: 2px 4px;
    gap: 2px;
}
.a11y-top-btn {
    border: none;
    background: transparent;
    color: #ffffff;
    font-family: 'Outfit', 'Plus Jakarta Sans', system-ui, sans-serif;
    font-weight: 700;
    font-size: 0.72rem;
    padding: 2px 7px;
    border-radius: 50px;
    cursor: pointer;
    line-height: 1.2;
    transition: all 0.2s ease;
}
.a11y-top-btn:hover {
    background: var(--gold-accent, #f59e0b);
    color: #0f172a;
}
.a11y-top-btn.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.a11y-top-trigger {
    background: rgba(255, 201, 71, 0.16);
    border: 1px solid rgba(255, 201, 71, 0.45);
    color: #ffd54f !important;
    font-size: 0.76rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}
.a11y-top-trigger:hover {
    background: var(--gold-accent, #f59e0b);
    color: #0f172a !important;
    transform: translateY(-1px);
}

/* 3. Floating Accessibility Widget Trigger Button (Right Side Middle of Screen) */
.a11y-float-btn {
    position: fixed;
    top: 50%;
    right: 18px;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--navy-primary, #0A1931) 0%, var(--royal-blue, #185ADB) 100%);
    color: #ffffff;
    border: 2.5px solid var(--gold-accent, #f59e0b);
    box-shadow: 0 8px 24px rgba(10, 25, 49, 0.35), 0 0 0 3px rgba(255, 201, 71, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.55rem;
    cursor: pointer;
    z-index: 1040;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, background 0.25s ease;
}
.a11y-float-btn:hover {
    transform: translateY(-50%) scale(1.1) rotate(5deg);
    box-shadow: 0 12px 28px rgba(24, 90, 219, 0.45), 0 0 0 6px rgba(255, 201, 71, 0.35);
    color: #ffffff;
}
.a11y-float-btn:focus-visible {
    outline: 3px solid #ffd54f;
    outline-offset: 3px;
}
.a11y-float-btn .a11y-badge-pulse {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    background: #16a34a;
    border: 2px solid #ffffff;
    border-radius: 50%;
    animation: a11yPulse 2s infinite;
}
@keyframes a11yPulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7); }
    70% { transform: scale(1.15); box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

/* 3.1. Floating Theme Selector Button (Left Side Middle of Screen) */
.theme-float-btn {
    position: fixed;
    top: 50%;
    left: 18px;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--navy-primary, #0A1931) 0%, var(--royal-blue, #185ADB) 100%);
    color: var(--gold-accent, #ffd54f);
    border: 2.5px solid var(--gold-accent, #f59e0b);
    box-shadow: 0 8px 24px rgba(10, 25, 49, 0.35), 0 0 0 3px rgba(255, 201, 71, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
    cursor: pointer;
    z-index: 1040;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, background 0.25s ease;
}
.theme-float-btn:hover {
    transform: translateY(-50%) scale(1.1) rotate(-5deg);
    box-shadow: 0 12px 28px rgba(24, 90, 219, 0.45), 0 0 0 6px rgba(255, 201, 71, 0.35);
    color: #ffffff;
}
.theme-float-btn:focus-visible {
    outline: 3px solid #ffd54f;
    outline-offset: 3px;
}

/* 3.2. Scroll to Top Button (Bottom Right Corner) */
.back-to-top-btn {
    position: fixed;
    bottom: 24px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-accent, #f59e0b) 0%, #d97706 100%);
    color: #0f172a;
    border: 2px solid #ffffff;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    line-height: 1;
}
.back-to-top-btn .top-text {
    font-size: 0.62rem;
    letter-spacing: 0.05em;
    font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif;
    font-weight: 800;
    margin-top: 1px;
}
.back-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top-btn:hover {
    transform: translateY(-3px) scale(1.08);
    background: linear-gradient(135deg, #ffd54f 0%, var(--gold-accent, #f59e0b) 100%);
    box-shadow: 0 12px 28px rgba(245, 158, 11, 0.45);
    color: #000000;
}
.back-to-top-btn:focus-visible {
    outline: 3px solid #0f172a;
    outline-offset: 2px;
}

@media (max-width: 575.98px) {
    .a11y-float-btn {
        top: 50%;
        right: 10px;
        transform: translateY(-50%);
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
    }
    .a11y-float-btn:hover {
        transform: translateY(-50%) scale(1.08);
    }
    .theme-float-btn {
        top: 50%;
        left: 10px;
        transform: translateY(-50%);
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }
    .theme-float-btn:hover {
        transform: translateY(-50%) scale(1.08);
    }
    .back-to-top-btn {
        bottom: 18px;
        right: 14px;
        width: 44px;
        height: 44px;
        font-size: 0.95rem;
    }
}

/* 4. Accessibility Drawer (Offcanvas Panel) */
.a11y-offcanvas {
    width: 380px !important;
    border-left: 3px solid var(--gold-accent, #f59e0b) !important;
    background: #ffffff;
    box-shadow: -10px 0 35px rgba(10, 25, 49, 0.22);
    z-index: 1060;
}
.a11y-offcanvas .offcanvas-header {
    background: linear-gradient(135deg, var(--navy-primary, #0A1931) 0%, var(--royal-blue, #185ADB) 100%);
    color: #ffffff;
    padding: 18px 20px;
    border-bottom: 2px solid var(--gold-accent, #f59e0b);
}
.a11y-offcanvas .offcanvas-title {
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.a11y-offcanvas .offcanvas-title i {
    color: var(--gold-accent, #f59e0b);
}
.a11y-offcanvas .offcanvas-body {
    padding: 20px;
    overflow-y: auto;
}

/* Control Tiles inside Drawer */
.a11y-section-title {
    font-family: 'Outfit', 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #64748b;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.a11y-section-title i {
    color: var(--royal-blue, #185ADB);
    font-size: 0.88rem;
}

.a11y-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 18px;
}
.a11y-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 18px;
}
.a11y-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 18px;
}

.a11y-card-btn {
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 12px;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.76rem;
    font-weight: 700;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 4px;
    min-height: 64px;
}
.a11y-card-btn i {
    font-size: 1.15rem;
    color: var(--royal-blue, #185ADB);
    transition: transform 0.2s ease;
}
.a11y-card-btn:hover {
    border-color: var(--royal-blue, #185ADB);
    background: #eff6ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(24, 90, 219, 0.12);
}
.a11y-card-btn.active {
    border-color: var(--royal-blue, #185ADB);
    background: #eff6ff;
    color: var(--royal-blue, #185ADB);
    box-shadow: 0 0 0 2px rgba(24, 90, 219, 0.25);
}
.a11y-card-btn.active i {
    color: var(--royal-blue, #185ADB);
}

/* 5. Reading Guide Line */
#a11y-reading-guide-line {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    height: 10px;
    background: rgba(255, 201, 71, 0.55);
    border-top: 2px solid #d97706;
    border-bottom: 2px solid #d97706;
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.45);
    pointer-events: none;
    z-index: 99998;
    transform: translateY(-5px);
}
body.a11y-reading-guide-active #a11y-reading-guide-line {
    display: block;
}

/* 6. Active Modifier Classes Applied to HTML or Body */

/* Font Sizing */
html.a11y-size-sm { font-size: 88% !important; }
html.a11y-size-normal { font-size: 100% !important; }
html.a11y-size-md { font-size: 114% !important; }
html.a11y-size-lg { font-size: 128% !important; }

/* High Contrast Mode (WCAG AAA Compliance: Black background, Yellow text) */
html.a11y-mode-high-contrast body {
    background-color: #000000 !important;
    color: #ffff00 !important;
}
html.a11y-mode-high-contrast .top-utility-bar,
html.a11y-mode-high-contrast .school-brand-header,
html.a11y-mode-high-contrast .main-navbar,
html.a11y-mode-high-contrast .site-footer,
html.a11y-mode-high-contrast .premium-card,
html.a11y-mode-high-contrast .cms-card,
html.a11y-mode-high-contrast .notice-board-card,
html.a11y-mode-high-contrast .modal-content,
html.a11y-mode-high-contrast .dropdown-menu {
    background: #000000 !important;
    color: #ffff00 !important;
    border: 2px solid #ffff00 !important;
    box-shadow: none !important;
}
html.a11y-mode-high-contrast a,
html.a11y-mode-high-contrast h1,
html.a11y-mode-high-contrast h2,
html.a11y-mode-high-contrast h3,
html.a11y-mode-high-contrast h4,
html.a11y-mode-high-contrast h5,
html.a11y-mode-high-contrast h6,
html.a11y-mode-high-contrast p,
html.a11y-mode-high-contrast span,
html.a11y-mode-high-contrast li,
html.a11y-mode-high-contrast td,
html.a11y-mode-high-contrast th {
    color: #ffff00 !important;
    text-shadow: none !important;
}
html.a11y-mode-high-contrast .btn {
    background: #ffff00 !important;
    color: #000000 !important;
    border: 2px solid #ffff00 !important;
    font-weight: 800 !important;
}

/* Grayscale Mode */
html.a11y-mode-grayscale {
    filter: grayscale(100%) !important;
}

/* Invert Colors Mode */
html.a11y-mode-invert {
    filter: invert(100%) hue-rotate(180deg) !important;
}
html.a11y-mode-invert img,
html.a11y-mode-invert video,
html.a11y-mode-invert iframe {
    filter: invert(100%) hue-rotate(180deg) !important;
}

/* Dyslexia Friendly Font */
html.a11y-font-dyslexia,
html.a11y-font-dyslexia body,
html.a11y-font-dyslexia h1,
html.a11y-font-dyslexia h2,
html.a11y-font-dyslexia h3,
html.a11y-font-dyslexia h4,
html.a11y-font-dyslexia h5,
html.a11y-font-dyslexia h6,
html.a11y-font-dyslexia p,
html.a11y-font-dyslexia span,
html.a11y-font-dyslexia a,
html.a11y-font-dyslexia li {
    font-family: 'OpenDyslexic', 'Comic Sans MS', 'Verdana', system-ui, sans-serif !important;
}

/* Increased Letter Spacing */
html.a11y-spacing-active,
html.a11y-spacing-active body,
html.a11y-spacing-active p,
html.a11y-spacing-active span,
html.a11y-spacing-active a,
html.a11y-spacing-active li {
    letter-spacing: 0.08em !important;
    word-spacing: 0.16em !important;
}

/* Increased Line Height */
html.a11y-line-height-active,
html.a11y-line-height-active body,
html.a11y-line-height-active p,
html.a11y-line-height-active span,
html.a11y-line-height-active li {
    line-height: 1.95 !important;
}

/* Highlight All Links */
html.a11y-links-highlighted a {
    text-decoration: underline 3px #f59e0b !important;
    text-underline-offset: 4px !important;
    background-color: rgba(254, 240, 138, 0.22) !important;
    color: #185adb !important;
    font-weight: 700 !important;
}

/* Big High-Visibility Cursor */
html.a11y-cursor-big,
html.a11y-cursor-big body,
html.a11y-cursor-big * {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="38" height="38" viewBox="0 0 24 24" fill="%230A1931" stroke="%23FFC947" stroke-width="2"><polygon points="0 0 0 20 5.5 15 10 24 13.5 22.5 9 13.5 15.5 13.5 0 0"/></svg>'), default !important;
}

/* Stop Animations & Motion */
html.a11y-stop-motion *,
html.a11y-stop-motion *::before,
html.a11y-stop-motion *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
    scroll-behavior: auto !important;
}

