/*
Theme Name: Tìm Hiểu
Theme URI: https://baidu.com
Author: AI Assistant
Author URI: https://baidu.com
Description: WordPress theme for news website
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tim-hoi
Tags: responsive-layout, custom-menu, threaded-comments, sticky-post, theme-options
*/

/* Reset CSS */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary-color: #e63946;
    --secondary-color: #1d3557;
    --text-color: #333;
    --light-gray: #f8f9fa;
    --border-color: #dee2e6;
    --container-width: 1200px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-color);
    background: #fff;
}

img { max-width: 100%; height: auto; }
a { text-decoration: none; color: inherit; transition: 0.3s; }
a:hover { color: var(--primary-color); }
ul, ol { list-style: none; }

/* Container */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background: var(--secondary-color);
    color: #fff;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.site-title {
    font-size: 24px;
    font-weight: 700;
}

.site-title a { color: #fff; }

.main-nav ul {
    display: flex;
    gap: 30px;
}

.main-nav a {
    color: #fff;
    font-weight: 500;
    padding: 8px 15px;
    border-radius: 5px;
}

.main-nav a:hover, .main-nav a.current {
    background: var(--primary-color);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    font-size: 24px;
    cursor: pointer;
}

/* Hero Section */
.hero-section {
    padding: 30px 0;
    background: var(--light-gray);
}

/* Iframe Container */
.iframe-container {
    width: 100%;
    margin: 20px 0;
}

#tyle-iframe {
    width: 100%;
    min-height: 600px;
    border: none;
    border-radius: 10px;
}

/* Featured Posts Grid */
.featured-posts {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 20px;
    margin: 30px 0;
}

.featured-post {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    background: #000;
}

.featured-post.large {
    grid-row: span 2;
}

.featured-post img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.5s;
}

.featured-post:hover img {
    transform: scale(1.1);
}

.featured-post-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: #fff;
}

.featured-post-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.large .featured-post-title {
    font-size: 24px;
}

.featured-post-meta {
    font-size: 14px;
    opacity: 0.8;
}

/* Latest Posts Section */
.latest-posts-section {
    padding: 40px 0;
}

.section-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
}

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

/* Post Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

/* Post Card */
.post-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: 0.3s;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.post-card-image {
    position: relative;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    overflow: hidden;
}

.post-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-card-category {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--primary-color);
    color: #fff;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 3px;
}

.post-card-content {
    padding: 20px;
}

.post-card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
}

.post-card-title a {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-excerpt {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #999;
}

.post-card-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 40px 0;
}

.pagination a, .pagination span {
    padding: 10px 20px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background: #fff;
}

.pagination a:hover, .pagination span.current {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* Breadcrumb */
.breadcrumb {
    padding: 20px 0;
    background: var(--light-gray);
    font-size: 14px;
}

.breadcrumb a {
    color: var(--primary-color);
}

.breadcrumb .separator {
    margin: 0 10px;
    color: #999;
}

/* Article Page */
.article-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

.article-header {
    margin-bottom: 30px;
}

.article-category {
    display: inline-block;
    background: var(--primary-color);
    color: #fff;
    padding: 5px 15px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 3px;
    margin-bottom: 15px;
}

.article-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.3;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.article-meta-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.article-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.article-author img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.article-meta-right {
    display: flex;
    gap: 15px;
}

.article-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #666;
}

/* Article Featured Image */
.article-featured-image {
    margin: 30px 0;
    border-radius: 10px;
    overflow: hidden;
}

.article-featured-image img {
    width: 100%;
    height: auto;
    border-radius: 10px;
}

/* Table of Contents */
.article-toc {
    background: var(--light-gray);
    padding: 25px;
    border-radius: 10px;
    margin: 30px 0;
}

.article-toc-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.article-toc ul {
    list-style: none;
}

.article-toc li {
    margin: 8px 0;
}

.article-toc a {
    color: var(--text-color);
    padding: 5px 0;
    display: block;
    border-left: 3px solid transparent;
    padding-left: 15px;
}

.article-toc a:hover {
    border-left-color: var(--primary-color);
    color: var(--primary-color);
}

.article-toc .toc-h3 {
    padding-left: 35px;
    font-size: 14px;
}

/* Article Content */
.article-content {
    font-size: 18px;
    line-height: 1.8;
}

.article-content h2 {
    font-size: 28px;
    margin: 40px 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.article-content h3 {
    font-size: 24px;
    margin: 30px 0 15px;
}

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

.article-content img {
    border-radius: 10px;
    margin: 20px 0;
}

/* Related Posts */
.related-posts {
    background: var(--light-gray);
    padding: 40px 0;
    margin-top: 60px;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

/* Footer */
.site-footer {
    background: var(--secondary-color);
    color: #fff;
    padding: 50px 0 20px;
}

.footer-top {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 30px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}

.footer-about p {
    opacity: 0.8;
    line-height: 1.8;
}

.footer-links li {
    margin: 10px 0;
}

.footer-links a {
    opacity: 0.8;
}

.footer-links a:hover {
    opacity: 1;
}

/* Social Share */
.social-share {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.social-share a {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.social-share a:hover {
    background: var(--primary-color);
}

.social-share img {
    width: 20px;
    height: 20px;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    z-index: 999;
    box-shadow: 0 5px 15px rgba(230,57,70,0.4);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
}

/* Sidebar */
.sidebar {
    margin-top: 40px;
}

.widget {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
}

.widget-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.widget-posts-list li {
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.widget-posts-list li:last-child {
    border-bottom: none;
}

.widget-post-thumb {
    display: flex;
    gap: 15px;
}

.widget-post-thumb img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
}

.widget-post-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 992px) {
    .featured-posts {
        grid-template-columns: 1fr 1fr;
    }
    
    .featured-post.large {
        grid-row: span 1;
    }
    
    .posts-grid,
    .related-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-top {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--secondary-color);
        padding: 20px;
    }
    
    .main-nav.active {
        display: block;
    }
    
    .main-nav ul {
        flex-direction: column;
        gap: 0;
    }
    
    .main-nav a {
        padding: 12px;
        border-radius: 0;
    }
    
    .featured-posts {
        grid-template-columns: 1fr;
    }
    
    .posts-grid,
    .related-posts-grid {
        grid-template-columns: 1fr;
    }
    
    .article-title {
        font-size: 24px;
    }
    
    .article-content {
        font-size: 16px;
    }
    
    .article-content h2 {
        font-size: 22px;
    }
    
    .article-content h3 {
        font-size: 18px;
    }
    
    .footer-top {
        grid-template-columns: 1fr;
    }
    
    .article-meta {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .section-title {
        font-size: 22px;
    }
    
    .post-card-title {
        font-size: 16px;
    }
    
    .article-title {
        font-size: 20px;
    }
}
