/* ============================================
   ACCESSIBILITY STYLES - ASI Jodhpur Circle
   WCAG 2.1 AA Compliance
   ============================================ */

/* --- Global overrides (fix normalize.css 14px and font-family) --- */
body {
    font-family: 'Source Sans Pro', 'source_sans_proregular', sans-serif !important;
}
a, li a, .footer a, footer a, .footer-link-row2 a,
.side-link-box1 a, .side-link-box2 a, .top-link a,
.contact-info a, .nav-bar a, #main a {
    text-decoration: none !important;
    font-size: inherit !important;
    font-family: inherit !important;
}
a:hover, a:focus {
    text-decoration: none !important;
}
h1, h2, h3 {
    font-family: 'Playfair Display', 'Source Sans Pro', serif !important;
}
p, li, td, th, span, div {
    font-family: 'Source Sans Pro', 'source_sans_proregular', sans-serif;
}

/* --- Screen Reader Only (visually hidden but readable) --- */
.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;
}

/* --- Skip Navigation Links --- */
.skip-nav {
    position: absolute;
    top: -100%;
    left: 10px;
    background: #B45833;
    color: #fff;
    padding: 12px 20px;
    z-index: 100000;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.skip-nav:focus {
    top: 0;
    outline: 3px solid #FFD700;
    outline-offset: 2px;
    color: #fff;
    text-decoration: none;
}

/* --- Focus Indicators (WCAG 2.4.7) --- */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus,
[tabindex]:focus {
    outline: 3px solid #FFD700 !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.3) !important;
}

/* --- Accessibility Toolbar --- */
#accessibility-toolbar {
    background: #2c2c2c;
    color: #fff;
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 2px solid #B45833;
    position: relative;
    z-index: 10000;
}
.a11y-toolbar-inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 15px;
}
.a11y-label {
    font-weight: 600;
    margin-right: 6px;
    font-size: 13px;
    color: #fff;
}
.a11y-label i {
    font-size: 16px;
    margin-right: 4px;
}
.a11y-separator {
    color: #666;
    margin: 0 4px;
}
#accessibility-toolbar button {
    background: #444;
    color: #fff;
    border: 1px solid #666;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.2s ease, transform 0.1s ease;
    line-height: 1.4;
}
#accessibility-toolbar button:hover {
    background: #B45833;
    border-color: #B45833;
}
#accessibility-toolbar button:focus {
    outline: 2px solid #FFD700 !important;
    outline-offset: 1px !important;
}
#accessibility-toolbar button.active {
    background: #B45833;
    border-color: #FFD700;
    box-shadow: 0 0 0 2px #FFD700;
}
#btn-font-decrease { font-size: 11px; }
#btn-font-default { font-size: 13px; }
#btn-font-increase { font-size: 15px; font-weight: 700; }

/* --- Font Size Modes --- */
body.font-size-large {
    font-size: 118% !important;
}
body.font-size-large p,
body.font-size-large li,
body.font-size-large a,
body.font-size-large td,
body.font-size-large th,
body.font-size-large span,
body.font-size-large div {
    font-size: 118% !important;
    line-height: 1.6 !important;
}
body.font-size-largest {
    font-size: 136% !important;
}
body.font-size-largest p,
body.font-size-largest li,
body.font-size-largest a,
body.font-size-largest td,
body.font-size-largest th,
body.font-size-largest span,
body.font-size-largest div {
    font-size: 136% !important;
    line-height: 1.7 !important;
}

/* --- High Contrast Mode (WCAG 1.4.3 / 1.4.6) --- */
body.high-contrast {
    background: #fff !important;
    color: #000 !important;
}
body.high-contrast p,
body.high-contrast li,
body.high-contrast a,
body.high-contrast span,
body.high-contrast div,
body.high-contrast td,
body.high-contrast th,
body.high-contrast h1,
body.high-contrast h2,
body.high-contrast h3,
body.high-contrast h4,
body.high-contrast h5,
body.high-contrast h6 {
    color: #000 !important;
}
body.high-contrast a {
    color: #0000CC !important;
    text-decoration: underline !important;
    font-weight: 700 !important;
}
body.high-contrast a:hover,
body.high-contrast a:focus {
    color: #CC0000 !important;
}
body.high-contrast .nav-bar,
body.high-contrast .menu {
    background: #000 !important;
}
body.high-contrast .nav-bar a,
body.high-contrast .menu a {
    color: #FFD700 !important;
}
body.high-contrast .nav-bar a:hover,
body.high-contrast .menu a:hover {
    color: #fff !important;
    background: #333 !important;
}
body.high-contrast .header,
body.high-contrast header {
    background: #fff !important;
    border-bottom: 3px solid #000 !important;
}
body.high-contrast .footer,
body.high-contrast footer {
    background: #000 !important;
    color: #fff !important;
}
body.high-contrast footer a {
    color: #FFD700 !important;
}
body.high-contrast .side-link-box1,
body.high-contrast .side-link-box2 {
    background: #fff !important;
    border: 2px solid #000 !important;
}
body.high-contrast .side-link-box1 a,
body.high-contrast .side-link-box2 a {
    color: #000 !important;
}
body.high-contrast img {
    border: 2px solid #000 !important;
}
body.high-contrast #accessibility-toolbar {
    background: #000 !important;
    border-bottom: 3px solid #FFD700 !important;
}
body.high-contrast #accessibility-toolbar button {
    background: #333 !important;
    color: #FFD700 !important;
    border-color: #FFD700 !important;
}

/* --- Dark Mode --- */
body.dark-mode {
    background: #1a1a2e !important;
    color: #e0e0e0 !important;
}
body.dark-mode p,
body.dark-mode li,
body.dark-mode span,
body.dark-mode div,
body.dark-mode td,
body.dark-mode th {
    color: #e0e0e0 !important;
}
body.dark-mode a {
    color: #7cb3ff !important;
}
body.dark-mode a:hover {
    color: #FFD700 !important;
}
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4 {
    color: #FFD700 !important;
}
body.dark-mode .header,
body.dark-mode header {
    background: #16213e !important;
}
body.dark-mode .nav-bar,
body.dark-mode .menu {
    background: #0f3460 !important;
}
body.dark-mode .nav-bar a {
    color: #e0e0e0 !important;
}
body.dark-mode .nav-bar a:hover {
    color: #FFD700 !important;
}
body.dark-mode .footer,
body.dark-mode footer {
    background: #0a0a1a !important;
    color: #ccc !important;
}
body.dark-mode footer a {
    color: #7cb3ff !important;
}
body.dark-mode .right-sidebar {
    background: #16213e !important;
}
body.dark-mode .side-link-box1,
body.dark-mode .side-link-box2 {
    background: #16213e !important;
    border-color: #0f3460 !important;
}
body.dark-mode .side-link-box1 a,
body.dark-mode .side-link-box2 a {
    color: #e0e0e0 !important;
}
body.dark-mode .side-link-box2 {
    color: #e0e0e0 !important;
}
body.dark-mode #accessibility-toolbar {
    background: #0a0a1a !important;
}
body.dark-mode .container {
    background: transparent !important;
}
body.dark-mode .middle-part {
    background: #1a1a2e !important;
}
body.dark-mode .districthead {
    background: #0f3460 !important;
    color: #e0e0e0 !important;
}
body.dark-mode .districtlist {
    background: #16213e !important;
    border-color: #0f3460 !important;
}
body.dark-mode .districtlist a {
    color: #e0e0e0 !important;
}
body.dark-mode .marquee_back {
    background: #0f3460 !important;
}

/* --- Screen Reader Helper Mode --- */
body.screen-reader-mode *:focus {
    outline: 4px solid #FF0000 !important;
    outline-offset: 4px !important;
    box-shadow: 0 0 0 6px rgba(255, 0, 0, 0.3) !important;
}
body.screen-reader-mode a,
body.screen-reader-mode button {
    text-decoration: underline !important;
}

/* --- Live Region for Screen Reader Announcements --- */
#a11y-announcer {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- External Link Indicator (screen reader only) --- */
a[target="_blank"]::after {
    content: " (opens in new window)";
    font-size: 0;
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

/* --- Better Link Spacing for Touch/Motor (sidebar only) --- */
.side-link-box1 ul li a {
    min-height: 38px;
    display: flex;
    align-items: center;
}

/* Images without alt - no visible indicator on production */

/* --- Back to Top Button --- */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 46px;
    height: 46px;
    background: linear-gradient(135deg, #8B1A1A, #A0023D);
    color: #fff !important;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    z-index: 9999;
    box-shadow: 0 4px 15px rgba(160,2,61,0.4);
    transition: all 0.3s ease;
}
#back-to-top:hover {
    background: linear-gradient(135deg, #A0023D, #c9325e);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(160,2,61,0.5);
}
#back-to-top.visible {
    display: flex;
}

/* --- Responsive Toolbar --- */
@media (max-width: 768px) {
    .a11y-toolbar-inner {
        justify-content: center;
    }
    .a11y-separator {
        display: none;
    }
    #accessibility-toolbar button {
        padding: 6px 8px;
        font-size: 11px;
    }
}
