:root {
    --black-text: rgb(0, 0, 0);
    --dark-text: rgb(65, 69, 81);
    --white-text: white;
    --white-grey-text: rgb(222, 222, 222);
    --light-text: rgb(125, 126, 138);
    --light-grey: rgb(182, 185, 200);

    --button-color:  #cd3b3b;
    --card-border-color: #ecad00;
    --hover-color: #a50230;
    --h1-text-shadow: 1px 2px 2px #8b92a7;

    --card-background: rgb(246, 246, 246);
    --sidebar-background: rgb(1, 23, 43);
    --header-background: linear-gradient(0.25turn, #1e499f, 20%, #3984e5, 75%, #e88973);
    --main-background: rgb(221, 229, 238);

    --title-font-size: 1.8rem;
    --search-font-size: 16px;
    --button-font: 'Beth Ellen', cursive;
    --title-font: 'Merriweather', serif;
    --header-font: 'Fredericka the Great', cursive;
    --sidebar-font: 'Libre Baskerville', serif;
    --project-title-font: 'Libre Baskerville', serif;
    --project-font: 'Quicksand', sans-serif;
    --announcement-title-font: 'Lora', serif;
    --announcement-font: 'Raleway', sans-serif;

    --hex-grey-filter: invert(81%) sepia(97%) saturate(3713%) hue-rotate(175deg) brightness(77%) contrast(81%);
    --hex-orange-filter: brightness(0) saturate(100%) invert(78%) sepia(77%) saturate(1753%) hue-rotate(349deg) brightness(111%) contrast(96%);    
    --hex-blue-filter: invert(88%) sepia(21%) saturate(3441%) hue-rotate(170deg) brightness(99%) contrast(100%);

    --small-pfp: 45px;
    --header-pfp: 35px;
    --large-pfp: 55px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

* {
    margin: 0;
}

html, body {
    min-height: 100vh;
}

body {
    background: var(--main-background);
    display: grid;
    grid-template: 170px 2fr 70px / minmax(30px, 250px) 2fr;
    transition: all .5s ease-in-out;
}

a {
    text-decoration: none;
}

/*** HEADER ***/
header {
    background: var(--header-background);
    grid-column: 2;
    display: grid;
    grid-template-columns: 3fr 1fr;
    grid-template-rows: 80px 40px;
    align-items: center;
    padding: 10px;
    font-family: var(--header-font);
    box-shadow: 0 1px 5px 1px var(--light-grey);
    transition: all .3s ease-in-out;
}
header img {
    width: 30px;
    border-radius: 50px;
}
header .header-nav-right img.pfp {
    width: var(--header-pfp);
}
header .header-nav-bottom .pfp {
    width: var(--large-pfp);
}
.header-nav-right, .header-nav-bottom {
    transition: .3s;
    gap: 17px;
}
.search-container1, .header-nav-right {
    display: -webkit-box;
    display: -moz-box;
    display: -ms-flexbox;
    display: -moz-flex;
    display: -webkit-flex;
    display: flex;
    align-items: center;
}
.search-container1 {
    justify-self: center;
    background: white;
    border-radius: 10px;
    width: 95%;
    height: 35px;
    padding-left: 5px;
}
.search-container1 input {
    outline: none;
    appearance: none;
    border: none;
    font-size: var(--search-font-size);
    border-radius: 15px;
    width: 100%;
    padding: 5px 10px;
}
.container2, .header-nav-right .divider {
    display: none;
}
.header-nav-right {
    justify-content: end;
    padding-right: 30px;
    gap: 18px;
} 
.header-nav-right .name {
    color: var(--black-text);
    font-size: 25px;
}
.header-nav-right > img:first-of-type {
    filter: var(--hex-orange-filter);
}
.header-nav-right img:first-of-type:hover, .search-container1 .search-button:hover, .container2 .search-button:hover{
    animation: shake .5s ease-in-out forwards;
}
.header-nav-right img:first-of-type:focus:active {
    animation: stretch-bounce .5s ease-in-out forwards; 
}
.greetings, .buttons-container {
    display: -webkit-box;
    display: -moz-box;
    display: -ms-flexbox;
    display: -moz-flex;
    display: -webkit-flex;
    display: flex;
    align-items: center;
    gap: 15px;
}
.greetings {
    color: var(--white-text);
    font-size: 20px;
    margin-left: 5px;
}
.header-nav-bottom {
    grid-column: span 2;
    display: grid;
    grid-template-columns: 3fr 1fr;
    margin-top: 30px;
}
.greetings p:nth-child(2) {
   font-size: 1.5rem;
}
.buttons-container button{
    appearance: none;
    border: none;
    border-radius: 15px;
    color: var(--white-text);
    padding: 1.5px 25px;
    background-color: var(--button-color);
    font-size: .9rem;
    font-family: var(--button-font);
    transition: all .5s ease;
}
.buttons-container button:hover {
    background-color: var(--hover-color);
    transform: translateY(-2px);
}
.buttons-container button:active{
    transform: translateY(2px);
}

/*** SIDEBAR ***/
.sidebar {
    grid-row: 1 / -1;
    padding: 50px;
    color: var(--white-grey-text);
    background-color: var(--sidebar-background);
    transition: all .3s ease-in-out ;
}
.sidebar-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
}
.sidebar img {
    width: 50px;
    filter: var(--hex-orange-filter);
}
.sidebar-title {
    font-size: 2rem;
}
.sidebar-nav1, .sidebar-nav2{
    margin-top: 20px;
    font-family: var(--sidebar-font);
    font-size: .9rem;
}
.sidebar-nav2 {
    margin-top: 50px;
}
.sidebar ul {
    list-style: none;
    margin-bottom: 30px;
    padding: 0;
}
.nav {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}
.nav a {
    color: inherit;
}
.nav-icon {
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all .15s ease-out;
}
.nav-icon:hover {
    transform: scale(1.2);
}
.nav-icon:focus {
    transform: scale(1.2);
}
.nav-icon img {
    width: 30px;
    /* to change the color of the svg icons [see CSS Filter property] */
    filter: var(--hex-grey-filter);
}

/*** MAIN CONTENT ***/
/* Overall */
.main-content {
    grid-row: 2;
    display: grid;
    grid-template-columns: 3fr 1fr;
}
.project-container > h1, .announcement-container > h1, .trending-container > h1 {
    font-family: var(--title-font);
    font-size: var(--title-font-size);
    font-weight: 900;
    text-shadow: var(--h1-text-shadow);
}
.project-container, .announcement-container, .trending-container {
    gap: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
}
.announcement-container .card, .trending-container .card{
    background-color: var(--card-background);
    border-radius: 5px;
    border: none;
    padding: 20px;
}
.card {
    box-shadow: 1px 1px 5px rgb(145, 145, 145);
}
/* PROJECTS */
.project-container {
    grid-row: 1 / -3;
}
.project-container .card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(355px, 1fr));
    /* grid-auto-rows: 250px; */
    gap: 20px;
}
.project-container .card {
    display: flex;
    flex-direction: column;
    background-color: var(--card-background);
    border-left: 7px solid var(--card-border-color);
    border-radius: 5px;
    padding: 15px;
    position: relative;
}
.project-container .card h1 {
    font-size: 1.3rem;
    font-family: var(--project-title-font);
    color: var(--dark-text);
}
.project-container .card p {
    margin-top: 5px;
    font-size: 1rem;
    color: var(--light-text);
    font-family: var(--project-font);
}
.card > img {
    border-radius: 10px;
    width: 100%;
    margin: 10px 0;
    box-shadow: 1px 1px 5px 1px rgb(205, 210, 211);
}
.project-container .icons-container {
    flex: 1;
    margin-top: 10px;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 10px;
}
.icons-container img {
    width: 1.5rem;
    transition: transform .5s ease-in-out;
}
.icons-container div:hover {
    filter: var(--hex-orange-filter);    
    animation: stretch-bounce .4s ease-in-out forwards;
}
.icons-container div:focus:active {
    filter: var(--hex-orange-filter);
    animation: expand-fade .3s ease-in-out forwards;
}
.icons-container a:first-of-type img:hover {
    animation: blink .2s ease-in-out forwards;
}
.icons-container a:last-child img:hover {
    transform: rotate(360deg);
}
/* ANNOUNCEMENTS */
.announcement h1 {
    font-size: .9rem;
    font-family: var(--announcement-title-font);
}
.announcement p {
    color: var(--light-text);
    font-size: .8rem;
    font-family: var(--announcement-font);
}
.announcement {
    padding: 15px 0;
    border-bottom: 1px solid var(--light-grey);
}
.announcement:first-child {
    padding-top: 0;
}
.announcement:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
/* TRENDING */
.trending-container .card {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    font-size: .8rem;
}
.trending-container img{
    width: 30px;
}
.trending-container .pfp-container {
    height: var(--small-pfp);
    width: var(--small-pfp);
    border-radius: 50%;
    overflow: hidden;  
}
.trending-container img#alphonse{
    width: 250px;
    margin: -83px 0px 0px -73px;
}
.trending-container img#link{
    width: 150px;
    margin: -1px 0px 0px -50px;
}
.trending-container img#kagura {
    width: 45px;
    margin: 1px 0px 0px 0px;
}
.trending-container img#layton{
    width: 160px;
    margin: -25px 0px 0px -60px;
}
.trending-container p {
    color: var(--light-text)
}
.profile-info {
    display: grid;
    grid-template-columns: 43px 2fr;
    gap: 10px;
    align-items: center;
}
.profile-info div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/***** FOOTER *****/
footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    color: white;
    font-size: 18px;
    background-color: rgb(60, 125, 216);
    padding: .6em;
    margin-top: 20px;
}
footer a {
    display: flex;
    align-items: center;
}
footer img {
    border-radius: 50%;
    width: 30px;
    transition: transform .5s ease-in-out;
}
footer img:hover {
    transform: rotate(360deg);
}

@keyframes blink {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes stretch-bounce {
    0% {
      transform: scale(1);
    }
    25% {
      transform: scale(1.5);
    }
    50% {
      transform: scale(0.9);
    }
    75% {
      transform: scale(1.2);
    }
    100% {
    transform: scale(1);
    }
}

@keyframes expand-fade {
    0% {
        transform: scale(1);
        opacity: .9;
      }
    25% {
        transform: scale(1.3);
        opacity: .6;
    }
    50% {
        transform: scale(1.5);
        opacity: .3;
    }
    75% {
        transform: scale(2);
        opacity: .1;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

@keyframes shake {
    0%, 30%, 60%, 100% {
        transform: rotate(0deg);
      }
    5%, 25%, 65%, 85% {
        transform: rotate(10deg);
    }
    10%, 20%, 70%, 80% {
        transform: rotate(20deg);
    }
    15%, 75% {
        transform: rotate(30deg);
    }
    35%, 55% {
        transform: rotate(-10deg);
    }
    40%, 50% {
        transform: rotate(-20deg);
    }
    45% {
        transform: rotate(-30deg);
    }
}

/* ALLOW main content cards to all be in one column*/
@media screen and (max-width: 910px){
    .main-content {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 795px){
    .greetings div {
        font-size: clamp(.5rem, 1.8vw, 1rem);
    }
    .header-nav-right .name {
        font-size: 20px;
    }
    .greetings p:nth-child(2) {
        font-size: 1.2rem;
    }
}

@media screen and (max-width: 795px){
    .search-container1 {
        width: 90%;
    }
    .header-nav-right .name {
        font-size: 20px;
    }
    .header-nav-right {
        gap: 13px;
        padding-right: 15px;
    }
    .header-nav-right .divider {
        display: inline-block;
        background-color: rgb(237, 240, 245);
        height: 40px;
        width: 1px;
    }
    .greetings div {
        font-size: clamp(.5rem, 1.8vw, 1rem);
    }
    .greetings p:nth-child(2) {
        font-size: 1.2rem;
    }
    .header-nav-bottom .greetings div {
        display: none;
    }
}

/**** MOBILE SIZE [VERTICAL] ****/
@media screen and (max-width: 700px) {  
    body {
        grid-template: 120px 2fr 70px / 70px 1fr;
    }
    header {
        grid-template-rows: 50px 60px;
    }
    .header-nav-bottom {
        grid-template-columns: 1fr;
        justify-items: center;
        margin: 0;
    }
    .header-nav-right > div:last-of-type, .header-nav-bottom .greetings {
        display: none;
    }
    /* ******************************** */
    /* Shrinking sidebar */
    .sidebar {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 10px;
    }
    .sidebar-header {
        margin-top: 20px;
    }
    .sidebar-header div, .sidebar-nav1 span, .sidebar-nav2 span{
        display: none;
    }
    /* ******************************** */
    /* Expanding|shrinking search bar */
    .search-container1 {
        display: none;
    }
    .container2 {
        display: inline-block;
        position: relative;
        padding-left: 10px;
        width: 40px;
        height: 40px;
    }
    /***  
        By having the absolute here instead of in the input
        we can get the search to go from left to right. But we want to 
        expand from right to left instead, so I've put 'absolute' in the input instead.
    ***/
    .search-container2 {
        position: absolute;
        display: flex;
        align-items: center;
        background: white;
        height: 35px;
        border-radius: 50px;
        padding: 5px;
        z-index: 1;
    }
    .search-container2 input {
        appearance: none;
        outline: none;
        border: none;
        width: 0;
        padding: 0;
        font-size: var(--search-font-size);
        transition: .3s;
        line-height: 40px;
        background: none;
        /** BELOW is only for expanding from right to left **/
        /* background-color: white;
        border-radius: 50px;
        position: absolute;
        left: auto;
        right: 50px;  */
    }
    .search-container2 .search-button {
        width: 25px;
        height: 25px;
        border-radius: 50px;
        cursor: pointer;
        background-color: #ffffff;
        transition: .3s;
    }
    .search-container2:focus > input {
        width: 45vw;
        padding: 0 6px;
        /** BELOW is only for expanding from right to left **/
        /* height: 45px; */
    }
    .search-container2 input:focus,
    .search-container2 input:not(:placeholder-shown) {
        width: 45vw;
        padding: 0 6px;
    }

}