/* Override Oxygen's background images on the section and its title. */
:is(#section-4-11, #section-4-12).section-header {
    background: #fff;
}

:is(#section-4-11, #section-4-12) > .ct-section-inner-wrap > .ct-text-block {
    padding-block: 24px 0;
    background: none;
    color: #292f38;
    font-size: 30px;
    font-weight: 600;
    line-height: 1.3;
    text-align: left;
}

:is(#section-4-11, #section-4-12) + :is(#section-2-11, #section-2-12) > .ct-section-inner-wrap {
    padding-top: 16px;
}

/* Keep the controls in place when filtering shortens the results. */
html:has(:is(#dx-document-filter-container, #dx-software-filter-container)) {
    scrollbar-gutter: stable;
}

:is(#dx-document-filter-container, #dx-software-filter-container) {
    --catalog-border: #d9dfe6;
    --catalog-blue: #005eeb;
    column-gap: clamp(20px, 2vw, 32px);
    grid-template-columns: clamp(192px, 16vw, 248px) minmax(0, 1fr);
    grid-template-areas: "b a" "b c";

    & .search-wrap {
        flex-flow: row nowrap;
        align-items: center;
        gap: 0;
        background: #fff;
        border: 1px solid #c7cbd0;
        border-radius: 6px;
    }
    & .search-wrap > :where(.dx-search, #dx-version-scope) {
        box-sizing: border-box;
        height: 44px;
        min-width: 0;
        padding: 0 16px;
        border: 0;
        border-radius: 6px;
        appearance: none;
        background-color: #fff;
        background-image: var(--control-icon), linear-gradient(currentColor, currentColor);
        background-repeat: no-repeat;
        background-position: var(--icon-position), var(--mark-position) bottom 6px;
        background-size: var(--icon-size), var(--underline-width, 0px) 2px;
        color: #24282c;
        font-weight: 400;
        outline: none;
        box-shadow: none;
        -webkit-tap-highlight-color: transparent;
    }
    & .search-wrap:not(.pointer-focus) > :where(.dx-search, #dx-version-scope):focus-visible {
        --underline-width: 18px;
    }
    & .search-wrap > .dx-search {
        --control-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%235c5c56' stroke-width='1.7' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='5.3'/%3E%3Cpath d='m12 12 4.5 4.5'/%3E%3C/svg%3E");
        --icon-position: 14px center;
        --mark-position: left 14px;
        --icon-size: 17px;
        flex: 1;
        padding-inline-start: 40px;
    }
    & .dx-search::placeholder { color: #585e66; opacity: 1; }
    & .search-wrap::before {
        content: "";
        order: 1;
        flex: 0 0 1px;
        height: 20px;
        background: #c7cbd0;
    }
    & .search-wrap > #dx-version-scope {
        order: 2;
        --control-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%23484843' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m1.5 1.5 4.5 4.5 4.5-4.5'/%3E%3C/svg%3E");
        --icon-position: right 14px center;
        --mark-position: right 12px;
        --icon-size: 12px;
        width: clamp(116px, 14vw, 172px);
        padding-inline: 14px 33px;
        cursor: pointer;
    }
    @media (forced-colors: active) {
        & .search-wrap > :where(.dx-search, #dx-version-scope):focus-visible {
            forced-color-adjust: none;
            color: HighlightText;
            background-color: Highlight;
        }
    }

    & .taxonomy-wrap {
        align-self: start;
        width: 100%;
        padding: 16px;
        border: 1px solid var(--catalog-border);
        border-radius: 8px;
        background: #fafbfc;
    }

    & .taxonomy-group + .taxonomy-group,
    & .button-row {
        margin-top: 14px;
        padding-top: 14px;
        border-top: 1px solid var(--catalog-border);
    }

    & .taxonomy-group strong {
        padding: 0;
        color: #292f38;
        font-size: 16px;
        line-height: 1.4;
        letter-spacing: normal;
    }

    & .terms-list { margin-top: 6px; }
    & .terms-list label {
        display: flex;
        align-items: center;
        gap: 8px;
        min-height: 32px;
        max-width: 100%;
        padding: 5px 6px;
        border-radius: 4px;
        color: #454d57;
        font-size: 15px;
        line-height: 1.35;
        letter-spacing: normal;
        cursor: pointer;
    }
    & .terms-list label span { margin: 0; overflow-wrap: anywhere; }
    & .terms-list input[type="checkbox"] {
        flex: none;
        width: 15px;
        height: 15px;
        margin: 0;
        accent-color: var(--catalog-blue);
    }
    & .terms-list label:has(input:checked) {
        color: #004ab9;
        background: #e7efff;
        font-weight: 600;
    }
    & .terms-list label:has(input:disabled) {
        color: #747b85;
        cursor: not-allowed;
    }
    & .terms-list input:disabled + span { color: inherit; }
    & .taxonomy-wrap :is(input, button):focus-visible {
        outline: 2px solid var(--catalog-blue);
        outline-offset: 2px;
    }

    & #dx-clear-filters {
        height: 36px;
        max-width: none;
        gap: 7px;
        border: 1px solid #c3cbd5;
        border-radius: 5px;
        background: white;
        color: #394453;
        font-size: 14px;
        font-weight: 600;
    }
    & #dx-clear-filters:hover { border-color: #7c8ca0; }
    & #dx-clear-filters img { width: 14px; filter: brightness(0.35); }
    & :is(.search-wrap, .dx-search, .result-wrap) { min-width: 0; }
}

@media (max-width: 991px) {
    /* The 60px mobile navigation bar overlays the start of the section. */
    :is(#section-4-11, #section-4-12) > .ct-section-inner-wrap > .ct-text-block {
        padding-top: 78px;
        font-size: 26px;
    }

    :is(#dx-document-filter-container, #dx-software-filter-container) {
        & .taxonomy-wrap { margin-top: 20px; }
        & .taxonomy-groups { gap: 16px; }
        & .taxonomy-group + .taxonomy-group { margin: 0; border: 0; padding: 0; }
        & .terms-list label, & #dx-clear-filters { min-height: 44px; }
    }
}

@media (max-width: 767px) {
    :is(#dx-document-filter-container, #dx-software-filter-container) {
        & .taxonomy-wrap { padding: 14px; }
        & .terms-list { flex-wrap: wrap; gap: 0 8px; }
        & .result-wrap { overflow-wrap: anywhere; }
    }
}

@media (max-width: 400px) {
    :is(#dx-document-filter-container, #dx-software-filter-container) .search-wrap > .dx-search {
        --control-icon: none;
        padding-inline: 10px 5px;
    }
    :is(#dx-document-filter-container, #dx-software-filter-container) .dx-search:placeholder-shown::-webkit-search-cancel-button {
        display: none;
    }
    :is(#dx-document-filter-container, #dx-software-filter-container) .search-wrap > #dx-version-scope {
        padding-inline: 12px 25px;
        --icon-position: right 10px center;
        --mark-position: right 8px;
    }
}
