/* 🌐 Giao diện blog hiện đại – AI168 gradient */
body {
    background-color: #f4f6fa;
    /* trắng */
}

/* Container chính */
.container.py-5 {
    border-radius: 20px;
    padding: 50px;
    max-width: 2000px;
    /* tăng giới hạn cho màn hình cực rộng */
    margin: 0 auto;

    background: #f4f6fa;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
}

/* --- Responsive max-width --- */
@media (max-width: 1800px) {
    .container.py-5 {
        max-width: 1650px;
    }
}

@media (max-width: 1650px) {
    .container.py-5 {
        max-width: 1400px;
    }
}

@media (max-width: 1400px) {
    .container.py-5 {
        max-width: 1200px;
        padding: 40px;
    }
}

@media (max-width: 1200px) {
    .container.py-5 {
        max-width: 1000px;
        padding: 35px;
    }
}

@media (max-width: 992px) {
    .container.py-5 {
        max-width: 750px;
        padding: 30px;
    }
}

@media (max-width: 768px) {
    .container.py-5 {
        max-width: 100%;
        padding: 20px;
    }
}

@media (max-width: 576px) {
    .container.py-5 {
        padding: 15px;
    }
}

/* --- Sidebar --- */
.card {
    border: none;
    border-radius: 16px;
}

.card-header {
    font-weight: 600;
    font-size: 1.05rem;
    border-bottom: 1px solid #f0f0f0;
}

/* --- Danh mục --- */
.list-group-item {
    border: none;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
}

.list-group-item:hover {
    background-color: #f9fafb;
    transform: translateX(4px);
}

/* --- Blog hot --- */
.hot-item {
    transition: background-color 0.25s ease, transform 0.2s ease;
}

.hot-item:hover {
    background-color: #f9fafb;
    transform: translateX(4px);
}

/* --- Ảnh vuông blog hot --- */
.hot-thumb-container {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.hot-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.row.g-4 {
    row-gap: 50px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .card-img-container {
        height: 180px;
    }

    .hot-thumb-container {
        width: 60px;
        height: 60px;
    }
}

/* Blog card vuông, bo góc */
.blog-card {
    display: flex;
    flex-direction: column;
    border-radius: 1rem;
    overflow: hidden;
}

.card-img-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.card-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hot-thumb-container {
    width: 50px;
    height: 50px;
    overflow: hidden;
    border-radius: 50%;
}

.hot-thumb-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-left,
.sidebar-right {
    position: sticky;
    top: 100px;
}

@media (max-width: 992px) {

    .sidebar-left,
    .sidebar-right {
        position: static;
        margin-top: 20px;
    }
}

/* style cho phân trang */
.pagination {
    display: flex;
    justify-content: center;
    /* canh giữa */
    gap: 6px;
    margin-top: 20px;
}

.pagination li {
    list-style: none;
}

.pagination li a,
.pagination li span {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 50px;
    border: 1px solid #ddd;
    color: #333;
    text-decoration: none;
    transition: all 0.2s;
}

.pagination li a:hover {
    background-color: #ee25d381;
    color: white;
    border-color: #ee25d381;
}

.pagination .active span {
    background-color: #ee25d381;
    color: white;
    border-color: #ee25d381;
}

p.small.text-muted {
    display: none;
}

.suggested-scroll-wrapper {
    overflow-x: auto;
    display: flex;
    gap: 1rem;
    scroll-behavior: smooth;
    padding-bottom: 5px;
    cursor: grab;
}

.suggested-scroll-wrapper::-webkit-scrollbar {
    height: 6px;
}

.suggested-scroll-wrapper::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.suggested-card {
    width: 200px;
    flex-shrink: 0;
}

.card-img-container {
    height: 120px;
    overflow: hidden;
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

.card-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-card {
    position: relative;
    /* Để badge có thể định vị tuyệt đối */
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

/* Ảnh trong card */
.card-img-container {
    width: 100%;
    height: 180px;
    /* chiều cao cố định */
    overflow: hidden;
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
}

.card-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.blog-card:hover .card-img-container img {
    transform: scale(1.05);
    /* zoom nhẹ khi hover */
}

/* Phần mô tả blog */
.blog-description {
    flex-grow: 1;
    margin-bottom: 0.5rem;
}

/* Hot thumb dạng tròn (chỗ khác) */
.hot-thumb-container {
    width: 50px;
    height: 50px;
    overflow: hidden;
    border-radius: 50%;
}

.hot-thumb-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-left,
.sidebar-right {
    position: sticky;
    top: 100px;
}

@media (max-width: 992px) {
    .sidebar-left,
    .sidebar-right {
        position: static;
        margin-top: 20px;
    }
}

/* style cho phân trang */
.pagination {
    display: flex;
    justify-content: center; /* canh giữa */
    gap: 6px;
    margin-top: 20px;
}

.pagination li {
    list-style: none;
}

.pagination li a,
.pagination li span {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 50px;
    border: 1px solid #ddd;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s;
    background: #ffffff;
}

/* Hover & active: dùng gradient AI168 */
.pagination li a:hover {
    background: linear-gradient(120deg, #fb7185, #3b82f6, #a855f7, #fb923c);
    color: #ffffff;
    border-color: transparent;
}

.pagination .active span {
    background: linear-gradient(120deg, #fb7185, #3b82f6, #a855f7, #fb923c);
    color: #ffffff;
    border-color: transparent;
}

p.small.text-muted {
    display: none;
}

/* Scroll gợi ý */
.suggested-scroll-wrapper {
    overflow-x: auto;
    display: flex;
    gap: 1rem;
    scroll-behavior: smooth;
    padding-bottom: 5px;
    cursor: grab;
}

.suggested-scroll-wrapper::-webkit-scrollbar {
    height: 6px;
}

.suggested-scroll-wrapper::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 3px;
}

.suggested-card {
    width: 200px;
    flex-shrink: 0;
}

/* Card ảnh trong suggested */
.card-img-container {
    height: 120px;
    overflow: hidden;
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

.card-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Card tin mới nhất ngang */
.latest-blog-card-horizontal {
    display: flex;
    overflow: hidden;
    border-radius: 2rem;
    /* bo góc lớn */
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    width: 100%;
    max-width: 1600px;
    /* gấp đôi */
    margin: 0 auto;
    align-items: stretch;
    /* ảnh và card-body cao bằng nhau */
}

.latest-blog-card-horizontal:hover {
    transform: translateY(-10px);
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.15);
}

/* Ảnh bên trái */
.latest-blog-card-horizontal .card-img-container {
    flex: 0 0 400px;
    /* chiều ngang ảnh */
    height: auto;
    border-radius: 2rem 0 0 2rem;
    overflow: hidden;
    display: flex;
    position: relative;
}

.latest-blog-card-horizontal .card-img-container img {
    width: 100%;
    height: 100%;
    /* match chiều cao thẻ */
    object-fit: cover;
    transition: transform 0.3s;
}

.latest-blog-card-horizontal:hover .card-img-container img {
    transform: scale(1.05);
}

/* Badge “Mới nhất” dùng gradient AI168 */
.latest-blog-card-horizontal .card-img-container .badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    font-size: 1.5rem;
    /* gấp đôi */
    padding: 0.4rem 1rem;
    border-radius: 1rem;
    background: linear-gradient(120deg, #fb7185, #3b82f6, #a855f7, #fb923c);
    color: #fff;
    z-index: 2;
}

/* Nội dung bên phải */
.latest-blog-card-horizontal .card-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2rem;
    /* gấp đôi padding */
    flex: 1;
}

.latest-blog-card-horizontal .card-body h4 {
    margin: 0;
    font-size: 2.5rem;
    /* gấp đôi */
    font-weight: 700;
}

.latest-blog-card-horizontal .card-body .blog-description {
    color: #6c757d;
    font-size: 1.8rem;
    /* gấp đôi font-size */
    margin: 1rem 0;
    line-height: 2.4rem;
    max-height: 4.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.latest-blog-card-horizontal .author-date {
    display: flex;
    gap: 2rem;
    /* gấp đôi khoảng cách */
    font-size: 1.6rem;
    /* gấp đôi font-size */
    color: #6c757d;
}

/* Responsive nhỏ màn hình */
@media (max-width: 1200px) {
    .latest-blog-card-horizontal {
        flex-direction: column;
        /* ảnh lên trên */
        max-width: 90%;
    }

    .latest-blog-card-horizontal .card-img-container {
        flex: 0 0 auto;
        height: 400px;
        /* cố định chiều cao */
        border-radius: 2rem 2rem 0 0;
    }

    .latest-blog-card-horizontal .card-body {
        padding: 1.5rem;
    }

    .latest-blog-card-horizontal .card-body h4 {
        font-size: 2rem;
    }

    .latest-blog-card-horizontal .card-body .blog-description {
        font-size: 1.4rem;
        max-height: 3.6rem;
    }

    .latest-blog-card-horizontal .author-date {
        font-size: 1.2rem;
        gap: 1rem;
    }
}

/* ==== CẢI TIẾN TIN MỚI NHẤT TRÊN MOBILE ==== */
@media (max-width: 768px) {

    .latest-blog-card-horizontal {
        flex-direction: column;
        max-width: 100%;
        border-radius: 1rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
        margin-bottom: 1rem;
    }

    .latest-blog-card-horizontal .card-img-container {
        height: 200px;
        flex: unset;
        border-radius: 1rem 1rem 0 0;
    }

    .latest-blog-card-horizontal .card-img-container img {
        height: 100%;
        object-fit: cover;
    }

    /* Badge nhỏ lại như thẻ bình thường */
    .latest-blog-card-horizontal .card-img-container .badge {
        font-size: 0.9rem;
        padding: 0.3rem 0.7rem;
        border-radius: 0.5rem;
    }

    .latest-blog-card-horizontal .card-body {
        padding: 1rem;
    }

    .latest-blog-card-horizontal .card-body h4 {
        font-size: 1.2rem;
        line-height: 1.4rem;
        margin-bottom: 0.5rem;
    }

    .latest-blog-card-horizontal .card-body .blog-description {
        font-size: 0.95rem;
        line-height: 1.4rem;
        max-height: none;
        margin-bottom: 0.8rem;
    }

    .latest-blog-card-horizontal .author-date {
        font-size: 0.85rem;
        gap: 0.5rem;
        color: #6c757d;
        flex-wrap: wrap;
    }
}