/**
 * HNMC BFSG Tool-Kit frontend styles
 * Base accessibility improvements
 */

/* ==========================================
   General Accessibility Improvements
   ========================================== */

/* Improve readability for all users */
body {
    line-height: 1.5;
}

/* Improve color contrast for inputs */
input, 
select, 
textarea, 
button {
    border: 1px solid #767676; /* Minimum contrast ratio */
}

/* Ensure links are recognizable */
a {
    text-decoration: underline;
}

/* Exceptions for buttons and navigation links */
a.button,
.button a,
button a,
nav a,
.nav a,
.navigation a,
.menu a,
.main-navigation a,
.navbar a,
a.nav-link,
header a,
.site-header a,
.header a,
.sub-menu a,
.menu-item a,
a.btn,
.btn a,
a[class*="btn"],
[class*="btn"] a,
[class*="button"] a,
a[class*="button"],
[role="button"] a,
a[role="button"] {
    text-decoration: none !important;
}

/* Ensure good spacing for clickable elements (WCAG 2.5.5) */
button, 
[role="button"], 
input[type="button"], 
input[type="submit"], 
input[type="reset"] {
    padding: 0.5em 0.75em;
    min-height: 44px; /* Minimum touch target size */
    min-width: 44px;
}

/* Make sure labels are properly associated with form controls */
label {
    display: inline-block;
    margin-bottom: 0.5em;
}

/* Screen reader only class */
.sr-only,
.screen-reader-text {
    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;
}

/* Focus visible for keyboard navigation */
.sr-only:focus,
.screen-reader-text: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;
}

/* ==========================================
   Reduced Motion Support
   ========================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ==========================================
   High Contrast Mode Support
   ========================================== */

@media (prefers-contrast: high) {
    body {
        --hnmc-border-color: currentColor;
    }
    
    button,
    input,
    select,
    textarea {
        border-width: 2px;
    }
}

/* ==========================================
   Print Styles for Accessibility
   ========================================== */

@media print {
    /* Ensure links show their URLs when printed */
    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
    
    /* Don't print the accessibility widget */
    .hnmc-a11y-widget,
    .hnmc-reading-guide {
        display: none !important;
    }
}
