/**
 * Screen Reader Support - WCAG 2.1 AA Compliant
 * Enhanced ARIA labels and semantic HTML for screen readers
 */

/* Ensure landmarks are properly identified */
main[role="main"],
main {
    display: block;
}

header[role="banner"],
header {
    /* display: block; */
}

nav[role="navigation"],
nav {
    display: block;
}

footer[role="contentinfo"],
footer {
    display: block;
}

/* Ensure buttons are properly labeled */
button:not([aria-label]):not([aria-labelledby]) {
    /* If button has visible text, use aria-label for screen readers */
}

button:empty {
    /* Empty buttons should always have aria-label */
}

/* Ensure form inputs have labels */
input:not([aria-label]):not([aria-labelledby]):not([id]) {
    /* Should have label or aria-label */
}

/* Improve button announcements */
button[aria-label] {
    /* aria-label overrides visible text for screen readers */
}

/* Ensure status messages are announced */
[role="status"],
[role="alert"],
[role="alertdialog"] {
    /* Screen readers will announce these */
}

/* Ensure live regions work properly */
[aria-live="polite"],
[aria-live="assertive"] {
    /* Screen readers will announce changes */
}

/* Ensure form errors are properly associated */
[aria-invalid="true"] {
    border-color: var(--color-error);
    border-width: 2px;
}

[aria-invalid="true"]:focus {
    outline-color: var(--color-error);
}

/* Ensure table headers are properly associated */
th[scope] {
    /* scope attribute helps screen readers understand table structure */
}

/* Ensure list structure is clear */
ul[role="list"],
ol[role="list"] {
    /* Explicit role helps screen readers */
}

/* Ensure headings are in proper order */
h1, h2, h3, h4, h5, h6 {
    display: block;
}

/* Ensure decorative images are ignored */
img[alt=""],
img[role="presentation"] {
    /* Screen readers will skip these */
}

/* Ensure loading states are announced */
[aria-busy="true"] {
    /* Screen readers will announce loading state */
}

/* Ensure disabled states are clear */
[aria-disabled="true"],
:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Ensure required fields are clear */
[aria-required="true"],
:required {
    /* Screen readers will announce required */
}

/* Ensure error messages are associated */
[aria-describedby] {
    /* Screen readers will read the description */
}

/* Ensure modals trap focus */
[role="dialog"],
[role="alertdialog"] {
    /* Focus should be trapped inside */
}

/* Ensure progress indicators are announced */
[role="progressbar"],
[aria-valuenow] {
    /* Screen readers will announce progress */
}
