@import url('https://fonts.googleapis.com/css2?family=Karla&display=swap');

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

body{
    font-family: 'Karla', sans-serif;
    background-color: rgb(245, 235, 220);
}

img{
    max-width: 100%;
}

.hero__navbar{
    position: sticky;
    top: 0;
    z-index: 1;
    min-height: 5em;
    background-color: rgb(246, 204, 238);
    display: flex;
    align-items: center;
    margin-bottom: 2.5em;
}

.navbar__logo{
    height: 35px;
    width: 45px;
    border-radius: 15px;
    margin: 1em;
}

.search_box{
    margin: 0 2em 0 auto;
    width: 40%;
}

.search{
    border-radius: 5px;
    border: none;
    padding: 10px;
    width: 100%;
}

.search__logo{
    position: absolute;
    right: 3em;
    top: 1.8em;
}

.image {
    border-radius: 10px;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image:hover{
    opacity: 0.8;
}

.component{
    position: relative;
    margin: 0.5em;
}

.download--div{
    background-color: #fff;
    height: 35px;
    width: 35px;
    border-radius: 10px;
    position: absolute;
    bottom: 7px;
    right: 7px;
    opacity: 0.7;
}

.download{
    padding: 6px;
}

.download:active {
    border-radius: 10px;
    box-shadow: inset 3px 3px 2px 0.5px rgba(0, 0, 0, 0.2); 
}

.image img{
    border-radius: 10px;
}

.images{
    display: grid;
    grid-template-columns: repeat(3, minmax(100px, 1fr));
    margin: 0 20px;
}

.loading {
    font-size: larger;
}

.api-error{
    display: flex;
    flex-direction: column;
    font-size: larger;
    color: red;
}

.footer{
    display: flex;
    justify-content: center;
}

.footer__button{
    background-color: rgb(246, 204, 238);
    box-shadow: 5px 5px 5px 0.5px rgba(0, 0, 0, 0.2); 
    color: black;
    padding: 1em 3em;
    border: none;
    border-radius: 15px;
    font-size: larger;
    margin: 2em;
}

.footer__button:hover{
    opacity: 0.75;
}

.footer__button:active{
    box-shadow: inset 5px 5px 5px 0.5px rgba(0, 0, 0, 0.2); 
}

@media (max-width: 600px) {
    .images{
        grid-template-columns: repeat(2, minmax(100px, 1fr));
    }
    .hero__heading {
        font-size: 28px;
    }
    .navbar__logo{
        margin: 0.5em;
    }
    .search_box{
        width: 40%;
        margin: 0 1em 0 auto;
    }
    .search__logo{
        right: 1.75em;
    }
}

@media (max-width: 480px) {
    .hero__heading {
        display: none;
    }
    .search_box{
        width: 60%;
        margin: 0 1em 0 auto;
    }
    .navbar__logo{
        height: 40px;
        width: 50px;
        margin-left: 1.5em;
    }
}

@media (max-width: 320px) {
    .images{
        grid-template-columns: 1fr;
    }
}