/* Homepage search only. Native autocomplete, categories and starfield stay intact. */
/* Keep the original collapsed form footprint so categories do not move. */
/* Let all category rows and the shared bottom padding fit either button style. */
#content #search { max-height: none; }
/* The native background is 542px tall. Mirror only the uncovered strip. */
#search::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: max(0px, calc(100% - 542px));
    background: url('../images/bg.jpg') center top repeat-x;
    transform: scaleY(-1);
    pointer-events: none;
    z-index: 0;
}
#search #searchform { height: 0; }
#search .search-container .input_container {
    position: relative;
    height: 48px;
    max-width: 95%;
    border-radius: 30px;
    background: #fff;
    box-shadow: 0 5px 18px rgba(0, 17, 30, .13);
}
#search .input_container #q {
    box-sizing: border-box;
    width: 100%;
    height: 48px;
    margin: 0;
    padding: 0 61px 0 21px;
    border: 1px solid transparent;
    border-radius: 30px;
    background: #fff;
    color: #788993;
    font-family: 'nerislight', Arial, sans-serif;
    font-size: 18px;
    line-height: 46px;
    letter-spacing: 0;
    box-shadow: none;
}
#search #q::placeholder { color: #788993; opacity: 1; }
#search .input_container:focus-within {
    box-shadow: 0 0 0 3px rgba(193, 77, 218, .22), 0 5px 18px rgba(0, 17, 30, .13);
}
#search .input_container.search-open { border-radius: 24px 24px 0 0; }
#search .input_container.search-open #q {
    border-color: #c14dda;
    border-bottom-color: transparent;
    border-radius: 24px 24px 0 0;
}
#search .input_container #resultlist,
#search .input_container.search-open #resultlist {
    top: 48px;
    left: 0;
    width: 100%;
    margin: 0;
    border-top: 0;
    border-radius: 0 0 24px 24px;
    box-shadow: 0 10px 18px rgba(0, 17, 30, .13);
    z-index: 10;
}
#search #resultlist li { padding: 10px 21px; overflow-wrap: anywhere; }
#search .input_container > button {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 38px;
    height: 38px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #c347dd;
    box-shadow: none;
    -webkit-mask: none;
    mask: none;
    transition: background-color .18s ease, transform .18s ease;
}
#search .input_container > button::before {
    content: '';
    position: absolute;
    inset: 9px;
    background: #fff;
    -webkit-mask: url('../images/search-arrow-right.svg') center / 20px 20px no-repeat;
    mask: url('../images/search-arrow-right.svg') center / 20px 20px no-repeat;
}
#search .input_container > button:hover { background: #b335ce; transform: rotate(-15deg); }
#search .input_container > button:focus-visible { outline: 2px solid #2980b9; outline-offset: 2px; }
#search .search-curiosity {
    position: absolute;
    top: 48px;
    left: 0;
    right: 0;
    margin: 12px 0 0;
    text-align: center;
    color: #8fb9c9;
    font-family: 'Segoe Print', 'Comic Sans MS', cursive;
    font-size: 16px;
    line-height: 22px;
    letter-spacing: 0;
    transform: rotate(-3deg);
}
@media (max-width: 500px) {
    #search .input_container #q { font-size: 16px; padding-left: 16px; padding-right: 52px; }
}
@media (max-width: 350px) {
    #search .input_container #q { font-size: 14px; padding-left: 13px; }
}
@media (prefers-reduced-motion: reduce) {
    #search .input_container > button { transition: none; }
}
