$c-explorer-bg: $nav-submenu-bg;
$c-explorer-bg-dark: $nav-background;
$c-explorer-bg-active: rgba(0, 0, 0, 0.425);
$c-explorer-secondary: $text-color;
$c-explorer-easing: cubic-bezier(0.075, 0.82, 0.165, 1);
$menu-footer-height: 50px;

@import 'ExplorerItem';

.explorer__wrapper,
.explorer__wrapper * {
    box-sizing: border-box;
}

.explorer__wrapper {
    display: flex;
    flex: 1;
}

.explorer {
    width: 100%;
    display: flex;
    flex-direction: column;

    @include media-breakpoint-up(sm) {
        width: 485px;
        height: 100vh;
        position: fixed;
        z-index: 500;
        left: $menu-width;
    }

    *:focus {
        @include show-focus-outline-inside;
    }
}

.c-explorer {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: $c-explorer-bg;

    @include media-breakpoint-up(sm) {
        box-shadow: 2px 2px 5px $c-explorer-bg-active;
    }
}

.c-explorer > .c-transition-group {
    display: flex;
    flex-direction: column;
    height: 100%;
    z-index: 150;
}

.c-explorer__close {
    padding: 1em;
    color: $c-explorer-secondary;
    border-bottom: 1px solid rgba(200, 200, 200, 0.1);
    cursor: pointer;
    display: none;

    &:focus {
        background-color: $c-explorer-bg-active;
        color: $color-white;
    }

    // Overrides for default link hover.
    &:hover {
        color: $c-explorer-secondary;
    }

    @include media-breakpoint-down(xs) {
        .explorer-open & {
            display: block;
        }
    }
}

.c-explorer__drawer {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.c-explorer__header {
    display: block;
    background-color: $c-explorer-bg-dark;
    border-bottom: 1px solid $c-explorer-bg-dark;
    color: $color-menu-text;
}

.c-explorer__header__title {
    color: inherit;

    &:focus {
        background-color: $c-explorer-bg-active;
        color: darken($color-menu-text, 0.5);
    }

    // Overrides for default link hover.
    &:hover {
        color: darken($color-menu-text, 0.5);
    }

    @include hover {
        background-color: $c-explorer-bg-active;
    }
}

.c-explorer__header__title__inner {
    width: 70%;
    float: left;
    padding: 1em 0.75em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    .icon {
        color: $c-explorer-secondary;
        margin-right: 0.25rem;
        font-size: 1rem;
    }

    .icon--explorer-header {
        width: 1.25em;
        height: 1.25em;
        margin-right: 0.25rem;
        vertical-align: text-top;
        color: $c-explorer-secondary;
    }

    @include media-breakpoint-up(sm) {
        padding: 1em 1.5em;
    }
}

.c-explorer__header__select {
    $margin: 10px;
    position: relative;

    > select {
        width: calc(30% - #{$margin * 2});
        height: calc(100% - #{$margin * 2});
        margin-top: $margin;
        margin-right: $margin;
        float: right;
        padding: 0;
        padding-left: 10px;

        background-color: $c-explorer-bg-dark;
        border-radius: 0;
        border-color: #4c4e4d;
        color: $color-white;

        &:disabled {
            border: 0;
        }

        &:hover:enabled {
            cursor: pointer;
        }

        &:hover:disabled {
            color: inherit;
            background-color: inherit;
            cursor: inherit;
        }

        // Reset the arrow on `<select>`s in IE10+.
        &::-ms-expand {
            display: none;
        }
    }

    // Add select arrow back on browsers where native ui has been removed
    > span:after {
        z-index: 0;
        position: absolute;
        right: $margin;
        top: $margin + 3px;
        bottom: 0;
        width: 2em;
        font-family: wagtail;
        content: map-get($icons, 'arrow-down');
        text-align: center;
        font-size: 1.2em;
        pointer-events: none;
        color: $color-grey-3;

        .ie & {
            display: none;
        }
    }
}

.c-explorer__placeholder {
    padding: 1em;
    color: $color-white;

    @include media-breakpoint-up(sm) {
        padding: 1em 1.75em;
    }
}

.c-explorer__see-more {
    display: block;
    padding: 1em;
    background: rgba(0, 0, 0, 0.3);
    color: $color-white;

    &:focus {
        color: $c-explorer-secondary;
        background: $c-explorer-bg-active;
    }

    // Overrides for default link hover.
    &:hover {
        color: darken($color-menu-text, 0.5);
    }

    @include hover {
        background: $c-explorer-bg-active;
    }

    @include media-breakpoint-up(sm) {
        padding: 1em 1.75em;
        height: $menu-footer-height;
    }
}
