/* The homepage uses viewport-fit=cover. Let the actual hero image reach the
   screen edge; protect controls, not the image, with the device's safe insets. */
@media (max-width: 1120px) {
    html.benix-home-safe-area nav#menu.menu-mainpage {
        top: calc(10px + env(safe-area-inset-top, 0px)) !important;
        left: max(10px, env(safe-area-inset-left, 0px));
        right: max(10px, env(safe-area-inset-right, 0px));
    }

    /* Hide the complete header when its starting position includes a notch. */
    html.benix-home-safe-area nav#menu.menu-mainpage.menu-hidden {
        transform: translate3d(0, calc(-130% - env(safe-area-inset-top, 0px)), 0) !important;
    }

    /* Position the existing dropdown below the header, without changing the
       list's original 12px padding or inserting an empty area inside it. */
    html.benix-home-safe-area #menu-mobile-box {
        top: calc(82px + env(safe-area-inset-top, 0px));
        left: max(10px, env(safe-area-inset-left, 0px));
        right: max(10px, env(safe-area-inset-right, 0px));
        max-height: calc(100vh - 96px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
        max-height: calc(100svh - 96px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    }

    html.benix-home-safe-area body > article {
        padding-left: env(safe-area-inset-left, 0px);
        padding-right: env(safe-area-inset-right, 0px);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
}

/* In phone landscape the original desktop 650px minimum must not crop the
   first screen to an oversized hero. The existing slider controls its height. */
@media (max-height: 600px) and (pointer: coarse) {
    html.benix-home-safe-area #slides.homepage-slides {
        min-height: 0;
    }
}
