/*--------------------------------------------------------------
# ADA Compliance Accessibility Enhancements
--------------------------------------------------------------*/

/* Skip Link for keyboard navigation */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    z-index: 999999;
    color: #fff;
    background-color: #4154f1;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
}

.skip-link:focus {
    top: 6px;
    color: #fff;
    outline: 2px solid #fff;
}

/* Screen reader only text */
.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;
}

.sr-only-focusable:focus {
    position: static !important;
    width: auto !important;
    height: auto !important;
    padding: inherit !important;
    margin: inherit !important;
    overflow: visible !important;
    clip: auto !important;
    white-space: normal !important;
}

/* Enhanced focus indicators - using site colors */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus,
.btn:focus {
    outline: 2px solid #4154f1;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(65, 84, 241, 0.25);
}

/* Maintain original link styling for design consistency */
/* Links are accessible with proper color contrast already in style.css */
/* Only force underline on focus for clarity */
a:not(.navbar a):not(.navbar-mobile a):not(.logo):focus {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-decoration-skip-ink: auto;
}

/* Improved button accessibility */
/* Ensure buttons meet WCAG 2.1 Level AA touch target sizes (44x44px) */
/* BUT preserve existing button styling from the original design */
.btn, button, input[type="button"], input[type="submit"] {
    cursor: pointer;
    /* Removed hardcoded min-height/width to preserve existing button designs */
}

.btn:focus {
    border-color: #4154f1;
}

/* Table accessibility improvements - minimal styling */
/* Tables should maintain proper semantics without heavy visual overrides */
table {
    border-collapse: collapse;
    width: 100%;
}

/* Only add minimal padding and semantic improvements */
th {
    font-weight: bold;
    text-align: left;
}

/* GridView accessibility improvements */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Form accessibility - minimal overrides */
/* Only enhance accessibility without changing visual design */
label {
    /* Let existing form styles handle layout */
    font-weight: 500;
}

/* Visual indicator for required fields */
input[required], 
textarea[required], 
select[required] {
    /* Subtle left border to indicate required fields */
    border-left-width: 3px;
    border-left-color: #4154f1;
}

/* Error states */
.error, .field-validation-error {
    color: #d63384;
    font-weight: bold;
}

.input-validation-error {
    border-color: #d63384;
}

/* Navigation accessibility - minimal overrides to preserve design */
/* The main navigation styling is handled in style.css */
/* These rules only enhance focus and keyboard navigation */

/* Ensure dropdowns work with keyboard navigation */
.navbar .dropdown a:focus + ul {
    opacity: 1;
    top: 100%;
    visibility: visible;
}

/* Mobile accessibility */
@media (max-width: 768px) {
    /* Ensure adequate touch targets on mobile for interactive elements */
    nav[role="navigation"] a {
        padding: 15px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    a {
        text-decoration: underline;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Print accessibility */
@media print {
    .skip-link,
    .back-to-top {
        display: none !important;
    }
    
    a::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
}

/* Color contrast improvements */
.text-muted {
    color: #6c757d !important;
}

.bg-light {
    background-color: #f8f9fa !important;
    color: #212529 !important;
}

.bg-dark {
    background-color: #212529 !important;
    color: #ffffff !important;
}

/* GridView accessibility improvements */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Bootstrap table enhancements for accessibility */
.table thead th {
    vertical-align: bottom;
}

.table tbody + tbody {
    border-top: 2px solid #dee2e6;
}

/* Social links accessibility */
.social-links a {
    display: inline-block;
    min-height: 44px;
    min-width: 44px;
    text-align: center;
    line-height: 44px;
    margin: 0 5px;
}

.social-links a:focus,
.social-links a:hover {
    transform: none;
    outline: 2px solid #4154f1;
    outline-offset: 2px;
}

/* Additional accessibility improvements */
/* Preserve responsive behavior without forcing max-width */
/* The img-fluid class from Bootstrap handles responsive images */

/* Improve official photos styling */
.official {
    border: 2px solid #ccc;
    border-radius: 4px;
    margin: 10px;
    max-width: 200px;
}

/* Center alignment utility that's accessible */
.text-center {
    text-align: center;
}

/* Improve list styling for better readability in content areas */
/* Navigation lists are handled by style.css */
.inner-page ul:not(.navbar ul):not(.dropdown ul), 
.inner-page ol:not(.navbar ul):not(.dropdown ul),
.entry-content ul,
.entry-content ol {
    padding-left: 1.5em;
    line-height: 1.6;
}

.inner-page li:not(.navbar li):not(.dropdown li),
.entry-content li {
    margin-bottom: 0.5em;
}

/* Better spacing for content sections */
.inner-page p {
    margin-bottom: 1em;
    line-height: 1.6;
}

/* Improve form field visibility */
.form-control:focus {
    border-color: #4154f1;
    box-shadow: 0 0 0 0.2rem rgba(65, 84, 241, 0.25);
}

/* Ensure adequate spacing for touch targets on mobile */
/* Let existing button styles handle sizing */
@media (max-width: 768px) {
    /* Only adjust form controls if needed */
    input[type="text"], 
    input[type="email"], 
    textarea {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Table readability - let Bootstrap handle the styling */
/* Only ensure semantic improvements without overriding visual design */

/* Improve visibility of current page in breadcrumbs */
.breadcrumbs nav[aria-label="Breadcrumb"] ol li[aria-current="page"] {
    color: #fff !important;
    font-weight: 600;
}

/* Mobile Navigation Enhancements */
.mobile-nav-toggle {
    z-index: 9999;
}

.mobile-nav-toggle:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Ensure mobile navbar is above other content */
.navbar-mobile {
    z-index: 9998 !important;
}

/* Mobile navigation links - ensure proper touch targets */
@media (max-width: 991px) {
    .navbar-mobile a {
        min-height: 44px;
        display: flex;
        align-items: center;
        text-decoration: none !important;
    }
    
    .navbar-mobile .dropdown > a {
        cursor: pointer;
    }
    
    /* Ensure dropdown icons are visible on mobile */
    .navbar-mobile .dropdown > a i {
        margin-left: auto;
    }
}

/* Improve contrast for clock icons */
.entry-meta .bi-clock,
.bi-clock {
    color: #333 !important;
}

/* Ensure footer text and links have high contrast */
#footer a,
#footer p,
#footer .copyright {
    color: #333 !important;
}

#footer a:hover {
    color: #4154f1 !important;
}

/* Ensure sidebar links have high contrast */
.sidebar a {
    color: #4154f1 !important;
}

.sidebar a:hover {
    color: #333 !important;
}

/* Ensure all text has high contrast */
body,
p,
h1, h2, h3, h4, h5, h6,
.entry-content,
.sidebar-title,
.entry-meta,
.entry-meta li {
    /* color: #333 !important;*/
}

/* Ensure back-to-top button is visible on desktop */
.back-to-top {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Override for dark backgrounds like breadcrumbs */
.breadcrumbs li[aria-current="page"] {
    color: #fff !important;
}