/*
Theme Name: News Theme
Theme URI: https://yourdomain.com/news-theme
Author: Your Name
Author URI: https://yourdomain.com
Description: A modern responsive news WordPress theme for sports, entertainment, politics, and breaking news. Features responsive design, trending stories, category filtering, and SEO optimization.
Version: 1.0.0
License: GPL v2 or later
Text Domain: news-theme
Tags: news, blog, newspaper, magazine, sports, entertainment, responsive-layout, custom-header, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ===== RESET & VARIABLES ===== */
:root {
    --primary-bg: #ffffff;
    --secondary-bg: #f5f5f5;
    --card-bg: #ffffff;
    --primary-color: #d32f2f;
    --primary-dark: #b71c1c;
    --primary-light: #ff6659;
    --text-primary: #212121;
    --text-secondary: #757575;
    --text-muted: #9e9e9e;
    --border-color: #e0e0e0;
    --sidebar-width: 320px;
    --border-radius: 12px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background-color: var(--secondary-bg);
    color: var(--text-primary);
    line-height: 1.5;
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-color);
}

/* ===== HEADER ===== */
.site-header {
    background: var(--primary-bg);
    border-bottom: 3px solid var(--primary-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.8rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo a {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary-color);
}

.site-logo img {
    max-height: 50px;
    width: auto;
}

/* Navigation */
.main-navigation {
    display: none;
}

@media (min-width: 769px) {
    .main-navigation {
        display: block;
    }
    
    .primary-menu {
        display: flex;
        list-style: none;
        gap: 1.8rem;
        margin: 0;
        padding: 0;
    }
    
    .primary-menu li a {
        font-weight: 600;
        font-size: 0.95rem;
        text-decoration: none;
    }
    
    .primary-menu li a:hover {
        color: var(--primary-color);
    }
    
    .primary-menu li.current-menu-item a {
        color: var(--primary-color);
        border-bottom: 2px solid var(--primary-color);
    }
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .main-navigation {
        display: none;
    }
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1500;
}

.overlay.active {
    display: block;
}

.mobile-menu-panel {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background: var(--primary-bg);
    z-index: 2000;
    padding: 2rem;
    transition: left 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.mobile-menu-panel.open {
    left: 0;
}

.close-menu {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
}

.mobile-menu {
    list-style: none;
    margin-top: 2rem;
}

.mobile-menu li {
    margin-bottom: 1rem;
}

.mobile-menu li a {
    font-size: 1.1rem;
    font-weight: 500;
}

/* Search Section */
.search-section {
    background: var(--primary-color);
    padding: 0.5rem 0;
}

.search-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    position: relative;
}

#search-input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: none;
    border-radius: 50px;
    font-size: 0.9rem;
    outline: none;
}

.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 1.5rem;
    right: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
}

.search-results-dropdown.active {
    display: block;
}

.search-result {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
}

.search-result:hover {
    background: var(--secondary-bg);
}

.search-result img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}

/* ===== HOMEPAGE ===== */
.home-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 992px) {
    .home-container {
        grid-template-columns: 1fr var(--sidebar-width);
    }
}

.main-content {
    min-width: 0;
    overflow-x: hidden;
}

/* Section Title */
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--primary-color);
    display: inline-block;
}

/* Featured Carousel */
.featured-slider-section {
    margin-bottom: 2rem;
    overflow: hidden;
}

.carousel-container {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius);
}

.carousel-track {
    display: flex;
    gap: 1.5rem;
    transition: transform 0.5s ease;
}

.featured-card {
    flex: 0 0 calc(33.333% - 1rem);
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.featured-image {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.featured-card:hover .featured-image img {
    transform: scale(1.05);
}

.category-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

.featured-info {
    padding: 1rem;
}

.featured-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured-excerpt {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured-date {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Carousel Buttons */
.carousel-prev,
.carousel-next {
    position: absolute;
    top: 40%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(0,0,0,0.7);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    z-index: 10;
}

.carousel-prev:hover,
.carousel-next:hover {
    background: var(--primary-color);
}

.carousel-prev {
    left: 10px;
}

.carousel-next {
    right: 10px;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-color);
    cursor: pointer;
    transition: all 0.3s;
}

.dot.active {
    background: var(--primary-color);
    width: 24px;
    border-radius: 4px;
}

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.news-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: var(--shadow-sm);
}

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

.news-image {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

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

.news-category-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 0.2rem 0.8rem;
    font-size: 0.7rem;
    font-weight: 600;
}

.news-info {
    padding: 1rem;
}

.news-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.news-excerpt {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Load More Button */
.load-more-container {
    text-align: center;
    margin: 2rem 0;
}

.load-more-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.load-more-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 100%;
}

.widget {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.widget-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

/* Trending Tabs */
.trending-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.trending-tab {
    background: none;
    border: none;
    padding: 0.4rem 1rem;
    cursor: pointer;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.8rem;
    transition: all 0.3s;
}

.trending-tab.active {
    background: var(--primary-color);
    color: white;
}

.trending-list {
    display: none;
}

.trending-list.active {
    display: block;
}

.trending-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
}

.trending-item:hover {
    background: var(--secondary-bg);
}

.trending-number {
    width: 28px;
    height: 28px;
    background: var(--secondary-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--primary-color);
    flex-shrink: 0;
}

.sidebar-post-thumb {
    width: 55px;
    height: 55px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.sidebar-post-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    line-height: 1.3;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.pagination a,
.pagination span {
    padding: 0.5rem 1rem;
    background: var(--card-bg);
    border-radius: 8px;
    color: var(--text-primary);
}

.pagination .current {
    background: var(--primary-color);
    color: white;
}

/* ===== FOOTER ===== */
.site-footer-full {
    background: var(--text-primary);
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    text-align: center;
}

.footer-menu {
    display: flex;
    justify-content: center;
    gap: 2rem;
    list-style: none;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.footer-menu li a {
    color: white;
    font-size: 0.85rem;
}

.footer-menu li a:hover {
    color: var(--primary-light);
}

.footer-bottom {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .home-container {
        padding: 0 1rem;
        margin: 1rem auto;
    }
    
    .news-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1rem;
    }
    
    .featured-card {
        flex: 0 0 calc(100% - 1rem);
    }
    
    .featured-title {
        font-size: 1rem;
    }
    
    .carousel-prev,
    .carousel-next {
        width: 32px;
        height: 32px;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .section-title {
        font-size: 1.3rem;
    }
    
    .footer-menu {
        gap: 1rem;
        flex-direction: column;
        align-items: center;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.news-card,
.featured-card {
    animation: fadeIn 0.5s ease;
}

/* ===== NEW FEATURES ADDED ===== */

/* Breaking News Ticker */
.breaking-news {
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 0.5rem 0;
    overflow: hidden;
    position: relative;
}

.breaking-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.breaking-label {
    background: rgba(255,255,255,0.2);
    padding: 0.2rem 1rem;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.breaking-ticker {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: 30px;
}

.breaking-track {
    display: flex;
    animation: tickerScroll 20s linear infinite;
    white-space: nowrap;
}

.breaking-track a {
    color: white;
    margin-right: 2rem;
    font-size: 0.9rem;
}

.breaking-track a:hover {
    text-decoration: underline;
}

@keyframes tickerScroll {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* Hero Section with Gradient Overlay */
.hero-section {
    position: relative;
    margin-bottom: 2rem;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.hero-slide {
    position: relative;
    height: 500px;
    background-size: cover;
    background-position: center;
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    padding: 3rem 2rem 2rem;
    color: white;
}

.hero-category {
    display: inline-block;
    background: var(--primary-color);
    padding: 0.3rem 1rem;
    border-radius: 30px;
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.hero-excerpt {
    font-size: 1rem;
    opacity: 0.9;
    max-width: 600px;
}

/* Category Cards */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.category-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.category-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.category-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.category-count {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Newsletter Signup */
.newsletter-section {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    padding: 3rem 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    margin: 2rem 0;
    color: white;
}

.newsletter-title {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.newsletter-desc {
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.newsletter-form {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
    gap: 0.5rem;
}

.newsletter-input {
    flex: 1;
    padding: 0.8rem 1rem;
    border: none;
    border-radius: 50px;
    outline: none;
}

.newsletter-btn {
    background: #000;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.newsletter-btn:hover {
    background: #333;
    transform: scale(1.02);
}

/* Author Box */
.author-box {
    display: flex;
    gap: 1.5rem;
    background: var(--secondary-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin: 2rem 0;
}

.author-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.author-info h4 {
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
}

.author-bio {
    color: var(--text-secondary);
    line-height: 1.5;
}

.author-social {
    display: flex;
    gap: 0.8rem;
    margin-top: 0.8rem;
}

.author-social a {
    color: var(--text-muted);
    transition: color 0.3s;
}

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

/* Comment Section Styling */
.comments-section {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-top: 2rem;
}

.comment-list {
    list-style: none;
}

.comment {
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.5rem;
}

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

.comment-author .fn {
    font-weight: 700;
}

.comment-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.comment-content {
    margin-top: 0.5rem;
    line-height: 1.5;
}

.comment-reply-link {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--primary-color);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 100;
    box-shadow: var(--shadow-md);
    transition: all 0.3s;
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
}

.back-to-top.show {
    display: flex;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(0,0,0,0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    z-index: 1000;
    transition: transform 0.3s;
    white-space: nowrap;
}

.toast-notification.show {
    transform: translateX(-50%) translateY(0);
}

/* Responsive Enhancements */
@media (max-width: 768px) {
    .hero-slide {
        height: 350px;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .hero-overlay {
        padding: 2rem 1rem;
    }
    
    .newsletter-title {
        font-size: 1.3rem;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .author-box {
        flex-direction: column;
        text-align: center;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-bg: #1a1a1a;
        --secondary-bg: #2a2a2a;
        --card-bg: #2a2a2a;
        --text-primary: #ffffff;
        --text-secondary: #cccccc;
        --border-color: #3a3a3a;
    }
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--border-color) 25%, var(--card-bg) 50%, var(--border-color) 75%);
    background-size: 200% 100%;
    animation: skeletonLoading 1.5s infinite;
}

@keyframes skeletonLoading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}