.custom-menu-container,
.custom-menu-container * {
    box-sizing: border-box;
}

.custom-menu-container ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.custom-menu-container > ul {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: space-between;
}

.custom-menu-container ul a {
    display: block;
    font-size: var(--wp--preset--font-size--small);
    font-weight: 400;
    padding: 0.5rem 0;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-decoration-thickness: 1px;
    text-underline-offset: 6px;
    transition: text-decoration-color 0.3s ease;
}

.custom-menu-container .sub-menu > .menu-item {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.custom-menu-container > ul > li > a {
    color: white;
    padding: 1.5rem 0;
}

.custom-menu-container ul a:hover,
.custom-menu-container li.open > a {
    text-decoration-color: currentcolor;
}

.custom-menu-container ul li.current-menu-item > a,
.custom-menu-container ul li.current-menu-ancestor > a {
    font-weight: 700;
    text-decoration-color: currentcolor;
}

.custom-menu-container > ul > li > ul {
    background-color: white;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: flex-start;
    left: 0;
    margin: auto;
    max-height: 0;
    max-width: var(--wp--style--global--wide-size);
    opacity: 0;
    overflow: hidden;
    padding: 3rem 0;
    position: absolute;
    right: 0;
    top: -200%;
    transition:
        max-height 0.5s ease,
        opacity 0.5s ease;
    visibility: hidden;
    width: 100%;
    z-index: -1;
}

.custom-menu-container > ul > li > ul::after {
    background: white;
    content: '';
    height: 100%;
    left: calc((100vw - var(--wp--style--global--wide-size)) / 2 * -1);
    position: absolute;
    right: 0;
    top: 0;
    width: 100vw;
    z-index: -1;
}

.custom-menu-container > ul > li > ul:focus-within,
.custom-menu-container > ul > li.open > ul {
    max-height: 999px;
    opacity: 1;
    overflow: visible;
    top: 100%;
    transition: all 0.5s ease;
    transition-property: max-height, opacity;
    visibility: visible;
    z-index: 10;
}

.custom-menu-container > ul > .menu-item-has-children > a {
    gap: 0.5rem;
    position: relative;
}

.custom-menu-container > ul > .menu-item-has-children > a::after {
    background-color: currentcolor;
    bottom: 0.125em;
    content: '';
    height: 0.75em;
    mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 12 7' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A");
    mask-position: center;
    mask-repeat: no-repeat;
    transform: rotateX(0deg);
    transition: transform 0.25s ease-out;
    width: 0.75em;
}

.custom-menu-container > ul > .menu-item-has-children.open > a::after {
    transform: rotateX(180deg);
}

.custom-menu-container ul .menu-item-has-thumbnail > a {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.custom-menu-container ul .menu-item-has-thumbnail > a img {
    aspect-ratio: 4 / 3;
    border-radius: 0.5rem;
    height: 8.75rem;
    margin-block-end: 1.5em;
    max-width: 10.5rem;
    object-fit: cover;
    object-position: center;
}

.custom-menu-container figure {
    margin: 0;
}

.custom-menu-container > ul > li > ul li.menu-item-has-children > a {
    font-weight: 500;
}

@media screen and (min-width: 900px) and (max-width: 100rem) {
    .custom-menu-container > ul {
        gap: 0.5em;
    }

    .custom-menu-container > ul > li > ul {
        padding: 3rem 1rem;
    }
}
