/* ============================================================
   CATEGORY PAGE CSS
   Dùng kèm style.css (có :root variables)
============================================================ */

/* ===== HEADER ===== */
.category-header {
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--color-border);
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--color-muted);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--color-muted);
    text-decoration: none;
    transition: color .15s;
}

.breadcrumb a:hover { color: var(--color-blue); }

.breadcrumb span { color: var(--color-text); }

.category-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--color-blue);
    margin: 0 0 6px;
}

.category-meta {
    font-size: 0.82rem;
    color: var(--color-muted);
}


/* ===== LAYOUT ===== */
.category-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 36px;
    align-items: start;
}

/* ===== CARD GRID ===== */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 36px;
}

/* ===== CARD ===== */
.cat-card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
    display: flex;
    flex-direction: column;
}

.cat-card:hover {
    box-shadow: 0 8px 24px rgba(0,33,71,.1);
    transform: translateY(-3px);
}

.cat-card-thumb {
    display: block;
    overflow: hidden;
    height: 180px;
    flex-shrink: 0;
}

.cat-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s;
}

.cat-card:hover .cat-card-thumb img { transform: scale(1.04); }

.cat-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.cat-card-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 8px;
    line-height: 1.4;
}

.cat-card-title a {
    color: var(--color-text);
    text-decoration: none;
    transition: color .15s;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cat-card-title a:hover { color: var(--color-blue); }

.cat-card-excerpt {
    font-size: 0.85rem;
    color: var(--color-muted);
    line-height: 1.6;
    margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.cat-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.75rem;
    color: var(--color-muted);
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}

/* ===== EMPTY ===== */
.category-empty {
    text-align: center;
    padding: 60px 0;
    color: var(--color-muted);
    font-size: 0.95rem;
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: center;
    margin: 8px 0 16px;
}

.pagination ul {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.pagination a,
.pagination .page-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--color-border);
    color: var(--color-text);
    background: #fff;
    transition: background .15s, border-color .15s, color .15s;
}

.pagination a:hover {
    background: var(--color-blue);
    border-color: var(--color-blue);
    color: #fff;
}

.pagination a.active {
    background: var(--color-blue);
    border-color: var(--color-blue);
    color: #fff;
    pointer-events: none;
}

.pagination .page-dots {
    border: none;
    background: none;
    color: var(--color-muted);
    cursor: default;
}

.pagination .page-prev,
.pagination .page-next {
    font-size: 1.1rem;
    font-weight: 700;
}

/* ===== SIDEBAR ===== */
.category-sidebar {
    position: sticky;
    top: 80px;
}

.sidebar-widget {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 20px;
}

.widget-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--color-muted);
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-border);
}

/* ===== POPULAR LIST ===== */
.popular-list {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: popular;
}

.popular-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}

.popular-item:last-child { border-bottom: none; }

.popular-num {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: var(--color-blue);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.popular-item:nth-child(1) .popular-num { background: #f59e0b; }
.popular-item:nth-child(2) .popular-num { background: #94a3b8; }
.popular-item:nth-child(3) .popular-num { background: #b45309; }

.popular-info { min-width: 0; }

.popular-title {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text);
    text-decoration: none;
    line-height: 1.4;
    margin-bottom: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .15s;
}

.popular-title:hover { color: var(--color-blue); }

.popular-views {
    font-size: 0.72rem;
    color: var(--color-muted);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 960px) {
    .category-layout {
        grid-template-columns: 1fr;
    }

    .category-sidebar {
        position: static;
        border-top: 1px solid var(--color-border);
        padding-top: 24px;
    }

    .cat-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

@media (max-width: 560px) {
    .category-title { font-size: 1.4rem; }
    .cat-grid       { grid-template-columns: 1fr; }
    .cat-card-thumb { height: 160px; }
}