/*
Theme Name: Thời Báo Việt - Newspaper Theme
Theme URI: http://example.com/wp-theme-newspaper
Description: Giao diện đọc báo cao cấp "Thời Báo Việt" được thiết kế dựa trên phong cách chuyên nghiệp, hiện đại, tối ưu hóa tốc độ tải và responsive.
Author: AcmaTvirus
Version: 1.0.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: blog, news, two-columns, custom-menu, featured-images, translation-ready
Text Domain: wp-theme-newspaper
*/

/* --- Import Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* --- Design Tokens / CSS Variables --- */
:root {
    --primary-color: #0D5CA6;
    /* Màu xanh Thời Báo Việt */
    --primary-hover: #074783;
    --accent-color: #E67E22;
    /* Màu cam nổi bật */
    --accent-yellow: #F1C40F;
    /* Màu vàng của ngôi sao */
    --text-dark: #1A1A1A;
    --text-gray: #555555;
    --text-light: #888888;
    --bg-light: #F8F9FA;
    --bg-dark: #1E293B;
    --bg-hero-overlay: rgba(0, 0, 0, 0.7);
    --border-color: #E2E8F0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --container-max-width: 1200px;
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Base Resets --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

ul,
ol {
    list-style: none;
}

input,
button {
    font-family: inherit;
    font-size: inherit;
}

.container {
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* --- HEADER SECTION --- */
.site-header {
    background-color: var(--primary-color);
    color: #ffffff;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

/* Logo */
.site-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-brand .custom-logo-link {
    display: inline-block;
    align-self: center;
}

.site-brand .custom-logo {
    max-height: 46px;
    width: auto;
    display: block;
}

.site-title-wrap {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.site-logo-icon {
    width: 38px;
    height: 38px;
    background-color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Logo SVG emblem: red circle background, yellow star/lightning */
.site-logo-icon svg {
    width: 38px;
    height: 38px;
}

.site-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-transform: uppercase;
}

/* Primary Navigation */
.main-navigation {
    display: flex;
    align-items: center;
    height: 100%;
}

.menu-primary-container {
    height: 100%;
}

.nav-menu {
    display: flex;
    height: 100%;
    align-items: center;
}

.nav-menu li {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.nav-menu a {
    color: rgba(255, 255, 255, 0.85);
    padding: 0 14px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    height: 100%;
    display: flex;
    align-items: center;
    border-bottom: 3px solid transparent;
    transition: all var(--transition-fast);
}

.nav-menu a:hover,
.nav-menu .current-menu-item>a {
    color: #ffffff;
    border-bottom-color: var(--accent-yellow);
    background-color: rgba(255, 255, 255, 0.05);
}

/* Dropdown Menu Support */
.nav-menu li ul {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #ffffff;
    color: var(--text-dark);
    box-shadow: var(--shadow-lg);
    border-radius: 0 0 6px 6px;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-fast);
    padding: 8px 0;
}

.nav-menu li:hover>ul {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-menu li ul a {
    color: var(--text-dark);
    height: auto;
    padding: 10px 20px;
    font-size: 14px;
    text-transform: none;
    font-weight: 500;
    border-bottom: none;
    display: block;
}

.nav-menu li ul a:hover {
    color: var(--primary-color);
    background-color: var(--bg-light);
}

/* Search bar */
.header-search {
    display: flex;
    align-items: center;
}

.search-form-header {
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    padding: 4px 8px;
    transition: background-color var(--transition-fast);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.search-form-header:focus-within {
    background-color: #ffffff;
    border-color: #ffffff;
}

.search-form-header input {
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    padding: 4px 8px;
    font-size: 13px;
    width: 140px;
    transition: width var(--transition-smooth);
}

.search-form-header:focus-within input {
    color: var(--text-dark);
    width: 180px;
}

.search-form-header input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.search-form-header:focus-within input::placeholder {
    color: var(--text-light);
}

.search-submit-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 2px;
}

.search-form-header:focus-within .search-submit-btn {
    color: var(--text-gray);
}

/* Login section */
.header-auth {
    display: flex;
    align-items: center;
}

.login-btn {
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 14px;
    border-radius: 4px;
    transition: all var(--transition-fast);
}

.login-btn:hover {
    background-color: #ffffff;
    color: var(--primary-color);
}

/* Mobile Toggle */
.mobile-nav-toggle {
    display: none;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
}

/* --- MAIN LAYOUT --- */
.main-wrapper {
    padding: 30px 0;
}

.layout-grid {
    display: grid;
    grid-template-columns: minmax(0, 12fr) minmax(0, 4fr);
    gap: 30px;
}

/* --- HERO SECTION --- */
.featured-hero {
    position: relative;
    background-color: var(--bg-dark);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
}

/* Main Display */
.hero-slider-display {
    position: relative;
    aspect-ratio: 16 / 9;
    min-height: 380px;
    overflow: hidden;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    display: flex;
    justify-content: flex-end;
}

.hero-slide.active {
    opacity: 1;
    visibility: visible;
    position: relative;
}

.hero-slide-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.hero-slide-content-overlay {
    width: 45%;
    height: 100%;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.85) 60%, rgba(0, 0, 0, 0) 100%);
    position: absolute;
    top: 0;
    left: 0;
    padding: 30px 40px 30px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #ffffff;
    z-index: 2;
}

/* Special styling for matching the user screenshot */
.hero-slide-content-overlay .category-tag {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--accent-yellow);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.hero-slide-content-overlay h2 {
    font-size: 22px;
    line-height: 1.35;
    font-weight: 800;
    margin-bottom: 14px;
    letter-spacing: -0.3px;
    color: #ffffff;
}

.hero-slide-content-overlay h2 a:hover {
    color: var(--accent-yellow);
}

.hero-slide-content-overlay p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    line-height: 1.5;
}

/* Tabs under Hero */
.hero-tabs-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background-color: #121212;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-tab {
    padding: 16px 20px;
    cursor: pointer;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    transition: all var(--transition-fast);
    text-align: left;
}

.hero-tab:last-child {
    border-right: none;
}

.hero-tab-title {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 4px;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.hero-tab-desc {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.hero-tab:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.hero-tab.active {
    background-color: #000000;
    border-top: 3px solid var(--accent-color);
    padding-top: 13px;
    /* Offset the 3px border to maintain height */
}

.hero-tab.active .hero-tab-title {
    color: var(--accent-yellow);
}

/* --- POST CARDS (3 COLUMNS GRID) --- */
.news-grid-three-col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.post-card {
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.post-thumbnail-wrapper {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background-color: #eaeaea;
}

.post-thumbnail-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-smooth);
}

.post-card:hover .post-thumbnail-wrapper img {
    transform: scale(1.05);
}

.post-category-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: var(--primary-color);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 3px;
    letter-spacing: 0.3px;
}

.post-card-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.post-card-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 8px;
    color: var(--text-dark);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.post-card-excerpt {
    font-size: 12px;
    color: var(--text-gray);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

.post-card-meta {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-light);
}

.post-card-meta svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
}

/* --- SIDEBAR WIDGETS --- */
.sidebar-wrapper {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.sidebar-widget {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.widget-title-container {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 16px;
    position: relative;
}

.widget-title-container::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background-color: var(--primary-color);
}

.widget-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Trending widget (Xu hướng) */
.trending-searches-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-gray);
    margin-bottom: 12px;
}

.trending-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.trending-item a {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    padding: 6px 0;
    transition: transform var(--transition-fast);
}

.trending-item a:hover {
    color: var(--primary-color);
    transform: translateX(4px);
}

.trending-item svg {
    width: 14px;
    height: 14px;
    color: var(--text-light);
}

/* Video widget */
.video-thumbnail-container {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 12px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.video-thumbnail-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-fast);
}

.video-thumbnail-container:hover .video-play-overlay {
    background-color: rgba(0, 0, 0, 0.4);
}

.play-button-icon {
    width: 46px;
    height: 46px;
    background-color: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: transform var(--transition-smooth);
}

.video-thumbnail-container:hover .play-button-icon {
    transform: scale(1.15);
}

.play-button-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    margin-left: 3px;
    /* Center the triangle visually */
}

.video-widget-title {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 6px;
}

.video-widget-title a:hover {
    color: var(--primary-color);
}

.video-widget-meta {
    font-size: 11px;
    color: var(--text-light);
}

/* Ads widget */
.ads-widget-flex {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ad-banner {
    display: block;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast);
}

.ad-banner:hover {
    transform: scale(1.02);
}

.ad-banner img {
    width: 100%;
    height: auto;
}

/* CSS-styled fallback banner ad if no images */
.custom-ad-fallback {
    background: linear-gradient(135deg, #1E3A8A 0%, #3B82F6 100%);
    color: #ffffff;
    padding: 24px 20px;
    text-align: center;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.custom-ad-tag {
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 8px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.5px;
}

.custom-ad-fallback h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent-yellow);
}

.custom-ad-fallback p {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 12px;
}

.custom-ad-btn {
    background-color: var(--accent-color);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.custom-ad-btn:hover {
    background-color: #d35400;
}

/* --- FOOTER SECTION --- */
.site-footer {
    background-color: #121A26;
    color: rgba(255, 255, 255, 0.7);
    padding: 40px 0 30px;
    border-top: 4px solid var(--primary-color);
    font-size: 13px;
}

.footer-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 30px;
}

.footer-col h3 {
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 16px;
    letter-spacing: 0.5px;
}

.footer-about p {
    line-height: 1.6;
    margin-bottom: 14px;
}

.footer-links-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-links-list a:hover {
    color: #ffffff;
    padding-left: 4px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-copyright {
    font-size: 12px;
}

.footer-socials {
    display: flex;
    gap: 12px;
}

.footer-social-link {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: background-color var(--transition-fast);
}

.footer-social-link:hover {
    background-color: var(--primary-color);
}

/* --- SINGLE POST & PAGE CONTENT --- */
.content-area {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: var(--shadow-sm);
}

.post-header {
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.post-meta-top {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 10px;
}

.post-meta-cat {
    color: var(--primary-color);
    font-weight: 700;
    text-transform: uppercase;
}

.single-post-title {
    font-size: 28px;
    line-height: 1.3;
    font-weight: 800;
    color: var(--text-dark);
}

.post-featured-image {
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 24px;
}

.post-featured-image img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
}

.post-entry-content {
    font-size: 16px;
    line-height: 1.7;
    color: #2D3748;
}

.post-entry-content p {
    margin-bottom: 20px;
}

.post-entry-content h2,
.post-entry-content h3 {
    color: var(--text-dark);
    margin: 30px 0 15px;
    font-weight: 700;
}

.post-entry-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 20px;
    margin: 20px 0;
    font-style: italic;
    color: var(--text-gray);
}

.post-tags {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-link {
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 4px;
    color: var(--text-gray);
}

.tag-link:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
}

/* --- RESPONSIVE STYLES --- */
@media (max-width: 1024px) {
    .layout-grid {
        grid-template-columns: 1fr;
    }

    .hero-slide-content-overlay {
        width: 60%;
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .header-container {
        height: auto;
        padding: 15px 20px;
        flex-wrap: wrap;
        gap: 15px;
    }

    .main-navigation {
        order: 3;
        width: 100%;
        display: none;
        /* Can toggle via JS */
        height: auto;
    }

    .main-navigation.active {
        display: block;
    }

    .nav-menu {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        height: auto;
        padding: 10px 0;
    }

    .nav-menu li {
        width: 100%;
        height: auto;
        display: block;
    }

    .nav-menu a {
        padding: 12px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        height: auto;
    }

    .nav-menu a:hover,
    .nav-menu .current-menu-item>a {
        border-bottom-color: transparent;
        color: var(--accent-yellow);
        background-color: transparent;
    }

    .nav-menu li ul {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background-color: rgba(255, 255, 255, 0.05);
        color: #ffffff;
        box-shadow: none;
        border-radius: 0;
        padding: 0;
        margin-left: 15px;
    }

    .nav-menu li ul a {
        color: rgba(255, 255, 255, 0.8);
        padding: 8px 10px;
    }

    .header-search {
        order: 2;
    }

    .header-auth {
        order: 2;
    }

    .mobile-nav-toggle {
        display: block;
        order: 1;
    }

    .hero-slide-content-overlay {
        width: 100%;
        background: linear-gradient(0deg, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.6) 100%);
        justify-content: flex-end;
        padding: 20px;
    }

    .hero-slider-display {
        aspect-ratio: 4 / 3;
    }

    .hero-tabs-bar {
        grid-template-columns: 1fr;
    }

    .hero-tab {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .hero-tab.active {
        border-top: none;
        border-left: 3px solid var(--accent-color);
        padding-top: 16px;
        padding-left: 17px;
    }

    .news-grid-three-col {
        grid-template-columns: 1fr;
    }

    .footer-columns {
        grid-template-columns: 1fr;
    }
}