﻿/* --- CATEGORIES WIDGET STYLE --- */

/* 1. List Structure */
.category-list li {
    position: relative;
}

    /* Đường kẻ ngăn cách giữa các mục (trừ mục cuối) */
    .category-list li:not(:last-child) {
        border-bottom: 1px dashed #eef2f6;
    }

/* 2. Link Item Styling */
.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5px; /* Tăng vùng bấm */
    color: #64748b; /* Màu chữ xám hiện đại */
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    font-size: 0.95rem;
    font-weight: 500;
}

/* Icon Folder */
.cat-icon {
    color: #cbd5e1; /* Màu icon nhạt mặc định */
    transition: color 0.3s;
    font-size: 0.9rem;
}

/* Badge Count (Số lượng) */
.cat-count {
    background-color: #f1f5f9;
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 20px;
    transition: all 0.3s;
}

/* 3. HOVER & ACTIVE STATE */

/* Khi Hover vào dòng category */
.category-item:hover,
.category-item.active {
    color: var(--primary-color, #0046ba);
    padding-left: 10px; /* Hiệu ứng trượt sang phải */
    background-color: rgba(0, 70, 186, 0.02); /* Nền xanh siêu nhạt */
}

    /* Đổi màu Icon khi hover */
    .category-item:hover .cat-icon,
    .category-item.active .cat-icon {
        color: var(--primary-color, #0046ba);
    }

    /* Đổi màu Badge Count khi hover */
    .category-item:hover .cat-count,
    .category-item.active .cat-count {
        background-color: var(--primary-color, #0046ba);
        color: #fff;
        box-shadow: 0 3px 6px rgba(0, 70, 186, 0.2);
    }

/* Widget Title (Kế thừa từ BlogDetail nhưng nhắc lại để chắc chắn) */
.sidebar-widget .widget-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    position: relative;
}

    .sidebar-widget .widget-title::after {
        content: '';
        position: absolute;
        bottom: -2px;
        left: 0;
        width: 50px;
        height: 2px;
        background: var(--primary-color, #0046ba);
    }


/* --- LATEST POSTS WIDGET --- */

.latest-post-item {
    display: flex;
    align-items: flex-start; /* Căn chỉnh theo cạnh trên */
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px dashed #eef2f6; /* Đường kẻ ngăn cách nhẹ */
    transition: all 0.3s;
}

    /* Bỏ đường kẻ ở bài cuối cùng */
    .latest-post-item:last-child {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
    }

/* 1. Thumbnail Styling */
.post-thumb {
    width: 80px;
    height: 80px; /* Ảnh vuông cố định */
    flex-shrink: 0; /* Không bị co lại */
    border-radius: 10px;
    overflow: hidden;
    margin-right: 15px;
    position: relative;
    background-color: #f1f5f9;
}

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

/* Hover Effect: Zoom ảnh */
.latest-post-item:hover .post-thumb img {
    transform: scale(1.1);
}

/* 2. Info Styling */
.post-info {
    flex-grow: 1;
}

.post-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 5px;
    /* Cắt dòng tiêu đề (tối đa 2 dòng) */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

    .post-title a {
        color: #333;
        text-decoration: none;
        transition: color 0.3s;
    }

/* Hover Effect: Đổi màu tiêu đề */
.latest-post-item:hover .post-title a {
    color: var(--primary-color, #0046ba);
}

.post-date {
    font-size: 0.75rem;
    color: #94a3b8;
    display: block;
}

/* --- Responsive --- */
/* Trên màn hình nhỏ (Tablet), có thể giảm kích thước ảnh một chút */
@media (max-width: 991px) and (min-width: 768px) {
    .post-thumb {
        width: 60px;
        height: 60px;
    }

    .post-title {
        font-size: 0.9rem;
    }
}