/**
 * Accessibility Enhancements
 * 
 * Improves accessibility with ARIA support, keyboard navigation, and screen reader optimizations.
 */

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus indicators */
*:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Skip to main content link */
.skip-to-main {
    position: absolute;
    top: -40px;
    left: 0;
    background: #3b82f6;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-to-main:focus {
    top: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .service-card {
        border: 2px solid #000;
    }
    
    button {
        border: 2px solid #000;
    }
}

/* 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;
    }
}

/* Keyboard navigation improvements */
.service-card:focus-within {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
}

/* ARIA live regions */
.aria-live {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Improved color contrast for WCAG AA compliance */
.service-card {
    color: #1f2937; /* High contrast text */
}

.service-card-title {
    color: #111827; /* Even higher contrast */
}

/* Alt text for images */
img {
    alt: attr(alt);
}

/* Form labels always visible */
label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    color: #374151;
}

/* Required field indicators */
.required::after {
    content: " *";
    color: #ef4444;
    font-weight: bold;
}

/* Error messages */
.error-message {
    color: #dc2626;
    font-size: 14px;
    margin-top: 4px;
    display: block;
}

/* Success messages */
.success-message {
    color: #059669;
    font-size: 14px;
    margin-top: 4px;
    display: block;
}

/* Button minimum size for touch targets (44x44px) */
button, .btn {
    min-height: 44px;
    min-width: 44px;
    padding: 8px 16px;
}

/* Link focus styles */
a:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Input focus styles */
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-color: #3b82f6;
}

/* Landmark regions */
main[role="main"] {
    outline: none;
}

nav[role="navigation"] {
    outline: none;
}

/* Language attribute support */
[lang="ar"] {
    direction: rtl;
    text-align: right;
}

[lang="en"] {
    direction: ltr;
    text-align: left;
}

