.searchContainer {
    display: flex;
    align-items: stretch;
    flex-wrap: nowrap;
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
}

.searchContainer input[type="search"],
.searchContainer input[type="text"] {
    box-sizing: border-box;
    min-width: 0;
    flex: 1 1 auto;
    height: 3.2rem;
    margin: 0 !important;
    padding: 0 .95rem !important;
    line-height: 1.25 !important;
    vertical-align: top;
    border: 1px solid #d7d7d7;
    border-right: 0;
    border-radius: 0;
    background: #fff;
    color: inherit;
    font: inherit;
}

.searchContainer input:focus {
    position: relative;
    z-index: 1;
    outline: 2px solid currentColor;
    outline-offset: -2px;
}

.searchContainer button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    width: 3.2rem;
    height: 3.2rem;
    min-width: 3.2rem;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
    vertical-align: top;
    border: 0;
    border-radius: 0;
    background: #222733;
    color: #fff;
    cursor: pointer;
}

#searchForm #searchField,
#searchForm #searchButton {
    top: auto !important;
    bottom: auto !important;
    transform: none !important;
}

.searchContainer button:hover,
.searchContainer button:focus-visible {
    filter: brightness(1.15);
}

.search-icon {
    width: 1.15rem;
    height: 1.15rem;
    fill: currentColor;
}

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

html.search-modal-open,
body.search-modal-open {
    overflow: hidden;
}

.search-modal[hidden] {
    display: none;
}

.search-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: grid;
    place-items: start center;
    padding: clamp(1rem, 5vh, 4rem) 1rem 1rem;
}

.search-modal__backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(0, 0, 0, .68);
    cursor: default;
}

.search-modal__panel {
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    width: min(900px, 100%);
    max-height: calc(100vh - 2rem);
    overflow: auto;
    padding: clamp(1rem, 3vw, 2rem);
    border-radius: 4px;
    background: #fff;
    color: #222;
    box-shadow: 0 20px 70px rgba(0, 0, 0, .35);
}

.search-modal__header {
    display: flex;
    gap: .75rem;
    align-items: stretch;
    position: sticky;
    top: 0;
    z-index: 2;
    padding-bottom: 1rem;
    background: #fff;
}

.search-modal__input {
    box-sizing: border-box;
    min-width: 0;
    flex: 1 1 auto;
    height: 3.2rem;
    padding: 0 1rem;
    border: 1px solid #888;
    border-radius: 2px;
    background: #fff;
    color: #222;
    font: inherit;
    font-size: 1.05rem;
}

.search-modal__input:focus {
    outline: 2px solid #222;
    outline-offset: 2px;
}

.search-modal__close {
    flex: 0 0 auto;
    min-height: 3.2rem;
    padding: 0 1rem;
    border: 1px solid #222;
    border-radius: 2px;
    background: #222;
    color: #fff;
    font: inherit;
    cursor: pointer;
}

.search-modal__status {
    min-height: 1.5rem;
    margin: 0 0 1rem;
    font-weight: 600;
}

.search-result {
    padding: 1rem 0;
    border-top: 1px solid #ddd;
}

.search-result__title {
    margin: 0 0 .45rem;
    font-size: 1.25rem;
    line-height: 1.3;
}

.search-result__title a {
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: .08em;
    text-underline-offset: .16em;
}

.search-result__snippet {
    margin: 0;
    line-height: 1.55;
}

.search-result mark {
    padding: 0 .08em;
    background: #ffe58a;
    color: inherit;
}

@media (max-width: 600px) {
    .search-modal {
        padding: .5rem;
    }

    .search-modal__panel {
        max-height: calc(100vh - 1rem);
        padding: 1rem;
    }

    .search-modal__header {
        flex-wrap: wrap;
    }

    .search-modal__input {
        flex-basis: 100%;
    }

    .search-modal__close {
        width: 100%;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .search-modal__panel {
        animation: search-modal-in .14s ease-out;
    }

    @keyframes search-modal-in {
        from { opacity: 0; transform: translateY(-8px); }
        to { opacity: 1; transform: translateY(0); }
    }
}
