/**
 * kbnx-forced-colors.css — Windows High Contrast (forced-colors) fixes.
 *
 * Ensures all kbnexus components remain visible and usable when
 * forced-colors mode is active. Uses system color keywords
 * (CanvasText, LinkText, ButtonText, etc.) for proper integration.
 *
 * @see WCAG 2.1 SC 1.4.11 (Non-text Contrast)
 * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/forced-colors
 */

@media (forced-colors: active) {
    /* Ensure card-like components have visible borders. */
    .kbnx-block,
    .kbnx-search-result,
    .kbnx-faq-item,
    [data-kbnx-component="notice"],
    [data-kbnx-component="code-snippet"],
    [data-kbnx-component="author-box"],
    [data-kbnx-component="popular-docs"] {
        border: 1px solid ButtonText;
    }

    /* Ensure SVG icons inherit system text color. */
    .kbnx-icon svg,
    [data-kbnx-component] svg {
        fill: currentColor;
        forced-color-adjust: auto;
    }

    /* Ensure buttons have visible borders and system colors. */
    .kbnx-button,
    [data-kbnx-component] button {
        border: 1px solid ButtonText;
        color: ButtonText;
        background: ButtonFace;
    }

    /* Focus ring uses system highlight color. */
    .kbnx-block *:focus-visible,
    [data-kbnx-component] *:focus-visible,
    .kbnx-skip-link:focus-visible {
        outline: 2px solid Highlight;
        outline-offset: 2px;
        box-shadow: none;
    }

    /* Preserve link styling with system link color. */
    .kbnx-block a,
    .kbnx-block a:visited,
    [data-kbnx-component] a,
    [data-kbnx-component] a:visited {
        color: LinkText;
    }

    /* Disabled elements use system GrayText. */
    .kbnx-block [disabled],
    .kbnx-block [aria-disabled="true"],
    [data-kbnx-component] [disabled],
    [data-kbnx-component] [aria-disabled="true"] {
        color: GrayText;
        border-color: GrayText;
    }

    /* Preserve status icon colors that convey meaning. */
    .kbnx-status-icon {
        forced-color-adjust: none;
    }

    /* Ensure tab active state has visible indicator. */
    [role="tab"][aria-selected="true"] {
        border-bottom: 2px solid Highlight;
    }

    /* Ensure accordion triggers are distinguishable. */
    [aria-expanded="true"] {
        border-color: Highlight;
    }
}
