.web-community-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.web-community-grid > li {
    display: flex;
}

.web-community-grid > li > .web-community-card {
    width: 100%;
}

.web-home-post-rail > .web-community-card {
    flex: 0 0 calc((100% - 0.65rem) / 2);
    scroll-snap-align: start;
}

.web-community-card {
    position: relative;
    min-width: 0;
    overflow: hidden;
    background: var(--web-bg-surface);
    border: 1px solid var(--web-border-color);
    border-radius: calc(var(--web-radius) + 0.1rem);
    box-shadow: var(--web-shadow-sm);
    color: var(--web-text-primary);
    text-decoration: none;
    isolation: isolate;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.web-community-card:hover {
    color: var(--web-text-inverse);
    border-color: color-mix(in srgb, var(--web-color-primary) 45%, var(--web-border-color));
    box-shadow: var(--web-shadow-md);
    transform: translateY(-0.12rem);
}

.web-community-card-edit {
    position: absolute;
    top: .6rem;
    right: .6rem;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    min-height: 2rem;
    padding: .25rem .55rem;
    border: 1px solid var(--web-border-color);
    border-radius: 8px;
    background: var(--web-bg-surface);
    color: var(--web-color-primary);
    font-size: .8125rem;
    font-weight: 800;
    text-decoration: none;
    box-shadow: var(--web-shadow-sm);
}

.web-community-card-edit:hover,
.web-community-card-edit:focus {
    border-color: var(--web-color-primary);
    color: var(--web-color-primary-hover);
}

.web-community-card-frame {
    border: 3px solid transparent;
    background:
        linear-gradient(var(--web-bg-surface), var(--web-bg-surface)) padding-box,
        linear-gradient(
            135deg,
            var(--web-frame-gold-highlight) 0%,
            var(--web-frame-gold) 26%,
            var(--web-frame-gold-deep) 54%,
            var(--web-frame-gold) 78%,
            var(--web-frame-gold-highlight) 100%
        ) border-box;
    box-shadow:
        0 0 0 0.12rem color-mix(in srgb, var(--web-frame-gold) 48%, transparent),
        0 0.55rem 1.25rem color-mix(in srgb, var(--web-frame-gold) 28%, transparent),
        var(--web-shadow-md);
}

.web-community-card-frame::before {
    content: "";
    position: absolute;
    inset: 0.28rem;
    z-index: 3;
    pointer-events: none;
    border: 2px solid color-mix(in srgb, var(--web-frame-gold) 88%, var(--web-frame-gold-highlight));
    border-radius: calc(var(--web-radius) - 0.1rem);
    box-shadow:
        inset 0 0 0.18rem var(--web-frame-gold-highlight),
        0 0 0.24rem color-mix(in srgb, var(--web-frame-gold) 72%, transparent);
}

.web-community-card-media {
    position: relative;
    aspect-ratio: 9 / 16;
    background: var(--web-bg-muted);
    overflow: hidden;
}

.web-community-card-link {
    display: block;
    width: 100%;
    color: inherit;
    text-decoration: none;
}

.web-community-card-link:hover,
.web-community-card-link:focus {
    color: inherit;
}

.web-community-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1.001);
    transition: transform 0.24s ease;
}

.web-community-card:hover .web-community-card-image {
    transform: scale(1.045);
}

.web-community-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--web-text-muted);
    font-size: 1.75rem;
}

.web-community-card-status {
    position: absolute;
    inset: 0;
    z-index: 2;
}

.web-community-card-badge {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    min-height: 2rem;
    padding: 0.35rem 0.5rem;
    border: 1px solid color-mix(in srgb, var(--web-text-inverse) 24%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--web-text-primary) 58%, transparent);
    color: var(--web-text-inverse);
    box-shadow: var(--web-shadow-sm);
    backdrop-filter: blur(0.75rem);
}

.web-community-card-badge .bi {
    font-size: 1rem;
    line-height: 1;
}

.web-community-card-badge-review {
    top: 0.55rem;
    left: 0.55rem;
}

.web-community-card-badge-official {
    top: 0.55rem;
    left: 50%;
    min-width: 2.2rem;
    min-height: 2.2rem;
    padding: 0;
    transform: translateX(-50%);
    border-color: color-mix(in srgb, var(--web-color-accent) 68%, var(--web-text-inverse));
    background: linear-gradient(135deg, color-mix(in srgb, var(--web-color-accent) 82%, var(--web-color-primary)), color-mix(in srgb, var(--web-color-primary) 72%, var(--web-bg-surface)));
    color: var(--web-text-inverse);
}

.web-community-card-badge-official .bi {
    font-size: 1.2rem;
}

.web-community-card-badge-rose {
    top: 0.55rem;
    right: 0.55rem;
    gap: 0.25rem;
    font-size: 0.8125rem;
    font-weight: 800;
}

.web-community-card-badge-rose img {
    width: 1.15rem;
    height: 1.15rem;
    object-fit: contain;
}

.web-community-card-badge-video {
    right: 0.55rem;
    bottom: 0.55rem;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
}

.web-community-card-badge-video .bi {
    transform: translateX(0.08rem);
    font-size: 1.35rem;
}

.web-community-rest-badge {
    position: absolute;
    left: 50%;
    top: 45%;
    z-index: 3;
    pointer-events: none;
    max-width: calc(100% - 2rem);
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    color: var(--web-text-inverse);
    background: color-mix(in srgb, var(--web-text-primary) 72%, transparent);
    border: 1px solid color-mix(in srgb, var(--web-text-inverse) 22%, transparent);
    box-shadow: var(--web-shadow-md);
    backdrop-filter: blur(0.8rem);
    font-size: 0.875rem;
    font-weight: 800;
    white-space: nowrap;
    transform: translate(-50%, -50%);
}

.web-community-card-overlay {
    position: absolute;
    inset: auto 0 0;
    z-index: 1;
    display: grid;
    gap: 0.35rem;
    min-height: 42%;
    align-content: end;
    padding: 4.25rem 2.9rem 0.75rem 0.75rem;
    color: var(--web-text-inverse);
    background: linear-gradient(to top, color-mix(in srgb, var(--web-text-primary) 86%, transparent) 0%, color-mix(in srgb, var(--web-text-primary) 64%, transparent) 48%, transparent 100%);
}

.web-author-line {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
}

.web-author-avatar {
    position: relative;
    z-index: 4;
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--web-bg-muted);
    color: var(--web-text-muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-decoration: none;
}

.web-author-avatar > img:not(.web-author-badge) {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
}

.web-author-badge {
    position: absolute;
    right: -0.18rem;
    top: -0.18rem;
    width: 0.9rem;
    height: 0.9rem;
    object-fit: cover;
    background: var(--web-bg-surface);
    border: 1px solid var(--web-bg-surface);
    box-shadow: var(--web-shadow-sm);
}

.web-author-name {
    position: relative;
    z-index: 4;
    min-width: 0;
    color: var(--web-author-color, var(--web-text-primary));
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
}

.web-author-avatar:hover,
.web-author-avatar:focus,
.web-author-name:hover,
.web-author-name:focus {
    color: var(--web-color-primary-hover);
}

.web-community-card-author {
    max-width: 100%;
}

.web-community-card-author .web-author-avatar {
    width: 1.8rem;
    height: 1.8rem;
    background: color-mix(in srgb, var(--web-text-inverse) 16%, transparent);
    color: var(--web-text-inverse);
}

.web-community-card-author .web-author-name {
    color: var(--web-author-color, var(--web-text-inverse));
}

.web-community-card-summary {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
}

.web-community-card h2 {
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--web-text-inverse);
    font-size: 0.95rem;
    line-height: 1.28;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.web-community-card-location,
.web-community-card-stats {
    display: flex;
    align-items: center;
    min-width: 0;
}

.web-community-card-location {
    gap: 0.28rem;
    color: color-mix(in srgb, var(--web-text-inverse) 88%, transparent);
    font-size: 0.75rem;
    font-weight: 650;
}

.web-community-card-location span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.web-community-card-stats {
    justify-content: space-between;
    gap: 0.45rem;
}

.web-community-card-stats span {
    display: inline-flex;
    align-items: center;
    gap: 0.22rem;
    min-width: 0;
    color: color-mix(in srgb, var(--web-text-inverse) 82%, transparent);
    font-size: 0.75rem;
}

.web-community-card-stats strong {
    color: var(--web-text-inverse);
    font-weight: 800;
}

.web-detail-location-ranking .web-community-card {
    zoom: 0.87;
}

@media (min-width: 576px) {
    .web-community-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .web-home-post-rail > .web-community-card {
        flex-basis: calc((100% - 1.3rem) / 3);
    }
}

@media (min-width: 992px) {
    .web-community-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0.85rem;
    }

    .web-home-post-rail > .web-community-card {
        flex-basis: calc((100% - 2.55rem) / 4);
    }
}
