/*
Theme Name: NHANFL News Premium
Theme URI: https://nhanfl.com
Author: SEO & Sports News Specialist
Author URI: https://nhanfl.com
Description: A premium, ultra-fast, and SEO-optimized WordPress theme built specifically for Google News and Top Stories ranking. Features a clean 3-column grid, dark mode support, and mobile-first off-canvas navigation.
Version: 1.0.0
Text Domain: nhanfl
Tags: news, sports, grid-layout, seo-optimized, fast-loading, responsive
*/

/* ==========================================================================
   1. CSS Variables & Reset
   ========================================================================== */
:root {
    --primary-black: #000000;
    --secondary-white: #ffffff;
    --bg-light: #f9f9f9;
    --accent-red: #c00000; /* Google News / Category Red */
    --text-dark: #111111;
    --text-grey: #555555;
    --meta-grey: #888888;
    --border-light: #eeeeee;
    --border-gradient: linear-gradient(90deg, #d3005a, #4a00e0);
    --font-main: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --transition-speed: 0.3s;
}

/* Basic Reset for SEO & Layout consistency */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
    color: var(--text-dark);
    background-color: var(--secondary-white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary-black);
    text-decoration: none;
    transition: color var(--transition-speed);
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.flex-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ==========================================================================
   2. Header & Navigation Styles
   ========================================================================== */
/* Top Bar */
.top-bar { background: var(--primary-black); padding: 8px 0; font-size: 13px; }
.top-menu-list { list-style: none; margin: 0; padding: 0; display: flex; gap: 20px; }
.top-menu-list a { color: var(--secondary-white); opacity: 0.8; }
.top-menu-list a:hover { opacity: 1; color: var(--accent-red); }
.top-socials { display: flex; gap: 12px; }
.top-socials a { color: var(--secondary-white); opacity: 0.7; font-size: 14px; }
.top-socials a:hover { opacity: 1; color: var(--accent-red); }

/* Gradient Line */
.header-gradient-line { height: 4px; background: var(--border-gradient); width: 100%; }

/* Main Header */
.main-header { background: var(--secondary-white); padding: 15px 0; position: sticky; top: 0; z-index: 999; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.header-left { display: flex; align-items: center; gap: 20px; }
.open-sidebar { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--primary-black); padding: 0; display: none; }
.site-logo img { max-height: 50px; width: auto; }

/* Main Menu */
.main-menu-list { list-style: none; margin: 0; padding: 0; display: flex; gap: 25px; }
.main-menu-list a { font-weight: 700; font-size: 16px; text-transform: capitalize; position: relative; }
.main-menu-list a::after { content: ''; position: absolute; bottom: -5px; left: 0; width: 0; height: 2px; background: var(--accent-red); transition: width var(--transition-speed); }
.main-menu-list a:hover::after { width: 100%; }

/* Header Right Buttons */
.header-right { display: flex; align-items: center; gap: 15px; }
.btn-google-news { background: var(--accent-red); color: var(--secondary-white); padding: 8px 16px; border-radius: 4px; font-size: 13px; font-weight: 800; letter-spacing: 0.5px; }
.btn-google-news:hover { background: var(--primary-black); color: var(--secondary-white); }
.icon-btn { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--primary-black); }

/* ==========================================================================
   3. Sidebar Menu (Off-Canvas)
   ========================================================================== */
.nhanfl-sidebar { position: fixed; top: 0; left: -350px; width: 320px; height: 100vh; background-color: #0b0b0b; color: var(--secondary-white); z-index: 9999; transition: left 0.3s ease; overflow-y: auto; }
.nhanfl-sidebar.active { left: 0; }
.sidebar-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 9998; display: none; }
.sidebar-overlay.active { display: block; }
.close-sidebar { position: absolute; top: 20px; right: 20px; background: #222; color: #fff; border: none; width: 35px; height: 35px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.sidebar-content { padding: 50px 20px 30px; display: flex; flex-direction: column; align-items: center; }
.sidebar-logo img { width: 200px; margin-bottom: 40px; }
.sidebar-menu-list { list-style: none; padding: 0; width: 100%; margin: 0 0 30px 0; }
.sidebar-menu-list li { border-bottom: 1px solid #1a1a1a; }
.sidebar-menu-list a { color: var(--secondary-white); font-size: 18px; font-weight: 700; display: block; padding: 15px 10px; text-transform: uppercase; }
.sidebar-menu-list a:hover { color: var(--accent-red); padding-left: 15px; }
.sidebar-socials { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.sidebar-socials a { background: #1a1a1a; color: var(--secondary-white); width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.sidebar-socials a:hover { background: var(--accent-red); }

/* ==========================================================================
   4. Homepage News Grid (Screenshot 2 Match)
   ========================================================================== */
.site-main {
    padding: 40px 0;
}

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

.news-card {
    display: flex;
    flex-direction: column;
}

.news-thumbnail {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    margin-bottom: 15px;
}

.news-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.news-thumbnail:hover img {
    transform: scale(1.05);
}

.news-category {
    color: var(--accent-red);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.news-title {
    font-size: 22px;
    line-height: 1.3;
    font-weight: 800;
    margin: 0 0 10px 0;
}

.news-title a {
    color: var(--primary-black);
}

.news-title a:hover {
    color: var(--accent-red);
}

.news-meta {
    font-size: 11px;
    color: var(--meta-grey);
    text-transform: uppercase;
    margin-bottom: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.news-meta .author {
    color: var(--text-grey);
}

.news-excerpt {
    font-size: 15px;
    color: var(--text-grey);
    line-height: 1.5;
    margin: 0;
}

/* ==========================================================================
   5. Responsive Design (Media Queries)
   ========================================================================== */
@media (max-width: 991px) {
    /* Hide Desktop Menus */
    .top-bar, .desktop-nav { display: none; }
    
    /* Show Hamburger Menu */
    .open-sidebar { display: block; }
    
    /* Adjust Header Spacing */
    .header-left { gap: 15px; }
    .site-logo img { max-height: 40px; }
    
    /* 2 Columns for Tablets */
    .news-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
}

@media (max-width: 768px) {
    /* 1 Column for Mobile */
    .news-grid { grid-template-columns: 1fr; }
    
    .news-title { font-size: 20px; }
    
    /* Adjust Header Buttons for small screens */
    .btn-google-news { padding: 6px 10px; font-size: 11px; }
    .header-right { gap: 10px; }
}