/*
Theme Name: congthanh-theme
Theme URI: https://tienganh.info.vn
Description: Theme độc lập phong cách Apple tối giản, tốc độ cao cho Thư viện tiếng Anh Số
Author: Nguyen Cong Thanh
Version: 1.0.0
Text Domain: congthanh-theme
*/

/* ==========================================
   1. NỀN TỔNG THỂ VÀ KHOẢNG TRỐNG DOCK
   ========================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    background-color: #f5f5f7 !important;
    padding-bottom: 90px !important;
    color: #172033;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================
   2. KHUNG BREADCRUMB
   CĂN TRÁI THEO KHUNG NỘI DUNG
   ========================================== */

body .tvta-breadcrumb-top-slot {
    display: block !important;
    width: 100% !important;
    max-width: 860px !important;
    margin: 12px auto 22px !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    text-align: left !important;
    clear: both !important;
}

/* ==========================================
   3. THANH BREADCRUMB APPLE MINIMAL GLASS
   ========================================== */

body .tvta-breadcrumb-top-slot nav.tvta-global-breadcrumb {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: max-content !important;
    max-width: 100% !important;
    min-height: 38px !important;
    margin: 0 !important;
    padding: 8px 17px !important;
    box-sizing: border-box !important;
    background: rgba(255, 255, 255, 0.96) !important;
    border: 1px solid #d2d2d7 !important;
    border-radius: 999px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.035) !important;
    backdrop-filter: blur(20px) saturate(150%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(150%) !important;
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "SF Pro Text",
        "Helvetica Neue",
        Arial,
        sans-serif !important;
    line-height: 1.4 !important;
    position: relative !important;
    z-index: 2 !important;
    vertical-align: top !important;
}

/* ==========================================
   4. DANH SÁCH BREADCRUMB NẰM NGANG
   ========================================== */

body nav.tvta-global-breadcrumb ul.tvta-breadcrumb-flex {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 7px !important;
    width: auto !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    list-style-type: none !important;
    white-space: nowrap !important;
    background: transparent !important;
}

/* ==========================================
   5. THIẾT LẬP TỪNG THÀNH PHẦN BREADCRUMB
   ========================================== */

body nav.tvta-global-breadcrumb ul.tvta-breadcrumb-flex li,
body nav.tvta-global-breadcrumb ul.tvta-breadcrumb-flex li.tvta-breadcrumb-node,
body nav.tvta-global-breadcrumb ul.tvta-breadcrumb-flex li.tvta-breadcrumb-sep {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    float: none !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    list-style-type: none !important;
    background: transparent !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    box-sizing: border-box !important;
}

body nav.tvta-global-breadcrumb ul.tvta-breadcrumb-flex li::before,
body nav.tvta-global-breadcrumb ul.tvta-breadcrumb-flex li::after {
    display: none !important;
    content: none !important;
    background: none !important;
}

body nav.tvta-global-breadcrumb .tvta-breadcrumb-node a {
    display: inline-flex !important;
    align-items: center !important;
    color: #0066cc !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    transition: color 0.2s ease !important;
}

body nav.tvta-global-breadcrumb .tvta-breadcrumb-node a:hover {
    color: #004499 !important;
    text-decoration: underline !important;
}

body nav.tvta-global-breadcrumb .tvta-breadcrumb-node.active span {
    color: #1d1d1f !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
}

body nav.tvta-global-breadcrumb .tvta-breadcrumb-sep {
    color: #86868b !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    user-select: none !important;
}

/* ==========================================
   6. KHÔNG ĐẢO NGƯỢC BỐ CỤC NỘI DUNG
   ========================================== */

.single-post .entry-content,
.single .entry-content,
.page .entry-content,
.post-inner {
    display: block !important;
    flex-direction: initial !important;
}

/* ==========================================
   7. KHUNG TEMPLATE ĐỘC LẬP (PAGE / SINGLE / ARCHIVE)
   ========================================== */

.ct-main-wrap {
    padding: 16px 0 40px;
}

.ct-container {
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
    padding: 0;
}

.ct-article-card {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.09);
    border-radius: 26px;
    padding: 28px 30px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.045);
}

.ct-entry-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.ct-entry-title {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.3;
    color: #172033;
}

.ct-entry-meta {
    margin-top: 8px;
    font-size: 12.5px;
    color: #64748b;
}

.ct-article-card .entry-content {
    font-size: 15.5px;
    line-height: 1.72;
    color: #1f2937;
    overflow-wrap: break-word;
}

.ct-article-card .entry-content img,
.ct-article-card .entry-content video,
.ct-article-card .entry-content iframe {
    max-width: 100%;
    height: auto;
}

.ct-archive-header {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.09);
    border-radius: 24px;
    padding: 22px 26px;
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.ct-archive-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #172033;
    border-left: 3px solid #d32f2f;
    padding-left: 12px;
}

.ct-archive-desc {
    margin: 10px 0 0;
    font-size: 14px;
    color: #475569;
}

.ct-posts-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.ct-post-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.09);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.035);
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.ct-post-card:hover {
    border-color: rgba(211, 47, 47, 0.45);
    transform: translateY(-2px);
}

.ct-post-card-title {
    margin: 0 0 8px;
    font-size: 16.5px;
    font-weight: 700;
    line-height: 1.38;
}

.ct-post-card-title a {
    color: #172033;
    text-decoration: none;
}

.ct-post-card-title a:hover {
    color: #d32f2f;
}

.ct-post-card-excerpt {
    margin: 0 0 14px;
    font-size: 13.5px;
    line-height: 1.55;
    color: #475569;
}

.ct-post-card-link {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 700;
    color: #172033;
    text-decoration: none;
}

.ct-post-card:hover .ct-post-card-link {
    color: #d32f2f;
}

.ct-pagination {
    margin-top: 24px;
    display: flex;
    justify-content: center;
}

.ct-pagination .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ct-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #ffffff;
    color: #172033;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
}

.ct-pagination .page-numbers.current,
.ct-pagination .page-numbers:hover {
    border-color: #d32f2f;
    background: #d32f2f;
    color: #ffffff;
}

/* ==========================================
   8. RESPONSIVE - TABLET VÀ MOBILE
   ========================================== */

@media (max-width: 860px) {
    body .tvta-breadcrumb-top-slot,
    .ct-container {
        width: calc(100% - 32px) !important;
    }

    body .tvta-breadcrumb-top-slot {
        margin: 10px auto 18px !important;
    }
}

@media (max-width: 640px) {
    .ct-posts-list {
        grid-template-columns: 1fr;
    }

    .ct-article-card {
        padding: 20px 18px;
        border-radius: 22px;
    }

    .ct-entry-title {
        font-size: 21px;
    }
}

@media (max-width: 600px) {
    body .tvta-breadcrumb-top-slot,
    .ct-container {
        width: calc(100% - 28px) !important;
    }

    body .tvta-breadcrumb-top-slot {
        margin: 10px auto 18px !important;
        overflow: hidden !important;
    }

    body .tvta-breadcrumb-top-slot nav.tvta-global-breadcrumb {
        display: flex !important;
        width: max-content !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        padding: 8px 13px !important;
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
    }

    body .tvta-breadcrumb-top-slot nav.tvta-global-breadcrumb::-webkit-scrollbar {
        display: none !important;
    }
}