/* BIEI custom header for Inspiro 2.2.2 */
.biei-menu-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    text-align: center;
    white-space: nowrap;
}

.biei-menu-label-en {
    display: block;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0;
}

.biei-menu-label-ja {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: 0;
}

@media (min-width: 1025px) {
    .biei-customheader-active #site-navigation .header-navigation-wrapper {
        justify-content: center;
        min-width: 0;
    }

    .biei-customheader-active #site-navigation .primary-menu-wrapper {
        width: min(100%, 820px);
    }

    .biei-customheader-active #site-navigation .primary-menu-wrapper > .navbar-nav {
        display: grid;
        grid-template-columns: repeat(4, minmax(130px, 1fr));
        gap: 18px 24px;
        width: 100%;
        margin: 0;
        padding: 0;
        align-items: center;
        justify-content: center;
    }

    /*
     * Inspiro/Superfish adds clearfix pseudo-elements to the menu UL.
     * With CSS Grid, ::before is treated as the first grid item and leaves
     * an empty cell before ABOUT, so disable both clearfix items on desktop.
     */
    .biei-customheader-active #site-navigation .primary-menu-wrapper > .navbar-nav::before,
    .biei-customheader-active #site-navigation .primary-menu-wrapper > .navbar-nav::after {
        display: none !important;
        content: none !important;
    }

    .biei-customheader-active #site-navigation .primary-menu-wrapper > .navbar-nav > li {
        min-width: 0;
        margin: 0;
        text-align: center;
    }

    .biei-customheader-active #site-navigation .primary-menu-wrapper > .navbar-nav > li > a {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 38px;
        padding: 0;
    }
}

@media (max-width: 1024px) {
    .biei-customheader-active .side-nav .biei-menu-label {
        align-items: flex-start;
        text-align: left;
        white-space: normal;
    }
}
