@media (max-width: 991.98px) {
    /*
     * Uebergang zum Desktop-Layout (768px bis 992px) fliessend:
     * Abstaende wachsen linear mit dem Viewport (Mobile-Logo bleibt volle Breite).
     */
    .header {
        position: relative;
        --header-pad: clamp(0px, calc((100vw - 768px) * .143), 2rem);
        padding: var(--header-pad) 0 0;
    }

    .logo-subpages,
    .logo-start {
        width: 100%;
        max-width: 100%;
    }

    #c95 {
        padding-bottom: calc(2rem - clamp(0px, calc((100vw - 768px) * .0714), 1rem));
    }
}

/* menu */

ul.footer-menu {
    list-style-type: none;
    display: flex;
    flex-wrap: wrap;
}

ul.navbar-nav {
    flex-direction: column !important;
    row-gap: 0rem;
    column-gap: 3rem;
}

@media (max-width: 991.98px) {
    ul.navbar-nav {
        column-gap: 0;
        margin: 0;
        padding: 0;
    }
}

.nav-link {
    font-size: var(--bs-nav-link-font-size);
    font-weight: var(--bs-nav-link-font-weight);
    color: var(--bs-nav-link-color);
}

@media (min-width: 992px) {
    .offcanvas {
        visibility: visible;
        position: relative;
        background: none;
        border: none;
        justify-content: end;
    }
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-toggler-icon {
    width: 2em;
    height: 2em;
}

@media (max-width: 991.98px) {
    .offcanvas {
        width: 250px !important;
    }

    .offcanvas-start-lg {
        top: 0;
        left: 0;
        border-right: 1px solid rgba(0, 0, 0, .2);
        transform: translateX(-100%);
    }

    .navbar-toggler-icon {
        z-index: 1111;
        padding-right: 2rem;
    }

    .navbar > .container-fluid {
        justify-content: end;
    }

    /* Die ausgeblendete Navigation (Offcanvas ist position: fixed) soll keinen Platz belegen */
    nav.navbar,
    nav.navbar > .container-fluid {
        padding: 0;
    }
}

@media (min-width: 992px) {
    /* Start- und Unterseiten-Logo gleich gross: waechst fliessend mit dem Viewport */
    .logo-subpages,
    .logo-start {
        float: left;
        width: min(40vw, 520px);
        max-width: none;
    }

    #c95 {
        clear: both;
        padding: 2rem 0 1rem 0;
    }

    .header {
        padding: 2rem 0;
        margin-bottom: clamp(2rem, calc(2rem + (100vw - 992px) * .2451), 8rem);
    }
}

ul.navbar-nav {
    margin-top: 2rem;
}

ul.navbar-nav li {
    transform: rotate(-5.7deg);
}

ul.navbar-nav li:nth-child(1) {
    padding-left: 20px;
}

ul.navbar-nav li:nth-child(2) {
    padding-left: 60px;
}

ul.navbar-nav li:nth-child(3) {
    padding-left: 100px;
}

ul.navbar-nav li:nth-child(4) {
    padding-left: 140px;
}

/* Mobile-Menue-Button: drei schraege Linien (Winkel wie der Logo-Schriftzug) auf grauer, leicht erhabener Flaeche */
.mobile-menu-button .mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    min-height: 48px;
    padding: .6rem .7rem;
    background: rgba(204, 204, 204, .3);
    border: 1px solid rgba(0, 0, 0, .12);
    border-radius: .3rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, .2);
    cursor: pointer;
    margin-top: 2.5rem;
    margin-bottom: 2rem !important;
    transition: background-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.mobile-menu-icon {
    display: block;
    width: 2.2rem;
    height: auto;
    overflow: visible;
}

/* Animation: die versetzten Linien schieben sich zu einer Kante zusammen */
.mobile-menu-icon path {
    transition: transform .25s ease;
}

.mobile-menu-button .mobile-menu-toggle:hover .mobile-menu-icon path:nth-child(1),
.mobile-menu-button .mobile-menu-toggle:active .mobile-menu-icon path:nth-child(1),
.mobile-menu-button .mobile-menu-toggle:focus-visible .mobile-menu-icon path:nth-child(1) {
    transform: translateX(4px);
}

.mobile-menu-button .mobile-menu-toggle:hover .mobile-menu-icon path:nth-child(3),
.mobile-menu-button .mobile-menu-toggle:active .mobile-menu-icon path:nth-child(3),
.mobile-menu-button .mobile-menu-toggle:focus-visible .mobile-menu-icon path:nth-child(3) {
    transform: translateX(-4px);
}

@media (prefers-reduced-motion: reduce) {
    .mobile-menu-icon path {
        transition: none;
    }
}

.mobile-menu-button .mobile-menu-toggle:hover {
    background: rgba(204, 204, 204, .5);
    box-shadow: 0 3px 7px rgba(0, 0, 0, .25);
}

.mobile-menu-button .mobile-menu-toggle:active {
    background: rgba(204, 204, 204, .6);
    box-shadow: inset 0 3px 5px rgba(0, 0, 0, .15);
    transform: translateY(1px);
}

.mobile-menu-button .mobile-menu-toggle:focus-visible {
    outline: 2px solid var(--studio-color-blue);
    outline-offset: 2px;
}

/*
 * Mobile-Menue-Button im unteren Bereich des Logos (rechts unten).
 * Steht am Dateiende, damit diese Regeln die Basisregeln oben ueberschreiben.
 * Groesse und Abstand skalieren stetig mit der Bildbreite (kein Knick, kein Springen):
 * - Button: ueberall in Desktop-Groesse (48px)
 * - Abstand zur Logo-Unterkante: proportional zur Logohoehe, hoechstens 40px
 */
@media (max-width: 991.98px) {
    .header {
        position: relative;
        --btn: 48px;
    }

    .mobile-menu-button {
        position: absolute;
        right: .75rem;
        bottom: clamp(0px, calc((100vw - 32px) * .1497 - var(--btn)), 40px);
        z-index: 2;
    }

    .mobile-menu-button .mobile-menu-toggle {
        margin: 0 !important;
        min-width: var(--btn);
        min-height: var(--btn);
        padding: .6rem .7rem;
    }

    .mobile-menu-icon {
        width: 2.2rem;
    }
}
