/* The shared search control opens one focused dialog on desktop and mobile. */
body.site-page.site-search-open {
    overflow: hidden;
}

body.site-page.site-search-open .site-header {
    z-index: 1001;
}

body.site-page .site-search-panel {
    position: fixed;
    inset: 0;
    z-index: 1002;
    display: grid;
    align-items: start;
    justify-items: center;
    box-sizing: border-box;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: clamp(64px, 12vh, 120px) 20px 24px;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.site-search-panel__backdrop {
    position: fixed;
    inset: 0;
    background: rgb(10 25 43 / 64%);
    cursor: pointer;
}

.site-search-panel__dialog {
    position: relative;
    box-sizing: border-box;
    width: min(100%, 580px);
    min-width: 0;
    padding: 24px;
    border: 1px solid var(--site-line);
    border-radius: 16px;
    background: var(--site-white);
    box-shadow: 0 24px 70px rgb(8 25 44 / 24%);
    animation: site-search-enter 180ms var(--site-ease) both;
}

.site-search-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-block-end: 18px;
}

.site-search-panel__head h2 {
    margin: 0;
    color: var(--site-ink);
    font-size: clamp(20px, 2vw, 24px);
    font-weight: 800;
    line-height: 1.35;
}

.site-search-panel__close {
    display: inline-grid;
    flex: 0 0 40px;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--site-line);
    border-radius: 10px;
    background: var(--site-white);
    color: var(--site-ink);
    cursor: pointer;
    transition: background-color var(--site-fast) ease;
}

.site-search-panel__close:hover {
    background: var(--site-blue-soft);
}

body.site-page .site-search-panel .site-search--modal {
    width: 100%;
    height: 52px;
    margin: 0;
}

body.site-page .site-search-panel .site-search__input {
    font-size: 16px;
    line-height: 52px;
}

body.site-page .site-search-panel .site-search__submit {
    flex-basis: 52px;
    width: 52px;
    min-width: 52px;
}

@keyframes site-search-enter {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
    body.site-page .site-search-panel {
        padding: 64px 12px 16px;
    }

    .site-search-panel__dialog {
        padding: 18px;
        border-radius: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-search-panel__dialog {
        animation: none;
    }
}
