.overlay-menu-container {
    background-color: var(--wp--preset--color--blue-light);
    padding: var(--wp--preset--spacing--50);
    padding-block: var(--wp--preset--spacing--40);
}

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

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

.wp-block-overlay-menu {
    align-items: center;
    display: flex;
    height: 2.5em;
    justify-content: center;
    width: 2.5em;
}

.menu-item-has-children {
    background-color: transparent;
    transition: background-color 0.3s ease;
}

.menu-item-has-children > a {
    align-items: center;
    display: flex !important;
    justify-content: space-between;
}

.overlay-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: 0.375rem;
    transition: text-decoration-color 0.25s ease;
}

.overlay-menu-container > ul > li > a {
    color: var(--wp--preset--color--purple);
    font-weight: 500;
    padding: 1.25rem 0;
}

.overlay-menu-container > ul ul a {
    font-size: 0.875rem;
}

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

/* ---- HAMBURGER TOGGLE ----- */

.wp-block-overlay-menu .menu-toggle:not([aria-expanded=true]) .menu-toggle-label--open {
    display: none;
}

.wp-block-overlay-menu .menu-toggle[aria-expanded=true] .menu-toggle-label--closed {
    display: none;
}

.menu-toggle:not(.menu-toggle--toggled) + .menu-toggle .open {
    display: none;
}

.wp-block-overlay-menu .menu-toggle {
    background-color: transparent;
    border-width: 0;
    color: var(--wp--preset--color--purple);
    display: block;
    line-height: 1;
    margin: 0;
    max-width: 3rem;
    position: relative;
    text-align: center;
    z-index: 10;
}

.hamburger {
    display: block;
    height: 2rem;
    margin: auto;
    position: relative;
    transition: opacity 0.25s cubic-bezier(0.19, 1, 0.22, 1);
    width: 2rem;
    z-index: 99;
}

.hamburger > .line {
    background: var(--wp--preset--color--purple);
    border-radius: 3px;
    display: block;
    height: 3px;
    position: absolute;
    top: calc(17px - 1.5px);
    transform: rotate(0deg);
    width: 34px;
}

.hamburger > .line1 {
    top: calc(17px - 1.5px - 8px);
}

.hamburger > .line2 {
    opacity: 1;
}

.hamburger > .line3 {
    top: calc(17px - 1.5px + 8px);
}

.hamburger > .line4 {
    height: 0;
    left: calc(17px - 1.5px);
    opacity: 0;
    width: 3px;
}

.menu-toggle[aria-expanded=true] .hamburger > .line {
    transition:
        transform 0.25s cubic-bezier(0.19, 1, 0.22, 1) 0.6s,
        top 0.25s cubic-bezier(0.19, 1, 0.22, 1),
        opacity 0.25s cubic-bezier(0.19, 1, 0.22, 1),
        height 0.25s cubic-bezier(0.19, 1, 0.22, 1) 0.25s,
        width 0s linear 0.25s;
}

.menu-toggle[aria-expanded=true] .hamburger > .line1 {
    opacity: 0;
    top: calc(17px - 1.5px);
}

.menu-toggle[aria-expanded=true] .hamburger > .line2 {
    transform: rotate(45deg);
}

.menu-toggle[aria-expanded=true] .hamburger > .line3 {
    opacity: 0;
    top: calc(17px - 1.5px);
}

.menu-toggle[aria-expanded=true] .hamburger > .line4 {
    height: 34px;
    opacity: 1;
    top: 0;
    transform: rotate(45deg);
}

.mobile-menu-panel {
    background-color: var(--wp--preset--color--base);
    border-width: 0;
    box-sizing: border-box;
    height: 100vh;
    height: calc(100vh - var(--header-height));
    margin: 0;
    max-width: 100%;
    opacity: 0;
    overflow-y: auto;
    padding: 0;
    position: fixed;
    top: -200vh;
    width: 100%;
    z-index: -1;
}

.mobile-menu-panel-additional {
    display: flex;
    padding: var(--wp--preset--spacing--50);
}

.mobile-menu-panel-additional-inner {
    margin: auto;
    max-width: var(--wp--style--global--content-size);
    width: 100%;
}

.menu-toggle[aria-expanded=true] + .mobile-menu-panel {
    bottom: 0;
    opacity: 1;
    top: var(--header-height);
    z-index: 10;
}

.overlay-menu-container > ul ul {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding-inline-start: 0.75rem;
}

.overlay-menu-container li.open > ul {
    max-height: 9999px;
    opacity: 1;
}

.overlay-menu-container .menu-item-has-thumbnail img {
    display: none;
}

.overlay-menu-container li {
    border-bottom: 1px solid var(--wp--preset--color--blue-medium);

    &:last-child {
        border-bottom: none;
    }
}

.overlay-menu-container .menu-item-has-children > a::after {
    background-color: var(--wp--preset--color--blue);
    color: inherit;
    content: '';
    display: block;
    height: 1rem;
    mask-image: url("data:image/svg+xml,%3Csvg width='12' height='7' viewBox='0 0 12 7' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A");
    mask-position: center;
    mask-repeat: no-repeat;
    mask-size: contain;
    transform: rotate(270deg);
    transition: transform 0.25s ease;
    width: 1rem;
}

.overlay-menu .sub-menu li:not(.menu-item-has-children) > a::before {
    background-color: var(--wp--preset--color--blue);
    color: inherit;
    content: '';
    display: inline-block;
    height: 0.75rem;
    margin-inline-end: 0.375rem;
    mask-image: url("data:image/svg+xml,%3Csvg width='12' height='7' viewBox='0 0 12 7' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A");
    mask-position: center;
    mask-repeat: no-repeat;
    mask-size: contain;
    transform: rotate(270deg);
    transition: transform 0.25s ease;
    width: 0.75rem;
}

.overlay-menu-container .menu-item-has-children.open {
    background: var(--wp--preset--color--blue-light);
    bottom: 0;
    left: 0;
    margin: 0;
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
    padding: 1.5rem;
    position: fixed;
    right: 0;
    top: var(--header-height, 4.675rem);
    z-index: 11;
}

.overlay-menu-container .menu-item-has-children.open > a {
    color: var(--wp--preset--color--purple);
    flex-direction: row-reverse;
    font-size: 1rem;
    font-weight: 500;
    gap: 1rem;
    justify-content: flex-end;
    padding: 1.25rem 0;
}

.overlay-menu-container .menu-item-has-children.open > a::after {
    background-color: var(--wp--preset--color--purple);
    transform: rotate(90deg);
}

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

.menu-open #header {
    background-color: var(--wp--preset--color--base);
    left: 0;
    position: fixed;
    top: calc(0 + var(--wp-admin--admin-bar--height, 0));
    width: 100%;
    z-index: 10;
}

.wp-block-overlay-menu .wp-block-search {
    width: 100%;
}

.menu-open .wp-block-message-strip {
    display: none;
}
