/* 
   Accessibility Stylesheet
   Ensures WCAG 2.1 Level AA Compliance
*/

/* Screen Reader Only Content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Skip Navigation Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000034;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
    border-radius: 0 0 4px 0;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid #FFD700;
    outline-offset: 2px;
}

/* Enhanced Focus Visibility for Keyboard Navigation */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 3px solid #FFD700;
    outline-offset: 2px;
}

/* Form Label Styling */
label {
    display: inline-block;
    margin-right: 8px;
    font-weight: bold;
    color: #000034;
}

/* Required Form Fields Indicator */
.required::after {
    content: " *";
    color: #942F26;
}

/* Improve Input Focus States */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="search"]:focus,
textarea:focus {
    border: 2px solid #FFD700;
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

/* Enhance Button Focus States */
input[type="submit"]:focus,
button:focus {
    outline: 3px solid #FFD700;
    outline-offset: 2px;
    background-color: #8B7BA8;
}

/* Ensure sufficient color contrast - Fix link colors */
.bdy a:link,
.bdy a:hover,
.bdy a:active,
.bdy a:visited {
    color: #1A0DAB; /* old 0056b3 */
    font-weight: bold;
    text-decoration: underline;
}

/* Improve text readability */
.bdy {
    line-height: 1.5;
    color: #1a1a1a;
    font-size: 13pt;
}

.bdy p {
    line-height: 1.6;
}

/* Heading contrast improvement */
h1, h2, h3, h4, h5, h6 {
    color: #000034;
    line-height: 1.3;
}

/* Better list styling */
ul, ol {
    margin: 15px 0;
    padding-left: 40px;
}

li {
    margin-bottom: 8px;
}

/* Improve table accessibility */
table {
    border-collapse: collapse;
    border: 1px solid #000034;
    margin: 15px 0;
}

table th {
    background-color: #b4bacb;
    color: #000034;
    font-weight: bold;
    padding: 8px;
    text-align: left;
    border: 1px solid #000034;
}

table td {
    padding: 8px;
    border: 1px solid #000034;
}

table tr:nth-child(even) {
    background-color: #f0f0f0;
}

/* Ensure buttons have sufficient padding and size */
input[type="submit"],
button {
    padding: 10px 15px;
    min-height: 44px;
    min-width: 44px;
    cursor: pointer;
    font-size: 13pt;
}

/* Image borders with better contrast */
img {
    border: 3px solid #595959;
}

/* Navigation focus states */
.nav a:focus {
    outline: 2px solid #FFD700;
    outline-offset: -2px;
    background-color: rgba(255, 215, 0, 0.2);
}

/* Improve color contrast in footer */
.ftr {
    color: #FFFFFF;
    line-height: 1.5;
}

/* Ensure form controls have adequate spacing */
form > * {
    margin-bottom: 10px;
}

/* Error message styling for better visibility */
.error {
    color: #C41E3A;
    background-color: #FFF5F5;
    border-left: 4px solid #C41E3A;
    padding: 10px;
    margin: 10px 0;
}

/* Success message styling */
.success {
    color: #065A41;
    background-color: #F0F9F7;
    border-left: 4px solid #065A41;
    padding: 10px;
    margin: 10px 0;
}

/* Improve print stylesheet for accessibility */
@media print {
    /* Ensure focus outlines are visible */
    *:focus {
        outline: 2px solid black !important;
    }
    
    /* Ensure all text is black for printing */
    .bdy {
        color: black;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
}

/* Mobile/Responsive accessibility improvements */
@media (max-width: 768px) {
    /* Increase touch target size */
    button,
    input[type="submit"],
    a {
        min-height: 44px;
        min-width: 44px;
        padding: 10px 12px;
    }
    
    label {
        display: block;
        margin-bottom: 5px;
    }
    
    input[type="text"],
    textarea,
    select {
        width: 100%;
        max-width: 100%;
    }
}
