/* Dropdowns */

.dropdown {
    position: relative;

    &__trig {
        position: relative;

        &:before {
            @include triangleTop(24px, 14px, $gray);
            position: absolute;
            left: calc(50% - 12px);
            transform: translateY(0);
            top: 100%;
            transition: none;
            visibility: hidden;
            opacity: 0;
        }

        &--active {
            &:before {
                visibility: visible;
                opacity: 1;
                transform: translateY(-100%);
                transition: all 0.1s ease-in;
            }
        }
    }

    &__menu {
        position: absolute;
        left: 50%;
        top: 100%;
        transform: translateX(-50%);
        width: 15rem;

        overflow: hidden;
        max-height: 0;
        opacity: 0;
        transition: max-height 0.2s ease-out;

        &--open {
            opacity: 1;
            max-height: 100vh;
        }
    }

    &__menu-inner {
        text-align: left;
        background: $gray;
        padding: 2rem 2rem;
    }
}

.dropdown-nav {
    &__list {
        margin: 0;
    }

    &__item {
        padding: 0;
        margin-bottom: 0.2rem;
        display: block;
    }

    &__link {
        color: $white;
    }
}

@media screen and (max-width: $mobileMenu) {
    .dropdown {
        &__trig {
            &:before {
                display: none;
            }
        }

        &__menu {
            position: relative;
            width: 100%;
            left: auto;
            top: auto;
            transform: none;
            padding: 0 0 0 1.5rem;
            background: none;
        }
    }
}
