.image-grid {
    display: block !important;
    column-count: 3;
    column-gap: 8px;
    line-height: 0;
    height: auto;
    overflow: hidden;
}

.image-grid a {
    display: block;
    margin-bottom: 8px;
    break-inside: avoid;
}

.image-grid img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 0;
}

.album-grid {
    display: grid !important;
    column-count: unset;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    line-height: 0;
}

.album-grid a {
    display: block;
    margin-bottom: 0;
}

.album-title {
    line-height: normal;
    padding: 6px 0;
    display: block;
}

.gallery-image {
    max-height: 85vh;
    width: auto;
    max-width: 100%;
    display: block;
    margin: 0 auto;
}

.photo-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 12px 0;
}

.photo-nav-btn {
    padding: 4px 0;
    text-decoration: none;
}

.photo-nav-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.photo-nav-disabled {
    opacity: 0.3;
}

.photo-blog-link {
    margin-top: 24px;
    padding: 12px;
    border: 1px solid #444;
    border-radius: 4px;
}

.photo-blog-link a {
    text-decoration: none;
}

.post-content {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.post-content > *:not(.post-photo-wrap) {
    flex: 0 0 100%;
}

.post-photo-wrap {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
}

.post-photo-thumb {
    width: 100%;
    height: auto;
    display: block;
}

.post-photo-link {
    display: block;
}

/* Hide italic captions that follow post images */
.post-photo-wrap + em {
    display: none;
}

.posts-list .post {
    margin-bottom: 4px;
}

@media (max-width: 768px) {
    .image-grid {
        column-count: 2;
    }
    .album-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .terminal-menu ul {
        justify-content: flex-end !important;
    }
}

@media (max-width: 480px) {
    .image-grid {
        column-count: 1;
    }
    .album-grid {
        grid-template-columns: 1fr;
    }
}
