/*
 * PPA 29.6 — Compact mobile bottom navigation
 * Keep existing colours and button behaviour.
 * Dialogs and overlays remain above navigation.
 */

@media screen and (max-width: 920px) {

    body #app > nav.bottom-nav {
        display: flex;
        position: fixed;

        left: 50%;
        right: auto;
        bottom: 0;

        transform: translateX(-50%);

        width: min(720px, 100vw);
        max-width: 100vw;
        min-width: 0;

        height: auto;
        min-height: 0;

        margin: 0;

        padding:
            3px
            6px
            calc(3px + env(safe-area-inset-bottom, 0px));

        gap: 2px;

        align-items: stretch;
        justify-content: space-between;

        box-sizing: border-box;

        border-radius: 16px 16px 0 0;

        /*
         * Above ordinary page content.
         * Below modal overlays.
         */
        z-index: 60;

        overflow: hidden;
    }

    body #app > nav.bottom-nav > .nav-item {
        display: flex;
        flex: 1 1 0;

        flex-direction: column;
        align-items: center;
        justify-content: center;

        width: 0;
        min-width: 0;
        max-width: none;

        min-height: 44px;

        padding: 4px 2px;

        margin: 0;
        gap: 2px;

        border-radius: 10px;
        box-sizing: border-box;
    }

    body #app > nav.bottom-nav > .nav-item.hidden {
        display: none !important;
    }

    body #app > nav.bottom-nav > .nav-item > span {
        font-size: 16px;
        line-height: 1;
    }

    body #app > nav.bottom-nav > .nav-item > small {
        display: block;

        width: 100%;
        min-width: 0;

        font-size: clamp(8px, 2vw, 10px);
        line-height: 1.15;

        font-weight: 800;
        text-align: center;

        white-space: normal;
        overflow-wrap: anywhere;
    }

    /*
     * Prevent page content from disappearing
     * beneath the fixed navigation.
     */
    body #app main {
        padding-bottom: max(
            110px,
            calc(82px + env(safe-area-inset-bottom, 0px))
        );
    }
}

/* PPA FOOTER CLEARANCE V1
   Keep footer links accessible above fixed mobile navigation.
*/
@media screen and (max-width: 920px) {
    body #app > footer.site-footer {
        padding-bottom: max(
            92px,
            calc(72px + env(safe-area-inset-bottom, 0px))
        );
        box-sizing: border-box;
    }
}