html {
    background-image: url(../images/what-the-hex.png);
    background-repeat: repeat;
    background-attachment: fixed;
}

#mobile-menu-button {
    display: none;
}

body {
    margin: auto;
    width: auto;
    max-width: 720px;
    font-family: "Signika", sans-serif;
}

/* Using the flexbox layout style */
header, main {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
}

/*** Styling the logo ***/
#main-logo {
    /* push the logo a few pixels on the left to not intrude
      on the navigation bar */
    margin: auto;
    padding: 20px;
    display: block;
    width: 100%;
    text-align: center;
    text-shadow: 1px 0px 10px darkgrey;
    line-height: 0;
    color: black;
    -webkit-transition: opacity 0.5s;
    -o-transition: opacity 0.5s;
    transition: opacity 0.5s;
}

#main-logo:hover {
    opacity: 0.5;
}

#main-logo-caption {
    background: center;
    font-family: "Exo", arial;
    -webkit-transform: rotate(-5deg);
        -ms-transform: rotate(-5deg);
            transform: rotate(-5deg);
    text-decoration: none;
}

#main-logo-link {
    text-decoration: none;
}

#main-logo-link:visited {
    color: initial;
}


/*** Styling the navigation bar next to the logo ***/
#nav-menu {
    /* padding */
    width: 80%;
    display: block;
    -ms-flex-item-align: center;
        -ms-grid-row-align: center;
        align-self: center;
}

#nav-menu ul {
    width: 77%;
    /* margin */
    margin: 0 auto;
    /* list */
    list-style: none inside;
    /* misc */
    overflow: hidden;
    display: table;
    padding-top: 1%;
    padding-bottom: 1%;
}

#nav-menu li {
    float: left;
}

.nav-menu-tiles {
    width: auto;
    /* margin */
    margin-left: 10px;
    margin-right: 10px;
    /* border */
    border: 1px solid white;
    border-radius: 20px;
    /* padding */
    padding-left: 20px;
    padding-right: 20px;
    /* text */
    text-align: center;
    text-decoration: none;
    color: #FFE47F;
    font-size: 1.25rem;
    text-shadow: 1px 1px 1px black;
    /* misc */
    -webkit-transition: border-color 0.2s, color 0.2s;
    -o-transition: border-color 0.2s, color 0.2s;
    transition: border-color 0.2s, color 0.2s;
    -webkit-box-shadow: 1px 2px 3px black;
            box-shadow: 1px 2px 3px black;
    display: block;
    background-image: -webkit-gradient(linear, left top, right top, from(#00b4db), to(#0083b0));
    background-image: -webkit-linear-gradient(left, #00b4db, #0083b0);
    background-image: -o-linear-gradient(left, #00b4db, #0083b0);
    background-image: linear-gradient(to right, #00b4db, #0083b0);
    /* disables selection of the text and image on each tile from the user */
    -webkit-user-select: none;
       -moz-user-select: none;
        -ms-user-select: none;
            user-select: none;
}

.nav-menu-tiles:focus {
    border: 0.12rem dashed lightgrey;
    outline: none;
}

.nav-menu-tiles:hover {
    cursor: pointer;
    border-color: cyan;
    background-image: -webkit-gradient(linear, left top, right top, from(#00d2ff), to(#3a7bd5));
    background-image: -webkit-linear-gradient(left, #00d2ff, #3a7bd5);
    background-image: -o-linear-gradient(left, #00d2ff, #3a7bd5);
    background-image: linear-gradient(to right, #00d2ff, #3a7bd5);
}

.nav-menu-tiles:active img {
    -webkit-filter: invert(100%);
            filter: invert(100%);
}

.nav-menu-tiles:active {
    position: relative;
    top: 1px;
    left: 1px;
    -webkit-box-shadow: 0 1px 3px black;
            box-shadow: 0 1px 3px black;
    color: white;
    background-image: -webkit-gradient(linear, left top, right top, from(#00b4db), to(#0083b0));
    background-image: -webkit-linear-gradient(left, #00b4db, #0083b0);
    background-image: -o-linear-gradient(left, #00b4db, #0083b0);
    background-image: linear-gradient(to right, #00b4db, #0083b0);
}


/* styling the sidebar */
#sidebar {
    border-left: 2px solid black;
    -webkit-box-shadow: -8px 10px 10px -7px rgba(0,0,0,0.59);
            box-shadow: -8px 10px 10px -7px rgba(0,0,0,0.59);
    border-radius: 10px;
    display: block;
    margin: 100px 30px auto 1rem;
    padding: 10px 50px 100px 10px;
}

.sidebar-content-boxes {
    margin-bottom: 30px;
    padding-right: auto;
}

.sidebar-box-headers {
    display: block;
    text-align: center;
}

.sidebar-content-text {
    text-align: center;
}

/* styling the related box */
.sidebar-links {
    padding-left: 16px;
    display: block;
}

#sidebar-link-list li {
    display: block;
    padding: 1rem;
    margin-left: -30px;
}

.sidebar-links:hover, .sidebar-links:focus {
    background: url('../images/arrow-right.svg') no-repeat 0% 2px;
    background-size: 16px 16px;
    -webkit-animation-duration: 0.2s;
            animation-duration: 0.2s;
    -webkit-animation-name: bckg-slidein;
            animation-name: bckg-slidein;
}

/* smooth out the appearance of the arrow next to the links */
@-webkit-keyframes bckg-slidein {
    from {
        background-size: 0px 16px;
    }

    to {
        background-size: 16px 16px;
    }
}
@keyframes bckg-slidein {
    from {
        background-size: 0px 16px;
    }

    to {
        background-size: 16px 16px;
    }
}

/* styling the search box */
#sidebar-search {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
}

input[type="search"] {
    background-color: transparent;
    -webkit-box-sizing: border-box;
            box-sizing: border-box;
    border: 1.5px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
    width: 150%;
    /* this line makes sure that text typed
    on the search box, won't go beneath the search button */
    padding-right: 25%;
    margin-right: -13%;
}

input[type="search"]:focus {
    -webkit-animation-duration: 0.5s;
            animation-duration: 0.5s;
    -webkit-animation-name: cyanlightup;
            animation-name: cyanlightup;
    -webkit-box-shadow: 0px 0px 5px cyan;
            box-shadow: 0px 0px 5px cyan;
}

@-webkit-keyframes cyanlightup {
    from {
        -webkit-box-shadow: 0px 0px 0px cyan;
                box-shadow: 0px 0px 0px cyan;
    }

    to {
        -webkit-box-shadow: 0px 0px 5px cyan;
                box-shadow: 0px 0px 5px cyan;
    }
}

@keyframes cyanlightup {
    from {
        -webkit-box-shadow: 0px 0px 0px cyan;
                box-shadow: 0px 0px 0px cyan;
    }

    to {
        -webkit-box-shadow: 0px 0px 5px cyan;
                box-shadow: 0px 0px 5px cyan;
    }
}

input[type="submit"] {
    border: 1px solid transparent;
    background-color: transparent;
    padding: 3%;
    margin-left: -10px;
    border-radius: 5px;
}

input[type="search"]:focus+input[type="submit"]:hover {
    cursor: pointer;
    -webkit-box-shadow: 4px 0px 5px cyan;
            box-shadow: 4px 0px 5px cyan;
}

input[type="submit"]:hover {
    cursor: pointer;
    -webkit-box-shadow: 0px 0px 5px cyan;
            box-shadow: 0px 0px 5px cyan;
}


/* styling the article */
article {
    padding-right: 2%;
    width: 100%;
    text-align: justify;
    display: block;
    font-size: 1.265rem;
}

article h2, article h3 {
    text-align: center;
}

article > p {
    line-height: 1.7rem;
    -webkit-hyphens: auto;
        -ms-hyphens: auto;
            hyphens: auto;
    text-indent: 2%;
}

/* styling the footer */
footer {
    width: auto;
    margin: auto;
    display: block;
    text-align: center;
    overflow: hidden;
}

/* responsive design styles */
@media only screen and (max-width: 720px) {
    .nav-menu-tiles {
        margin: 5px;
    }
}

@media only screen and (max-width: 640px) {
    #nav-menu li {
        float: none;
        margin: 10px 32%;
    }
}

@media only screen and (max-width: 600px) {
    #main-logo-caption {
        font-size: 1.5rem;
    }

    /* sidebar and navigation menu CANCELLED ???? */
    #sidebar, #nav-menu {
        display: none;
    }

    /* hamburger menu styling */
    #mobile-menu-btn {
        display: block;
        margin: auto;
        width: 10%;
    }

    .burger-menu-btn:nth-child(n) {
        border-radius: 10px;
        margin-top: 5%;
        margin-bottom: 5%;
        -webkit-transition: 0.1s;
        -o-transition: 0.1s;
        transition: 0.1s;
        -webkit-user-select: none;
           -moz-user-select: none;
            -ms-user-select: none;
                user-select: none;
    }

    .burger-menu-btn:nth-child(odd) {
        padding-top: 9%;
        padding-bottom: 9%;
        background-color: orange;
    }

    .burger-menu-btn:nth-child(2) {
        padding-top: 6%;
        padding-bottom: 6%;
        background-color: brown;
    }

    #mobile-menu-btn:hover {
        cursor: pointer;
    }

    #mobile-menu-btn:hover .burger-menu-btn,
    #mobile-menu-btn:focus .burger-menu-btn {
        -webkit-box-shadow: 0px 0px 2px blue;
                box-shadow: 0px 0px 2px blue;
    }

    /* the shape of the button changes when it's clicked */
    .toggled .burger-menu-btn:nth-child(n) {
        background-color: black;
    }

    .toggled .burger-menu-btn:nth-child(1) {
        -webkit-transform: rotate(-45deg) translate(-20%, 100%);
            -ms-transform: rotate(-45deg) translate(-20%, 100%);
                transform: rotate(-45deg) translate(-20%, 100%);
    }

    .toggled .burger-menu-btn:nth-child(2) {
        opacity: 0;
    }

    .toggled .burger-menu-btn:nth-child(3) {
        -webkit-transform: rotate(45deg) translate(-10%, -40%);
            -ms-transform: rotate(45deg) translate(-10%, -40%);
                transform: rotate(45deg) translate(-10%, -40%);
    }

    .toggled #nav-menu {
        position: absolute;
        display: inline;
        border-radius: 10px 10px 0px 0px;
        padding-top: 10px;
        bottom: auto;
        top: 130px;
        width: 100%;
    }

    #nav-menu ul {
        padding: 0;
        margin: 0;
        width: 100%;
        -webkit-box-align: center;
            -ms-flex-align: center;
                align-items: center;
    }

    .nav-menu-tiles {
        width: 100%;
        background-image: none;
        font-size: 2rem;
        color: #FFE47F;
        border: 0;
        border-radius: 0;
        margin-top: -10px;
        margin-bottom: -10px;
        padding: 0;
        padding-left: 88%;
        padding-right: 88%;
        margin-left: -88%;
        margin-right: 0;
        -webkit-box-shadow: none;
                box-shadow: none;
    }

    .nav-menu-tiles:active {
        position: unset;
        -webkit-box-shadow: unset;
                box-shadow: unset;
    }

    .toggled article, .toggled footer {
        display: none;
    }

    article {
        -ms-flex-line-pack: center;
            align-content: center;
        padding-right: 5%;
        padding-left: 5%;
        -webkit-transition: 0.2s;
        -o-transition: 0.2s;
        transition: 0.2s;
    }
}

@media only screen and (max-width: 510px) {
    #main-logo-caption {
        font-size: 1.5rem;
    }
}

/* misc */
[href^=mailto]::before {
    /* prepend all mailto hyperlinks with the envelope emoji */
    content: '✉ ';
}

article [href^=http]::after {
    /* prepend all href hyperlinks with the envelope emoji */
    content: '⤻ ';
}
