/* Bind the five section links to the locally hosted icon strip. */
#MagicMenu .nav-link[href="/"] { --section-icon-y: 0%; }
#MagicMenu .nav-link[href="/noutati"] { --section-icon-y: 25%; }
#MagicMenu .nav-link#navbarDropdown { --section-icon-y: 50%; }
#MagicMenu .nav-link[href="/contacte"] { --section-icon-y: 75%; }
#MagicMenu .nav-link[href="https://moldova1.md/live"] {
    --section-icon-y: 100%;
    --section-icon-color: #ff7268;
}

#MagicMenu .nav-item > .nav-link:is([href="/"], [href="/noutati"], #navbarDropdown, [href="/contacte"], [href="https://moldova1.md/live"]) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 9px;
    border-radius: 6px;
    color: #d1cccd;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    text-decoration: none;
    transition: background-color 140ms ease, color 140ms ease;

    & > i {
        display: inline-block;
        width: 17px;
        height: 17px;
        flex: none;
        background-color: var(--section-icon-color, currentColor);
        -webkit-mask: url("../../images/nav-sections-v1.svg") center var(--section-icon-y) / 100% 500% no-repeat;
        mask: url("../../images/nav-sections-v1.svg") center var(--section-icon-y) / 100% 500% no-repeat;
    }
    & > i::before { content: none; }
    &:is(:hover, :focus-visible), &[aria-expanded="true"] {
        background-color: #353132;
        color: #fff;
    }
    &:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
    &:is(.nav-item.active > a) {
        background-color: #433f40;
        color: #fff;
        font-weight: 700;
    }
}

#MagicMenu #navbarDropdown::after {
    width: 7px;
    height: 7px;
    margin: -3px 2px 0 2px;
    border: solid currentColor;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
}
#MagicMenu #navbarDropdown[aria-expanded="true"]::after {
    transform: rotate(225deg);
    margin-top: 3px;
}
#MagicMenu .dropdown-menu[aria-labelledby="navbarDropdown"] {
    min-width: 166px;
    padding: 5px;
    border: 1px solid #595354;
    border-radius: 7px;
    background: #302c2d;
    color: #eeebeb;
    box-shadow: 0 5px 12px rgb(20 15 16 / 17%);
}
#MagicMenu .dropdown-menu[aria-labelledby="navbarDropdown"]::before {
    content: none;
}
#MagicMenu .dropdown-menu[aria-labelledby="navbarDropdown"] .dropdown-item {
    padding: 9px 12px;
    border-radius: 4px;
    color: #eeebeb;
    font-size: .9375rem;
    line-height: 1.4;
    white-space: normal;
}
#MagicMenu .dropdown-menu[aria-labelledby="navbarDropdown"] .dropdown-item:is(:hover, :focus, .active) {
    background: #464143;
    color: #fff;
}
@media (max-width: 991.98px) {
    #MagicMenu #navbarColor02.show {
        max-height: calc(100vh - 70px);
        max-height: calc(100dvh - 70px);
        overflow-y: auto;
    }
    #MagicMenu #navbarColor02 > ul:has(> .nav-item > #navbarDropdown) {
        width: min(100%, 25rem);
        gap: 3px;
        padding-block: 4px 8px;
    }
    #MagicMenu #navbarColor02 > ul:has(> .nav-item > #navbarDropdown) > .nav-item {
        align-self: stretch;
        text-align: left;
    }
    #MagicMenu .nav-item > .nav-link:is([href="/"], [href="/noutati"], #navbarDropdown, [href="/contacte"], [href="https://moldova1.md/live"]) {
        width: 100%;
        justify-content: flex-start;
    }
    #MagicMenu .dropdown-menu[aria-labelledby="navbarDropdown"] .dropdown-item {
        display: flex;
        align-items: center;
        min-height: 44px;
    }
}
