/* Mobile/tablet drawer behavior for the site's side navigation widgets
   (.divmenuproj on Projects/Index, .menuleftx logo link on every other page).
   Nothing here applies at 1024px and above, so desktop is byte-for-byte unchanged. */

.hb-menu-toggle,
.hb-menu-backdrop {
    display: none;
}

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

    .hb-menu-toggle {
        /* .divmenuproj only ever renders on Projects/Index, where the grid
           content starts at margin-left:12% (.divproj) — center the toggle
           in that empty strip instead of a fixed left offset that can run
           past it on narrow phones */
        position: fixed;
        bottom: 14px;
        left: 6%;
        transform: translateX(-50%);
        z-index: 2000;
        width: 34px;
        height: 34px;
        border: none;
        border-radius: 7px;
        background: rgba(0, 0, 0, 0.75);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 0;
        cursor: pointer;
    }

        .hb-menu-toggle span {
            display: block;
            width: 16px;
            height: 2px;
            background: #fff;
            border-radius: 1px;
            transition: transform .25s ease, opacity .25s ease;
        }

    body.hb-menu-open .hb-menu-toggle span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    body.hb-menu-open .hb-menu-toggle span:nth-child(2) {
        opacity: 0;
    }

    body.hb-menu-open .hb-menu-toggle span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    .hb-menu-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1500;
        opacity: 0;
        pointer-events: none;
        transition: opacity .25s ease;
    }

    body.hb-menu-open .hb-menu-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    /* .divmenuproj becomes an off-canvas drawer */
    body.hb-has-drawer-menu .divmenuproj {
        position: fixed;
        top: 0;
        bottom: 0;
        left: -100%;
        height: 100%;
        width: 78%;
        max-width: 320px;
        background: rgba(17, 17, 17, 0.97);
        z-index: 1900;
        padding: 28px 28px 90px;
        overflow-y: auto;
        box-sizing: border-box;
        transition: left .3s ease;
    }

    body.hb-has-drawer-menu.hb-menu-open .divmenuproj {
        left: 0;
    }

    body.hb-has-drawer-menu .divmenuproj .fmenu {
        font-size: 20px;
        line-height: 2.4;
        color: #fff;
        display: block;
    }

    /* pmenu.png is a solid logo made for light page backgrounds, so it shows up
       as an awkward opaque box on the drawer's dark background — swap in the
       light/transparent logo already used for dark backgrounds on other pages */
    body.hb-has-drawer-menu .divmenuproj img {
        content: url('/images/logomenu.png');
        max-width: 140px;
    }

    /* .menuleftx: single logo/home icon present on every other page. Several
       pages draw a decorative vertical rule via a repeating background tile
       a bit further in (e.g. aboutbg2.png's rule sits at ~14-17% from the
       left) — keep the icon inside the strip before that rule instead of
       sitting on top of it. */
    .menuleftx {
        width: 36px;
        left: 8px;
        bottom: 12px;
    }
}
