/* Compact search at opening; dock only after the first matching results. */
#searchOverlay {
    --search-header-height: 126px;
    top: var(--search-viewport-top, 0px);
    bottom: auto;
    height: var(--search-viewport-height, 100dvh);
    overflow: hidden;
    z-index: 11000;
}

.contentPreviewOverlay {
    z-index: 11001;
}

#searchOverlay .searchHeader {
    position: absolute;
    top: 50%;
    left: 50%;
    width: calc(100% - 48px);
    max-width: 760px;
    transform: translate(-50%, -50%);
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 20px;
    box-sizing: border-box;
    transition: top 380ms cubic-bezier(.22, 1, .36, 1),
        transform 380ms cubic-bezier(.22, 1, .36, 1),
        width 380ms cubic-bezier(.22, 1, .36, 1),
        max-width 380ms cubic-bezier(.22, 1, .36, 1),
        padding 380ms ease, border-radius 380ms ease;
}

#searchOverlay .searchForm,
#searchOverlay .searchInput {
    min-width: 0;
}

#searchOverlay .searchContent {
    position: absolute;
    top: calc(50% + 84px);
    right: 0;
    bottom: 0;
    left: 0;
    min-height: 0;
    overscroll-behavior: contain;
    transition: top 380ms cubic-bezier(.22, 1, .36, 1);
}

#searchOverlay.searchOverlay--results .searchHeader {
    top: 0;
    width: 100%;
    max-width: 100%;
    transform: translate(-50%, 0);
    padding: 20px 40px;
    border-radius: 0;
    border-top: 0;
    border-right: 0;
    border-left: 0;
}

#searchOverlay.searchOverlay--results .searchContent {
    top: var(--search-header-height);
}

@media (max-width: 768px) {
    #searchOverlay .searchHeader {
        width: calc(100% - 32px);
        max-width: 540px;
        padding: 18px 16px;
        border-radius: 16px;
    }

    #searchOverlay .searchHeaderContent {
        gap: 8px;
    }

    #searchOverlay .searchInput {
        width: 100%;
        font-size: 16px;
    }

    #searchOverlay.searchOverlay--results .searchHeader {
        padding: 15px 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #searchOverlay .searchHeader,
    #searchOverlay .searchContent {
        transition: none;
    }
}
