/*
 * Alle Seiten: Suchbutton-Basis; bis 768px gemeinsame mobile Kopfzeile.
 * Nach swim.css laden. Die Einbindung ist bewusst nicht Teil dieser Datei.
 * Vorhandene .search-open-Logik und Bottomnavigation bleiben zuständig.
 */
body .top_head_row button.search-toggle {
    background: transparent;
    border: 0;
    font-family: FontAwesome;
}

body .top_head_row button.search-toggle:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
    box-shadow: 0 0 0 6px #384656;
}

@media screen and (max-width: 768px) {
    body:not(.home) .inner_top_bar {
        height: auto;
        min-height: 0;
        border-bottom: 0;
    }

    :is(body.home, body:not(.home)) .top_head_row {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: space-between;
        box-sizing: border-box;
        width: 100%;
        min-height: 80px;
        padding: 16px;
        background: #fff;
        border-bottom: 1px solid #e9eff4;
        overflow: visible;
    }

    :is(body.home, body:not(.home)) .top_head_row .logo {
        float: none;
        flex: 0 1 250px;
        width: 250px;
        min-width: 0;
        margin: 0 16px 0 0;
    }

    :is(body.home, body:not(.home)) .top_head_row .logo img.mobile {
        content: url('../newimg/Logo.svg');
        display: block !important;
        width: 100%;
        max-width: 250px;
        height: auto;
        aspect-ratio: 439 / 58;
        object-fit: contain;
        object-position: left center;
    }

    :is(body.home, body:not(.home)) .top_head_row .logo img.desktop {
        display: none;
    }

    :is(body.home, body:not(.home)) .top_head_row .primary-sidebar {
        position: static;
        float: none;
        flex: 0 0 48px;
        width: 48px;
        margin: 0;
    }

    :is(body.home, body:not(.home)) .top_head_row .wrap_top_head_home {
        display: block;
        float: none;
    }

    :is(body.home, body:not(.home)) .top_head_row .sidebar_2:first-child,
    :is(body.home, body:not(.home)) .top_head_row .wrap_top_head_home .sidebar_2:first-child {
        position: static;
        margin: 0;
    }

    :is(body.home, body:not(.home)) .top_head_row .sidebar_2 .searchform,
    :is(body.home, body:not(.home)) .top_head_row .sidebar_2 form > div {
        margin: 0;
    }

    :is(body.home, body:not(.home)) .top_head_row .sidebar_2 form > div {
        display: flex;
        justify-content: flex-end;
    }

    :is(body.home, body:not(.home)) .top_head_row .sidebar_2 .search-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 48px;
        box-sizing: border-box;
        width: 48px;
        height: 48px;
        padding: 0;
        border: 1px solid #576685;
        border-radius: 8px;
        background: #576685;
        color: #fff;
        font-size: 21px;
        line-height: 1;
        opacity: 1;
        cursor: pointer;
        touch-action: manipulation;
    }

    :is(body.home, body:not(.home)) .top_head_row .sidebar_2.search-open .search-toggle,
    :is(body.home, body:not(.home)) .top_head_row .sidebar_2 .search-toggle:hover {
        background: #384656;
        border-color: #384656;
    }

    /* Das geschlossene Feld darf weder Platz noch unsichtbaren Fokus belegen. */
    :is(body.home, body:not(.home)) .top_head_row .sidebar_2 input[type="text"],
    :is(body.home, body:not(.home)) .top_head_row .sidebar_2 input[type="submit"] {
        display: none;
    }

    /* Suchpanel unterhalb der Kopfzeile; der vorhandene Toggle setzt den Fokus. */
    :is(body.home, body:not(.home)) .top_head_row .sidebar_2.search-open input[type="text"] {
        display: block;
        position: absolute;
        z-index: 2;
        top: calc(100% + 8px);
        left: 12px;
        box-sizing: border-box;
        width: calc(100% - 24px);
        height: 52px;
        padding: 0 108px 0 14px;
        border: 2px solid #576685;
        border-radius: 8px;
        background: #fff;
        color: #384656;
        font-size: 16px;
        line-height: normal;
        box-shadow: 0 4px 12px rgba(56, 70, 86, 0.2);
        transition: none;
    }

    :is(body.home, body:not(.home)) .top_head_row .sidebar_2.search-open input[type="text"]::placeholder {
        color: #576685;
        opacity: 1;
    }

    :is(body.home, body:not(.home)) .top_head_row .sidebar_2.search-open input[type="submit"] {
        display: block;
        position: absolute;
        z-index: 3;
        top: calc(100% + 12px);
        right: 16px;
        box-sizing: border-box;
        width: 92px;
        height: 44px;
        padding: 0 8px;
        border: 0;
        border-radius: 5px;
        background: #576685;
        color: #fff;
        font: inherit;
        cursor: pointer;
        pointer-events: auto;
        touch-action: manipulation;
    }

    :is(body.home, body:not(.home)) .top_head_row .sidebar_2 input:focus-visible,
    :is(body.home, body:not(.home)) .top_head_row .sidebar_2 .search-toggle:focus-visible {
        outline: 3px solid #384656;
        outline-offset: 3px;
    }

    /* Kein zweiter Menüzugang neben der bestehenden Bottomnavigation. */
    :is(body.home, body:not(.home)) .top_head_row .burger {
        display: none !important;
    }

    :is(body.home, body:not(.home)) .top_head_row .primary-sidebar > .fa-times.mobile {
        display: none !important;
    }

    body.home .hero {
        height: clamp(220px, 32vh, 280px);
        min-height: 220px;
    }

    body.home .hero-content {
        bottom: 20%;
        padding: 0 16px;
    }

    body.home .hero-content h1 {
        font-size: 26px;
        line-height: 1.25;
        overflow-wrap: break-word;
    }

    body.home .hero-content p {
        font-size: clamp(14px, 3.8vw, 17px);
    }
}
