/*
Theme Name: Aaj Tak Nav Bharat
Theme URI: https://aajtaknavbharat.com
Author: Your Name
Author URI: https://yourwebsite.com
Description: A modern, high-performance WordPress theme optimized for news websites. Passes Core Web Vitals with features like lazy loading, optimized assets, and mobile-first responsive design. Perfect for news portals, magazines, and content-rich websites.
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: aajtaknavbharat
Tags: news, magazine, blog, two-columns, right-sidebar, custom-menu, custom-logo, editor-style, featured-images, footer-widgets, sticky-post, theme-options, threaded-comments, translation-ready
*/

/* Critical CSS - Above the fold */
:root {
  --primary-color: #dc2626;
  --secondary-color: #1e40af;
  --text-color: #1f2937;
  --light-gray: #f3f4f6;
  --border-color: #e5e7eb;
  --white: #ffffff;
  --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-primary);
  color: var(--text-color);
  line-height: 1.6;
  background: var(--white);
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

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

/* Layout */
.site-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
.site-header {
  background: var(--white);
  border-bottom: 2px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.header-top {
  background: var(--primary-color);
  color: var(--white);
  padding: 0.5rem 0;
  font-size: 0.875rem;
}

.header-main {
  padding: 1rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.site-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

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

/* Navigation */
.main-navigation {
  background: var(--secondary-color);
}

.main-navigation ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
}

.main-navigation li {
  position: relative;
}

.main-navigation a {
  display: block;
  padding: 0.875rem 1.25rem;
  color: var(--white);
  font-weight: 500;
  font-size: 0.9375rem;
}

.main-navigation a:hover {
  background: var(--primary-color);
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  background: var(--primary-color);
  color: var(--white);
  border: none;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  font-size: 1rem;
  border-radius: 4px;
}

/* Content Area */
.site-content {
  padding: 2rem 0;
}

.content-area {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
}

.main-content {
  min-width: 0;
}

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

/* Article Card */
.article-card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.article-image {
  position: relative;
  width: 100%;
  padding-top: 60%;
  overflow: hidden;
  background: var(--light-gray);
}

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

.article-content {
  padding: 1.25rem;
}

.article-category {
  display: inline-block;
  background: var(--primary-color);
  color: var(--white);
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}

.article-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 0.75rem;
  color: var(--text-color);
}

.article-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 0.75rem;
}

.article-excerpt {
  font-size: 0.9375rem;
  color: #4b5563;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.read-more {
  display: inline-block;
  color: var(--secondary-color);
  font-weight: 600;
  font-size: 0.9375rem;
}

/* Single Post */
.single-post-header {
  margin-bottom: 2rem;
}

.single-post-title {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.post-content {
  font-size: 1.0625rem;
  line-height: 1.8;
}

.post-content h2,
.post-content h3,
.post-content h4 {
  margin: 2rem 0 1rem;
  font-weight: 700;
}

.post-content p {
  margin-bottom: 1.5rem;
}

.post-content img {
  margin: 2rem 0;
  border-radius: 8px;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 100px;
}

.widget {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

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

.widget ul {
  list-style: none;
}

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

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

/* Footer */
.site-footer {
  background: #1f2937;
  color: #d1d5db;
  padding: 3rem 0 1rem;
  margin-top: 4rem;
}

.footer-widgets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-widget h3 {
  color: var(--white);
  margin-bottom: 1rem;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid #374151;
  font-size: 0.875rem;
}

/* Breaking News */
.breaking-news {
  background: var(--primary-color);
  color: var(--white);
  padding: 0.75rem 0;
  margin-bottom: 2rem;
}

.breaking-news-label {
  font-weight: 700;
  text-transform: uppercase;
  margin-right: 1rem;
}

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

.pagination a,
.pagination span {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
}

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

/* Responsive */
@media (max-width: 768px) {
  .content-area {
    grid-template-columns: 1fr;
  }
  
  .posts-grid {
    grid-template-columns: 1fr;
  }
  
  .menu-toggle {
    display: block;
  }
  
  .main-navigation ul {
    display: none;
    flex-direction: column;
  }
  
  .main-navigation.toggled ul {
    display: flex;
  }
  
  .main-navigation a {
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  
  .single-post-title {
    font-size: 1.75rem;
  }
  
  .sidebar {
    position: static;
  }
}

/* Accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary-color);
  color: var(--white);
  padding: 8px;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

/* Loading optimization */
.lazy {
  opacity: 0;
  transition: opacity 0.3s;
}

.lazy.loaded {
  opacity: 1;
}