/* Home feed previews */
.home-feed-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 20px;
    width: min(1760px, calc(100% - 48px));
    margin: 16px auto 36px;
}

.home-feed-panel {
    min-width: 0;
}

.home-feed-heading h2 {
    margin: 0 0 10px;
}

.home-feed-panel .image-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    gap: 12px;
    width: 100%;
    margin: 0 0 12px;
    box-sizing: border-box;
}

.home-feed-panel .image-grid .image-item {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    padding: 4px;
    border: 1px solid #34343a;
    border-radius: 4px;
    background: #25252a;
    box-shadow: none;
    box-sizing: border-box;
    overflow: hidden;
}

.home-feed-panel .image-grid .image-item > a:first-child {
    display: block;
    width: 100%;
    min-width: 0;
}

.home-feed-panel .image-grid .image-item > a:first-child > img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: 2px;
    object-fit: cover;
}

.home-feed-panel .image-grid .profileunderimage {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 5px 0 0;
    padding: 0 2px;
    box-sizing: border-box;
}

.home-feed-panel .image-grid .profileunderimage .pfp {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    object-fit: cover;
}

.home-feed-panel .image-grid .profileunderimage a:last-child {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-feed-more {
    display: flex;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px solid #45454b;
}

.home-feed-more a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #FFD700;
    text-decoration: none;
}

.home-feed-more a:hover {
    color: #fff;
}

/* Infinite feed pages */
.feed-page {
    width: min(1760px, calc(100% - 48px));
    margin: 20px auto;
}

.feed-page .feed-heading {
    margin: 0 0 12px;
}

.feed-page .feed-heading h2 {
    margin: 0;
}

.feed-page .feed-posts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: start;
    justify-items: stretch;
    gap: 14px;
    width: 100%;
    margin: 0 0 18px;
    box-sizing: border-box;
}

.feed-page .feed-posts .image-item {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    padding: 4px;
    border: 1px solid #34343a;
    border-radius: 4px;
    background: #25252a;
    box-shadow: none;
    box-sizing: border-box;
    overflow: hidden;
}

.feed-page .feed-posts .image-item > a:first-child {
    display: block;
    width: 100%;
    min-width: 0;
}

.feed-page .feed-posts .image-item > a:first-child > img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.feed-page .feed-posts .profileunderimage {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 5px 0 0;
    padding: 0 2px;
    box-sizing: border-box;
}

.feed-page .feed-posts .profileunderimage .pfp {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    object-fit: cover;
}

.feed-page .feed-posts .profileunderimage a:last-child {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.feed-page .feed-sentinel {
    min-height: 42px;
}

.feed-page .feed-load-more {
    width: auto;
    margin: 12px auto 30px;
    padding: 9px 14px;
    background: #FFD700;
    color: #1f1f1f;
}

/* Post tags and follow actions */
.galleryDetailsBottom .tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;
    width: 100%;
    float: none;
    text-align: left;
}

.galleryDetailsBottom .tags .post-tag-follow {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    max-width: 100%;
    margin: 0;
}

.galleryDetailsBottom .tags a.tagbutton {
    display: inline-flex;
    align-items: center;
    width: auto;
    max-width: 100%;
    min-height: 30px;
    padding: 5px 9px;
    border-radius: 4px;
    background: #FFD700;
    color: #1f1f1f;
    text-decoration: none;
    transform: none;
    box-sizing: border-box;
}

.galleryDetailsBottom .tags form.tag-follow-form {
    display: inline-flex;
    width: auto;
    min-width: 0;
    margin: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
}

.galleryDetailsBottom .tags button.tag-follow-button {
    display: inline-grid;
    place-items: center;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    margin: 0;
    padding: 0;
    border: 1px solid #d0ae00;
    border-radius: 4px;
    background: #FFD700;
    color: #1f1f1f;
    line-height: 1;
    transform: none;
}

@media (max-width: 1100px) {
    .home-feed-grid {
        grid-template-columns: 1fr;
        width: min(900px, calc(100% - 32px));
        gap: 24px;
    }

    .feed-page .feed-posts {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .home-feed-grid {
        width: calc(100% - 24px);
        gap: 20px;
    }

    .home-feed-panel .image-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .home-feed-panel .image-grid .image-item:nth-child(n + 7) {
        display: none;
    }

    .feed-page {
        width: calc(100% - 24px);
        margin: 14px auto;
    }

    .feed-page .feed-posts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .galleryDetailsBottom .tags {
        width: 100%;
        justify-content: flex-start;
    }
}
