:root {
    --page-search-border-radius: 8px;
    --page-search-clear-width: 34px;
    --page-search-submit-width: 42px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.search-wrapper {
    position: relative;
    order: 5;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin: 0;
    padding: 0;
    overflow: visible;
    z-index: 20;
}

.page-search-form {
    position: relative;
    width: 100%;
    margin: 0;
}

.page-search-input {
    display: block;
    width: 100%;
    height: 50px;
    padding: 8px calc(var(--page-search-clear-width) + var(--page-search-submit-width) + 8px) 7px 11px;
    color: var(--header-text-color, #31516a);
    background: white;
    border: 1px solid #d7d7d7;
    border-radius: var(--page-search-border-radius);
    outline: none;
    font-size: 15pt;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.page-search-input:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.1rem rgba(0, 123, 255, 0.25);
}

.page-search-input::placeholder {
    color: #86acd0;
    font-size: 11pt;
    opacity: 1;
}

/* Keep the custom clear button as the single clearing control. */
.page-search-input::-webkit-search-cancel-button {
    display: none;
    appearance: none;
    -webkit-appearance: none;
}

.page-search-input::-ms-clear {
    display: none;
}

.page-search-form .page-search-clear,
.page-search-form .page-search-submit {
    position: absolute;
    top: 0;
    height: 50px;
    padding: 0;
    color: var(--header-text-color, #31516a);
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 18px;
    z-index: 2;
}

.page-search-form .page-search-clear {
    right: var(--page-search-submit-width);
    width: var(--page-search-clear-width);
}

.page-search-form .page-search-submit {
    right: 0;
    width: var(--page-search-submit-width);
    border-radius: 0 var(--page-search-border-radius) var(--page-search-border-radius) 0;
}

.page-search-input:placeholder-shown ~ .page-search-clear {
    visibility: hidden;
}

.page-search-form .page-search-clear:hover,
.page-search-form .page-search-submit:hover,
.page-search-form .page-search-clear:focus-visible,
.page-search-form .page-search-submit:focus-visible {
    color: #087fc0;
    background: #edf5fa;
}

.page-search-suggestions {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: min(440px, 90vw);
    max-height: min(480px, 65vh);
    overflow-y: auto;
    color: #304050;
    background: white;
    border: 1px solid #c8d9e5;
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(24, 52, 77, 0.24);
    z-index: 1000;
}

.page-search-suggestion {
    display: block;
    padding: 10px 12px;
    color: #31516a;
    border-bottom: 1px solid #e5edf2;
    text-decoration: none;
}

.page-search-suggestion:last-child {
    border-bottom: 0;
}

.page-search-suggestion:hover,
.page-search-suggestion:focus-visible {
    color: #075f8f;
    background: #edf5fa;
    text-decoration: none;
}

.page-search-suggestion__title,
.page-search-suggestion__excerpt {
    display: block;
}

.page-search-suggestion__document {
    display: inline-flex;
    align-items: center;
    margin-bottom: 4px;
    padding: 1px 6px;
    color: #5146a2;
    background: #f1efff;
    border: 1px solid #c9c4f4;
    border-radius: 999px;
    font-size: 8pt;
    font-weight: 600;
    line-height: 1.3;
}

.page-search-suggestion__title {
    font-size: 10.5pt;
    font-weight: 600;
}

.page-search-suggestion__excerpt {
    margin-top: 3px;
    color: #667b8b;
    font-size: 9pt;
    line-height: 1.3;
}

.page-search-message {
    padding: 13px 14px;
    color: #667b8b;
    font-size: 10pt;
}

.page-search-message--error {
    color: #8b2534;
    background: #fff4f5;
}

.pagefind-results-page {
    min-height: 360px;
    padding: 20pt;
    background: white;
    border-radius: 8pt;
}

.pagefind-results-page > h1 {
    margin: 0 0 16pt;
    color: #31516a;
    font-size: 20pt;
}

.pagefind-results__summary {
    margin: 0 0 12pt;
    color: #667b8b;
}

.pagefind-results__list {
    display: flex;
    flex-direction: column;
    gap: 8pt;
}

.pagefind-result {
    display: block;
    padding: 12pt 14pt;
    color: inherit;
    background: #f4f7f9;
    border: 1px solid transparent;
    border-radius: 7pt;
    text-decoration: none;
}

.pagefind-result:hover,
.pagefind-result:focus-visible {
    color: inherit;
    background: #edf5fa;
    border-color: #c8d9e5;
    text-decoration: none;
}

.pagefind-result__title {
    margin: 0;
    color: #087fc0;
    font-size: 14pt;
}

.pagefind-result__document {
    display: inline-flex;
    align-items: center;
    margin-bottom: 6pt;
    padding: 2px 7px;
    color: #5146a2;
    background: #f1efff;
    border: 1px solid #c9c4f4;
    border-radius: 999px;
    font-size: 8.5pt;
    font-weight: 600;
    line-height: 1.25;
}

.pagefind-result__excerpt {
    margin: 6pt 0 0;
    color: #526878;
    font-size: 10pt;
    line-height: 1.45;
}

@media only screen and (max-width: 549px) {
    .search-wrapper--expanded {
        width: 70vw !important;
    }

    .page-search-header-hidden {
        display: none !important;
    }

    .page-search-suggestions {
        position: fixed;
        top: 68px;
        right: 10px;
        left: 10px;
        width: auto;
    }

    .pagefind-results-page {
        padding: 12pt;
    }
}
