/* =========================================================================
   Stichwortsuche – St. Hedwig-Stiftung
   Eigenständiges Stylesheet (kein Teil des gulp-Builds).
   Nutzt die globale CSS-Variable --main-color der Website.
   ========================================================================= */

:root {
    --aw-search-color: var(--main-color, #0c6b3d);
}

/* =========================================================================
   Desktop: Lupe in der Topbar (Feld fährt nach LINKS aus)
   ========================================================================= */
.aw-search {
    position: relative;
    display: inline-flex;
    align-items: center;
    z-index: 20;
    /* deutlicher Abstand zum Facebook-/Social-Icon rechts daneben */
    margin: 0 26px 0 4px;
}

/* Lupe = Toggle UND Submit */
.aw-search__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    border-radius: 50%;
    transition: color .2s ease, background-color .2s ease;
}

.aw-search__toggle svg {
    width: 19px;
    height: 19px;
}

.aw-search__toggle:hover,
.aw-search.is-open .aw-search__toggle {
    color: var(--aw-search-color);
    background: rgba(0, 0, 0, .05);
    outline: none;
}

/* Ausfahrendes Feld – absolut LINKS von der Lupe, ohne Layout-Sprung */
.aw-search__field {
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-right: 6px;
    width: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    /* deckt darunterliegende Menüpunkte beim Ausfahren sauber ab */
    background: #fff;
    transition: width .3s ease, opacity .2s ease;
}

.aw-search.is-open .aw-search__field {
    width: 250px;
    opacity: 1;
    pointer-events: auto;
}

/* Neues, minimalistisches Feld-Design (Unterstrich-Stil) */
.aw-search__input {
    width: 100%;
    height: 34px;
    box-sizing: border-box;
    padding: 0 4px 4px;
    border: 0;
    border-bottom: 2px solid var(--aw-search-color);
    border-radius: 0;
    background: transparent;
    font-size: 15px;
    color: #222;
    outline: none;
}

.aw-search__input::placeholder {
    color: #9a9a9a;
}

/* =========================================================================
   Hauptnavigation: „Einrichtungen“-Dropdown breiter, kein Umbruch
   ========================================================================= */
.site-topbar-navbar .uk-navbar-dropdown,
.site-header-navbar .uk-navbar-dropdown {
    width: max-content !important;
    min-width: 220px !important;
    max-width: 90vw !important;
}

.site-topbar-navbar .uk-navbar-dropdown a,
.site-header-navbar .uk-navbar-dropdown a {
    white-space: nowrap;
}

/* =========================================================================
   Mobile
   ========================================================================= */
/* Burger-Icon deutlich größer */
.site-header-navbar .uk-navbar-toggle {
    padding: 6px;
}

.site-header-navbar .uk-navbar-toggle svg {
    width: 32px;
    height: 32px;
}

/* Im Offcanvas-Menü die (aus der Topbar mitgerenderte) Desktop-Lupe ausblenden */
.mobile-navigation .aw-search {
    display: none !important;
}

/* Suchleiste fest oben im Fullscreen-Menü (Offcanvas) */
.mobile-navigation .aw-search-offcanvas {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    /* unter die Home-/Schließen-Zeile setzen */
    margin: 64px 0 22px !important;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(0, 0, 0, .1);
}

.aw-search-offcanvas .aw-search-offcanvas__input {
    flex: 1 1 auto;
    min-width: 0;
    height: 44px;
    padding: 0 14px;
    border: 1px solid rgba(0, 0, 0, .15);
    border-radius: 22px;
    background: #fff;
    font-size: 16px;
    color: #222;
    outline: none;
}

.aw-search-offcanvas .aw-search-offcanvas__input:focus {
    border-color: var(--aw-search-color);
}

.aw-search-offcanvas .aw-search-offcanvas__submit {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: var(--aw-search-color);
    color: #fff;
    cursor: pointer;
}

.aw-search-offcanvas .aw-search-offcanvas__submit svg {
    width: 20px;
    height: 20px;
}

/* Lupe im grünen Button weiß einfärben (UIkit-SVG nutzt stroke="#000") */
.aw-search-offcanvas__submit svg [stroke] {
    stroke: #fff;
}

/* =========================================================================
   Ergebnis-Seite
   ========================================================================= */
.aw-search-results {
    max-width: 820px;
    margin: 0 auto;
    padding: 20px 0 60px;
}

.aw-search-results__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
}

.aw-search-results__count {
    color: #666;
    font-size: 15px;
}

.aw-search-results__sort label {
    font-size: 14px;
    color: #666;
    margin-right: 6px;
}

.aw-search-results__sort select {
    height: 34px;
    border: 1px solid rgba(0, 0, 0, .15);
    border-radius: 6px;
    padding: 0 8px;
    background: #fff;
}

.aw-search-result {
    border-bottom: 1px solid rgba(0, 0, 0, .08);
    padding: 18px 0;
}

.aw-search-result__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 19px;
    line-height: 1.3;
    margin: 0 0 6px;
}

.aw-search-result__title a {
    color: var(--aw-search-color);
    text-decoration: none;
}

.aw-search-result__title a:hover {
    text-decoration: underline;
}

.aw-search-result__badge {
    flex: 0 0 auto;
    display: inline-block;
    min-width: 22px;
    padding: 2px 8px;
    border-radius: 11px;
    background: var(--aw-search-color);
    color: #fff;
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
}

.aw-search-result__snippet {
    color: #444;
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
}

.aw-search-result__snippet mark,
.aw-search-highlight {
    background: #ffe7a3;
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
}

.aw-search-highlight--active {
    background: #ffcf4d;
}

.aw-search-empty {
    color: #666;
    font-size: 16px;
    padding: 20px 0;
}
