/**
 * Mobile menu
 */

/* Burger */
.hamburger {
    align-items: center;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    display: block;
    flex-shrink: 0;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.hamburger__bar {
    background: #333;
    display: block;
    height: 1px;
    margin: 3px auto;
    width: 20px;
}

.mobile-menu {
    inset: 0;
    overflow: auto;
    pointer-events: none;
    position: fixed;
    z-index: 1000;
}

.mobile-menu > ul {
    list-style: none;
    margin: 40px 0 0 0;
    padding: 0;
}

.mobile-menu__backdrop {
    inset: 0;
    opacity: 0;
    position: absolute;
}

.mobile-menu__inner {
    background: #fff;
    box-shadow: 2px 0 12px rgba(0, 0, 0, .12);
    display: flex;
    flex-direction: column;
    height: 100%;
    left: 0;
    position: absolute;
    transform: translateX(-100%);
    transition: transform .3s ease;
    top: 0;
    width: max(80%, 320px);
    z-index: 1001;
}

.mobile-menu__close {
    align-self: flex-start;
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 2.5rem;
    line-height: 1;
    position: absolute;
    right: 20px;
    top: 10px;
}

.mobile-menu ul.mobile-menu-main {
    display: flex;
    flex-direction: column;
    font-size: 1.3rem;
    gap: 1em;
    padding: 40px 0 10px 0;
}

.mobile-menu .mobile-menu-main a {
    align-items: center;
    color: #000;
    display: flex;
    font-size: .9rem;
    justify-content: space-between;
    padding: .6em 1.5em;
    width: 100%;
}

.mobile-menu .menu-item-has-children > a::after {
    content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512' width='12' height='16' fill='%23000000'%3E%3Cpath d='M169.4 374.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 306.7 54.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z'/%3E%3C/svg%3E");
}

.mobile-menu .mobile-menu-main .sub-menu {
    display: flex;
    flex-direction: column;
    gap: 1em;
    max-height: 0;
    overflow: hidden;
    padding-left: 1em;
    transition: max-height 0.3s ease;
}

.mobile-menu .mobile-menu-main a:hover {
    color: var(--school-primary-color);
}


body.mobile-menu-open .mobile-menu {
    pointer-events: auto;
}

body.mobile-menu-open .mobile-menu__inner {
    transform: translateX(0);
}

@media (min-width: 768px) {
    .hamburger {
        display: none;
    }
}
