/* Dropdown menu - infinite levels. Below 768px the mobile menu is mmenu light. */

.main-nav {
    display: none;
}

@media (min-width: 768px) {
    .main-nav {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        grid-column: span 2 / span 2;
    }
}

.dd-menu,
.dd-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dd-menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
}

.dd-menu li {
    position: relative;
}

.dd-menu a {
    display: block;
    padding: 12px;
    color: rgba(0, 0, 41, 0.75);
    font-family: Roboto, sans-serif;
    font-size: 17px;
    font-weight: 400;
    line-height: 18px;
    text-decoration: none;
    white-space: nowrap;
}

.dd-menu .menu-item-has-children > a {
    padding-right: 26px;
}

/* Polylang language switcher */
.dd-menu .lang-item > a {
    display: flex;
    align-items: center;
}

.dd-menu .lang-item img {
    display: block;
}


/* Submenu toggle (arrow button) */
.dd-toggle {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 26px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

.dd-toggle::before {
    content: "";
    position: absolute;
    top: 50%;
    right: 10px;
    margin-top: -2px;
    border-style: solid;
    border-width: 5px 4px 0 4px;
    border-color: #666666 transparent transparent transparent;
}

.dd-toggle:focus-visible {
    outline: 2px solid rgba(0, 0, 41, 0.75);
    outline-offset: -4px;
}


/* Submenus */
.dd-menu ul {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    min-width: 12em;
    width: max-content;
    max-width: 20em;
    padding: 5px 0;
    background: #fff;
    border: 1px solid #cccccc;
    box-shadow: 0 5px 9px rgba(0, 0, 0, 0.1);
    visibility: hidden;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s;
}

/* Nested levels fly out to the side, aligned with the parent item */
.dd-menu ul ul {
    top: -6px;
    left: 100%;
}

/* Flipped by JS when the submenu would overflow the right edge of the viewport */
.dd-menu > li > ul.dd-flip {
    left: auto;
    right: 0;
}

.dd-menu ul ul.dd-flip {
    left: auto;
    right: 100%;
}

/* Open: hover on mouse devices, .is-open from JS (toggle button, touch, keyboard) */
@media (hover: hover) {
    .dd-menu li:hover > ul {
        visibility: visible;
        opacity: 1;
        transform: none;
        transition-delay: 0s;
    }
}

.dd-menu li.is-open > ul {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition-delay: 0s;
}

.dd-menu ul a {
    padding: 10px 20px;
    color: #666666;
    font-size: 16px;
    white-space: normal;
}

.dd-menu ul a:hover,
.dd-menu ul a:focus-visible {
    color: rgba(0, 0, 41, 0.75);
}

.dd-menu ul .menu-item-has-children > a {
    padding-right: 30px;
}

.dd-menu ul .dd-toggle {
    width: 30px;
}

.dd-menu ul .dd-toggle::before {
    right: 12px;
    margin-top: -4px;
    border-width: 4px 0 4px 5px;
    border-color: transparent transparent transparent #666666;
}

@media (prefers-reduced-motion: reduce) {
    .dd-menu ul {
        transform: none;
        transition: none;
    }
}