﻿/* UTILITIES */
* {
    margin: 0;
    padding: 0;                          /*removes bullets and indentation */
    box-sizing: border-box;              /*account for any border and padding in values specified for an element's width and height.*/
}



/* NAVBAR STYLING STARTS */
/* by default... flex-direction: row */
.navbar {
    display: flex;                          /* use flexbox layout */
    align-items: center;                    /* items are centered in the cross(vertical)-axis */
    justify-content: space-between;         /* equal space between the items along the main axis. First/last items begin/end at begin/end of main axis */
    padding: 10px 10px 10px 10px;
    background-color: rgb(0, 128, 128);
    color: #fff;
    /*font-family: cursive;*/
    font-family: 'rubik', sans-serif;
}
.navbar a {
    text-decoration: none;              /* remove hyperlink-related text decoration, such as underlines */
}
.navbar li {
    list-style: none;                   /* remove all list-item styling. Gets inherited by all children */
}

.nav-links a {                          /* set colour of links in .nav-links, inc. children */
    color: #fff;
}

/* LOGO */
.logo {
    /*font-size: 32px;*/
}
.logo a {
    color: #fff;
}
.logo_img {
    width: 40px;
    height: 40px;
}

/* NAVBAR MENU */
.menu {
    display: flex; /* applies to links, not inc. hamburger */
    gap: 1em; /* sets the gaps (gutters) between rows and columns */
    font-size: 18px;
}
.menu > div:hover {                        /* change bg colour when hovering over a menu item */
    background-color: #4c9e9e;
    border-radius: 5px;
    transition: 0.3s ease;
}
.menu > div {                              /* add some padding around menu items */
    padding: 5px 14px;
}



/* RESPONSIVE NAVBAR MENU STARTS */
/* CHECKBOX HACK */
#checkbox_toggle {
    display: none;
}
/* HAMBURGER MENU */
.hamburger {
    display: none; /* hides the hambuger menu symbol */
    font-size: 24px;
    user-select: none; /* hamburger symbol is just text. Don't let the text be selectable */
}
.ham_img {
    width: 25px;
    height: 25px;
}








.navbar .container {
    position: relative;
    padding: 1.5rem;
}

.menu-toggle {
    position: absolute;
    right: 0rem;
    top: 49%;
    transform: translate(0, -50%);
    height: 26px;
    width: 29px;
  
    &, &:hover {
      color: black;
    }
}

.menu-toggle-bar {
    display: block;
    position: absolute;
    top: 50%;
    margin-top: -1px;
    right: 0;
    width: 100%;
    height: 4px;
    border-radius: 4px;
    background-color: white;
    transition: all 0.3s ease;

    &.menu-toggle-bar--top {
        transform: translate(0, -10px);
    }
    &.menu-toggle-bar--middle {

    }
    &.menu-toggle-bar--bottom {
        transform: translate(0, 10px);
    }
}












/* APPLYING MEDIA QUERIES */
@media (max-width: 768px) { /* apply the following css when the max-width of the viewing device is 768px */
    .menu {
        display: none;                      /* hide the desktop-styled menu bar */ 
        position: absolute;                 /* WITH RESPECT TO PARENT. I.e.: <ul class="nav-links"> */
        background-color: teal;
        right: 0;
        left: 0;
        text-align: center;
        padding: 16px 0;
        z-index: 10;
        margin-top: 10px;
    }

    .menu div + div {
        margin-top: 5px;
    }

    .navbar input[type=checkbox]:checked ~ .menu {
        display: block;                     /* gets .menu elements that are siblings of input[type=checkbox]:checked and appear after it */
    }

    .hamburger {
        display: block;                     /* show the hamburger menu symbol */
    }

    .navbar input[type=checkbox]:checked ~ .hamburger .container .menu-toggle .menu-toggle-bar--top { 
        transform: translate(0, 0) rotate(45deg);
    }
    .navbar input[type=checkbox]:checked ~ .hamburger .container .menu-toggle .menu-toggle-bar--middle { 
        opacity: 0;
    }
    .navbar input[type=checkbox]:checked ~ .hamburger .container .menu-toggle .menu-toggle-bar--bottom { 
        transform: translate(0, 0) rotate(-45deg);
    }
}