/* Tag, search, and listing output */
.hg-content-shell:has(.ap-category-card),
.ap-listing-grid-fix {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px !important;
    width: 100%;
    max-width: 1240px;
    padding: 0 22px clamp(86px, 8vw, 126px) !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}
.hg-content-shell:has(.ap-category-card) .speedbar,
.hg-content-shell:has(.ap-category-card) .info,
.hg-content-shell:has(.ap-category-card) > h1,
.hg-content-shell:has(.ap-category-card) > .title,
.hg-content-shell:has(.ap-category-card) > .berrors,
.hg-content-shell:has(.ap-category-card) > .box:not(.ap-category-card) {
    grid-column: 1 / -1;
}
.hg-content-shell:has(.ap-category-card) .navigation,
.hg-content-shell:has(.ap-category-card) .pages,
.hg-content-shell:has(.ap-category-card) .page_next-prev {
    grid-column: 1 / -1;
    justify-self: center;
}
.ap-category-card-generic .ap-category-card-desc img,
.ap-category-card-generic .ap-category-card-desc .story_icons,
.ap-category-card-generic .ap-category-card-desc .story_tools,
.ap-category-card-generic .ap-category-card-desc .rate,
.ap-category-card-generic .ap-category-card-desc .editdate {
    display: none !important;
}
.ap-category-card-generic .ap-category-card-desc {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
/* Safety: if old default shortstory still appears anywhere, make it not destructive */
.hg-content-shell .shortstory:not(.ap-category-card) .story_icons,
.hg-content-shell .shortstory:not(.ap-category-card) .story_tools,
.hg-content-shell .shortstory:not(.ap-category-card) .rate {
    display: none !important;
}
.hg-content-shell .shortstory:not(.ap-category-card) svg.icon {
    width: 18px !important;
    height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
}
@media (max-width: 1040px) {
    .hg-content-shell:has(.ap-category-card),
    .ap-listing-grid-fix {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 680px) {
    .hg-content-shell:has(.ap-category-card),
    .ap-listing-grid-fix {
        grid-template-columns: 1fr;
        padding-left: 14px !important;
        padding-right: 14px !important;
    }
}
