* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    list-style: none;
}

body {
    font: 100%/1.5 system, -apple-system, ".SFNSText-Regular", "San Francisco", "Roboto", "Segoe UI", "Helvetica Neue", "Lucida Grande", sans-serif;
    background: #fff;
    color: #000;
}

button {
    cursor: pointer;
    padding: 0;
    background-color: transparent;
    border: none;
    font-size: inherit;
    font-family: inherit;
}

select {
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 0.25rem;
    background-color: #fff;
    font-family: inherit;
    font-size: inherit;
}

#grid {
    margin: 2.5em auto;
    max-width: 1120px;
    padding-left: 1em;
    padding-right: 1em;
}

@media screen and (min-width: 768px) {
    #grid {
        padding-left: 0;
        padding-right: 0;
    }
}

.grid-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.5em;
    border-bottom: 1px solid #ddd;
}

.grid-header h1 {
    font-size: 1em;
    text-transform: uppercase;
    letter-spacing: .1em;
    font-weight: 600;
}

.grid-filters select {
    margin-left: 1rem;
}

#grid-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(30%, 1fr));
    gap: 1em;
    margin-top: 1.5rem;
}

.grid-item {
    width: 100%;
    transition: opacity 400ms ease;
}

.grid-item.filtered {
    opacity: 0.3;
}

.grid-item img {
    display: block;
    max-width: 100%;
    height: auto;
}

#grid-content.filter-active .grid-item:not(.filtered) {
    grid-column: span 2;
}

#grid-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100vh;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    font-weight: bold;
}

#grid-loader.loaded {
    display: none;
}