.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-6);
    margin-top: var(--space-8);
}

.post-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background-color: var(--surface);
    box-shadow: var(--shadow-sm);
    color: inherit;
    text-decoration: none;
    transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease),
        border-color var(--duration) var(--ease);
}

.post-card:hover {
    border-color: var(--blue);
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

.post-card__header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
}

.post-card__avatar {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    padding: 3px;
    border: 2px solid var(--blue);
    border-radius: 50%;
    background-color: var(--surface);
    object-fit: contain;
}

.post-card__account {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    line-height: 1.3;
}

.post-card__handle {
    font-size: var(--fs-sm);
    font-weight: 700;
}

.post-card__date {
    color: var(--text-subtle);
    font-size: var(--fs-xs);
}

.post-card__brand {
    flex-shrink: 0;
    color: var(--text-subtle);
    transition: color var(--duration) var(--ease);
}

.post-card:hover .post-card__brand {
    color: #d62976;
}

.post-card__media {
    overflow: hidden;
    aspect-ratio: 1;
    background-color: var(--blue-50);
}

.post-card__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 400ms var(--ease);
}

.post-card:hover .post-card__image {
    transform: scale(1.04);
}

.post-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-4);
}

.post-card__headline {
    display: -webkit-box;
    overflow: hidden;
    font-size: var(--fs-sm);
    font-weight: 700;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.post-card__excerpt {
    display: -webkit-box;
    overflow: hidden;
    color: var(--text-muted);
    font-size: var(--fs-sm);
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.post-card__excerpt:empty {
    display: none;
}

.post-card__more {
    margin-top: auto;
    padding-top: var(--space-2);
    color: var(--blue-700);
    font-size: var(--fs-sm);
    font-weight: 600;
}

/* Faixa horizontal: cresce para o lado conforme novas postagens chegam. */
.posts-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-4);
}

.posts-controls {
    margin-top: 0;
}

.posts-track {
    --visible-posts: 3;
    display: flex;
    position: relative;
    gap: var(--space-6);
    margin-top: var(--space-8);
    padding: var(--space-1) var(--space-1) var(--space-4);
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-color: var(--blue) transparent;
    scrollbar-width: thin;
}

.posts-track > * {
    flex: 0 0 calc((100% - (var(--visible-posts) - 1) * var(--space-6)) / var(--visible-posts));
    scroll-snap-align: start;
}

@media (max-width: 900px) {
    .posts-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .posts-track {
        --visible-posts: 2;
    }
}

@media (max-width: 560px) {
    .posts-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .posts-track > * {
        flex-basis: 85%;
    }
}
