/*
 * Mobile Startseiten-Tabs. Nach bootstrap.css und swim.css laden.
 * Ursache: nowrap, 16%-Breiten, 9px-Schrift und nur aktive Tabs mit
 * 100px Mindesthöhe in swim.css. Bestehende Farben bleiben erhalten.
 */
body.home .tabs_h .home-section-heading {
    display: none;
}

body.home .tabs_h > .nav-tabs > li > a > .home-tab-label-desktop {
    position: static;
    bottom: auto;
    display: inline;
}

body.home .tabs_h > .nav-tabs > li > a > .home-tab-label-mobile {
    display: none;
}

@media screen and (max-width: 768px) {
    body.home .tabs_h .home-section-heading {
        display: block;
        text-align: center;
        font-size: 20px;
        line-height: 26px;
        font-weight: 600;
        color: #384656;
        margin: 14px 0 12px;
        padding: 0;
    }

    /* .content-area ist mobil bereits 100% breit; nur der Inhalt hat 30px Padding. */
    body.home .top_content {
        padding-left: 12px;
        padding-right: 12px;
    }

    body.home .tabs_h > .nav-tabs {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-auto-rows: 1fr;
        width: 100%;
        margin: 0;
        padding-left: 0;
    }

    /* Bootstrap-Clearfix darf keine zusätzlichen Grid-Zellen erzeugen. */
    body.home .tabs_h > .nav-tabs::before,
    body.home .tabs_h > .nav-tabs::after {
        display: none;
        content: none;
    }

    body.home .tabs_h > .nav-tabs > li {
        float: none;
        width: auto;
        min-width: 0;
        margin: 0;
    }

    body.home .tabs_h > .nav-tabs > li > a,
    body.home .tabs_h > .nav-tabs > li.active > a {
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 6px;
        height: 76px;
        min-height: 76px;
        margin: 0;
        padding: 10px 4px;
        font-size: 12px;
        /* Die vorhandene Tablet-Regel setzt line-height mit !important. */
        line-height: 16px !important;
        text-align: center;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    body.home .tabs_h > .nav-tabs > li > a > .home-tab-label-desktop {
        display: none;
    }

    body.home .tabs_h > .nav-tabs > li > a > .home-tab-label-mobile {
        display: block;
        position: static;
    }

    body.home .tabs_h > .nav-tabs > li > a > .home-tab-icon {
        position: static;
        bottom: auto;
        display: flex;
        flex: 0 0 24px;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;
    }

    body.home .tabs_h > .nav-tabs > li > a > .home-tab-icon > img {
        display: block;
        width: 24px;
        height: 24px;
        max-width: 100%;
        object-fit: contain;
    }

    body.home .tabs_h > .nav-tabs > li > a:focus-visible {
        outline: 2px solid currentColor;
        outline-offset: -3px;
    }

    /* Nach dem ersten Tabwechsel bleibt nur die kompakte Iconleiste. */
    body.home .tabs_h.mobile-tabs-compact > .nav-tabs {
        position: sticky;
        top: 0;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        box-sizing: border-box;
        width: calc(100% + 24px);
        margin: 0 -12px;
        height: auto;
        padding: 4px 12px;
        z-index: 60;
        background: #fff;
        border: 1px solid #e9eff4;
    }

    body.home .tabs_h.mobile-tabs-compact > .nav-tabs > li > a {
        height: 48px;
        min-height: 48px;
        justify-content: center;
    }

    body.home .tabs_h.mobile-tabs-compact > .nav-tabs > li > a > .home-tab-label-mobile {
        display: none;
    }
}
