#gallery{
    background-color: var(--color-secondary);
    color: var(--color-primary);
}

#gallery .wrapper{
    background-image: url('../img/gallery_wrapper.jpg');
    background-size: cover;
    background-position:center;
    background-attachment:initial;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 20rem;
    margin-bottom: 5rem;
}

.gallery{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 10rem;
    padding: 1rem 10rem;
}

.gallery span{
    background-color: var(--color-accent);
    text-transform: uppercase;
    text-align: left;
    font-size: smaller;
    margin-right: .5rem;
    padding: .2rem .5rem;
    border-radius: 10rem;
    white-space: nowrap;
}

#gallery2{
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.gallery article{
    display: flex;
    max-width: 15rem;
}

.gallery article:hover{
    transform: scale(1.02);
}

.gallery article a{
    display: flex;
    flex-direction: column;
    width: 100%;
    text-decoration: none;
}

.gallery h2{
    font-size: 0.6rem;
    margin-bottom: 0.3rem;
    text-align: center;
}

.gallery article h2::before, .gallery article h2::after{
    content: '"';
    display: inline;
}

.gallery article div{
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.gallery article div p{
    max-width: 65%;
}

.gallery article img{
    width: 100%;
    max-height: 30rem;
    display: block;
}

.gallery article p{
    margin: .5rem;
    font-size: 0.8rem;
}

.gallery-condensed{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 3rem;
}

.gallery-condensed a div{
    margin-bottom: -0.5rem;
}

.gallery-condensed a p{
    font-size: 0.5rem;
}

.gallery-condensed a h2{
    font-size: .4rem;
    margin-bottom: 0.1rem;
}

.gallery-condensed img{
    width: 10rem;
}

#view-toggle{
    display: flex;
    justify-content: right;
    border-radius: 10rem;
    width: fit-content;
    border: 0.1em solid var(--color-accent);
}

#view-toggle button{
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border-radius: 10rem;
    width: 4rem;
}

#view-toggle button.active{
    background-color: var(--color-accent);
}

#view-toggle button img{
    height: 1.5rem;
}

@media only screen and (max-width: 768px) {
    #gallery .wrapper{
        height: 30rem;
    }
    
    .gallery{
        grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
        gap: 4rem;
        padding: 1rem;
        place-items: center;
    }

    .gallery-condensed{
        place-items: initial;
    }

    .gallery h2{
        font-size: 0.6rem;
        margin-bottom: 0.2rem;
    }

    .gallery article{
        max-width: 15rem;
    }

    .gallery article img{
        max-width: 15rem;
        max-height: 25rem;
    }

    .gallery-condensed{
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(5rem, 1fr));
        gap: 2rem;
        padding: 0 2rem;
    }

    .gallery-condensed img{
        width: 5rem;
    }

    .gallery-condensed h2{
        display: none;
    }

    .gallery-condensed a span{
        font-size: 0.3rem;
    }
}