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

body {
    font-family: sans-serif;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 1px;
}

header {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin: 1rem 0;
}

#shuffle,
#viewmode {
    border: none;
    background: black;
    color: white;
    padding: 0.5em 1em;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 0.9em;
}

#shuffle:hover,
#viewmode:hover {
    background: #444;
}

.masonry {
    column-gap: 0;
    width: 100%;
    max-width: 1400px;
}

@media (min-width: 1201px) {
    .masonry {
        column-count: 4;
    }
}

@media (max-width: 1200px) {
    .masonry {
        column-count: 3;
    }
}

@media (max-width: 800px) {
    .masonry {
        column-count: 2;
    }
}

@media (max-width: 500px) {
    .masonry {
        column-count: 1;
    }
}

.content {
    position: relative;
    display: flex;
    width: 100%;
    overflow: hidden;
    text-align: center;
    color: white;
    outline: 1px solid black;
    background-color: var(--bg, black);
    isolation: isolate;
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    -moz-column-break-inside: avoid;
    transition: all 0.25s ease;
}

.content img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    vertical-align: top;
    mix-blend-mode: hue;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.content a {
    text-wrap: pretty;
    padding: 3rem;
    line-height: 1.25;
    width: 100%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-decoration: none;
    font-size: 0.9em;
    color: black;
    transition: opacity 0.3s ease;
    z-index: 2;
}

body[data-view="images-only"] .content a {
    display: none;
}

body[data-view="text-only"] .content img {
    display: none;
}

body[data-view="text-only"] .content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: var(--random-height);
    color: black;
    font-size: 1rem;
    text-transform: lowercase;
}

body[data-view="text-only"] .content a {
    background: none;
    color: black;
}

.info {
    position: fixed;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 50%;
    background-color: blue;
    color: white;
    mix-blend-mode: multiply;
}