/* =============================================================
   1. BIẾN & THIẾT LẬP CƠ BẢN (Variables & Reset)
   ============================================================= */


* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-main);
    line-height: 1.7;
    margin: 0;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.elitech-container {
    max-width: 80%;
    margin: 0 auto;
    padding: 0 20px;
}

/* =============================================================
   2. BREADCRUMBS (Phần bạn đang cần sửa)
   ============================================================= */
.breadcrumb-wrapper {
    /* background-color: #f9f9f9; */
    margin-top: 6px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

.breadcrumb {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.8rem;
}

.breadcrumb-item a {
    color: #888;
    text-decoration: none;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
}

.breadcrumb-item a:hover {
    color: var(--primary-color);
}

.breadcrumb-item.home-link i {
    margin-right: 6px;
    font-size: 0.85rem;
}

.breadcrumb .separator {
    margin: 0 12px;
    color: #ccc;
    font-size: 0.6rem;
    display: flex;
    align-items: center;
}

.breadcrumb-item.active {
    color: var(--primary-color);
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

/* =============================================================
   3. CATEGORY HERO SECTION
   ============================================================= */
/* --- CATEGORY HERO STYLE --- */
.category-hero {
    padding: 30px 0; /* Tăng padding để có khoảng thở như mẫu */
    background: linear-gradient(135deg, #ffffff 0%, #fff5f6 100%);
    border-bottom: 1px solid var(--border-color);
}

.hero-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 50px;
}

.archive-hero-text {
    flex: 1;
    max-width: 100%px;
    text-align: center;
    background: var(--primary-color);
    /* box-shadow: inset 0 0 8px 5px var(--primary-color);
    padding: 60px 40px;
    border-radius: 1em; */
}

.category-title {
    font-weight: bold;
    font-size: 2rem; /* Chữ h1 to bản, uy lực */
    color: #fff;
    margin-bottom: 20px;
    line-height: 1.1;
}

.category-desc {
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
    color: #fff;
}

.hero-image {
    flex: 0 0 350px; /* Cố định chiều rộng ảnh bên phải */
    display: flex;
    justify-content: flex-end;
}

.cat-hero-img {
    width: 100%;
    max-width: 340px;
    object-fit: contain;
    border-radius: 1em;
    box-shadow: var(--shadow-md); /* Đổ bóng sâu tạo chiều nổi */
    transition: var(--transition);
}

.cat-hero-img:hover {
    transform: scale(1.02);
}

/* Responsive cho Mobile */
@media (max-width: 991px) {
    .category-hero { padding: 50px 0; }
    .hero-flex { 
        flex-direction: column; 
        text-align: center; 
        gap: 30px;
    }
    .archive-hero-text { max-width: 100%; }
    .hero-image { display: none; } /* Ẩn ảnh trên mobile để tập trung vào tiêu đề */
    .category-title { font-size: 2.2rem; }
}

/* =============================================================
   4. LAYOUT CHÍNH (Grid)
   ============================================================= */
.archive-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 50px;
    margin: 40px 0;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

/* =============================================================
   5. BLOG CARD
   ============================================================= */
.blog-card {
    background: transparent;
    transition: var(--transition);
}

.blog-card a { text-decoration: none; color: inherit; display: block; }

.blog-card .img-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-sm);
}

.blog-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.6s var(--transition);
}

.blog-card:hover img { transform: scale(1.08); }

.blog-card .post-cat {
    position: absolute;
    top: 15px; left: 15px;
    background: rgba(156, 10, 33, 0.9);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 50px;
    text-transform: uppercase;
    backdrop-filter: blur(4px);
    z-index: 2;
}

.blog-card .post-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.4;
    margin: 10px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: var(--transition);
}

.blog-card:hover .post-title { color: var(--primary-color); }

.archive-layout .posts-grid .post-excerpt,
.archive-layout .posts-grid .blog-card:hover .post-excerpt,
.archive-layout .posts-grid .blog-card a:hover .post-excerpt {
    color: #000;
}

/* =============================================================
   6. SIDEBAR & WIDGETS
   ============================================================= */
.sidebar-widget {
    /* background: var(--primary-color); */
    padding: 25px;
    border-radius: 1em;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.widget-title {
    font-size: 0.95rem;
    font-weight: 800;
    margin-bottom: 20px;
    padding-left: 15px;
}

.widget-hotline {
    background: #fff;
    color: var(--primary-color);
    text-align: center;
    border: 2px solid var(--primary-color);
    border-radius: 24px;
    padding: 20px;
    transition: var(--transition);
}

.widget-hotline:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.widget-hotline .icon-hotline {
    font-size: 1.9rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.widget-hotline h5 {
    margin: 0 0 10px;
    font-size: 0.95rem;
    font-weight: 800;
    color: #111;
}

.phone-number {
    font-size: 1.05rem;
    line-height: 1.55;
    font-weight: 900;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.widget-hotline .small-text {
    margin: 0;
    font-size: 0.9rem;
    color: #111;
}

/* =============================================================
   7. PHÂN TRANG (Pagination)
   ============================================================= */
.custom-pagination .nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin: 40px 0;
}

.custom-pagination .page-numbers {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: transparent;
    color: var(--text-main);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.15s ease;
}

.custom-pagination .page-numbers.current {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.custom-pagination .page-numbers:hover:not(.current) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.custom-pagination .page-numbers.next,
.custom-pagination .page-numbers.prev {
    font-size: 0;
}

.custom-pagination .page-numbers.next::before,
.custom-pagination .page-numbers.prev::before {
    font-size: 14px;
}

.custom-pagination .page-numbers.prev::before { content: "\2190"; }
.custom-pagination .page-numbers.next::before { content: "\2192"; }

/* =============================================================
   8. RESPONSIVE
   ============================================================= */
@media (max-width: 991px) {
    .archive-layout { grid-template-columns: 1fr; }
    .posts-grid { grid-template-columns: 1fr; }
    .hero-flex { flex-direction: column; text-align: center; }
    .category-title { font-size: 1.8rem; }
}

/* Custom Rank Math Breadcrumbs */
/* --- BIẾN RANK MATH TRỞ NÊN ĐẸP --- */

/* 1. Ẩn dấu » mặc định của Rank Math */
.rank-math-breadcrumbs {
    font-size: 0.85rem;
    color: #888;
    font-weight: 500;
}

/* Rank Math thường dùng thẻ span cho dấu phân cách, ta ẩn nội dung text đi */
.rank-math-breadcrumbs .separator {
    visibility: hidden;
    position: relative;
    margin: 0 12px;
}

/* Tạo dấu mũi tên mới bằng CSS (đẹp và mảnh hơn) */
.rank-math-breadcrumbs .separator::before {
    content: "\f054"; /* Mã icon chevron-right của FontAwesome */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    visibility: visible;
    position: absolute;
    left: 0;
    font-size: 0.65rem;
    color: #ccc;
    top: 50%;
    transform: translateY(-50%);
}

/* 2. Style cho các link */
.rank-math-breadcrumbs a {
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
}

.rank-math-breadcrumbs a:hover {
    color: var(--primary-color);
}

/* 3. Trang hiện tại (Trang 2 hoặc Blog) */
.rank-math-breadcrumbs span:last-child {
    color: var(--primary-color);
    font-weight: 700;
}

/* 4. Thêm icon Home vào trước chữ Home/Trang chủ */
.rank-math-breadcrumbs a:first-child::before {
    content: "\f015"; /* Icon Home */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-right: 6px;
    font-size: 0.9rem;
}

/* Nếu bạn muốn đổi chữ Home thành Trang chủ bằng CSS (nếu lười sửa trong setting) */
/*
.rank-math-breadcrumbs a[href*="https://contrungviet.com/"] {
    font-size: 0;
}
.rank-math-breadcrumbs a[href*="https://contrungviet.com/"]::after {
    content: "Trang chủ";
    font-size: 0.85rem;
}
*/

/* Làm Sidebar dính */
.sidebar-area {
    height: 100%; /* Đảm bảo cha có chiều cao đủ để con dính */
}

.sidebar-sticky {
    position: -webkit-sticky;
    position: sticky;
    top: 130px; /* Header 110px + 20px khoảng cách an toàn */
    align-self: flex-start;
}


/* Chuốt lại Tag Cloud cho sang trọng */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-cloud a {
    background: #f1f1f1;
    color: #555 !important;
    padding: 6px 14px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 13px !important; /* Ghi đè size của hàm WP */
    transition: var(--transition);
    border: 1px solid transparent;
}

.tag-cloud a:hover {
    background: var(--primary-color);
    color: #fff !important;
    transform: translateY(-2px);
}
