/**
 * Category & Post List Style - Modern Card Grid Layout
 * Phong cách phù hợp với web game, responsive đầy đủ
 */

/* ============================================
   TIÊU ĐỀ DANH MỤC
   ============================================ */
.title-main-new .title-left {
    font-size: 16px;
    font-family: 'VJAMAI', sans-serif;
    color: #ffffff;
}

@media only screen and (min-width: 768px) {
    .title-main-new .title-left {
        font-size: 22px;
    }
}

.title-main-new .date-open-right {
    color: #ffdf7e;
    font-size: 13px;
}

@media only screen and (min-width: 768px) {
    .title-main-new .date-open-right {
        font-size: 16px;
    }
}

/* ============================================
   GRID LAYOUT CHO DANH SÁCH BÀI VIẾT
   ============================================ */
.list-new-page {
    padding: 16px 12px;
    padding-bottom: 20px;
}

@media only screen and (min-width: 768px) {
    .list-new-page {
        padding: 24px 20px;
        padding-bottom: 30px;
    }
}

/* Grid container */
.posts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

@media only screen and (min-width: 480px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media only screen and (min-width: 900px) {
    .posts-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media only screen and (min-width: 1200px) {
    .posts-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}

/* ============================================
   CARD BÀI VIẾT
   ============================================ */
.post-card {
    background: #efecde;
    border: 2px solid #12181f;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(13, 32, 49, 0.25);
}

.post-card > a {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: #291107;
    text-decoration: none;
}

/* Ảnh đại diện */
.post-card .card-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #12181f;
    flex-shrink: 0;
}

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

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

/* Badge danh mục */
.post-card .card-cat-badge {
    position: absolute;
    top: 8px;
    left: 0;
    background: #4f1906;
    color: #ffdf7e;
    font-family: 'VJAMAI', sans-serif;
    font-size: 10px;
    padding: 3px 10px 3px 8px;
    clip-path: polygon(0 0, 100% 0, 92% 100%, 0 100%);
    white-space: nowrap;
    max-width: 80%;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.3px;
}

@media only screen and (min-width: 768px) {
    .post-card .card-cat-badge {
        font-size: 11px;
        padding: 4px 14px 4px 10px;
        top: 10px;
    }
}

/* Nội dung card */
.post-card .card-body {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 6px;
}

@media only screen and (min-width: 768px) {
    .post-card .card-body {
        padding: 12px 14px 14px;
        gap: 8px;
    }
}

/* Tiêu đề bài viết */
.post-card .card-title {
    font-family: 'VJAMAI', sans-serif;
    font-size: 13px;
    font-weight: normal;
    line-height: 1.4;
    color: #12181f;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

@media only screen and (min-width: 768px) {
    .post-card .card-title {
        font-size: 14px;
    }
}

@media only screen and (min-width: 1024px) {
    .post-card .card-title {
        font-size: 15px;
    }
}

/* Đoạn tóm tắt */
.post-card .card-excerpt {
    font-size: 11px;
    color: #666;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

@media only screen and (min-width: 768px) {
    .post-card .card-excerpt {
        font-size: 12px;
        -webkit-line-clamp: 3;
    }
}

/* Meta thông tin (ngày, lượt xem) */
.post-card .card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 10px;
    color: #888;
    border-top: 1px solid rgba(18, 24, 31, 0.15);
    padding-top: 7px;
    margin-top: auto;
    gap: 4px;
}

@media only screen and (min-width: 768px) {
    .post-card .card-meta {
        font-size: 11px;
        padding-top: 8px;
    }
}

.post-card .card-meta .meta-date {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.post-card .card-meta .meta-views {
    display: flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}

/* Đường kẻ dưới title */
.post-card .card-divider {
    width: 30px;
    height: 2px;
    background: #4f1906;
    margin: 0;
    flex-shrink: 0;
}

/* ============================================
   BACKWARDS COMPAT - giữ nguyên .item-new
   nếu view nào dùng layout cũ
   ============================================ */
.list-new-page .item-new {
    padding: 0;
    background: #efecde;
    margin-bottom: 14px;
    border: 2px solid #12181f;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    overflow: hidden;
}

.list-new-page .item-new:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 18px rgba(13, 32, 49, 0.2);
}

.list-new-page .item-new a {
    color: #291107;
    text-decoration: none;
    display: flex;
    align-items: stretch;
}

.list-new-page .item-new .thumb {
    flex-shrink: 0;
    width: 110px;
}

.list-new-page .item-new .thumb img {
    display: block;
    width: 110px;
    height: 100%;
    min-height: 80px;
    object-fit: cover;
}

@media only screen and (min-width: 768px) {
    .list-new-page .item-new {
        margin-bottom: 20px;
    }

    .list-new-page .item-new .thumb {
        width: 200px;
    }

    .list-new-page .item-new .thumb img {
        width: 200px;
        min-height: 120px;
    }
}

.list-new-page .item-new .full-text {
    padding: 10px 12px;
    flex: 1;
    min-width: 0;
}

.list-new-page .item-new .full-text .title-new-date {
    font-size: 13px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(18, 24, 31, 0.2);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

@media only screen and (min-width: 768px) {
    .list-new-page .item-new .full-text {
        padding: 14px 18px;
    }

    .list-new-page .item-new .full-text .title-new-date {
        font-size: 16px;
        padding-bottom: 10px;
    }
}

.list-new-page .item-new .full-text .title-new-date .title-new {
    font-family: 'VJAMAI', sans-serif;
    font-weight: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    flex: 1;
    line-height: 1.4;
    margin: 0;
}

.list-new-page .item-new .full-text .title-new-date .title-new span {
    color: #4f1906;
    font-family: 'VJAMAI', sans-serif;
}

.list-new-page .item-new .full-text .title-new-date .date-open {
    color: #888;
    font-size: 11px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 2px;
}

@media only screen and (min-width: 768px) {
    .list-new-page .item-new .full-text .title-new-date .date-open {
        font-size: 13px;
    }
}

.list-new-page .item-new .full-text .des-text {
    margin-top: 8px;
    font-size: 11px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #666;
    line-height: 1.55;
}

@media only screen and (min-width: 768px) {
    .list-new-page .item-new .full-text .des-text {
        margin-top: 12px;
        font-size: 13px;
        -webkit-line-clamp: 3;
    }
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    margin-top: 24px;
    text-align: center;
}

@media only screen and (min-width: 768px) {
    .pagination {
        margin-top: 40px;
    }
}

.pagination ul {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagination ul li {
    width: 52px;
    height: 28px;
    background: #0d2031;
    clip-path: polygon(20% 0%, 100% 0%, 80% 100%, 0% 100%);
    margin: 0 -4px;
    transition: background 0.2s ease;
}

@media only screen and (min-width: 768px) {
    .pagination ul li {
        width: 72px;
        height: 38px;
        margin: 0 -6px;
    }
}

.pagination ul li.active,
.pagination ul li:hover {
    background: #4f1906;
}

.pagination ul li a {
    font-family: 'VJAMAI', sans-serif;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #fff;
    text-decoration: none;
}

@media only screen and (min-width: 768px) {
    .pagination ul li a {
        font-size: 16px;
    }
}

/* ============================================
   NO POSTS
   ============================================ */
.no-posts {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
    font-family: 'VJAMAI', sans-serif;
}

.no-posts p {
    font-size: 15px;
    margin-top: 16px;
}
