/* SITE NAV */
.site-nav {
    z-index: 999;
    position: fixed;
    top: auto;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    overflow-y: auto;
    transform: translateX(-100%);
    background: #fff;
    transition: transform 0.25s ease-in-out;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

.site-nav.active {
    transform: translateX(0);
}

#nav-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    color: black;
}

#nav-close:hover {
    color: var(--text-lighter);
}

/* Main Navigation */
.main-nav {
    list-style: none;
    padding: 0;
    margin: 2rem 0;
}

.main-nav li {
    margin-bottom: 1.2rem;
}

.main-nav a {
    color: black;
    font-size: 1.5rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.25s ease;
}

.main-nav a:hover {
    color: var(--text-lighter);
}

/* Topics Navigation */
.topics-nav {
    list-style: none;
    padding: 0;
    margin: 2rem 0;
}

@media screen and (min-width: 900px) {
    .topics-nav {
        /*Chrome columns fix*/
        height: 43rem;
    }
}

.topics-nav li {
    position: relative;
    margin-bottom: .5rem;
}

.topics-nav>li>a {
    color: black;
    font-size: 1.4rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.25s ease;
    display: block;
    padding: 0.5rem 0;
}

.topics-nav>li.menu-item-has-children>a {
    padding-right: 2rem;
}

.topics-nav>li.menu-item-has-children>a::after {
    content: '';
    position: absolute;
    right: 0;
    top: 1.8%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-right: 1px solid black;
    border-bottom: 1px solid black;
    transform: translateY(-50%) rotate(45deg);
    transition: transform 0.25s ease;
}

.topics-nav>li.menu-item-has-children.active>a::after {
    transform: translateY(-50%) rotate(-135deg);
}

.topics-nav ul {
    list-style: none;
    padding-left: 1.5rem;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease-out;
}

.topics-nav li.active>ul {
    max-height: 500px;
    /* Adjust based on your needs */
}

.topics-nav ul a {
    color: var(--text-lighter);
    font-size: 1.5rem;
    text-decoration: none;
    padding: 0.4rem 0;
    display: block;
    transition: color 0.25s ease;
}

.topics-nav ul a:hover {
    color: black;
}

.site-nav h4.lined {
    margin: 2rem 0;
    color: black;
    font-size: 1.6rem;
}

/* Socials Icons */
.site-nav .socials {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    margin-top: 4rem;
}

.site-nav .socials a {
    color: black;
    text-decoration: none;
    transition: color 0.25s ease;
}

.site-nav .socials a:hover {
    color: var(--text-lighter);
}

/* Desktop Navigation (900px and up) */
@media screen and (min-width: 900px) {
    .site-nav {
        max-width: 100%;
    }

    .nav-wrap {
        display: flex;
    }

    .main-nav {
        order: 2;
        min-width: 18%;
        padding-left: 5%;
        border-left: 1px solid #eee;
    }

    /* Render items as columns */
    .topics-nav {
        order: 1;
        flex: 1;
        column-count: 6;
        column-gap: .1rem;
        line-height: 2.8rem;
    }

    .topics-nav>li {
        display: inline-block;
        width: 100%;
        margin-bottom: 1.2rem;
    }

    .topics-nav>li>a {
        font-weight: 600;
        margin-bottom: 1rem;
        pointer-events: none;
    }

    .topics-nav>li.menu-item-has-children>a::after {
        display: none;
    }

    .topics-nav ul {
        max-height: none;
        padding-left: 0;
        overflow: visible;
    }

    .topics-nav ul li {
        margin-bottom: 0.5rem;
    }

    .topics-nav ul a {
        font-size: 1.5rem;
        padding: 0.2rem 0;
    }
}