/*
Theme Name: Newspaper Child
Theme URI: https://example.com/
Description: Child theme for the Newspaper theme.
Author: Your Name
Author URI: https://example.com/
Template: Newspaper
Version: 1.0.0
*/

/* Import Roboto font with multiple weights */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;600;700&display=swap');

/* Main content wrapper for category pages */
.tvxs-main-content {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px 16px 20px 16px;  /* top=10px, right=16px, bottom=20px, left=16px */
    box-sizing: border-box;
}

/* Category Title */
.tvxs-cat-title { 
    font-family: 'Roboto', sans-serif; 
    font-size: 60px; 
    font-weight: bold; 
    color: #00a651; 
    text-align: center; 
    margin: 20px 0 50px 0; 
    padding-bottom: 30px;
    border-bottom: 2px solid #ed1C24; 
}

/* Category Block - uses content inner wrapper */
.tvxs-cat-block { 
    width: 100%;
    margin: 40px 0; 
    padding: 0;
    box-sizing: border-box;
}

/* Grid Layout for Featured 4 */
.tvxs-grid-4 { 
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    gap: 16px; 
    margin-bottom: 20px; 
}

.tvxs-post-featured img {
    width: 100%;
    height: 70%;
    object-fit: cover;
    display: block; 
    margin-bottom: 8px; 
    transition: transform 0.3s ease;
}

.tvxs-post-featured:hover img { 
    transform: scale(1.1); 
}

.tvxs-post-featured h3 { 
    margin-top: 10px;
    font-family: 'Roboto', sans-serif;
    font-size: 20px !important;
    font-weight: bold;
    line-height: 1.3;
    letter-spacing: 0.5px;
    color: black;
}

.tvxs-post-featured h3 a { 
    text-decoration: none;
    color: inherit;
}

.tvxs-post-featured h3 a:hover { 
    color: #00a651; 
}

/* Lower Portion (2 columns) */
.tvxs-lower-portion {
    display: flex;
    gap: 24px;
    width: 100%;
    margin: 40px 0;
    align-items: flex-start;
    box-sizing: border-box;
}

.tvxs-left-column { 
    flex: 3; 
}

.tvxs-right-column { 
    flex: 1; 
}

/* Left column items */
.tvxs-lower-list { 
    list-style: none; 
    padding: 0; 
    margin: 0; 
}

.tvxs-lower-item {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.tvxs-lower-item:last-child {
    border-bottom: none;
}

.tvxs-lower-thumb {
    flex-shrink: 0;
}

.tvxs-lower-thumb img {
    width: 408px; 
    height: 200px;
    object-fit: cover; 
    display: block;
    transition: transform 0.3s ease;     /* Same transition as top portion */
}

.tvxs-lower-thumb:hover img {
    transform: scale(1.1);               /* Same hover effect as top portion */
}

.tvxs-lower-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tvxs-lower-title {
    margin: 0 0 6px 0;
    font-family: 'Roboto', sans-serif;  /* Same as top portion */
    font-weight: bold;                   /* Same as top portion */
    font-size: 20px !important;         /* Same as top portion */
    line-height: 1.3;                   /* Same as top portion */
    letter-spacing: 0.5px;               /* Same as top portion */
    color: black;                        /* Same as top portion */
}

.tvxs-lower-title a { 
    color: black;                        /* Same as top portion */
    text-decoration: none; 
}

.tvxs-lower-title a:hover { 
    color: #00a651;                      /* Same hover color as top portion */
}

.tvxs-lower-excerpt {
    margin: 0;
    color: #333;
    font-size: 14px;
    line-height: 1.4;
}

/* Right column - Bài mới block */
.tvxs-bai-moi {
    position: relative;
    height: 420px;
    overflow: hidden;
    margin-bottom: 20px;
    border-radius: 8px;
}

.tvxs-bai-moi-thumb {
    position: relative;
    height: 100%;
}

.tvxs-bai-moi-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Green "Bài mới" box */
.tvxs-bai-moi-label {
    position: absolute;
    top: 20px;
    left: 0;
    background: #00a651;
    color: #fff;
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    font-weight: bold;
    padding: 6px 12px;
    z-index: 2;
}

/* Title overlay */
.tvxs-bai-moi-title {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    color: #fff;
    font-family: 'Roboto', sans-serif;
    font-size: 18px;
    font-weight: bold;
    line-height: 1.3;
    z-index: 2;
}

.tvxs-bai-moi-title a {
    color: #fff;
    text-decoration: none;
}

.tvxs-bai-moi-title a:hover {
    color: #ffff00;
}

/* Ad box */
.tvxs-ad-box {
    margin-top: 20px;
}

.tvxs-ad-box img {
    width: 100%;
    height: auto;
    display: block;
}


/* Responsive Design */
@media (max-width: 1024px) {
    .tvxs-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tvxs-lower-portion {
        flex-direction: column;
    }
    
    .tvxs-lower-thumb img {
        width: 200px;
        height: 120px;
    }
}

@media (max-width: 768px) {
   /* Force spacing using absolute positioning approach */
    .tvxs-main-content .tvxs-cat-title,
    body .tvxs-main-content .tvxs-cat-title {
        font-size: 28px !important;
        font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif !important;
        position: relative !important;
        z-index: 10 !important;
        transform: translateY(40px) !important;
    }
    
    /* Compensate by adding space to the content below */
    .tvxs-main-content .tvxs-grid-4:first-of-type {
        margin-top: 80px !important;
    }
    
    .tvxs-grid-4 {
        grid-template-columns: 1fr;
    }
    
    .tvxs-lower-item {
        flex-direction: column;
        text-align: left;
        width: 100% !important;
        margin-left: 0; /* Add this line to remove the default list item margin */
    }
    
    .tvxs-lower-thumb {
        width: 100% !important;
        flex-shrink: 0 !important;
    }
    
    .tvxs-lower-thumb img {
        width: 100% !important;
        height: 200px !important;
        object-fit: cover !important;
        max-width: 100% !important;
    }
    
    .tvxs-left-column {
        width: 100% !important;
    }
}

/* Alternating background colors for categories */
.tvxs-cat-block:nth-child(odd) {
    background: #ffffff;
    padding: 40px 25px;
    margin: 40px -25px;
    border-radius: 8px;
}

.tvxs-cat-block:nth-child(even) {
    background: #f5f5f5;
    padding: 40px 25px;
    margin: 40px -25px;
    border-radius: 8px;
}

/* Reduce space above first category title */
.tvxs-main-content .tvxs-cat-block:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.tvxs-main-content .tvxs-cat-block:first-child .tvxs-cat-title {
    margin-top: 0 !important;
}

/* Mobile improvement - Hide header menu (browser-compatible) */
@media (max-width: 768px), 
       screen and (max-device-width: 768px),
       screen and (orientation: portrait) and (max-width: 1024px) {
    .tvxs-manual-menu {
        display: none !important;
    }
}

/* Ultimate override for TagDiv - maximum CSS specificity */
html body.postid-* .tvxs-main-content .tvxs-cat-block .tvxs-lower-portion .tvxs-left-column .tvxs-lower-list .tvxs-lower-item .tvxs-lower-content .custom-title-wrapper .custom-title-link,
html body .site-content .tvxs-main-content .custom-title-link,
html body .custom-title-link {
    font-family: 'Roboto', sans-serif !important;
    font-size: 20px !important;
    font-weight: bold !important;
    line-height: 1.3 !important;
    letter-spacing: 0.5px !important;
    color: black !important;
    text-decoration: none !important;
}

/* Universal font override - add at the very end of style.css */
body, body *, 
.tvxs-main-content, .tvxs-main-content *,
.tvxs-cat-title, .tvxs-post-featured h3, 
.tvxs-lower-title, .tvxs-lower-title a {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif !important;
}

/* Comprehensive icon font fix for all TagDiv elements */
/* Post navigation arrows */
.td-post-next-prev a:before,
.td-post-next-prev a:after {
    font-family: 'newspaper', 'FontAwesome', Arial !important;
    font-style: normal !important;
    font-weight: normal !important;
    display: inline-block !important;
    text-decoration: none !important;
    -webkit-font-smoothing: antialiased !important;
}

/* TagDiv Composer buttons - use FontAwesome check-circle */
.tdm-btn-s-icon:before,
.tdc-font-fa-check-circle:before {
    content: "\f058" !important;
    font-family: 'FontAwesome' !important;
    font-style: normal !important;
    font-weight: normal !important;
    display: inline-block !important;
    text-decoration: none !important;
    -webkit-font-smoothing: antialiased !important;
}

/* General icon font fallback */
[class*="tdc-font-fa"]:before,
.tdm-btn-s-icon {
    font-family: 'FontAwesome', Arial, sans-serif !important;
    display: inline-block !important;
}

/* Custom Category Pagination Styles - Updated */
.tvxs-lower-pagination {
    margin-top: 15px !important;
}

.tvxs-lower-pagination .page-numbers {
    display: inline-block !important;
    padding: 8px 12px !important;
    margin: 0 4px !important;
    background: #f5f5f5 !important;
    color: #333 !important;
    text-decoration: none !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    font-family: Roboto, sans-serif !important;
    transition: all 0.3s ease !important;
}

.tvxs-lower-pagination .page-numbers:hover {
    background: #00a651 !important;
    color: white !important;
}

.tvxs-lower-pagination .page-numbers.current {
    background: #00a651 !important;
    color: white !important;
    font-weight: bold !important;
}

.tvxs-lower-pagination .prev,
.tvxs-lower-pagination .next {
    background: #e9e9e9 !important;
    color: #666 !important;
}

.tvxs-lower-pagination .prev:hover,
.tvxs-lower-pagination .next:hover {
    background: #00a651 !important;
    color: white !important;
}

@media (max-width: 768px) {
    .tvxs-lower-pagination {
        text-align: center !important;
    }
    
    .tvxs-lower-pagination .page-numbers {
        padding: 6px 10px !important;
        margin: 0 2px !important;
        font-size: 12px !important;
    }
}

/* Set Giới thiệu Footer Menu to white important */
span.td-blm-menu-item-txt {
    color: white !important;
}

/* For hover state */
span.td-blm-menu-item-txt:hover {
    color: yellow !important;
}
