﻿/**
 * Pragyan CMS Accessibility Stylesheet
 * Standardized for WCAG 2.1/2.2 Level AA & GIGW 3.0 Compliance
 * Supports: Screen readers, Low-vision visitors, Keyboard navigation, High-contrast mode
 */

/* ==========================================================================
   1. Skip to Main Content Link (Off-screen until keyboard focused)
   ========================================================================== */
.skip-to-content {
    position: absolute;
    top: -100px;
    left: 15px;
    z-index: 999999;
    padding: 12px 20px;
    background-color: #012951;
    color: #ffffff !important;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none !important;
    border: 3px solid #ffbf47;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: top 0.2s ease-in-out;
}

.skip-to-content:focus,
.skip-to-content:focus-visible {
    top: 0;
    outline: 3px solid #ffbf47 !important;
    outline-offset: 2px;
}

/* ==========================================================================
   2. Screen Reader Only Utility (.sr-only)
   ========================================================================== */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ==========================================================================
   3. Focus Indicator (:focus-visible) for Keyboard Navigation
   ========================================================================== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid #ea6645 !important;
    outline-offset: 2px !important;
}

/* ==========================================================================
   4. Accessibility Toolbar Styles
   ========================================================================== */
.accessibility-bar {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
    vertical-align: middle;
}

.accessibility-bar li {
    display: inline-block;
    margin: 0 2px;
}

.access-btn {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 3px;
    padding: 2px 7px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    cursor: pointer;
    text-decoration: none !important;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.access-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: #ffffff;
    color: #ffffff !important;
}

.access-btn.active {
    background: #ea6645 !important;
    border-color: #ffffff !important;
    color: #ffffff !important;
}

.access-btn:focus-visible {
    outline: 2px solid #ffbf47 !important;
    outline-offset: 1px;
}

/* Screen Reader TTS Floating Control Indicator */
#tts-status-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #011c38;
    color: #ffffff;
    border: 2px solid #ea6645;
    border-radius: 8px;
    padding: 12px 18px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 99999;
    display: none;
    align-items: center;
    gap: 12px;
    font-family: inherit;
    font-size: 14px;
}

#tts-status-toast.tts-active {
    display: flex;
}

#tts-status-toast button {
    background: #ea6645;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 4px 10px;
    cursor: pointer;
    font-weight: bold;
}

#tts-status-toast button:hover {
    background: #d45535;
}

/* ==========================================================================
   5. Font Scaling Classes (Applied to <html> or <body>)
   ========================================================================== */
html.font-scale-sm {
    font-size: 90% !important;
}

html.font-scale-md {
    font-size: 100% !important;
}

html.font-scale-lg {
    font-size: 115% !important;
}

html.font-scale-xl {
    font-size: 130% !important;
}

html.font-scale-sm body {
    zoom: 90%;
}

html.font-scale-md body {
    zoom: 100%;
}

html.font-scale-lg body {
    zoom: 115%;
}

html.font-scale-xl body {
    zoom: 130%;
}

/* ==========================================================================
   6. High Contrast Mode (WCAG AAA standard - Yellow on Black & High Contrast)
   ========================================================================== */
html.high-contrast,
html.high-contrast body {
    background-color: #000000 !important;
    color: #ffff00 !important;
}

html.high-contrast #wrapper,
html.high-contrast .navigation-wrapper,
html.high-contrast .secondary-navigation-wrapper,
html.high-contrast .secondary-nav-inner,
html.high-contrast .primary-navigation-wrapper,
html.high-contrast header,
html.high-contrast nav,
html.high-contrast .main-nav,
html.high-contrast .nav-list,
html.high-contrast main,
html.high-contrast section,
html.high-contrast footer,
html.high-contrast #page-footer,
html.high-contrast #footer-bottom,
html.high-contrast #footer-content,
html.high-contrast .footer-grid,
html.high-contrast .footer-col,
html.high-contrast #main-view,
html.high-contrast #contentcontainer,
html.high-contrast .inner-content,
html.high-contrast .inner-sidebar,
html.high-contrast .inner-page-grid,
html.high-contrast #leftNav,
html.high-contrast #leftNavContent,
html.high-contrast .widget,
html.high-contrast .dropdown-menu,
html.high-contrast .mega-menu,
html.high-contrast .panel,
html.high-contrast .card,
html.high-contrast table,
html.high-contrast tr,
html.high-contrast td,
html.high-contrast th {
    background: #000000 !important;
    background-color: #000000 !important;
    color: #ffff00 !important;
    border-color: #ffff00 !important;
}

html.high-contrast a,
html.high-contrast a:link,
html.high-contrast a:visited {
    color: #00ffff !important;
    text-decoration: underline !important;
}

html.high-contrast a:hover,
html.high-contrast a:focus {
    color: #ffffff !important;
    background-color: #000080 !important;
}

html.high-contrast h1,
html.high-contrast h2,
html.high-contrast h3,
html.high-contrast h4,
html.high-contrast h5,
html.high-contrast h6,
html.high-contrast p,
html.high-contrast span,
html.high-contrast li,
html.high-contrast label,
html.high-contrast dt,
html.high-contrast dd {
    color: #ffff00 !important;
}

html.high-contrast input,
html.high-contrast select,
html.high-contrast textarea,
html.high-contrast button {
    background-color: #000000 !important;
    color: #ffff00 !important;
    border: 2px solid #ffff00 !important;
}

html.high-contrast input:focus,
html.high-contrast select:focus,
html.high-contrast textarea:focus,
html.high-contrast button:focus {
    outline: 3px solid #00ffff !important;
    background-color: #111111 !important;
}

html.high-contrast .access-btn {
    background: #000000 !important;
    color: #ffff00 !important;
    border: 1px solid #ffff00 !important;
}

html.high-contrast .access-btn.active {
    background: #ffff00 !important;
    color: #000000 !important;
}

html.high-contrast img {
    filter: contrast(120%);
    border: 1px solid #ffff00;
}

html.high-contrast hr {
    border-color: #ffff00 !important;
}
