@import '~@equitysim/react-uikit/dist/styles/styleguide';

.c-page-nav {
    // Breaks when there is not enough space for all inner elements.
    $breakpoint-md: 1086px;
    // Breaks when there is not enough space for header.
    $breakpoint-sm: 456px;
    // Breaks when tabs don't fit in anymore
    $breakpoint-xs: 414px;

    white-space: nowrap;
    background-color: $grey-30;

    @media screen and (min-width: $breakpoint-md + 1) {
        display: flex;
        flex-direction: row;
        height: v-space(8);
    }

    @media screen and (max-width: $breakpoint-md) {
        display: grid;
        grid-template-columns: auto 6.4rem;
    }

    h1 {
        @extend %heading-md;
        display: inline-block;
        margin: 0;
        padding-left: var(--container-padding-h);
        height: 100%;
        color: $grey-100;
        line-height: v-space(8);

        @media screen and (min-width: $breakpoint-md + 1) {
            flex: 1 1 auto;
            margin-right: v-space(3);
        }

        @media screen and (max-width: $breakpoint-md) {
            white-space: normal;
        }

        @media screen and (max-width: $breakpoint-sm) {
            line-height: 1;
            padding-top: v-space(2);
            padding-bottom: 0;

            & > a {
                white-space: nowrap;
                display: block;
                line-height: v-space(6);
                margin: 0;
            }
        }
    }

    &__tabs {
        @media screen and (max-width: $breakpoint-md) {
            text-align: right;
            grid-column: 1 / span 2;
            display: flex;
        }
        @media screen and (max-width: $breakpoint-xs) {
            display: grid;
        }

        & > button:not(:last-child) {
            @media screen and (max-width: $breakpoint-xs) {
                border-bottom: 0.1rem solid rgba(255, 255, 255, 0.2);
            }
        }
    }

    &__drop-menu {
        @media screen and (max-width: $breakpoint-md) {
            height: reset;
            grid-column: 2;
            grid-row: 1;
            text-align: right;
        }

        @media screen and (max-width: $breakpoint-sm) {
            height: v-space(8);
        }
    }

    &__button {
        @extend %button;
        @extend %button__text;
        background-color: transparent;
        border-color: transparent;
        border-radius: 0;
        border-width: 0;
        box-shadow: none;
        color: $grey-85;
        cursor: pointer;
        flex: 0 0 auto;
        font-size: 1.2rem;
        height: 100%;
        letter-spacing: 0.075em;
        outline: none;
        text-transform: uppercase;

        &--active {
            background-color: $success-color;
            cursor: unset;
        }

        &--active,
        &:hover {
            color: $grey-100;
        }

        @media screen and (min-width: $breakpoint-md + 1) {
            width: v-space(18);
        }

        @media screen and (max-width: $breakpoint-md) {
            width: unset;
            padding: 0 v-space(1);
            height: v-space(5);
            padding-right: var(--container-padding-h);
            padding-left: var(--container-padding-h);
            flex-grow: 1;
        }
    }

    &__settings-button {
        width: v-space(8);
        height: 100% !important;
        color: $grey-50;
        flex: 0 0 auto;

        &:hover {
            color: $grey-100;
        }
    }

    &__settings-icon {
        height: v-space(3);
        width: v-space(3);
    }
}
