/*
Theme Name: NewsPress
Theme URI: https://example.com/newspress-theme
Author: Gemini
Author URI: https://gemini.google.com
Description: A CNN-inspired news theme optimized for SEO and LiteSpeed with extensive Customizer options.
Version: 2.3
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: news, blog, two-columns, right-sidebar, custom-menu, post-thumbnails, theme-options, responsive-layout
Text Domain: newspress
*/

/* --- Global Variables & Reset --- */
:root {
    --cnn-red: #CC0000;
    --dark-charcoal: #262626;
    --medium-gray: #7d7d7d;
    --light-gray: #f5f5f5;
    --off-white: #fafafa;
    --font-primary: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --font-secondary: 'Georgia', serif;
}

body { font-family: var(--font-primary); background-color: #fff; color: var(--dark-charcoal); margin: 0; line-height: 1.6; }
body.no-scroll { overflow: hidden; }
a { color: var(--dark-charcoal); text-decoration: none; transition: color 0.2s ease-in-out; }
a:hover, .post-card-read-more:hover { color: var(--cnn-red); }
img { max-width: 100%; height: auto; display: block; border-radius: 8px; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* --- Top Bar --- */
#top-bar { background-color: var(--dark-charcoal); color: #fff; padding: 5px 0; font-size: 0.8rem; }
#top-bar a { color: #fff; }
#top-bar a:hover { color: var(--light-gray); }
#top-bar .top-bar-navigation ul { list-style: none; margin: 0; padding: 0; display: flex; justify-content: flex-end; }
#top-bar .top-bar-navigation li { margin-left: 20px; }

/* --- Header & Navigation --- */
.site-header { background-color: #ffffff; border-bottom: 1px solid #e5e5e5; padding: 15px 0; position: relative; z-index: 100; }
.header-content { display: flex; justify-content: space-between; align-items: center; }
.site-branding .site-title a { font-size: 2.5rem; font-weight: 900; color: var(--dark-charcoal); letter-spacing: -2px; }
#site-header-image { text-align: center; margin-top: 20px; }
#site-header-image img { max-width: 100%; height: auto; }
.main-navigation ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; }
.main-navigation li { margin-left: 25px; }
.main-navigation a { text-transform: uppercase; font-weight: 700; font-size: 0.9rem; letter-spacing: 0.5px; }
.menu-item-login a { background-color: var(--cnn-red); color: #fff; padding: 8px 15px; border-radius: 4px; }
.menu-item-login a:hover { color: #fff; opacity: 0.9; }
.menu-toggle { display: none; background: none; border: 1px solid var(--dark-charcoal); border-radius: 4px; padding: 8px 10px; cursor: pointer; }
.menu-toggle .icon-bar { display: block; width: 22px; height: 2px; background-color: var(--dark-charcoal); margin: 4px 0; }

/* --- Breadcrumbs --- */
.breadcrumb-nav { font-size: 0.85rem; color: var(--medium-gray); margin: 20px 0; }
.breadcrumb-nav a { color: var(--medium-gray); }
.breadcrumb-nav a:hover { color: var(--cnn-red); }

/* --- Content & Sidebar Wrapper --- */
.content-sidebar-wrap { display: flex; flex-wrap: wrap; gap: 40px; }
.site-main { flex: 1; min-width: 0; }
.has-sidebar .site-main { flex-basis: 66%; }
.widget-area { flex-basis: 30%; flex-grow: 1; }

/* --- Main Content Layouts --- */
.site-content { padding-top: 0; }
.hero-article { margin-bottom: 40px; border-bottom: 1px solid #e5e5e5; padding-bottom: 40px; }
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }

/* --- Page, Post, Attachment Layouts --- */
.single-post-layout .entry-header, .page-layout .entry-header { margin-bottom: 30px; text-align: left; }
.single-post-layout .entry-title, .page-layout .entry-title { font-family: var(--font-secondary); font-size: 3rem; line-height: 1.1; }
.single-post-layout .entry-meta { color: var(--medium-gray); font-size: 0.9rem; margin-top: 15px; }
.single-post-layout .entry-meta span { margin-right: 15px; }
.single-post-layout .entry-meta a { color: var(--dark-charcoal); font-weight: 700; }
.single-post-layout .post-thumbnail, .page-layout .post-thumbnail { margin-bottom: 30px; }
.single-post-layout .entry-content, .page-layout .entry-content { font-size: 1.1rem; line-height: 1.7; }
.single-post-layout .entry-footer { margin: 40px 0 0; padding-top: 20px; border-top: 1px solid #e5e5e5; font-size: 0.9rem; }

/* --- NEW: Table of Contents --- */
.toc-container {
    border: 1px solid #e5e5e5;
    background: #fafafa;
    padding: 20px;
    margin: 30px 0;
    border-radius: 8px;
}
.toc-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 15px;
}
.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.toc-list a {
    display: block;
    padding: 5px 0;
    color: var(--dark-charcoal);
    text-decoration: none;
}
.toc-list a:hover {
    color: var(--cnn-red);
}
.toc-level-3 {
    padding-left: 20px;
}

/* --- NEW: Related Posts --- */
.related-posts-container {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid #e5e5e5;
}
.related-posts-title {
    font-size: 1.8rem;
    font-family: var(--font-secondary);
    margin-bottom: 30px;
}
.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}
.related-post-card .related-post-image {
    display: block;
    position: relative;
    margin-bottom: 15px;
}
.related-post-card .category-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: var(--cnn-red);
    color: #fff;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 4px;
    z-index: 1;
}
.related-post-card .related-post-title {
    font-size: 1.1rem;
    font-family: var(--font-secondary);
    margin: 0;
    line-height: 1.4;
}
@media (max-width: 768px) {
    .related-posts-grid { grid-template-columns: 1fr; }
}

/* --- NEW: Post Tags --- */
.tags-links {
    font-size: 0.9rem;
    color: var(--medium-gray);
}
.tags-links a {
    display: inline-block;
    background: #e5e5e5;
    padding: 5px 10px;
    margin: 2px;
    border-radius: 4px;
    color: var(--dark-charcoal);
}
.tags-links a:hover {
    background: var(--cnn-red);
    color: #fff;
}


/* --- Widgets --- */
.widget { margin-bottom: 30px; background: var(--light-gray); padding: 20px; border-radius: 8px; }
.widget-title { font-size: 1.2rem; font-weight: 700; margin-top: 0; margin-bottom: 20px; border-bottom: 2px solid var(--cnn-red); padding-bottom: 10px; }
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget ul li { margin-bottom: 10px; border-bottom: 1px solid #e5e5e5; padding-bottom: 10px; }
.widget ul li:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.author-profile-widget { text-align: center; }
.author-profile-widget img { border-radius: 50%; margin: 0 auto 15px; }
.author-profile-widget .author-name { margin: 0 0 10px; }
.site-info-widget li { border: none; padding: 0; margin-bottom: 5px; }
.widget_newspress_posts_widget ul li a { display: flex; align-items: center; gap: 15px; }
.widget_newspress_posts_widget ul li img { width: 60px; height: 60px; object-fit: cover; }

/* --- Footer --- */
.site-footer { background-color: var(--dark-charcoal); color: var(--off-white); padding: 40px 0; margin-top: 40px; }
.footer-widgets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; margin-bottom: 40px; }
.footer-column { min-width: 0; }
.site-footer .widget { background: none; padding: 0; }
.site-footer .widget-title { color: #fff; border-color: var(--cnn-red); }
.site-footer a { color: #fff; }
.site-footer a:hover { text-decoration: underline; }
.footer-content { text-align: center; font-size: 0.9rem; border-top: 1px solid var(--medium-gray); padding-top: 30px; }

/* --- Responsive Design --- */
@media (max-width: 960px) {
    .footer-widgets { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .menu-toggle { display: block; }
    .main-navigation { display: none; }
    .main-navigation.toggled-on { display: block; }
    .main-navigation ul { flex-direction: column; align-items: flex-start; }
    .main-navigation li { margin: 0; width: 100%; border-bottom: 1px solid #e5e5e5; }
    .main-navigation a { display: block; padding: 15px 20px; width: 100%; }
    .menu-item-login a { background-color: transparent; color: var(--dark-charcoal); padding: 15px 20px; }
    .menu-item-login a:hover { color: var(--cnn-red); }
    .responsive-menu-dropdown .main-navigation { position: absolute; top: 100%; left: 0; width: 100%; background-color: #fff; border-top: 1px solid #e5e5e5; }
    .responsive-menu-slide-in .main-navigation { position: fixed; top: 0; left: -280px; width: 280px; height: 100vh; background-color: #fff; z-index: 1001; overflow-y: auto; transition: left 0.3s ease; box-shadow: 2px 0 10px rgba(0,0,0,0.1); }
    .responsive-menu-slide-in .main-navigation.toggled-on { left: 0; }
    .responsive-menu-slide-in .menu-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1000; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease; }
    .responsive-menu-slide-in .menu-overlay.is-visible { opacity: 1; visibility: visible; }
    .site-main, .widget-area { flex-basis: 100%; }
}

@media (max-width: 480px) {
    .footer-widgets { grid-template-columns: 1fr; }
}
