/*
 * NEMT accessibility baseline
 * Target: WCAG 2.2 Level AA
 * This file supplements the legacy Bootstrap and project styles.
 */

html {
    scroll-padding-top: 1rem;
}

body {
    min-width: 320px;
    line-height: 1.5;
}

a:not(.btn) {
    text-decoration: underline;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.15em;
}

.wcag-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;
}

.wcag-skip-link {
    position: fixed;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 100000;
    padding: 0.75rem 1rem;
    color: #ffffff;
    background: #003b63;
    border: 3px solid #ffffff;
    border-radius: 0.25rem;
    font-weight: 700;
    text-decoration: underline;
    transform: translateY(-150%);
}

.wcag-skip-link:focus {
    color: #ffffff;
    transform: translateY(0);
}

a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus,
[tabindex]:focus {
    outline: 3px solid #005fcc !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 6px #ffffff !important;
}

button,
input[type="button"],
input[type="submit"],
input[type="reset"],
input[type="image"],
input[type="file"],
input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
select {
    min-height: 24px;
}

input[type="checkbox"],
input[type="radio"] {
    min-width: 24px;
    min-height: 24px;
}

img,
svg,
video,
canvas {
    max-width: 100%;
}

input,
select,
textarea,
button {
    max-width: 100%;
}

.wcag-site-header {
    height: auto !important;
    min-height: auto;
    padding: 0.75rem 1rem;
    color: #ffffff;
    background: #0069aa;
}

.wcag-header-inner {
    width: min(100%, 1200px);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.25rem;
}

.wcag-site-logo {
    width: auto;
    max-width: min(18rem, 45vw);
    height: auto;
    max-height: 5rem;
}

.wcag-header-titles {
    min-width: min(100%, 15rem);
    flex: 1 1 22rem;
}

.wcag-app-name {
    display: block;
    color: #ffffff;
}

.wcag-page-title {
    margin: 0.2rem 0 0;
    color: #ffffff;
    font-size: clamp(1.25rem, 3vw, 2rem);
    line-height: 1.25;
}

.wcag-user-account {
    color: #ffffff;
}

.wcag-site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-left: auto;
}

.wcag-site-nav a,
.wcag-site-nav a:visited {
    display: inline-flex;
    min-width: 44px;
    min-height: 44px;
    padding: 0.6rem 0.8rem;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    color: #ffffff !important;
    background: #004b7a;
    border: 2px solid #ffffff;
    border-radius: 0.25rem;
    text-decoration: underline;
}

.wcag-site-nav a:hover,
.wcag-site-nav a:focus {
    color: #111827 !important;
    background: #ffffff;
}

.wcag-message {
    display: block;
    width: min(100%, 1200px);
    min-height: 1.5rem;
    margin: 0.5rem auto 0;
    color: #ffffff !important;
    font-weight: 700;
}

.wcag-main {
    width: 100%;
    min-width: 0;
}

.wcag-dialog {
    max-width: min(26rem, calc(100vw - 2rem));
    overflow: auto;
}

.wcag-dialog[aria-hidden="true"] {
    visibility: hidden;
}

.wcag-dialog[aria-hidden="false"] {
    visibility: visible;
}

.wcag-dialog-title {
    margin: 0 2.5rem 1rem 0;
    font-size: 1.35rem;
    line-height: 1.3;
}

.wcag-dialog label {
    display: block;
    margin: 0.75rem 0 0.25rem;
    font-weight: 700;
}

.wcag-dialog textarea,
.wcag-dialog input[type="file"] {
    width: 100%;
}

.wcag-icon-button {
    min-width: 44px;
    min-height: 44px;
    padding: 0.4rem;
    border: 2px solid currentColor;
    border-radius: 0.25rem;
    color: inherit;
    background: transparent;
    cursor: pointer;
}

.wcag-table-region {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

table[role="presentation"] {
    max-width: 100%;
}

table:not([role="presentation"]) th {
    color: #111827;
    background: #e2edf5;
    font-weight: 700;
}

table:not([role="presentation"]) th,
table:not([role="presentation"]) td {
    border-color: #64748b;
}

.material-icons[aria-hidden="true"] {
    speak: never;
}

@media (max-width: 48rem) {
    .wcag-site-header {
        padding: 0.65rem;
    }

    .wcag-header-inner {
        align-items: flex-start;
    }

    .wcag-site-nav {
        width: 100%;
        margin-left: 0;
    }

    .wcag-site-nav a {
        flex: 1 1 9rem;
    }

    table[role="presentation"].tablepaddingsmall,
    table[role="presentation"].tablepaddingmed,
    table[role="presentation"].tablepaddinglarge,
    table[role="presentation"].tablepaddingsmall > tbody,
    table[role="presentation"].tablepaddingmed > tbody,
    table[role="presentation"].tablepaddinglarge > tbody,
    table[role="presentation"].tablepaddingsmall > tbody > tr,
    table[role="presentation"].tablepaddingmed > tbody > tr,
    table[role="presentation"].tablepaddinglarge > tbody > tr {
        display: block;
        width: 100%;
    }

    table[role="presentation"].tablepaddingsmall > tbody > tr > td,
    table[role="presentation"].tablepaddingmed > tbody > tr > td,
    table[role="presentation"].tablepaddinglarge > tbody > tr > td {
        display: block;
        width: 100% !important;
        max-width: 100%;
    }
}

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

@media (forced-colors: active) {
    a:focus,
    button:focus,
    input:focus,
    select:focus,
    textarea:focus,
    [tabindex]:focus {
        outline-color: Highlight !important;
        box-shadow: none !important;
    }

    .wcag-site-nav a,
    .wcag-icon-button {
        border: 2px solid ButtonText;
    }
}
