/* ============================================================== */
/* TRANG DANH MỤC BÀI VIẾT - ĐỒNG BỘ SIDEBAR TRÁI & SÁNG ĐẸP      */
/* ============================================================== */

.blog-page-wrap,
.blog-page-wrap * {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    box-sizing: border-box;
}

.blog-page-wrap {
    max-width: 1240px;
    margin: 24px auto 60px;
    padding: 0 24px;
    font-size: 15.5px;
    color: #334155;
    line-height: 1.65;
}

/* KHỐI TIÊU ĐỀ ĐẦU TRANG SÁNG HIỆN ĐẠI */
.blog-header-bar {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 28px 32px;
    margin-bottom: 22px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.02);
}

.blog-header-tag {
    display: inline-block;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #e60012;
    margin-bottom: 6px;
}

.blog-header-bar h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 8px;
    letter-spacing: -0.3px;
}

.blog-header-bar p {
    color: #64748b;
    font-size: 15px;
    font-weight: 400;
    max-width: 760px;
    margin: 0;
    line-height: 1.6;
}

/* THANH LỌC DANH MỤC & TÌM KIẾM */
.blog-filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 24px;
}

.cat-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    padding-bottom: 2px;
}
.cat-tabs::-webkit-scrollbar {
    display: none;
}

.cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 99px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #475569;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: all 0.18s ease;
    flex-shrink: 0;
}
.cat-pill:hover {
    border-color: #cbd5e1;
    color: #1e293b;
}
.cat-pill.active {
    background: #e60012;
    border-color: #e60012;
    color: #ffffff;
}

.blog-search-box {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 99px;
    padding: 4px 14px;
    width: 100%;
    max-width: 280px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.blog-search-box:focus-within {
    border-color: #cbd5e1;
    box-shadow: 0 0 0 3px rgba(230, 0, 18, 0.06);
}
.blog-search-box input {
    border: none;
    background: transparent;
    padding: 6px 8px;
    outline: none;
    font-size: 14px;
    font-weight: 400;
    width: 100%;
    color: #1e293b;
}

/* LƯỚI BÀI VIẾT */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(275px, 1fr));
    gap: 20px;
}

.post-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.02);
}

.post-card:hover {
    transform: translateY(-3px);
    border-color: #fecaca;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.post-card-thumb {
    position: relative;
    height: 185px;
    overflow: hidden;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
}

.post-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
    display: block;
}

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

.post-card-body {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* TIÊU ĐỀ BÀI VIẾT */
.post-card-title {
    font-size: 16px;
    font-weight: 500;
    color: #1e293b;
    line-height: 1.45;
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 46px;
    transition: color 0.15s ease;
}

.post-card:hover .post-card-title {
    color: #e60012;
}

/* HÀNG BADGE DANH MỤC & NGÀY ĐĂNG NẰM DƯỚI TIÊU ĐỀ */
.post-meta-under-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.post-cat-badge-inline {
    display: inline-block;
    background: #fff5f5;
    border: 1px solid #fecaca;
    color: #e60012;
    font-size: 11.5px;
    font-weight: 500;
    padding: 2px 9px;
    border-radius: 6px;
    line-height: 1.4;
}

.post-date-inline {
    font-size: 12px;
    font-weight: 400;
    color: #94a3b8;
}

.post-card-summary {
    font-size: 13.5px;
    font-weight: 400;
    color: #64748b;
    line-height: 1.55;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================================== */
/* TỐI ƯU DI ĐỘNG: FULL MÀN 2 BÊN                                 */
/* ============================================================== */
@media (max-width: 768px) {
    .blog-page-wrap {
        padding: 0 !important;
        margin: 0 auto 40px !important;
        width: 100% !important;
    }

    .blog-header-bar {
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
        border-top: none !important;
        padding: 18px 16px !important;
        margin-bottom: 12px !important;
        box-shadow: none !important;
    }

    .blog-header-bar h1 {
        font-size: 1.35rem !important;
    }

    .blog-header-bar p {
        font-size: 13.5px !important;
    }

    .blog-filter-bar {
        padding: 0 14px !important;
        margin-bottom: 14px !important;
        gap: 10px !important;
    }

    .cat-tabs {
        width: 100%;
    }

    .cat-pill {
        padding: 7px 14px;
        font-size: 13px;
    }

    .blog-search-box {
        max-width: 100% !important;
        border-radius: 12px;
    }

    .post-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .post-card {
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
        box-shadow: none !important;
        flex-direction: row !important;
        align-items: stretch;
        padding: 12px 14px;
        gap: 12px;
    }

    .post-card:hover {
        transform: none !important;
    }

    .post-card-thumb {
        width: 118px !important;
        height: 92px !important;
        border-radius: 10px !important;
        border: 1px solid #f1f5f9 !important;
        flex-shrink: 0;
    }

    .post-card-body {
        padding: 0 !important;
        justify-content: center;
    }

    .post-card-title {
        font-size: 14.5px !important;
        min-height: auto !important;
        margin-bottom: 5px !important;
    }

    .post-meta-under-title {
        margin-bottom: 4px !important;
        gap: 6px !important;
    }

    .post-cat-badge-inline {
        font-size: 11px !important;
        padding: 1px 7px !important;
    }

    .post-card-summary {
        -webkit-line-clamp: 1 !important;
        font-size: 12.5px !important;
    }
}
