.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.6rem;
}

.post-card {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0.028) 100%);
    box-shadow:
        0 18px 46px rgba(0, 0, 0, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: transform 0.32s ease, box-shadow 0.32s ease, border-color 0.32s ease;
}

.post-card-clickable {
    cursor: pointer;
}

.post-card-clickable:focus-visible {
    outline: 2px solid rgba(187, 134, 252, 0.55);
    outline-offset: 3px;
}

.post-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(187, 134, 252, 0.08) 0%, transparent 26%, transparent 100%);
    opacity: 0;
    transition: opacity 0.32s ease;
    pointer-events: none;
}

.post-card:hover {
    transform: translateY(-10px);
    border-color: rgba(187, 134, 252, 0.3);
    box-shadow:
        0 24px 64px rgba(0, 0, 0, 0.42),
        0 0 0 1px rgba(187, 134, 252, 0.08);
}

.post-card:hover::before {
    opacity: 1;
}

.post-media {
    position: relative;
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, rgba(187, 134, 252, 0.12) 0%, rgba(3, 218, 198, 0.08) 100%);
    overflow: hidden;
}

.post-media::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, transparent 45%, rgba(5, 5, 5, 0.22) 100%);
    pointer-events: none;
}

.post-media-gallery-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0.42rem 0.72rem;
    border-radius: 999px;
    background: rgba(8, 8, 11, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    backdrop-filter: blur(10px);
}

.post-media-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1.01);
    transition: transform 0.42s ease;
}

.post-card:hover .post-media-image {
    transform: scale(1.06);
}

.post-media-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    background:
        radial-gradient(circle at top, rgba(187, 134, 252, 0.22) 0%, rgba(18, 18, 18, 0.8) 74%),
        linear-gradient(135deg, rgba(108, 99, 255, 0.2) 0%, rgba(3, 218, 198, 0.08) 100%);
}

.post-body {
    position: relative;
    padding: 1.45rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.post-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
}

.post-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.48rem 0.82rem;
    border-radius: 999px;
    background: rgba(187, 134, 252, 0.14);
    border: 1px solid rgba(187, 134, 252, 0.16);
    color: #f5edff;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.post-time {
    color: rgba(255, 255, 255, 0.54);
    font-size: 0.82rem;
    white-space: nowrap;
}

.post-title {
    font-size: 1.28rem;
    line-height: 1.32;
    letter-spacing: -0.02em;
}

.post-description {
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.72;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 5.2em;
}

.post-description .post-inline-link {
    color: #9fe8ff;
    text-decoration: underline;
    text-decoration-color: rgba(159, 232, 255, 0.45);
    text-underline-offset: 0.18em;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.post-description .post-inline-link:hover,
.post-description .post-inline-link:focus-visible {
    color: #d4f7ff;
    text-decoration-color: rgba(212, 247, 255, 0.8);
    outline: none;
}

.post-meta {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 0.2rem;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.post-author-link {
    color: inherit;
    text-decoration: none;
    border-radius: 18px;
    padding: 0.2rem 0.35rem 0.2rem 0.2rem;
    margin: -0.2rem 0 0 -0.2rem;
    transition: background 0.22s ease, transform 0.22s ease;
}

.post-author-link:hover {
    background: rgba(255, 255, 255, 0.045);
    transform: translateY(-1px);
}

.post-author-link:focus-visible {
    outline: 2px solid rgba(187, 134, 252, 0.45);
    outline-offset: 2px;
}

.post-author-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(187, 134, 252, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.post-author-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.post-author-avatar-placeholder {
    color: #fff;
    font-weight: 700;
}

.post-author-name {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
    color: #fff;
}

.post-author-name .verified-badge-icon {
    flex-shrink: 0;
    color: #03dac6;
}

.post-author-subtitle {
    color: rgba(255, 255, 255, 0.52);
    font-size: 0.86rem;
}

.post-engagement {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.65rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.86rem;
    white-space: nowrap;
}

.post-actions {
    padding-top: 0.15rem;
}

.post-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.post-delete-btn {
    background: rgba(255, 125, 125, 0.06);
    color: #ff8888;
    border: 1px solid rgba(255, 125, 125, 0.26);
    border-radius: 14px;
    padding: 0.7rem 1rem;
    cursor: pointer;
    font: inherit;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.post-delete-btn:hover {
    background: rgba(255, 125, 125, 0.12);
    border-color: rgba(255, 125, 125, 0.52);
    color: #ff9b9b;
    transform: translateY(-1px);
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3.2rem 2rem;
    border-radius: 28px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.045) 0%, rgba(255, 255, 255, 0.024) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.55rem;
    margin-bottom: 0.75rem;
}

.empty-state p {
    color: rgba(255, 255, 255, 0.65);
    max-width: 560px;
    margin: 0 auto 1.5rem;
    line-height: 1.7;
}

.empty-state-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 1.45rem;
    border-radius: 16px;
    text-decoration: none;
    color: white;
    font-weight: 700;
    background: linear-gradient(135deg, #bb86fc 0%, #6c63ff 100%);
    box-shadow: 0 12px 28px rgba(187, 134, 252, 0.24);
}

@media (max-width: 768px) {
    .post-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .post-engagement {
        width: 100%;
        justify-content: center;
    }

    .post-card-footer {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .posts-grid {
        grid-template-columns: 1fr;
    }

    .post-body {
        padding: 1.2rem;
    }

    .post-topline {
        flex-wrap: wrap;
    }

    .post-delete-btn {
        width: 100%;
        justify-content: center;
    }
}
