/* ==========================================================================
   GIAO DIỆN DANH SÁCH (ARCHIVE) & CHI TIẾT (SINGLE) - BẢN OPTIMIZED CLEARED
   ========================================================================== */

/* ==========================================================================
   1. HEADER OVERRIDE (ĐẢO MÀU SANG ĐEN TRÊN NỀN TRẮNG)
   ========================================================================== */
.site-header .main-menu > li > a,
.site-header .main-logo {
    color: #000000 !important;
}
.site-header .main-menu > li > a:hover {
    color: #666666 !important;
}
.site-header .h-icon svg {
    stroke: #b3b3b3 !important;
}
.site-header .main-logo img {
    filter: brightness(0) !important;
}

/* ==========================================================================
   2. UTILITIES & ANIMATIONS (HIỆU ỨNG CHUNG & BUTTONS)
   ========================================================================== */
/* Hiệu ứng trượt mượt mà (Reveal on scroll) */
.ap-reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.9s cubic-bezier(0.25, 1, 0.5, 1), transform 0.9s cubic-bezier(0.25, 1, 0.5, 1) !important;
}
.ap-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.15s !important; }
.reveal-delay-2 { transition-delay: 0.3s !important; }

/* Nút Tải thêm (Load More) */
.ap-load-more-wrapper { text-align: center; padding: 60px 0; margin-bottom: 40px; }
.btn-load-more {
    display: inline-block; padding: 20px 40px; border: 1px solid #111; color: #111;
    font-size: 11px; font-weight: bold; text-transform: uppercase; letter-spacing: 1px;
    text-decoration: none; transition: all 0.3s ease;
}
.btn-load-more:hover { background-color: #111; color: #fff; }

/* Nút Xem chi tiết (Đường kẻ vạch AP Style) */
.read-more {
    display: inline-flex !important; align-items: center !important; font-size: 11px !important;
    font-weight: bold !important; text-transform: uppercase !important; letter-spacing: 1px !important;
    color: #000 !important; text-decoration: none !important; border-bottom: none !important; 
    padding-bottom: 0 !important; transition: color 0.3s ease !important;
}
.read-more::before {
    content: "" !important; display: inline-block !important; width: 35px !important; height: 1px !important;
    background-color: #000 !important; margin-right: 15px !important; 
    transition: width 0.3s ease, background-color 0.3s ease !important;
}
.read-more:hover { color: #666 !important; }
.read-more:hover::before { width: 50px !important; background-color: #666 !important; }


/* ==========================================================================
   3. TRANG DANH SÁCH (ARCHIVE PAGE)
   ========================================================================== */
main.site-main.ap-archive-page {
    padding: 120px 5vw 100px !important; 
    background-color: #fff !important; color: #111 !important;
}

/* Tiêu đề & Thanh Tabs */
.archive-header { margin-bottom: 60px; }
.archive-title {
    font-family: 'Times New Roman', Times, serif; font-size: 3rem; font-style: italic;
    font-weight: 300; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 40px;
}
.archive-tabs {
    display: flex; list-style: none; padding: 0 0 15px 0; margin: 0; gap: 40px;
    border-bottom: 1px solid #eaeaea; overflow-x: auto; 
}
.archive-tabs li a {
    text-decoration: none; color: #999; font-size: 11px; font-weight: bold;
    text-transform: uppercase; letter-spacing: 1px; transition: color 0.3s;
    white-space: nowrap; padding-bottom: 16px; 
}
.archive-tabs li a:hover, .archive-tabs li a.active { color: #000; border-bottom: 1px solid #000; }

/* Khối Bài viết Nổi bật (Featured) */
.featured-post { margin-bottom: 80px; }
.featured-post .post-thumb img {
    width: 100%; aspect-ratio: 21/9; object-fit: cover; margin-bottom: 40px !important; border-radius: 2px;
}
.post-info-split {
    display: flex !important; justify-content: space-between !important; gap: 80px !important;
}
.post-info-split .split-left { flex: 0 0 55% !important; }
.post-info-split .split-right { flex: 1 !important; }
.featured-post .post-title {
    font-size: 2.8rem !important; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif !important;
    font-weight: 300 !important; text-transform: uppercase !important; line-height: 1.1 !important;
    letter-spacing: 1px !important; margin: 0 !important;
}
.featured-post .post-title a { color: #111; text-decoration: none; transition: color 0.3s; }
.featured-post .post-title a:hover { color: #666; }

/* Khối Lưới Bài viết Thường (Grid) */
.regular-posts-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 60px 40px; 
}
.regular-post .post-thumb img {
    width: 100%; aspect-ratio: 16/9; object-fit: cover; margin-bottom: 20px; border-radius: 2px;
}
.regular-post .post-title {
    font-size: 1.1rem; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 400; text-transform: uppercase; margin: 10px 0; line-height: 1.4;
}
.regular-post .post-title a { color: #000; text-decoration: none; }

/* Thành phần chung Post Meta */
.post-cat {
    display: block !important; font-size: 10px; font-weight: bold; text-transform: uppercase;
    letter-spacing: 1px; color: #777 !important; border-bottom: none !important;
    padding-bottom: 0 !important; margin-top: 15px !important; margin-bottom: 25px !important;
}
.post-excerpt { font-size: 14px !important; color: #555 !important; line-height: 1.6 !important; margin-bottom: 25px !important; }


/* ==========================================================================
   4. TRANG CHI TIẾT (SINGLE POST)
   ========================================================================== */
.site-main.ap-single-page {
    padding: 150px 0 80px; background-color: #ffffff !important; 
}
.ap-container { max-width: 1320px; margin: 0 auto; padding: 0 20px; }
.ap-single-wrapper { display: flex; flex-wrap: wrap; gap: 70px; align-items: flex-start; }

/* Cột Trái: Nội dung chính */
.ap-single-main {
    flex: 1; min-width: 0; background: transparent; padding: 0; border-radius: 0; margin-top: 180px;
}
.ap-breadcrumb { font-size: 13px; color: #888; margin-bottom: 25px; }
.ap-breadcrumb a { color: #888; text-decoration: none; }
.ap-breadcrumb .sep { margin: 0 8px; }
.ap-breadcrumb .current { color: #333; }

.single-cat-label { font-size: 12px; font-weight: 700; color: #000; text-transform: uppercase; margin-bottom: 15px; font-family: Arial; }
.single-main-title {
    font-size: 2.2rem; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-weight: 700; line-height: 1.3; color: #111; margin-bottom: 20px;
}

/* Khối Meta (Tác giả, Share) */
.single-meta {
    display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eee;
    padding-bottom: 20px; margin-bottom: 30px; font-size: 13px; color: #666;
}
.single-meta .meta-left { display: flex; align-items: center; gap: 15px; }
.single-meta .author { display: flex; align-items: center; gap: 8px; color: #111; }
.single-meta .author img { border-radius: 50%; }
.single-meta .meta-right { display: flex; align-items: center; gap: 15px; }

/* Hình ảnh & Nội dung bài */
.single-featured-img img { width: 100%; height: auto; border-radius: 8px; margin-bottom: 30px; }
.single-post-content { font-size: 1.1rem; line-height: 1.8; color: #333; }
.single-post-content p { margin-bottom: 20px; }
.single-post-content img { max-width: 100%; height: auto; border-radius: 6px; }

/* Cột Phải: Sidebar */
.ap-single-sidebar {
    width: 320px; flex-shrink: 0; display: flex; flex-direction: column; gap: 20px;
}
.sidebar-widget {
    background: #ffffff; padding: 30px; border-radius: 12px; border: 1px solid #f0f0f0; 
    box-shadow: 0 4px 20px rgba(0,0,0,0.03); 
}
.widget-title {
    font-size: 16px; font-weight: 700; color: #111; margin-bottom: 20px;
    padding-bottom: 15px; border-bottom: 1px solid #eee;
}

/* Sidebar: Popular Posts (Tự động đánh số) */
.popular-posts-list { list-style: none; padding: 0; margin: 0; counter-reset: pop-counter; }
.popular-posts-list li { display: flex; gap: 15px; margin-bottom: 20px; align-items: flex-start; }
.popular-posts-list li::before {
    counter-increment: pop-counter; content: counter(pop-counter); width: 24px; height: 24px;
    background: #1a73e8; color: #fff; border-radius: 50%; display: flex; justify-content: center;
    align-items: center; font-size: 12px; font-weight: bold; flex-shrink: 0;
}
.popular-posts-list li:last-child { margin-bottom: 0; }
.popular-posts-list .post-info a {
    display: block; font-size: 14px; font-weight: 600; color: #333; text-decoration: none; line-height: 1.4; margin-bottom: 5px;
}
.popular-posts-list .post-info .date { font-size: 12px; color: #888; }

/* Sidebar: Newsletter & Tags */
.widget-newsletter p { font-size: 14px; color: #555; margin-bottom: 15px; line-height: 1.5; }
.widget-newsletter form { display: flex; flex-direction: column; gap: 12px; }
.widget-newsletter input { padding: 12px 15px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; outline: none; }
.widget-newsletter button {
    background: #e50000; color: #fff; border: none; padding: 12px; border-radius: 6px; font-weight: bold;
    cursor: pointer; transition: background 0.3s;
}
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud a {
    display: inline-block; padding: 6px 15px; background: #f4f6f8; color: #333; font-size: 13px;
    text-decoration: none; border-radius: 4px;
}

/* ==========================================================================
   5. TƯƠNG TÁC CUỐI BÀI (LIKE, SHARE, BÀI LIÊN QUAN)
   ========================================================================== */
.ap-post-tags-wrapper { display: flex; flex-direction: column; gap: 20px; margin-top: 40px; padding-bottom: 30px; }
.post-tags-list { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.post-tags-list .tags-label { font-size: 11px; font-weight: bold; color: #888; text-transform: uppercase; margin-right: 10px; }
.post-tags-list .tag-item {
    font-size: 12px; color: #555; background: #f4f6f8; padding: 5px 12px; border-radius: 4px;
    text-decoration: none; transition: background 0.3s;
}
.post-tags-list .tag-item:hover { background: #e0e0e0; }

.ap-interaction-box {
    display: flex; justify-content: space-between; align-items: center; background: #ffffff;
    border: 1px solid #eaeaea; border-radius: 12px; padding: 25px 30px; margin-bottom: 50px;
}
.interact-left, .interact-right { display: flex; align-items: center; gap: 20px; }
.ap-interaction-box strong { font-size: 14px; color: #111; }

.share-icons { display: flex; gap: 8px; }
.share-icons a {
    width: 28px; height: 28px; display: flex; justify-content: center; align-items: center;
    border-radius: 50%; color: #fff; text-decoration: none; font-weight: bold; font-size: 12px;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) !important; position: relative;
}
.share-icons .fb { background: #1877f2; }
.share-icons .x { background: #000; }
.share-icons .in { background: #0a66c2; }
.share-icons .link { background: #e4e6eb; color: #333; }
.share-icons .bookmark { background: #fff; color: #555; border: 1px solid #ddd; }
.share-icons a:hover { transform: translateY(-5px) scale(1.1); box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2); }
.share-icons .link:hover, .share-icons .bookmark:hover { background: #111 !important; color: #fff !important; border-color: #111 !important; }

/* Nút Like (Hiệu ứng) */
.btn-react-like {
    display: inline-flex; align-items: center; gap: 8px; background: #f0f2f5; border: none;
    padding: 8px 16px; border-radius: 6px; font-size: 14px; font-weight: 600; color: #333;
    cursor: pointer; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}
.btn-react-like:hover { background: #e4e6e9 !important; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); }
.btn-react-like:active { transform: translateY(1px) scale(0.98); }
.btn-react-like.is-liked { background: #e8f0fe !important; color: #1a73e8 !important; box-shadow: inset 0 2px 5px rgba(26, 115, 232, 0.1); }
.btn-react-like.is-liked .thumb-icon { display: inline-block; animation: thumbPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }

@keyframes thumbPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.4) rotate(-20deg); } 
    100% { transform: scale(1) rotate(0deg); }
}

/* Bài Liên Quan */
.ap-related-posts { border-top: 2px solid #111; padding-top: 30px; margin-top: 30px; }
.related-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 25px; text-transform: uppercase; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 25px; }
.related-thumb img {
    width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 6px; margin-bottom: 15px; transition: transform 0.3s ease;
}
.related-card:hover .related-thumb img { transform: scale(1.03); }
.related-post-title { font-size: 1.1rem; line-height: 1.4; margin: 0; }
.related-post-title a { color: #111; text-decoration: none; transition: color 0.3s; }
.related-post-title a:hover { color: #1a73e8; }


/* ==========================================================================
   6. CTA NEWSLETTER (ĐĂNG KÝ NHẬN TIN GIAO DIỆN CHUNG)
   ========================================================================== */
.ap-newsletter-cta { border-top: 1px solid #eaeaea; padding: 100px 0; }
.ap-newsletter-cta .cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 40px; }
.cta-left { flex: 0 0 35%; }
.cta-left h2 { font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 4rem; font-weight: 100; text-transform: uppercase; line-height: 1; margin: 0; color: #111; }
.cta-left h2 em { display: block; font-family: 'Times New Roman', Times, serif; font-style: italic; font-weight: 300; letter-spacing: 3px; margin-top: 5px; }
.cta-middle { flex: 1; }
.cta-middle p { font-size: 15px; color: #555; line-height: 1.6; margin: 0; max-width: 400px; }
.cta-right { flex: 0 0 250px; text-align: right; }
.btn-subscribe {
    display: inline-block; background-color: #000; color: #fff; text-transform: uppercase; font-size: 12px;
    font-weight: bold; letter-spacing: 1.5px; padding: 22px 60px; text-decoration: none; transition: background-color 0.3s ease;
}
.btn-subscribe:hover { background-color: #444; }


/* ==========================================================================
   7. GIAO DIỆN MOBILE CHUNG (GỘP TOÀN BỘ VÀO ĐÂY)
   ========================================================================== */
@media (max-width: 991px) {
    /* Header Toggle */
    .site-header .mobile-toggle .line { background-color: #000 !important; }
    
    /* Archive Page */
    .ap-archive-page { padding-top: 120px !important; }
    .regular-posts-grid { grid-template-columns: 1fr; gap: 50px; }
    .post-info-split { flex-direction: column !important; gap: 20px !important; }
    .archive-title { font-size: 2rem; }
    .featured-post .post-title { font-size: 1.6rem !important; }
    
    /* Single Page */
    .ap-single-sidebar { width: 100%; }
    .single-meta { flex-direction: column; align-items: flex-start; gap: 15px; }
    
    /* Newsletter CTA */
    .ap-newsletter-cta .cta-inner { flex-direction: column; align-items: flex-start; gap: 40px; }
    .cta-left h2 { font-size: 2.8rem; }
    .cta-right { text-align: left; width: 100%; }
    .btn-subscribe { width: 100%; text-align: center; }
}

@media (max-width: 768px) {
    /* Single Page Extras */
    .ap-interaction-box { flex-direction: column; align-items: flex-start; gap: 25px; }
    .related-grid { grid-template-columns: 1fr; }
}