/**
 * File: assets/css/base.css
 * Theme: Astra Child - XTEINK
 * Description: Màu nền, typography chuẩn tiếng Việt, nhận diện thương hiệu & bố cục bài viết.
 */

/* =======================================================
   1. MÀU NỀN TỔNG THỂ & TYPOGRAPHY CHUẨN TIẾNG VIỆT
   ======================================================= */
body, .site, #page {
    background-color: #ffffff !important;
    color: #1e293b;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Đảm bảo chữ hiển thị tự nhiên, không bị ép kiểu làm lỗi dấu tiếng Việt */
html, body, h1, h2, h3, h4, h5, h6, p, a, span, li, button, input, textarea, select {
    text-transform: none;
}

/* Topbar: Giữ chữ hoa tự nhiên cho thứ/ngày và tên tỉnh thành */
#smart-weather-bar .vne-location-box,
#smart-weather-bar .auth-btn {
    font-weight: 600;
}

/* Menu chính: Chữ in hoa thanh lịch chuẩn phong cách Editorial */
.main-header-menu .menu-item > a,
.ast-header-custom-item a {
    text-transform: uppercase !important;
    letter-spacing: 0.8px;
    font-weight: 500;
}

/* Slogan dưới logo */
.site-description {
    text-transform: none !important;
}

/* Khôi phục ô nhập liệu hiển thị tự nhiên khi gõ phím */
input[type="text"],
input[type="search"],
input[type="email"],
input[type="url"],
textarea,
#comment {
    text-transform: none !important;
}


/* =======================================================
   2. TOPBAR THỜI TIẾT & TÌM KIẾM
   ======================================================= */
.vnexpress-topbar {
    background-color: #ffffff !important;
    border-bottom: 1px solid #e5e7eb !important;
    padding: 7px 32px !important;
    box-sizing: border-box;
}


/* =======================================================
   3. CỤM LOGO & THƯƠNG HIỆU (BRANDING)
   ======================================================= */
.site-header {
    background-color: #ffffff !important;
    border-bottom: 1px solid #f1f5f9 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02) !important;
}

.ast-site-identity {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 16px !important;
    padding: 22px 0 18px 0 !important;
}

.site-logo-img img,
.custom-logo-link img {
    width: 60px !important;
    height: 60px !important;
    border-radius: 50% !important;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08) !important;
    border: 1px solid #eaeaea !important;
    object-fit: cover !important;
    margin: 0 !important;
}

.ast-site-title-wrap {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: flex-start !important;
    text-align: left !important;
}

.site-title {
    margin: 0 !important;
    line-height: 1.1 !important;
}

.site-title a {
    font-size: 28px !important;
    font-weight: 800 !important;
    letter-spacing: 0.8px !important;
    text-transform: uppercase !important;
    color: #b73229 !important; /* Đỏ đô XTEINK */
    text-decoration: none !important;
    transition: color 0.2s ease;
}

.site-title a:hover {
    color: #92221b !important;
}

.site-description {
    font-size: 13px !important;
    font-weight: 400 !important;
    color: #64748b !important;
    letter-spacing: 0.2px !important;
    margin-top: 4px !important;
}


/* =======================================================
   4. THANH DANH MỤC TRANG CHỦ (CATEGORY PILLS)
   ======================================================= */
.home-category-bar-wrapper {
    width: 100%;
    margin: 15px 0 25px 0 !important;
    padding: 0 !important;
}

.home-category-container {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 4px 2px;
}
.home-category-container::-webkit-scrollbar { display: none; }

.cat-pill {
    background: #ffffff !important;
    color: #475569 !important;
    border: 1px solid #e2e8f0 !important;
    padding: 6px 16px !important;
    border-radius: 20px !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03) !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
}

.cat-pill:hover,
.cat-pill.active {
    background: #b73229 !important;
    color: #ffffff !important;
    border-color: #b73229 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(183, 50, 41, 0.25) !important;
}

.cat-pill .cat-count {
    background: #f1f5f9;
    color: #64748b;
    padding: 1px 7px;
    border-radius: 10px;
    margin-left: 6px;
    font-size: 11px;
}

.cat-pill.active .cat-count {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}


/* =======================================================
   5. CHUẨN HÓA THẺ BÀI VIẾT (CARD GRID) & ẢNH ĐẠI DIỆN (16:9)
   ======================================================= */
.ast-article-post {
    background: #ffffff !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03) !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    transition: transform 0.25s ease, box-shadow 0.25s ease !important;
    margin-bottom: 24px !important;
}

.ast-article-post:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.07) !important;
    border-color: #cbd5e1 !important;
}

/* Khung hình ảnh tỷ lệ chuẩn 16:9 */
.ast-article-post .post-thumb-img-content,
.ast-article-post .post-thumb,
article.post .post-thumb-img-content,
article.post .post-thumb {
    width: 100% !important;
    aspect-ratio: 16 / 9 !important;
    overflow: hidden !important;
    border-radius: 12px 12px 0 0 !important;
    background-color: #f1f5f9 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.ast-article-post .post-thumb img,
.ast-article-post .post-thumb-img-content img,
article.post .post-thumb img,
article.post .post-thumb-img-content img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
    display: block !important;
    transition: transform 0.35s ease !important;
}

.ast-article-post:hover .post-thumb img,
.ast-article-post:hover .post-thumb-img-content img {
    transform: scale(1.025) !important;
}

/* Nội dung bên trong thẻ bài viết */
.ast-article-post .ast-post-format-,
.ast-article-post .post-content {
    padding: 16px 18px 18px !important;
    display: flex !important;
    flex-direction: column !important;
    flex-grow: 1 !important;
}

.ast-article-post .cat-links,
.ast-article-post .cat-links a {
    color: #b73229 !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.6px !important;
    text-decoration: none !important;
    margin-bottom: 6px !important;
    display: inline-block !important;
}

.ast-article-post .entry-title {
    margin: 0 0 10px 0 !important;
    min-height: 3.8em !important;
}

.ast-article-post .entry-title a {
    font-size: 15.5px !important;
    line-height: 1.45 !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    text-decoration: none !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    transition: color 0.2s ease !important;
}

.ast-article-post:hover .entry-title a {
    color: #b73229 !important;
}

.ast-article-post .entry-meta {
    margin-top: auto !important;
    padding-top: 10px !important;
    border-top: 1px solid #f1f5f9 !important;
    font-size: 12px !important;
    color: #94a3b8 !important;
}

.ast-article-post .entry-meta a {
    color: #64748b !important;
    text-decoration: none !important;
}


/* =======================================================
   6. THANH TIẾN TRÌNH ĐỌC (TỐI ƯU HIỆU NĂNG - SINGLE ELEMENT)
   ======================================================= */
#xteink-reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #b73229, #f59e0b);
    z-index: 999999;
    width: 0%;
    pointer-events: none;
    transition: width 0.1s linear;
}

/* Trình duyệt hiện đại: dùng scroll-driven animation mượt mà */
@supports (animation-timeline: scroll()) {
    #xteink-reading-progress {
        transition: none !important;
        animation: modernReadingScroll auto linear;
        animation-timeline: scroll();
    }
    @keyframes modernReadingScroll {
        from { width: 0%; }
        to { width: 100%; }
    }
}

/* Nút cuộn lên đầu trang */
#ast-scroll-top,
.ast-scroll-top-icon {
    background-color: #1e293b !important;
    border-radius: 8px !important;
}

#ast-scroll-top:hover {
    background-color: #b73229 !important;
}


/* =======================================================
   7. BÀI VIẾT CHI TIẾT (SINGLE POST)
   ======================================================= */
.single-post .site-content .ast-container {
    max-width: 860px !important;
    margin: 25px auto 40px auto !important;
}

.single-post article.post {
    background: #ffffff !important;
    border-radius: 14px !important;
    padding: 36px 42px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03) !important;
}

.single-post .entry-title {
    font-size: 32px !important;
    font-weight: 800 !important;
    line-height: 1.35 !important;
    color: #0f172a !important;
    margin-bottom: 14px !important;
}

.single-post .entry-meta {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 13px !important;
    color: #64748b !important;
    margin-bottom: 25px !important;
    padding-bottom: 18px !important;
    border-bottom: 1px solid #f1f5f9 !important;
}

.single-post .entry-meta a {
    color: #b73229 !important;
    font-weight: 600 !important;
    text-decoration: none !important;
}

.single-post .post-thumb-img-content,
.single-post .entry-content img {
    border-radius: 10px !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05) !important;
}

.single-post .entry-content p {
    font-size: 17px !important;
    line-height: 1.8 !important;
    color: #334155 !important;
    margin-bottom: 18px !important;
}


/* =======================================================
   8. TRANG LƯU TRỮ, CHUYÊN MỤC & QUẢN TRỊ
   ======================================================= */
.ast-archive-description {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    padding: 16px 22px !important;
    margin: 15px auto 25px auto !important;
    max-width: 1200px !important;
    border-left: 4px solid #b73229 !important;
}

.ast-archive-description .ast-archive-title {
    font-size: 20px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    margin: 0 !important;
}

.ast-archive-description p {
    font-size: 13.5px !important;
    color: #64748b !important;
    margin: 4px 0 0 0 !important;
}

/* Ẩn mục tài khoản mặc định trên Admin Bar nếu cần */
#wpadminbar #wp-admin-bar-my-account {
    display: none !important;
}

/* =======================================================
   9. TƯƠNG THÍCH CHẾ ĐỘ E-INK (E-INK FRIENDLY)
   ======================================================= */
body.eink-mode-active {
    background-color: #ffffff !important;
    color: #000000 !important;
}

body.eink-mode-active .ast-article-post,
body.eink-mode-active .cat-pill,
body.eink-mode-active article.post {
    box-shadow: none !important;
    border: 1.5px solid #000000 !important;
    border-radius: 0 !important;
}

body.eink-mode-active .site-title a,
body.eink-mode-active .cat-pill.active,
body.eink-mode-active .ast-article-post:hover .entry-title a {
    color: #000000 !important;
    border-color: #000000 !important;
    background: #ffffff !important;
}