#globalsearch {
    position: relative;
    z-index: 1;
    margin-left: 30px;
    vertical-align: middle;
    --height: 34px;
    top: -3px;
}

.global-search {
    position: relative;
    width: 44px;
    height: var(--height);
    margin-block: -10px;
    transition: width 220ms ease-out;
}

.global-search[open] {
    width: min(250px, calc(100vw - 93px));
}

.global-search-toggle {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: var(--height);
    color: #666;
    cursor: pointer;
    list-style: none;
}

.global-search-toggle::-webkit-details-marker {
    display: none;
}

.global-search-toggle:hover,
.global-search[open] .global-search-toggle {
    color: #000;
}

#head:has(.global-search[open]) {
    transform: translateY(0);
}

.global-search-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    box-sizing: border-box;
}

@media (prefers-reduced-motion: reduce) {
    .global-search {
        transition: none;
    }
}

.abendrot-search-form {
    position: relative;
    margin-bottom: 24px;
    font-size: 16px;
}

.global-search-panel .abendrot-search-form {
    margin-bottom: 0;
}

.abendrot-search-form label {
    display: block;
    padding: 0 0 8px;
    font-size: 16px;
}

.abendrot-search-fields {
    display: flex;
    gap: 8px;
}

.abendrot-search-form input[type="search"] {
    flex: 1;
    min-width: 0;
    width: 100%;
    padding: 0 10px;
    box-sizing: border-box;
    border: 1px solid #888;
    border-radius: 0;
    background: #fff;
    color: #000;
    font: inherit;
    appearance: none;
}

.frame-type-list .abendrot-search-form input[type="search"] {
    padding: 0.5em 1em;
}

.global-search-panel input[type="search"] {
    height: var(--height);
    padding-right: 44px;
}

.abendrot-search-form button {
    flex: none;
    padding: 0 14px;
    border: 0;
    background: #023059;
    color: #fff;
    font: inherit;
}

.abendrot-search-form button:hover {
    animation: none;
    filter: brightness(1.2);
}
/*
.global-search-toggle:focus-visible,
.abendrot-search-form input:focus-visible,
.abendrot-search-form button:focus-visible {
    outline: 2px solid #023059;
    outline-offset: 3px;
}
    */

.abendrot-search-form .search-autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 11;
    max-height: 45vh;
    overflow-y: auto;
    background: #fff;
    box-shadow: 0 5px 12px #0002;
}

.abendrot-search-form .search-autocomplete-results:empty {
    display: none;
}

.abendrot-search-form .tx-indexedsearch-autocomplete {
    position: static;
    width: auto;
    background: transparent;
    font-size: inherit;
}

#metanav .search-autocomplete-results ul,
.abendrot-search-form .search-autocomplete-results ul {
    display: block;
    margin: 0;
    padding: 0;
    list-style: none;
}

.abendrot-search-form .search-autocomplete-results li {
    margin: 0;
    padding: 10px 12px;
    color: #000;
    font-size: 16px;
    cursor: pointer;
}

.abendrot-search-form .search-autocomplete-results li:hover,
.abendrot-search-form .search-autocomplete-results li.highlighted {
    background: #e5edf4;
}

.tx-indexedsearch-res {
    margin: 0;
    padding-bottom: var(--gap);
}

.tx-indexedsearch-res h3 {
    padding-bottom: 0.4em;
}

.tx-indexedsearch-res .tx-indexedsearch-title a::after {
    content: ' →';
    font-size: 0.8em;
}

.tx-indexedsearch-res .tx-indexedsearch-description {
    font-size: 16px;
    line-height: 1.5;
}

.tx-indexedsearch-info,
.tx-indexedsearch-info-sword,
.tx-indexedsearch-result-count,
.tx-indexedsearch-percent,
.tx-indexedsearch-icon,
.tx-indexedsearch-browsebox > p {
    display: none;
}

.tx-indexedsearch-info-noresult {
    font-size: 16px;
}

.tx-indexedsearch-sectionhead {
    padding-top: var(--gap);
}

.tx-indexedsearch-sectionhead .tx-indexedsearch-title {
    margin-bottom: 0.6em;
}

.tx-indexedsearch-sectionhead .tx-indexedsearch-title a {
    text-decoration: none;
}

ul.tx-indexedsearch-browsebox {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin: 0 0 var(--gap);
    padding: 0;
    list-style: none;
    font-size: 16px;
}

ul.tx-indexedsearch-browsebox li {
    margin: 0;
    padding: 0;
    font-size: inherit;
}

ul.tx-indexedsearch-browsebox a {
    display: inline-block;
    padding: 8px 0;
}

.search-visually-hidden,
.abendrot-search-form .search-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    border: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

@media (max-width: 1030px) {
    /* Keep the search visible alongside the existing mobile menu button. */
    #head #metanav:has(#globalsearch) {
        display: block;
        margin: 0 18px 0 0;
    }

    #head #metanav:has(#globalsearch) > ul {
        display: none;
    }

    #head:has(#globalsearch) #logo {
        max-width: calc(100% - 112px);
    }

    #globalsearch {
        margin-left: 0;
    }

    .global-search {
        margin-block: 0;
    }
}

@media print {
    #globalsearch,
    .abendrot-search-form {
        display: none !important;
    }
}

@media screen and (max-width: 620px) {
    /* The expanded field occupies the logo's space on narrow screens. */
    #head:has(.global-search[open]) #logo {
        display: none;
    }
}
