/* Front-end styling for menu item badges. Loaded only when a badge is present. Mobile-first. */
li.mib-has-badge {
    position: relative;
    overflow: visible;
}

li.mib-has-badge a {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}

.mib-badge {
    padding: 3px 6px 2px 6px;
    font-size: 10px;
    line-height: 1.2;
    border-radius: 24px;
    color: #fff;
    white-space: nowrap;
    pointer-events: none;
    text-decoration: none;
    align-self: center;
    margin-top: -3px;
}

/*
 * Atomic inline: stops the parent link's hover underline from propagating.
 * text-decoration: none on the flex-item .mib-badge itself does not work,
 * because a blockified flex item still inherits the drawn decoration.
 */
.mib-badge-text {
    display: inline-block;
    text-decoration: none;
}

ul.sub-menu .mib-has-badge a {
    display: flex !important;
}

ul.sub-menu .mib-has-badge .mib-badge {
    margin-top: -5px;
}

/* Desktop (>= 992px) */
@media (min-width: 992px) {
    /* Float the badge above the item. */
    .menu > li.mib-has-badge .mib-badge {
        position: absolute;
        top: -15px;
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }
}
