/*
Theme Name: Game News
Theme URI: https://example.com
Author: Your Name
Author URI: https://example.com
Description: Theme tin tức game hiện đại và đẹp mắt với thiết kế responsive, phù hợp cho website tin tức game.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: game-news
Tags: gaming, news, blog, responsive, modern
*/

/* ============================================
   RESET & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ============================================
   CONTAINER
   ============================================ */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* ============================================
   HEADER
   ============================================ */
.site-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
    position: relative;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
}

.site-title {
    font-size: 2.5em;
    font-weight: bold;
    margin: 0;
}

.site-title a {
    color: white;
    text-decoration: none;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.site-description {
    font-size: 0.9em;
    opacity: 0.9;
    margin-top: 5px;
}

.main-navigation {
    background-color: rgba(0,0,0,0.2);
    padding: 15px 0;
    margin-top: 20px;
    width: 100%;
}

.main-navigation ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
}

.main-navigation a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 10px 15px;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.main-navigation a:hover {
    background-color: rgba(255,255,255,0.2);
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */
.site-main {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    margin: 30px 0;
    padding: 0;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section {
    width: 100%;
    margin-bottom: 50px;
    padding: 0;
    overflow: hidden;
}

.hero-post {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 30px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 100%;
}

.hero-thumbnail {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    display: block;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
    display: block;
}

.hero-thumbnail:hover .hero-image {
    transform: scale(1.1);
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
    z-index: 1;
}

.hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px;
    color: white;
    z-index: 2;
    box-sizing: border-box;
}

.hero-title {
    font-size: 2.5em;
    margin: 15px 0;
    line-height: 1.2;
    word-wrap: break-word;
}

.hero-title a {
    color: white;
    text-decoration: none;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero-title a:hover {
    color: #ffd700;
}

.hero-meta {
    display: flex;
    gap: 20px;
    margin: 15px 0;
    flex-wrap: wrap;
    font-size: 0.95em;
}

.hero-excerpt {
    font-size: 1.1em;
    line-height: 1.8;
    margin: 20px 0;
    max-width: 800px;
    word-wrap: break-word;
}

.hero-read-more {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    padding: 15px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1em;
    transition: transform 0.3s, box-shadow 0.3s;
    margin-top: 20px;
}

.hero-read-more:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(255,107,107,0.4);
}

/* ============================================
   HOME CONTENT LAYOUT
   ============================================ */
.home-content {
    display: flex;
    flex-direction: row;
    gap: 30px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    align-items: flex-start;
}

.posts-section {
    flex: 2;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.sidebar {
    flex: 1;
    min-width: 280px;
    max-width: 350px;
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    height: fit-content;
    position: sticky;
    top: 20px;
    box-sizing: border-box;
    overflow: hidden;
}

/* ============================================
   SECTION TITLE
   ============================================ */
.section-title {
    font-size: 2em;
    margin-bottom: 30px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 15px;
    border-bottom: 3px solid #667eea;
    word-wrap: break-word;
}

.title-icon {
    font-size: 1.2em;
}

/* ============================================
   POSTS GRID
   ============================================ */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.post-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.post-card-thumbnail {
    display: block;
    width: 100%;
    height: 200px;
    overflow: hidden;
    flex-shrink: 0;
    box-sizing: border-box;
}

.post-card-thumbnail .post-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
    display: block;
}

.post-card:hover .post-thumbnail {
    transform: scale(1.1);
}

.post-card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    min-width: 0;
    overflow: hidden;
}

.post-card-title {
    font-size: 1.3em;
    margin: 10px 0;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.post-card-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.post-card-title a:hover {
    color: #667eea;
}

.post-card-meta {
    color: #666;
    font-size: 0.85em;
    margin: 10px 0;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.post-card-excerpt {
    color: #555;
    line-height: 1.6;
    margin: 10px 0;
    flex: 1;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow: hidden;
}

.post-card-read-more {
    display: inline-block;
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    margin-top: 15px;
    transition: color 0.3s;
}

.post-card-read-more:hover {
    color: #764ba2;
}

/* ============================================
   CATEGORY BADGE
   ============================================ */
.category-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 500;
    margin-right: 10px;
    margin-bottom: 5px;
    word-wrap: break-word;
}

.category-badge a {
    color: white;
    text-decoration: none;
}

/* ============================================
   CATEGORIES SECTION
   ============================================ */
.categories-section {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 50px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.category-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    padding: 30px 20px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    box-sizing: border-box;
    word-wrap: break-word;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(102,126,234,0.4);
}

.category-card a {
    text-decoration: none;
    color: white;
    display: block;
}

.category-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.category-name {
    font-size: 1.3em;
    margin: 10px 0;
    color: white;
    word-wrap: break-word;
}

.category-count {
    font-size: 0.9em;
    opacity: 0.9;
    margin-top: 10px;
}

/* ============================================
   WIDGETS
   ============================================ */
.widget {
    margin-bottom: 30px;
    width: 100%;
    box-sizing: border-box;
}

.widget:last-child {
    margin-bottom: 0;
}

.widget-title {
    font-size: 1.3em;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 3px solid #667eea;
    color: #333;
    word-wrap: break-word;
}

.widget ul {
    list-style: none;
    width: 100%;
}

.widget li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    word-wrap: break-word;
}

.widget li:last-child {
    border-bottom: none;
}

.widget a {
    color: #555;
    text-decoration: none;
    transition: color 0.3s;
    word-wrap: break-word;
}

.widget a:hover {
    color: #667eea;
}

/* ============================================
   POST STYLES (for index.php, archive, etc)
   ============================================ */
.post {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    transition: transform 0.3s, box-shadow 0.3s;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.post:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.post-thumbnail {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
    max-width: 100%;
}

.post-content {
    padding: 25px;
    box-sizing: border-box;
    word-wrap: break-word;
}

.post-title {
    font-size: 1.8em;
    margin-bottom: 15px;
    word-wrap: break-word;
}

.post-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
    word-wrap: break-word;
}

.post-title a:hover {
    color: #667eea;
}

.post-meta {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 15px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.post-excerpt {
    color: #555;
    line-height: 1.8;
    margin-bottom: 15px;
    word-wrap: break-word;
}

.read-more {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    transition: transform 0.3s;
}

.read-more:hover {
    transform: scale(1.05);
}

.featured-post {
    grid-column: 1 / -1;
}

.featured-post .post-thumbnail {
    height: 400px;
}

.featured-post .post-title {
    font-size: 2.5em;
}

/* ============================================
   SINGLE POST
   ============================================ */
.single-post .post-thumbnail {
    height: 500px;
}

.post-content p {
    margin-bottom: 20px;
    line-height: 1.8;
    word-wrap: break-word;
}

.post-content h2 {
    margin: 30px 0 15px;
    color: #333;
    word-wrap: break-word;
}

.post-content h3 {
    margin: 25px 0 12px;
    color: #444;
    word-wrap: break-word;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 20px 0;
    display: block;
}

.post-tags {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.tag-link {
    display: inline-block;
    background: #f0f0f0;
    color: #555;
    padding: 5px 12px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9em;
    margin-right: 8px;
    margin-bottom: 8px;
    transition: all 0.3s;
    word-wrap: break-word;
}

.tag-link:hover {
    background: #667eea;
    color: white;
}

.post-navigation {
    margin: 40px 0;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-links {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.nav-previous,
.nav-next {
    flex: 1;
    min-width: 0;
}

.nav-subtitle {
    display: block;
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.nav-title {
    display: block;
    font-weight: 500;
    color: #333;
    word-wrap: break-word;
}

.nav-links a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #764ba2;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 10px 15px;
    background: white;
    color: #667eea;
    text-decoration: none;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.pagination a:hover {
    background: #667eea;
    color: white;
}

.pagination .current {
    background: #667eea;
    color: white;
}

/* ============================================
   PAGE HEADER
   ============================================ */
.page-header {
    background: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    box-sizing: border-box;
}

.page-title {
    font-size: 2em;
    color: #333;
    margin-bottom: 10px;
    word-wrap: break-word;
}

.archive-description {
    color: #666;
    line-height: 1.8;
    word-wrap: break-word;
}

/* ============================================
   NO POSTS / ERROR
   ============================================ */
.no-posts {
    background: white;
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.no-posts h2 {
    color: #333;
    margin-bottom: 15px;
}

.no-posts p {
    color: #666;
    margin-bottom: 20px;
}

.error-404 {
    background: white;
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.error-actions {
    margin: 30px 0;
}

.search-form-wrapper {
    text-align: left;
    max-width: 500px;
    margin: 0 auto;
}

.search-form-wrapper h2 {
    margin-bottom: 15px;
    color: #333;
}

/* ============================================
   SEARCH FORM
   ============================================ */
.search-form {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.search-form input {
    flex: 1;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    min-width: 0;
    box-sizing: border-box;
}

.search-form button {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: transform 0.3s;
    white-space: nowrap;
}

.search-form button:hover {
    transform: scale(1.05);
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background: #2c3e50;
    color: white;
    padding: 40px 0;
    margin-top: 50px;
    width: 100%;
    box-sizing: border-box;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.footer-widget h3 {
    margin-bottom: 15px;
    color: #667eea;
}

.footer-widget p,
.footer-widget a {
    color: #bbb;
    text-decoration: none;
    line-height: 1.8;
    word-wrap: break-word;
}

.footer-widget a:hover {
    color: white;
}

.site-info {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #444;
    color: #999;
}

/* ============================================
   COMMENTS
   ============================================ */
.comments-area {
    background: white;
    padding: 30px;
    border-radius: 10px;
    margin-top: 40px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    box-sizing: border-box;
}

.comments-title {
    font-size: 1.5em;
    margin-bottom: 20px;
    color: #333;
}

.comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.comment {
    padding: 20px 0;
    border-bottom: 1px solid #eee;
}

.comment:last-child {
    border-bottom: none;
}

.comment-author {
    font-weight: 500;
    color: #333;
}

.comment-meta {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.comment-content {
    color: #555;
    line-height: 1.8;
    word-wrap: break-word;
}

/* ============================================
   SCREEN READER
   ============================================ */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

/* ============================================
   CONTENT AREA (for index, archive, etc)
   ============================================ */
.content-area {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    min-width: 0;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 968px) {
    .home-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .sidebar {
        min-width: 100%;
        max-width: 100%;
        position: static;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .hero-content {
        padding: 25px;
    }
    
    .hero-title {
        font-size: 2em;
    }
    
    .hero-thumbnail {
        height: 400px;
    }
    
    .section-title {
        font-size: 1.5em;
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .main-navigation ul {
        justify-content: center;
        gap: 15px;
    }
    
    .site-title {
        font-size: 2em;
    }
    
    .hero-thumbnail {
        height: 300px;
    }
    
    .hero-title {
        font-size: 1.5em;
    }
    
    .hero-content {
        padding: 20px;
    }
    
    .hero-excerpt {
        font-size: 1em;
    }
    
    .section-title {
        font-size: 1.3em;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .post-thumbnail {
        height: 200px;
    }
    
    .featured-post .post-thumbnail {
        height: 250px;
    }
    
    .featured-post .post-title {
        font-size: 1.8em;
    }
    
    .nav-links {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .hero-content {
        padding: 15px;
    }
    
    .hero-title {
        font-size: 1.3em;
    }
    
    .post-card-content {
        padding: 15px;
    }
    
    .post-card-title {
        font-size: 1.1em;
    }
}
