/* --- Premium News Grid UI - Version 2.1.0 (Fixed Layout) --- */

/* Ép toàn bộ thành phần bên trong tuân thủ box-sizing để tránh vỡ cột */
.ngotuyen-related-box,
.ngotuyen-related-box * {
    box-sizing: border-box !important;
}

.ngotuyen-related-box {
    margin: 40px 0 20px 0;
    padding: 25px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid #f1f1f1;
    clear: both;
}

/* Đường kẻ trái (accent) màu xanh lá */
.ngotuyen-related-title {
    font-size: 15px;
    font-weight: 800;
    margin-bottom: 25px;
    padding-left: 15px;
    border-left: 5px solid #2ecc71; 
    color: #2c3e50;
    line-height: 1.2;
    letter-spacing: 0.5px;
}

/* Khung lưới Grid chia làm 3 cột */
.ngotuyen-related-list {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important;
}

.ngotuyen-related-item {
    display: block !important;
}

/* Card chứa thông tin - Thiết lập hiển thị hàng dọc */
.ngotuyen-related-card {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    background: #ffffff !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    border: 1px solid #f2f2f2 !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

/* Hiệu ứng hover nhấc nhẹ card */
.ngotuyen-related-card:hover {
    border-color: #2ecc71 !important;
    transform: translateY(-5px) !important;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.06) !important;
    background-color: #f0fff4 !important;
}

.ngotuyen-related-link {
    display: flex !important;
    flex-direction: column !important; /* Đảm bảo cấu trúc: Hình ở trên, Chữ ở dưới */
    height: 100% !important;
    text-decoration: none !important;
    color: inherit !important;
}

/* Khung hình ảnh phía trên */
.ngotuyen-related-thumb {
    width: 100% !important;
    aspect-ratio: 16 / 10 !important; /* Ép tỷ lệ khung hình chuẩn vàng cho ảnh */
    overflow: hidden !important;
    background: #f8f9fa !important;
    flex-shrink: 0 !important;
}

.ngotuyen-related-thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    transition: transform 0.5s ease !important;
}

.ngotuyen-related-card:hover .ngotuyen-related-thumb img {
    transform: scale(1.06) !important;
}

/* Phần thông tin chữ phía dưới */
.ngotuyen-related-info {
    padding: 15px !important;
    flex-grow: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
}

/* Tiêu đề tin tức */
.ngotuyen-related-post-title {
    font-size: 15px !important;
    font-weight: 600 !important;
    margin: 0 0 10px 0 !important;
    line-height: 1.45 !important;
    color: #1a1a1a !important;
    /* Khống chế tối đa 2 dòng, nếu quá dài sẽ tự động sinh dấu ba chấm (...) giúp Grid đều tăm tắp */
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

.ngotuyen-related-date {
    font-size: 12px !important;
    color: #95a5a6 !important;
    display: block !important;
    margin-top: auto !important; /* Đẩy ngày xuống dưới cùng đáy Card */
}

.ngotuyen-related-price {
    font-size: 14px !important;
    color: #27ae60 !important;
    font-weight: 700 !important;
    margin-top: auto !important;
}

/* --- Tối ưu hiển thị Responsive --- */

/* Màn hình Máy tính bảng (Dưới 1024px) -> Chuyển thành lưới 2 cột */
@media (max-width: 1024px) {
    .ngotuyen-related-list {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }
}

/* Màn hình Điện thoại (Dưới 767px) -> Chuyển thành dạng 1 cột dọc dọc để dễ đọc */
@media (max-width: 767px) {
    .ngotuyen-related-box {
        padding: 15px !important;
        margin: 30px 0 15px 0 !important;
    }

    .ngotuyen-related-list {
        grid-template-columns: repeat(1, 1fr) !important;
        gap: 15px !important;
    }

    .ngotuyen-related-title {
        font-size: 18px !important;
        margin-bottom: 18px !important;
    }

    .ngotuyen-related-post-title {
        font-size: 14px !important;
    }

    .ngotuyen-related-card:hover {
        transform: none !important; /* Tắt hiệu ứng di chuyển trên điện thoại tránh lỗi giật màn hình */
        box-shadow: none !important;
    }
}

/* Dọn dẹp bullet nếu dính từ Theme */
.ngotuyen-related-list, .ngotuyen-related-item {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}