/*
Theme Name: CCNS Premium News
Theme URI: https://ccns.in
Author: Desh Raj
Author URI: https://ccns.in
Version: 1.0.0
Text Domain: ccns
*/

/* --- Base Variables & Reset --- */
:root {
    --primary-color: #d60000;
    --text-main: #333333;
    --text-light: #666666;
    --bg-main: #ffffff;
    --bg-footer: #3e3e3e;
    --bg-footer-bottom: #353537;
    --bg-widget: #fffdf8;
    --border-color: #e5e5e5;
    --container-width: 1300px;
    --font-family: 'Roboto', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-family); color: var(--text-main); background-color: var(--bg-main); line-height: 1.6; }
a { text-decoration: none; color: inherit; transition: color 0.3s ease; }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }
.container { max-width: var(--container-width); margin: 0 auto; padding: 0 15px; }

/* --- Header --- */
.site-header { position: sticky; top: 0; z-index: 1000; background: var(--bg-main); padding: 15px 0; border-bottom: 1px solid var(--border-color); box-shadow: 0 2px 5px rgba(0,0,0,0,1); }
.header-inner { display: flex; justify-content: space-between; align-items: center; }
.site-logo img { height: 55px; }
.main-navigation { display: flex; align-items: center; margin-left: auto; margin-right: 25px; }
.header-right { display: flex; align-items: center; gap: 20px; }
.menu-header { display: none; }
.nav-menu { display: flex; gap: 20px; }
.nav-menu a { font-size: 16px; font-weight: 500; text-transform: capitalize; }
.nav-menu a:hover { color: var(--primary-color); }
.search-icon { cursor: pointer; display: flex; align-items: center; }
.menu-toggle { display: none; background: none; border: none; cursor: pointer; font-size: 24px; }

/* --- Mobile Menu Overlay --- */
.menu-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.6); z-index: 998; transition: opacity 0.3s ease; }
.menu-overlay.active { display: block; }

/* --- Breaking News Ticker --- */
.breaking-news-wrapper { background-color: rgba(209, 25, 25, 0.81); color: #ffffff; position: relative; }
.breaking-news-inner { display: flex; align-items: center; padding: 8px 15px; font-size: 14px; }
.breaking-news-label { font-weight: bold; margin-right: 15px; white-space: nowrap; }
.breaking-news-ticker { overflow: hidden; flex-grow: 1; }
.ticker-list { display: flex; animation: ticker 20s linear infinite; white-space: nowrap; }
.ticker-list li { margin-right: 30px; }
.ticker-list a { color: #ffffff; }
.ticker-list .arrow { margin-right: 5px; }
.breaking-news-close { cursor: pointer; font-size: 20px; font-weight: bold; padding-left: 15px; }
@keyframes ticker { 0% { transform: translateX(100%); } 100% { transform: translateX(-100%); } }

/* --- Layout (Desktop Fix) --- */
.page-wrapper { display: flex; gap: 30px; margin-top: 30px; margin-bottom: 40px; }
.main-content { flex: 0 0 calc(75% - 15px); max-width: calc(75% - 15px); }
.sidebar { flex: 0 0 calc(25% - 15px); max-width: calc(25% - 15px); }

/* --- Hero News Grid --- */
.hero-news-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 30px; }
.hero-post-large { position: relative; border-radius: 4px; overflow: hidden; min-height: 260px; display: flex; align-items: flex-end; background-size: cover; background-position: center; }
.hero-post-large::after { content: ""; background-image: linear-gradient(190deg, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.77) 70%); position: absolute; inset: 0; pointer-events: none; }
.post-link-overlay { position: absolute; inset: 0; z-index: 2; }
.hero-post-content { position: relative; z-index: 1; padding: 15px; }
.hero-post-content h2 { color: #ffffff; font-size: 25px; font-weight: 700; }
.hero-post-stacked { display: flex; flex-direction: column; gap: 15px; }

/* --- Standard Post Items (FIXED IMAGE SQUISH) --- */
.post-list-item { display: flex; align-items: flex-start; gap: 15px; padding: 10px; border: 1px solid var(--border-color); border-radius: 4px; background: var(--bg-main); transition: border-color 0.3s; }
.post-list-item:hover { border-color: #bbbbbb; }
.post-thumb { flex: 0 0 25%; max-width: 25%; flex-shrink: 0; }
.post-thumb a { display: block; height: 100%; }
.post-thumb img { border-radius: 3px; width: 100%; height: 100%; aspect-ratio: 16 / 9; object-fit: cover !important; }
.post-details { flex: 1; display: flex; align-items: center; }
.post-details h3 { font-size: 17px; line-height: 1.3; font-weight: 700; }
.post-details a:hover { color: var(--primary-color); }

/* --- Category Block --- */
.category-block { margin-top: 30px; }
.category-header { background-color: var(--primary-color); padding: 8px 15px; margin-bottom: 20px; display: flex; align-items: center; justify-content: center; text-align: center; }
.category-header h2 { font-size: 18px; font-weight: 800; color: #ffffff; margin: 0; }
.category-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

/* --- Pagination (ORIGINAL RED NEXT BUTTON) --- */
.pagination { margin-top: 20px; display: flex; justify-content: center; }
.next-button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 8px 25px; background-color: var(--primary-color); color: #ffffff; font-size: 16px; font-weight: bold; border: none; border-radius: 4px; cursor: pointer; transition: background-color 0.3s ease; }
.next-button:hover { background-color: #a30000; color: #ffffff; }

/* --- Sidebar --- */
.widget { margin-bottom: 25px; background-color: var(--bg-widget); padding: 15px; border: 1px solid #f2eedf; }
.widget-title { font-size: 18px; font-weight: 800; padding: 8px 15px; color: #ffffff; background-color: var(--primary-color); margin: -15px -15px 15px -15px; display: flex; align-items: center; justify-content: center; text-align: center; gap: 8px; }
.widget-title.light { background-color: var(--primary-color); color: #ffffff; border-bottom: none; margin: -15px -15px 15px -15px; padding: 8px 15px; display: flex; align-items: center; justify-content: center; text-align: center; }
.widget-content.transparent { background: transparent; padding: 0; border: none; }

/* Widget Lists (FIXED IMAGE SQUISH) */
.widget-post-list li { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px solid var(--border-color); }
.widget-post-list li:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.widget-post-list li a:first-child { flex-shrink: 0; display: block; width: 85px; height: 65px; }
.widget-post-list img { width: 100%; height: 100%; object-fit: cover !important; border-radius: 3px; }
.widget-post-list a { font-size: 15px; font-weight: 600; line-height: 1.3; }
.widget-post-list a:hover { color: var(--primary-color); }

.widget-text-list li { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border-color); }
.widget-text-list li:last-child { border-bottom: none; margin-bottom: 0; }
.widget-text-list a { font-size: 15px; font-weight: 500; display: flex; align-items: flex-start; gap: 8px; }
.widget-text-list a svg { margin-top: 4px; flex-shrink: 0; color: var(--primary-color); }
.widget-text-list a:hover { color: var(--primary-color); }

/* --- Footer --- */
.site-footer { background-color: var(--bg-footer); color: #f0f0f0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 30px; padding: 40px 15px; }
.footer-logo { width: 150px; margin-bottom: 15px; }
.about-widget p { font-size: 14px; color: #e0e0e0; }
.link-widget h3, .social-widget h3 { font-size: 20px; color: #ffffff; margin-bottom: 15px; }
.link-widget ul li { margin-bottom: 8px; }
.link-widget ul li a { font-size: 14px; display: flex; align-items: center; }
.link-widget ul li a::before { content: "▶"; font-size: 10px; margin-right: 8px; }
.link-widget ul li a:hover { color: #ffffff; margin-left: 5px; }
.social-icons { display: flex; flex-wrap: wrap; gap: 10px; }
.social-icons a { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid #c2c2c2; border-radius: 4px; color: #c2c2c2; font-size: 14px; }
.social-icons a:hover { border-color: #ffffff; color: #ffffff; }
.footer-bottom { background-color: var(--bg-footer-bottom); padding: 15px 0; text-align: center; font-size: 13px; color: #f0f0f0; }

/* --- Single Post View Styles --- */
.single-post-title { font-size: 32px; font-weight: 800; line-height: 1.3; margin-bottom: 20px; color: var(--text-main); }
.post-meta-bar { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-color); padding-bottom: 15px; margin-bottom: 20px; flex-wrap: wrap; gap: 15px; }
.meta-left { display: flex; align-items: center; gap: 12px; }
.author-img { width: 45px; height: 45px; border-radius: 50%; object-fit: cover; }
.author-info { font-size: 14px; color: var(--text-light); line-height: 1.4; }
.author-name { font-weight: 700; color: var(--text-main); }
.category-badge { background-color: transparent; color: #ff0000; padding: 5px 12px; border-radius: 4px; font-size: 16px; font-weight: bold; display: inline-flex; align-items: center; gap: 5px; }
.single-featured-img { width: 100%; border-radius: 4px; margin-bottom: 25px; }
.single-post-content p { font-size: 17px; line-height: 1.7; margin-bottom: 20px; color: #444444; }
.social-share-box { display: flex; gap: 10px; margin-top: 30px; margin-bottom: 40px; }
.share-btn { flex: 1; display: flex; justify-content: center; align-items: center; padding: 12px; color: #ffffff; border-radius: 4px; transition: opacity 0.3s; }
.share-btn:hover { opacity: 0.8; color: #ffffff; }
.share-fb { background-color: #3b5998; } .share-x { background-color: #000000; } .share-wa { background-color: #25d366; } .share-tg { background-color: #0088cc; } .share-copy { background-color: #333333; }

/* --- Premium Comments & Search Override --- */
.comments-area { margin-top: 50px; padding-top: 30px; border-top: 2px solid var(--primary-color); }
.comments-title { font-size: 24px; font-weight: 800; margin-bottom: 25px; color: var(--text-main); display: inline-block; border-bottom: 3px solid var(--primary-color); padding-bottom: 5px; }
.comment-list li.comment { margin-bottom: 25px; background: #ffffff; padding: 25px; border: 1px solid var(--border-color); border-radius: 6px; box-shadow: 0 4px 10px rgba(0,0,0,0.03); }
.search-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background: rgba(0, 0, 0, 0.5); z-index: 9999; display: flex; justify-content: center; align-items: flex-start; padding-top: 120px; opacity: 0; visibility: hidden; transition: all 0.3s ease-in-out; backdrop-filter: blur(10px); }
.search-overlay.active { opacity: 1; visibility: visible; }
.close-search { position: absolute; top: 30px; right: 30px; background: none; border: none; color: #ffffff; font-size: 45px; cursor: pointer; }
.search-form-container { width: 90%; max-width: 700px; }
.search-form { display: flex; width: 100%; border-bottom: 2px solid var(--primary-color); }
.search-field { flex-grow: 1; background: transparent; border: none; color: #ffffff; font-size: 22px; padding: 12px 10px; }
.search-field:focus { outline: none; }
.search-submit { background: var(--primary-color); color: #ffffff; border: none; padding: 0 25px; font-size: 16px; font-weight: 800; cursor: pointer; text-transform: uppercase; }

/* --- RESPONSIVE FIXES (Makes Mobile view exactly like original stacked layout) --- */
@media (max-width: 1024px) {
    .hero-post-large h2 { font-size: 20px; }
}
@media (max-width: 768px) {
    .page-wrapper { flex-direction: column; }
    .main-content, .sidebar { flex: 0 0 100%; max-width: 100%; }
    
    /* These turn desktop grids into mobile stacked lists naturally */
    .hero-news-grid { grid-template-columns: 1fr; }
    .category-grid { grid-template-columns: 1fr; }
    
    .menu-toggle { display: block; }
    .main-navigation { position: fixed; top: 0; left: -300px; width: 280px; height: 100vh; background-color: rgba(209, 25, 25, 0.95); flex-direction: column; align-items: flex-start; padding: 20px; box-shadow: 2px 0 10px rgba(0,0,0,0.5); transition: left 0.3s ease; z-index: 999; margin: 0; }
    .main-navigation.active { left: 0; }
    .menu-header { display: flex; justify-content: space-between; align-items: center; width: 100%; padding-bottom: 15px; margin-bottom: 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.2); color: #ffffff; }
    .close-menu { background: none; border: none; color: #ffffff; font-size: 30px; cursor: pointer; }
    .nav-menu { flex-direction: column; width: 100%; gap: 15px; }
    .nav-menu a { color: #ffffff; font-size: 18px; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 25px 15px; text-align: left; }
    .about-widget, .social-widget { grid-column: span 2; text-align: center; }
    .footer-logo, .social-icons { margin-left: auto; margin-right: auto; justify-content: center; }
}
