/* responsive nav for small devices */

.offcanvas-menu {
    display: block;
    @include large-devices() {
        display: none;
    }
    >label {
        top: 30px;
        right: 30px;
        position: fixed;
        width: 40px;
        height: 40px;
        cursor: pointer;
        transition: 0.3s ease;
        display: flex;
        align-items: center;
        z-index: 9999;
    }
    label {
        span,
        span::before,
        span::after {
            transition: background 0.3s, transform 0.3s;
        }
        span,
        span::before,
        span::after {
            content: "";
            position: absolute;
            height: 4px;
            width: 40px;
            background-color: var(--site-branding-colour);
        }
        span::before {
            transform: translateY(-12px);
        }
        span::after {
            transform: translateY(12px);
        }
    }
    nav {
        position: fixed;
        top: 0;
        height: 100%;
        width: 350px;
        left: -350px;
        z-index: 999;
        overflow: hidden;
        background: #eee;
        transition: 0.3s ease;
        padding: 20px 30px;
        ul {
            &#primary-menu {
                margin: 2em 0;
                padding: 0;
                width: 100%;
                li {
                    margin-bottom: 1em;
                    a {
                        outline: none;
                        text-decoration: none;
                        border: 2px solid transparent;
                        -webkit-border-radius: 100px;
                        -moz-border-radius: 100px;
                        border-radius: 100px;
                        padding: 10px 2em;
                        transition: all 0.3s ease 0s, color 0.3s ease 0s;
                        font-weight: 500;
                        font-size: 18px;
                        line-height: 22px;
                        &:hover,
                        &:focus {
                            border: 2px solid var(--site-branding-colour);
                        }
                    }
                }
            }
        }
        >div {
            display: flex;
            justify-content: space-between;
            align-items: center;
            a {
                outline: none;
                text-decoration: none;
                border: 2px solid transparent;
                -webkit-border-radius: 100px;
                -moz-border-radius: 100px;
                border-radius: 100px;
                padding: 0;
                transition: all 0.3s ease 0s, color 0.3s ease 0s;
                font-weight: 500;
                font-size: 18px;
                line-height: 22px;
                &:hover,
                &:focus {
                    border: 2px solid var(--site-branding-colour);
                }
                i {
                    font-size: 4rem;
                    background: linear-gradient(120deg, #49a4ed 30%, #3d00a9 110%);
                    -webkit-background-clip: text;
                    background-clip: text;
                    -webkit-text-fill-color: transparent;
                }
            }
            label {
                width: 30px;
                height: 30px;
                display: flex !important;
                align-items: center;
                justify-content: center;
                cursor: pointer;
                transition: 0.3s ease;
                span,
                span:before,
                span:after {
                    background-color: var(--site-branding-colour);
                }
            }
        }
        >ul {
            counter-reset: nav-link-count;
            li {
                cursor: pointer;
                padding: 10px 0;
                transform: translateX(-30px);
                opacity: 0;
                transition: 0.4s ease;
                counter-increment: nav-link-count;
                a {
                    outline: none;
                    text-decoration: none;
                    border: 2px solid transparent;
                    -webkit-border-radius: 100px;
                    -moz-border-radius: 100px;
                    border-radius: 100px;
                    padding: 10px 2em;
                    transition: all 0.3s ease 0s, color 0.3s ease 0s;
                    font-weight: 500;
                    font-size: 18px;
                    line-height: 22px;
                    &:hover,
                    &:focus {
                        border: 2px solid var(--site-branding-colour);
                    }
                    &::after {
                        content: " : "counter(nav-link-count);
                    }
                }
                &:hover {
                    animation: hover 0.5s;
                }
            }
        }
    }
    input[type="checkbox"] {
        display: none;
        &:checked {
            ~label {
                opacity: 0;
                pointer-events: none;
            }
            ~nav {
                left: 0;
            }
            ~nav label span {
                background: transparent;
            }
            ~nav label span:before {
                transform: rotate(-45deg);
            }
            ~nav label span:after {
                transform: rotate(45deg);
            }
            ~nav label span:before,
            ~nav label span:after {
                transition-delay: 0.2s;
            }
            ~nav ul li {
                opacity: 1;
                transform: translateX(0px);
            }
        }
    }
}