/* Site-wide search: the drop-down under the homepage box and the full
   results page, /search (site-search.js). */

.siteSearch{
    position:relative;
    order:-1;
    flex:1 1 420px;
    min-width:0;
}

.siteSearch .topSearchWrap{
    order:0;
    width:100%;
}

.siteSearchPanel{
    position:absolute;
    z-index:60;
    top:calc(100% + 8px);
    left:0;
    right:0;
    max-height:min(70vh, 560px);
    overflow-y:auto;
    padding:6px 0;
    border-radius:12px;
    background:#ffffff;
    color:#10293b;
    text-align:left;
    box-shadow:0 14px 40px rgba(3,16,28,.35);
}

.siteSearchGroup + .siteSearchGroup{
    border-top:1px solid #e3eaee;
}

.siteSearchGroupHead{
    display:flex;
    align-items:baseline;
    justify-content:space-between;
    gap:10px;
    padding:8px 14px 2px;
}

.siteSearchGroupLabel{
    color:#0f6170;
    font-size:.7rem;
    font-weight:900;
    letter-spacing:.1em;
    text-transform:uppercase;
}

.siteSearchMore{
    color:#0f6170;
    font-size:.78rem;
    font-weight:700;
    text-decoration:none;
}

.siteSearchMore:hover,
.siteSearchMore:focus-visible{
    text-decoration:underline;
}

.siteSearchRow{
    display:flex;
    align-items:center;
    gap:12px;
    padding:7px 14px;
    color:inherit;
    text-decoration:none;
}

.siteSearchRow:hover,
.siteSearchRow:focus-visible,
.siteSearchRow.siteSearchActive,
.siteSearchAll:hover,
.siteSearchAll:focus-visible,
.siteSearchAll.siteSearchActive{
    background:#eef6f6;
    outline:none;
}

.siteSearchThumb{
    flex:none;
    width:40px;
    height:40px;
    border-radius:50%;
    object-fit:cover;
    background:#e3eaee;
}

.siteSearchPoster{
    height:56px;
    border-radius:4px;
}

.siteSearchBadge{
    display:grid;
    place-items:center;
    color:#0f6170;
    font-weight:900;
    font-size:1.05rem;
}

.siteSearchBadge-topics{
    border-radius:10px;
    background:#fff1cc;
    color:#8a5a00;
}

.siteSearchText{
    display:flex;
    flex-direction:column;
    min-width:0;
}

.siteSearchTitle{
    overflow:hidden;
    font-weight:700;
    line-height:1.25;
    text-overflow:ellipsis;
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
}

.siteSearchSub{
    overflow:hidden;
    color:#557080;
    font-size:.82rem;
    white-space:nowrap;
    text-overflow:ellipsis;
}

.siteSearchAll{
    display:block;
    margin-top:4px;
    padding:10px 14px;
    border-top:1px solid #e3eaee;
    color:#0f6170;
    font-weight:700;
    text-decoration:none;
}

.siteSearchEmpty{
    margin:0;
    padding:12px 14px;
    color:#557080;
}

/* ---------- the results page ---------- */

.searchPage{
    width:min(760px, calc(100% - 32px));
    margin:0 auto 60px;
    color:#ffffff;
}

.searchPage h1{
    margin:10px 0 14px;
    font-size:1.6rem;
}

.searchPageForm{
    display:flex;
    gap:8px;
}

.searchPageForm input{
    flex:1;
    min-width:0;
    padding:12px 14px;
    border:2px solid transparent;
    border-radius:12px;
    font-size:1rem;
}

.searchPageForm input:focus{
    border-color:#ffd166;
    outline:none;
}

.searchPageForm button{
    padding:0 18px;
    border:0;
    border-radius:12px;
    background:#ffd166;
    color:#10293b;
    font-weight:800;
    cursor:pointer;
}

.searchPageStatus{
    min-height:22px;
    margin:12px 0;
    color:#bfe8e3;
}

.siteSearchJump{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin-bottom:14px;
}

.siteSearchJumpLink{
    padding:6px 12px;
    border:1px solid rgba(255,209,102,.45);
    border-radius:999px;
    color:#ffd166;
    font-size:.85rem;
    font-weight:700;
    text-decoration:none;
}

.siteSearchPageGroup{
    margin-bottom:16px;
    padding:6px 0;
    border-radius:12px;
    background:#ffffff;
    color:#10293b;
    scroll-margin-top:16px;
}

.siteSearchPageGroup + .siteSearchPageGroup{
    border-top:0;
}

.siteSearchPageGroup h2{
    margin:0;
    padding:8px 14px 4px;
}

@media(max-width:768px){
    .siteSearch{
        flex-basis:100%;
    }
}

/* the search bar has a backdrop blur (its own layer), so lift the whole
   bar while the drop-down is open or later headings paint over it */
.aboutLinkBar:has(.siteSearchPanel:not([hidden])){
    position:relative;
    z-index:70;
}

/* A quiet magnifying glass instead of the "SEARCH" label, and no second
   outline inside the box - the box itself lights up gold when focused. */
.topSearchWrap::before{
    content:"";
    flex:none;
    width:18px;
    height:18px;
    margin-right:10px;
    background-color:#8aa0ac;
    -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5L21 21'/%3E%3C/svg%3E") center / contain no-repeat;
    mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5L21 21'/%3E%3C/svg%3E") center / contain no-repeat;
    transition:background-color .15s ease;
}

.topSearchWrap:focus-within::before{
    background-color:#0f6170;
}

.topSearchWrap .topSearch:focus,
.topSearchWrap .topSearch:focus-visible{
    outline:none;
}
