/* 
men-level-0 = tabs
men-level-1 = headings
men-level-2 = links 
*/


/* Resets */

#nav_menu .advanced-dropdown-menu li:last-child a {
    border: none;
}

.advanced-dropdown-menu .caret {
    display: none;
}

.advanced-dropdown-menu .nav>li>a:focus,
.advanced-dropdown-menu .nav>li>a:hover {
    background-color: unset;
}

.advanced-dropdown-menu .tabs-section::before {
    content: none;
}


/* Courses menu */

.advanced-dropdown-menu {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(295px, 1fr));
    gap: 1rem 15px;
    /* It's really a 30px gap, but 15px of padding are added to the [id*="side-content-area"] to make it's border centered between the #menus-section */
    position: absolute;
    background: white;
    left: calc(var(--side-margin));
    right: calc(var(--side-margin));
    z-index: 100;
    padding-block: 25px;
}

@media (min-width: 991px) {
    /* Make the dropdown visible at screen sizes down to 990px, when we switch to the mobile menu */
    .advanced-dropdown-menu.open {
        display: grid;
    }
}

.advanced-dropdown-menu>div {
    grid-column: 1/3;
}

.advanced-dropdown-menu::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(var(--side-margin) * -1);
    right: calc(var(--side-margin) * -1);
    background: white;
    z-index: -1;
    opacity: 1;
    border-bottom: 1px solid #eee;
}

.menus-section {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.advanced-dropdown-menu ul {
    all: revert;
    list-style: none;
    padding: 0;
    margin: 0;
}

.advanced-dropdown-menu a {
    white-space: break-spaces;
    transition: .125s color ease-in-out, .125s background ease-in-out;
}


/* Tabs, men-level-0 */

.advanced-dropdown-menu .tabs-section {
    display: flex;
    gap: 1rem 30px;
}

.advanced-dropdown-menu .tabs-section>li>a,
.advanced-dropdown-menu .men-level-1>li>a,
[id*="side-content-area"] a {
    /* Tabs, Headings, Side Content <a> */
    font-size: 18px;
    font-weight: 500;
    line-height: 1;
}

.tabs-section>li>a {
    /* Tabs <a> */
    color: var(--text);
    border: none;
    position: relative;
    padding: 0;
}

.advanced-dropdown-menu .tabs-section>li:is(:hover, :focus, :focus-within, .active)>a {
    /* Tabs <a> */
    background-color: transparent;
    color: var(--accent);
    border: none;
}

.tabs-section>li>a::before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    border-bottom: 2px solid transparent;
    transition: .125s border ease-in-out;
}

.advanced-dropdown-menu .tabs-section>li:is(:hover, :focus, :focus-within, .active)>a::before {
    border-color: currentColor;
}


/* Headings men-level-1 */

.advanced-dropdown-menu .men-level-1 {
    /* Headings */
    columns: 2;
    gap: 30px;
}

.advanced-dropdown-menu .men-level-1>.dropdown-submenu {
    /* Children of headings */
    page-break-inside: avoid;
    margin-bottom: 2rem;
}

.advanced-dropdown-menu .men-level-1>li:not(.button-link)>a {
    /* Headings <a>*/
    color: var(--text);
}

.advanced-dropdown-menu .men-level-1>li.button-link>a:not(annoying-selectors) {
    /* Button link <a>*/
    color: white;
    position: relative;
    padding-right: 1.75ch;
}

.advanced-dropdown-menu .button-link {
    background-color: var(--accent);
    padding-right:
}

.advanced-dropdown-menu .button-link:is(:hover, :focus) {
    background-color: var(--primary);
}

.advanced-dropdown-menu .button-link>a::before {
    /* Circle of magnifying glass icon */
    content: '';
    position: absolute;
    right: 0;
    width: .75rem;
    height: .75rem;
    border: 2px solid white;
    border-radius: 50%;
    top: .2rem;
}

.advanced-dropdown-menu .button-link>a::after {
    /* Handle of magnifying glass icon*/
    content: '';
    position: absolute;
    right: 0;
    height: .5rem;
    width: 1px;
    border-right: 3px solid white;
    border-radius: 50%;
    bottom: .3rem;
    transform: rotate(-39deg);
}

.advanced-dropdown-menu .men-level-1>li>.sub-a {
    /* If Heading is the label for a dropdown, make it unclickable*/
    pointer-events: none;
}

.advanced-dropdown-menu .dropdown-menu:is(.men-level-1, .men-level-2)>li>a {
    /* Headings and links <a> */
    padding-inline: 0;
    color: var(--text);
}


/* Links men-level-2 */

.advanced-dropdown-menu .men-level-1>li>a:focus,
.advanced-dropdown-menu .men-level-1>li>a:hover,
.advanced-dropdown-menu .men-level-2>li>a:focus,
.advanced-dropdown-menu .men-level-2>li>a:hover {
    background: transparent;
    color: var(--accent);
}

.advanced-dropdown-menu .men-level-1 a,
[id*="side-content-area"] {
    font-size: 15px;
}

#course-menu .button-link a {
    color: white;
}


/* Text content area */

#text-content-area {
    font-size: 15px;
    color: var(--primary);
}

:is(#text-content-area, #certified-text-content-area):empty {
    /* If no text is added to the content page for a dropdown, don't display the section it would show up in */
    display: none;
}


/* Side content area */

[id*="side-content-area"] {
    padding-left: 15px;
    border-left: 1px solid #eee;
}

[id*="side-content-area"] ul {
    display: flex;
    gap: 2rem 15px;
    flex-direction: column;
}

[id*="side-content-area"] li {
    display: flex;
    gap: 1rem 15px;
}

[id*="side-content-area"] img {
    object-fit: cover;
    aspect-ratio: 1/1;
    width: 90px;
    height: 90px;
    min-width: 90px;
    overflow: hidden;
    border-radius: 50%;
    min-width: max-content;
}