/* css/feed.css — giao diện feed bài viết kiểu Facebook (index + all-posts) */

.feed {
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.feed-card {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Hàng đầu: avatar + tên tác giả + ngày/danh mục */
.feed-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px 8px;
}

.feed-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.feed-author {
    font-weight: 600;
    font-size: 0.95rem;
    color: #050505;
}

.feed-sub {
    font-size: 0.8rem;
    color: #65676b;
}

.feed-sub a.feed-category {
    color: #65676b;
    font-weight: 500;
}

.feed-sub a.feed-category:hover {
    text-decoration: underline;
}

/* Nội dung */
.feed-body {
    padding: 0 16px 12px;
}

.feed-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.4;
}

.feed-title a {
    color: #050505;
    text-decoration: none;
}

.feed-title a:hover {
    color: #0066cc;
    text-decoration: none;
}

.feed-text {
    font-size: 0.95rem;
    color: #050505;
    white-space: pre-line;
    overflow-wrap: break-word;
}

/* Status rất ngắn -> chữ to giống Facebook */
.feed-text-large {
    font-size: 1.4rem;
    line-height: 1.4;
}

.feed-see-more {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-weight: 600;
    color: #65676b;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.feed-see-more:hover {
    text-decoration: underline;
    color: #65676b;
}

/* Ảnh đại diện bài viết: tràn hết chiều rộng thẻ */
.feed-image-link {
    display: block;
    line-height: 0;
}

.feed-image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    transition: opacity 0.25s ease;
}

.feed-image-link:hover .feed-image {
    opacity: 0.95;
}

/* Tags */
.feed-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 16px 0;
}

.feed-tag {
    display: inline-block;
    padding: 2px 8px;
    background-color: #eef5ff;
    color: #0066cc;
    border-radius: 4px;
    font-size: 0.78rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.feed-tag:hover {
    background-color: #0066cc;
    color: #fff;
    text-decoration: none;
}

/* Thanh hành động: bình luận / đọc bài viết */
.feed-actions {
    display: flex;
    margin: 10px 16px 4px;
    padding: 4px 0;
    border-top: 1px solid #e4e6eb;
}

.feed-action {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 0;
    border-radius: 6px;
    color: #65676b;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
}

.feed-action:hover {
    background-color: #f2f2f2;
    text-decoration: none;
    color: #65676b;
}

@media (max-width: 768px) {
    .feed {
        gap: 12px;
    }

    .feed-card {
        border-radius: 8px;
    }
}

/* Màn hình rộng: 2 cột dạng grid — 2 thẻ cùng hàng cao bằng nhau cho dễ
   theo dõi; mobile giữ 1 cột. Khối này phải nằm CUỐI file để thắng các
   rule cùng độ ưu tiên phía trên (margin, max-height...). */
@media (min-width: 900px) {
    .feed {
        display: grid;
        grid-template-columns: 1fr 1fr;
        max-width: 1080px;
    }

    /* Thẻ là cột flex để ghim thanh hành động xuống đáy */
    .feed-card {
        display: flex;
        flex-direction: column;
    }

    .feed-actions {
        margin-top: auto;
    }

    /* Ảnh co giãn lấp phần chênh lệch chiều cao giữa 2 thẻ cùng hàng */
    .feed-image-link {
        position: relative;
        flex: 1;
        min-height: 260px;
        overflow: hidden;
    }

    .feed-image {
        position: absolute;
        inset: 0;
        height: 100%;
        max-height: none;
    }
}
