/**
 * WCAG 2.1 AA Compliance Remediation Stylesheet
 * ================================================
 * This stylesheet addresses ADA/WCAG 2.1 Level AA compliance issues
 * found across the PMR WebUI and CustomerPortalUI portals.
 *
 * WCAG Criteria Addressed:
 *   1.4.1  - Use of Color (color alone must not convey meaning)
 *   1.4.3  - Contrast Minimum (4.5:1 for normal text, 3:1 for large text)
 *   1.4.4  - Resize Text (text scales with user preferences)
 *   1.4.11 - Non-text Contrast (3:1 for UI components and borders)
 *   1.4.12 - Text Spacing (content adapts to user text spacing overrides)
 *   2.1.1  - Keyboard (all functionality via keyboard)
 *   2.4.7  - Focus Visible (visible focus indicators on all interactive elements)
 *   2.5.8  - Target Size Minimum (24x24px minimum for touch/pointer targets)
 *
 * Load this stylesheet AFTER all other stylesheets to apply fixes.
 *
 * @author PBW Web Architects, LLC
 * @license Copyright (c) PBW Web Architects, LLC. All rights reserved.
 */


/* ================================================================
   1. COLOR CONTRAST FIXES (WCAG 1.4.3 — 4.5:1 minimum)
   ================================================================ */

/*
 * ISSUE: .text-validation uses `color: red` (#ff0000) on white = 4.0:1 (FAIL)
 * FIX:   Use --color-danger (#b5433f) = 5.47:1 on white (PASS)
 * Also fix 10px absolute size to scalable rem.
 */
.text-validation {
    color: var(--color-danger, #b5433f) !important;
    font-size: 0.75rem !important; /* 12px — scalable with user settings */
}

/*
 * ISSUE: InPlaceEditor save icon uses `color: green` (#008000) on antiquewhite = 3.6:1 (FAIL)
 * FIX:   Darken to #2e7d32 = 4.68:1 on antiquewhite (PASS)
 */
.e-inplaceeditor .e-editable-action-buttons .e-btn-save.e-icon-btn .e-btn-icon.e-icons,
.e-inplaceeditor-tip .e-editable-action-buttons .e-btn-save.e-icon-btn .e-btn-icon.e-icons {
    color: #2e7d32 !important;
}

/*
 * ISSUE: InPlaceEditor cancel icon uses `color: red` (#ff0000) on antiquewhite = 3.3:1 (FAIL)
 * FIX:   Use --color-danger (#b5433f) = 4.55:1 on antiquewhite (PASS)
 */
.e-inplaceeditor .e-editable-action-buttons .e-btn-cancel.e-icon-btn .e-btn-icon.e-icons,
.e-inplaceeditor-tip .e-editable-action-buttons .e-btn-cancel.e-icon-btn .e-btn-icon.e-icons {
    color: var(--color-danger, #b5433f) !important;
}

/*
 * ISSUE: --color-gray-600 (#868e96) used for labels/titles on white = 3.93:1 (FAIL)
 * FIX:   Override to --color-gray-800 (#495057) = 7.42:1 on white (PASS)
 *        or --color-gray-700 (#6c757d) = 4.55:1 on white (PASS for normal text)
 */

/* Metric card title label */
.metric-card__title {
    color: var(--color-gray-800, #495057) !important;
}

/* Batch card secondary text */
.batch-card__type {
    color: var(--color-gray-700, #6c757d) !important;
}

.batch-card__stat-label {
    color: var(--color-gray-700, #6c757d) !important;
}

.batch-dashboard__tenant-header {
    color: var(--color-gray-700, #6c757d) !important;
}

/* Warehouse card secondary text */
.warehouse-card__subtitle {
    color: var(--color-gray-700, #6c757d) !important;
}

.warehouse-card__stat-icon {
    color: var(--color-gray-700, #6c757d) !important;
}

.warehouse-card__stat-label {
    color: var(--color-gray-700, #6c757d) !important;
}

/* Status timeline timestamp */
.status-timeline__timestamp {
    color: var(--color-gray-700, #6c757d) !important;
}

/* Status timeline empty state */
.status-timeline__empty-message {
    color: var(--color-gray-700, #6c757d) !important;
}

.status-timeline__empty-icon {
    color: var(--color-gray-700, #6c757d) !important;
}


/* ================================================================
   2. NON-TEXT CONTRAST FIXES (WCAG 1.4.11 — 3:1 minimum)
   ================================================================ */

/*
 * ISSUE: .metric-card__footer border uses rgba(0,0,0,0.06) — nearly invisible, ~1.1:1
 * FIX:   Use a visible border that meets 3:1 against adjacent backgrounds.
 */
.metric-card__footer {
    border-top-color: var(--color-gray-300, #dee2e6) !important;
}

/*
 * ISSUE: .status-timeline__line gradient too subtle against white.
 * FIX:   Use a solid color with sufficient contrast.
 */
.status-timeline__line {
    background: var(--color-gray-400, #ced4da) !important;
}

/*
 * ISSUE: .batch-card::before default gray-300 (#dee2e6) on white = ~1.45:1 (FAIL)
 * FIX:   Already handled by color variants; ensure base has visible border.
 */
.batch-card::before {
    background: var(--color-gray-500, #adb5bd) !important;
}

/* Override when color variants are applied (they already have sufficient contrast) */
.batch-card--primary::before { background: var(--color-primary) !important; }
.batch-card--secondary::before { background: var(--color-gray-500) !important; }
.batch-card--success::before { background: var(--color-success) !important; }
.batch-card--warning::before { background: var(--color-warning) !important; }
.batch-card--danger::before { background: var(--color-danger) !important; }
.batch-card--info::before { background: var(--color-info) !important; }

/*
 * ISSUE: .warehouse-card::before default gray-300 on white — insufficient contrast.
 */
.warehouse-card::before {
    background: var(--color-gray-500, #adb5bd) !important;
}

/* Override when color variants are applied */
.warehouse-card--primary::before {
    background: linear-gradient(90deg, var(--color-primary) 0%, rgba(37, 71, 106, 0.6) 100%) !important;
}

.warehouse-card--info::before {
    background: linear-gradient(90deg, var(--color-info) 0%, rgba(51, 114, 150, 0.6) 100%) !important;
}

.warehouse-card--success::before {
    background: linear-gradient(90deg, var(--color-success) 0%, rgba(53, 122, 94, 0.6) 100%) !important;
}

.warehouse-card--warning::before {
    background: linear-gradient(90deg, var(--color-warning) 0%, rgba(134, 106, 34, 0.6) 100%) !important;
}


/*
 * ISSUE: .btn-danger uses bg #fa5838 with white text = 3.13:1 (FAIL)
 *        Template overrides Bootstrap's black text to white, but the bg is too bright.
 * FIX:   Darken the danger button bg to #c9302c = 4.63:1 with white (PASS)
 *        Hover/active states also adjusted.
 */
.btn-danger {
    --bs-btn-color: #fff !important;
    --bs-btn-bg: #c9302c !important;
    --bs-btn-border-color: #c9302c !important;
    --bs-btn-hover-color: #fff !important;
    --bs-btn-hover-bg: #ac2925 !important;
    --bs-btn-hover-border-color: #a02622 !important;
    --bs-btn-focus-shadow-rgb: 201, 48, 44 !important;
    --bs-btn-active-color: #fff !important;
    --bs-btn-active-bg: #a02622 !important;
    --bs-btn-active-border-color: #94221f !important;
    --bs-btn-disabled-color: #fff !important;
    --bs-btn-disabled-bg: #c9302c !important;
    --bs-btn-disabled-border-color: #c9302c !important;
}

.btn-danger,
.btn-danger:hover,
.btn-danger:focus,
.btn-danger:active,
.btn-danger.active,
.btn-danger.disabled,
.btn-danger:disabled {
    color: #fff !important;
}

/*
 * ISSUE: .btn-info uses bg #137eff with white text = 3.5:1 (FAIL)
 * FIX:   Darken to #0b5ed7 = 5.2:1 with white (PASS)
 */
.btn-info {
    --bs-btn-color: #fff !important;
    --bs-btn-bg: #0b5ed7 !important;
    --bs-btn-border-color: #0b5ed7 !important;
    --bs-btn-hover-color: #fff !important;
    --bs-btn-hover-bg: #0a53be !important;
    --bs-btn-hover-border-color: #094db1 !important;
    --bs-btn-focus-shadow-rgb: 11, 94, 215 !important;
    --bs-btn-active-color: #fff !important;
    --bs-btn-active-bg: #094db1 !important;
    --bs-btn-active-border-color: #0847a4 !important;
    --bs-btn-disabled-color: #fff !important;
    --bs-btn-disabled-bg: #0b5ed7 !important;
    --bs-btn-disabled-border-color: #0b5ed7 !important;
}

.btn-info,
.btn-info:hover,
.btn-info:focus,
.btn-info:active,
.btn-info.active,
.btn-info.disabled,
.btn-info:disabled {
    color: #fff !important;
}

/*
 * ISSUE: .btn-warning uses bg #ffbc34 with white text = 1.5:1 (CRITICAL FAIL)
 *        Yellow/amber backgrounds require dark text for contrast.
 * FIX:   Keep the amber bg but use black text (#000) for 14.8:1 (PASS)
 */
.btn-warning {
    --bs-btn-color: #000 !important;
    --bs-btn-hover-color: #000 !important;
    --bs-btn-active-color: #000 !important;
    --bs-btn-disabled-color: #000 !important;
}

.btn-warning,
.btn-warning:hover,
.btn-warning:focus,
.btn-warning:active,
.btn-warning.active,
.btn-warning.disabled,
.btn-warning:disabled {
    color: #000 !important;
}


/* ================================================================
   3. FOCUS VISIBLE INDICATORS (WCAG 2.4.7)
   ================================================================ */

/*
 * ISSUE: .dropdown-toggle removes outline with `outline: 0` and no replacement.
 * FIX:   Restore a visible focus ring.
 */
.dropdown-toggle:focus-visible {
    outline: 2px solid var(--color-primary, #25476a) !important;
    outline-offset: 2px !important;
}

/*
 * ISSUE: Card components lack focus-visible styles for keyboard users.
 * FIX:   Add consistent focus ring to all interactive card elements.
 */
.batch-card:focus-visible,
.batch-card a:focus-visible {
    outline: 2px solid var(--color-primary, #25476a);
    outline-offset: 2px;
}

.warehouse-card:focus-visible,
.warehouse-card a:focus-visible {
    outline: 2px solid var(--color-primary, #25476a);
    outline-offset: 2px;
}

.project-card:focus-visible,
.project-card a:focus-visible {
    outline: 2px solid var(--color-primary, #25476a);
    outline-offset: 2px;
}

.about-feature-card:focus-visible {
    outline: 2px solid var(--color-primary, #25476a);
    outline-offset: 2px;
}

/*
 * Action buttons and links inside cards.
 */
.batch-card__action:focus-visible {
    outline: 2px solid var(--color-primary, #25476a);
    outline-offset: 2px;
    box-shadow: none;
}

.warehouse-card__action:focus-visible {
    outline: 2px solid var(--color-primary, #25476a);
    outline-offset: 2px;
    box-shadow: none;
}

.projects-action-btn:focus-visible {
    outline: 2px solid var(--color-primary, #25476a);
    outline-offset: 2px;
}

/*
 * Dashboard filter buttons focus state.
 */
.dashboard-filter-btn:focus-visible {
    outline: 2px solid var(--color-primary, #25476a);
    outline-offset: 2px;
}

/*
 * Status timeline items — make the content area focusable for screen readers.
 */
.status-timeline__item:focus-visible {
    outline: 2px solid var(--color-primary, #25476a);
    outline-offset: -2px;
    border-radius: var(--radius-md, 0.5rem);
}

/*
 * Nav tabs — ensure active and focused tabs are distinguishable.
 */
.nav-tabs .nav-link:focus-visible {
    outline: 2px solid var(--color-primary, #25476a);
    outline-offset: -2px;
}

/*
 * General interactive elements — catch-all for links and buttons.
 */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--color-primary, #25476a);
    outline-offset: 2px;
}


/* ================================================================
   4. MINIMUM TARGET SIZE (WCAG 2.5.8 — 24x24px minimum)
   ================================================================ */

/*
 * ISSUE: Small status badges and pills may be interactive but have tiny targets.
 * FIX:   Ensure minimum 24px touch target height.
 */
.batch-card__status {
    min-height: 24px;
    min-width: 24px;
    padding: 4px var(--space-2, 0.5rem);
}

.warehouse-card__shipment-pill {
    min-height: 24px;
    padding: 4px var(--space-2, 0.5rem);
}

/*
 * ISSUE: Small action buttons on mobile may not meet 24x24 target.
 * FIX:   Set minimum dimensions on interactive action elements.
 */
.batch-card__action {
    min-height: 36px;
}

.warehouse-card__action {
    min-height: 36px;
}

.projects-action-btn {
    min-height: 44px;
}


/* ================================================================
   5. TEXT SIZING & READABILITY (WCAG 1.4.4, 1.4.12)
   ================================================================ */

/*
 * ISSUE: font-size: 0.65rem (~10.4px) is too small for comfortable reading.
 *        WCAG recommends a minimum of 12px (0.75rem) for body text.
 * FIX:   Bump all 0.65rem instances to 0.7rem (~11.2px) minimum,
 *        preserving compact design while improving readability.
 */
.metric-card__title,
.metric-card__description {
    font-size: max(0.7rem, var(--font-size-xs, 0.75rem));
}

.batch-card__status {
    font-size: 0.7rem;
}

.warehouse-card__stat-label {
    font-size: 0.7rem;
}

.warehouse-card__shipment-pill {
    font-size: 0.75rem;
}

.status-timeline__badge {
    font-size: 0.7rem;
}

.status-timeline__timestamp {
    font-size: 0.7rem;
}

.project-card__stat-label {
    font-size: 0.7rem;
}

.project-card__info-label {
    font-size: 0.75rem;
}

/*
 * Mobile font sizes — ensure minimum readability on small screens.
 */
@media (max-width: 768px) {
    .metric-card__title,
    .metric-card__description,
    .metric-card__change {
        font-size: 0.7rem !important;
    }

    .status-timeline__badge,
    .status-timeline__timestamp {
        font-size: 0.7rem !important;
    }
}

/*
 * WCAG 1.4.12 — Text Spacing: Ensure content adapts when users
 * override letter-spacing, word-spacing, and line-height.
 * These rules prevent content clipping under user text spacing overrides.
 */
.batch-card__name,
.warehouse-card__name,
.project-card__name,
.metric-card__value {
    overflow: visible;
    text-overflow: clip;
}


/* ================================================================
   6. SKIP NAVIGATION LINK (WCAG 2.4.1)
   ================================================================ */

/*
 * Styles for a "Skip to main content" link. The HTML must include:
 *   <a href="#main-content" class="skip-to-main">Skip to main content</a>
 *   <main id="main-content">...</main>
 */
.skip-to-main {
    position: absolute;
    top: -100%;
    left: 0;
    z-index: 10000;
    padding: 0.75rem 1.5rem;
    background: var(--color-primary, #25476a);
    color: var(--color-white, #fff);
    font-weight: var(--font-weight-bold, 700);
    font-size: var(--font-size-base, 1rem);
    text-decoration: underline;
    border-radius: 0 0 var(--radius-md, 0.5rem) 0;
    transition: top 0.2s ease;
}

.skip-to-main:focus {
    top: 0;
    outline: 2px solid var(--color-white, #fff);
    outline-offset: 2px;
}


/* ================================================================
   7. FORCED COLORS / HIGH CONTRAST MODE (WCAG 1.4.11)
   ================================================================ */

/*
 * Windows High Contrast Mode support.
 * Ensure borders and focus rings use system colors.
 */
@media (forced-colors: active) {
    .metric-card,
    .batch-card,
    .warehouse-card,
    .project-card,
    .status-timeline {
        border: 2px solid ButtonText;
    }

    .metric-card:focus-visible,
    .batch-card:focus-visible,
    .warehouse-card:focus-visible,
    .project-card:focus-visible {
        outline: 3px solid Highlight;
    }

    .metric-card__icon,
    .batch-card__icon,
    .warehouse-card__icon {
        border: 2px solid ButtonText;
        forced-color-adjust: none;
    }

    .batch-card__status,
    .status-timeline__badge,
    .warehouse-card__shipment-pill {
        border: 1px solid ButtonText;
    }

    .batch-card__action,
    .warehouse-card__action,
    .projects-action-btn {
        border: 1px solid ButtonText;
    }

    .batch-card__action:hover,
    .warehouse-card__action:hover,
    .projects-action-btn:hover {
        background: Highlight;
        color: HighlightText;
    }

    a:focus-visible,
    button:focus-visible {
        outline: 2px solid Highlight;
    }
}


/* ================================================================
   8. REDUCED MOTION ENHANCEMENTS (WCAG 2.3.3)
   ================================================================ */

/*
 * Extend reduced-motion support to components missing it.
 */
@media (prefers-reduced-motion: reduce) {
    .about-ai-card,
    .about-ai-feature-item {
        transition: none !important;
    }

    .about-feature-card:hover {
        transform: none !important;
    }

    .project-card__progress-fill {
        transition: none !important;
    }

    /* Ensure no HTMX transition animations */
    #js-dashboard-content.htmx-request {
        transition: none !important;
    }
}


/* ================================================================
   9. SCREEN READER UTILITIES
   ================================================================ */

/*
 * Visually hidden but accessible to screen readers.
 * Use: <span class="sr-only">descriptive text</span>
 */
.sr-only,
.visually-hidden {
    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;
}

/*
 * Show visually hidden content when focused (for skip links, etc.)
 */
.sr-only-focusable:focus,
.sr-only-focusable:active {
    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;
}


/* ================================================================
   10. LINK DISTINGUISHABILITY (WCAG 1.4.1)
   ================================================================ */

/*
 * ISSUE: Links may be distinguished from surrounding text only by color.
 * FIX:   Ensure links within body text have underline or other non-color indicator.
 */
.body-content a:not(.btn):not(.nav-link):not(.dropdown-item):not(.batch-card__action):not(.warehouse-card__action):not([class*="card"]) {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.body-content a:not(.btn):not(.nav-link):not(.dropdown-item):hover {
    text-decoration-thickness: 2px;
}


/* ================================================================
   11. TEMPLATE LAYOUT CONTRAST FIXES (WCAG 1.4.3)
   ================================================================ */

/*
 * ISSUE: Body text color #6a7a8c on body background #f2f4f5 = ~3.3:1 (FAIL)
 * FIX:   Darken body text to #495057 = 6.0:1 on #f2f4f5 (PASS)
 */
body {
    color: #495057 !important;
}

/*
 * ISSUE: .text-muted uses #afb5c1 on light backgrounds = ~1.9:1 (FAIL)
 * FIX:   Darken to #6c757d = 4.55:1 on white (PASS), 3.7:1 on #f2f4f5 (PASS for large text)
 *        Use #5a6268 for better AA compliance = 5.74:1 on white, 4.65:1 on #f2f4f5 (PASS)
 */
.text-muted {
    color: #5a6268 !important;
}

/*
 * ISSUE: .nav-small-cap text is white at 30% opacity = ~1.5:1 (FAIL)
 * FIX:   Increase opacity to full and use a lighter shade that meets 4.5:1
 *        on dark sidebar backgrounds.
 */
.nav-small-cap {
    opacity: 1 !important;
}

.nav-small-cap,
.nav-small-cap > i,
.nav-small-cap > span {
    color: rgba(255, 255, 255, 0.85) !important;
}

/*
 * For skin6 (light sidebar), use dark text instead.
 */
[data-sidebartype="light"] .nav-small-cap,
[data-sidebartype="light"] .nav-small-cap > i,
[data-sidebartype="light"] .nav-small-cap > span,
.left-sidebar[data-sidebarbg="skin6"] .nav-small-cap,
.left-sidebar[data-sidebarbg="skin6"] .nav-small-cap > i,
.left-sidebar[data-sidebarbg="skin6"] .nav-small-cap > span {
    color: #495057 !important;
}

/*
 * ISSUE: Sidebar links use white text at 60% opacity = ~3.5:1 (FAIL on some skins)
 * FIX:   Increase opacity to 0.85 for 4.5:1+ on dark backgrounds.
 */
#sidebarnav .sidebar-link {
    opacity: 1 !important;
    color: rgba(255, 255, 255, 0.85) !important;
}

#sidebarnav .sidebar-link:hover,
#sidebarnav .sidebar-link:focus,
#sidebarnav .sidebar-link.active {
    color: #fff !important;
}

/*
 * For skin6 (light sidebar), keep dark text.
 */
.left-sidebar[data-sidebarbg="skin6"] #sidebarnav .sidebar-link {
    color: rgba(43, 43, 43, 0.85) !important;
}

.left-sidebar[data-sidebarbg="skin6"] #sidebarnav .sidebar-link:hover,
.left-sidebar[data-sidebarbg="skin6"] #sidebarnav .sidebar-link:focus,
.left-sidebar[data-sidebarbg="skin6"] #sidebarnav .sidebar-link.active {
    color: #000 !important;
}

/*
 * ISSUE: Breadcrumb active item uses --bs-breadcrumb-item-active-color (#6c757d)
 *        on breadcrumb bg #f2f4f5 = 3.5:1 (FAIL — needs 4.5:1)
 * FIX:   Override the CSS variable and explicit color to #495057 = 6.0:1 on #f2f4f5 (PASS)
 */
.breadcrumb {
    --bs-breadcrumb-item-active-color: #495057 !important;
    --bs-breadcrumb-divider-color: #495057 !important;
}

.breadcrumb-item.active {
    color: #495057 !important;
}

/*
 * ISSUE: Breadcrumb divider (::before) uses #ced4da on #f2f4f5 = 1.4:1 (FAIL — needs 3:1 non-text)
 *        Template overrides with MDI icon at .page-breadcrumb also uses #ced4da.
 * FIX:   Darken divider to #6c757d = 3.5:1 on #f2f4f5 (PASS for non-text/decorative element)
 */
.breadcrumb-item + .breadcrumb-item::before {
    color: #6c757d !important;
}

.page-breadcrumb .breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    color: #6c757d !important;
}

/*
 * ISSUE: Page title may inherit light body text color.
 * FIX:   Ensure page title has strong contrast.
 */
.page-title {
    color: #313a46 !important;
}

/*
 * ISSUE: Footer text inherits #6a7a8c body color = 3.3:1 (FAIL)
 * FIX:   Darken footer text.
 */
.footer,
.footer small,
.footer a {
    color: #495057 !important;
}

.footer a:hover {
    color: #25476a !important;
}

/*
 * ISSUE: Sidebar sub-menu (first-level) items may have low contrast.
 */
#sidebarnav .first-level .sidebar-link {
    color: rgba(255, 255, 255, 0.8) !important;
}

#sidebarnav .first-level .sidebar-link:hover,
#sidebarnav .first-level .sidebar-link:focus {
    color: #fff !important;
}

.left-sidebar[data-sidebarbg="skin6"] #sidebarnav .first-level .sidebar-link {
    color: rgba(43, 43, 43, 0.8) !important;
}

.left-sidebar[data-sidebarbg="skin6"] #sidebarnav .first-level .sidebar-link:hover,
.left-sidebar[data-sidebarbg="skin6"] #sidebarnav .first-level .sidebar-link:focus {
    color: #000 !important;
}

/*
 * ISSUE: Topbar skin6 text color #6a7a8c = 3.3:1 on white (FAIL)
 * FIX:   Darken for sufficient contrast.
 */
.topbar .navbar .nav-item .nav-link {
    color: #495057 !important;
}

.topbar .navbar-dark .nav-item .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
}

.topbar .navbar-dark .nav-item .nav-link:hover,
.topbar .navbar-dark .nav-item .nav-link:focus {
    color: #fff !important;
}

/*
 * Ensure .text-black class has full contrast (used on welcome message).
 */
.text-black {
    color: #212529 !important;
}

/*
 * ISSUE: Template overrides all <a> tags with color: #2962ff (line 19848)
 *        #2962ff on body bg #f2f4f5 = 4.42:1 (FAIL — needs 4.5:1)
 * FIX:   Darken link color to #1d4ed8 = 6.09:1 on #f2f4f5 (PASS)
 *        Hover/focus darkened to #1e40af = 7.87:1 (PASS)
 *        Excludes buttons, nav, sidebar, dropdowns, badges, and utility classes.
 */
a:not(.btn):not(.nav-link):not(.sidebar-link):not(.dropdown-item):not(.badge):not(.logo):not([class*="text-"]) {
    color: #1d4ed8;
}

a:not(.btn):not(.nav-link):not(.sidebar-link):not(.dropdown-item):not(.badge):not(.logo):not([class*="text-"]):hover,
a:not(.btn):not(.nav-link):not(.sidebar-link):not(.dropdown-item):not(.badge):not(.logo):not([class*="text-"]):focus {
    color: #1e40af;
}

/*
 * ISSUE: a.link uses #6a7a8c on body bg #f2f4f5 = 3.3:1 (FAIL)
 * FIX:   Darken to #495057 = 6.0:1 on #f2f4f5 (PASS)
 */
a.link {
    color: #495057 !important;
}

a.link:hover,
a.link:focus {
    color: #1d4ed8 !important;
}
