/* ===========================
   1. Global Styles & Variables
   =========================== */
:root {
  --primary: #d16b7e;
  --secondary: #f9e6e8;
  --accent: #6d28d9;
  --text-dark: #2c2c2c;
  --text-light: #ffffff;
  --text-muted: #666666;
  --bg-light: #fff9f9;
  --border-color: rgba(0, 0, 0, 0.05);
  --font-heading: 'Playfair Display', serif;
  --font-body: 'Inter', sans-serif;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --radius: 8px;
  --transition: all 0.3s ease;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-light);
  color: var(--text-dark);
  margin: 0;
  padding: 0;
  line-height: 1.6;
}

/* ===========================
   2. Shared Components
   =========================== */
section {
  padding: 80px 20px;
  margin: 0 auto;
  max-width: 1200px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  color: var(--primary);
  margin-bottom: 40px;
  text-align: center;
  font-weight: 700;
}

/* Buttons */
.cta-btn, .hero-btn, .newsletter-btn {
  background: var(--primary);
  color: #fff;
  padding: 12px 28px;
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-block;
}
.cta-btn:hover, .hero-btn:hover, .newsletter-btn:hover {
  background: #b94b6a;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* Grids */
.posts-grid, .popular-grid, .recent-grid, .categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

/* Cards */
.post-card, .popular-card, .recent-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.post-card:hover, .popular-card:hover, .recent-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}
/* UPDATE: Added .popular-card-content here to fix the padding issue */
.post-card-content, .recent-card-content, .popular-card-content {
  padding: 20px;
  flex: 1;
}
.post-thumb img, .popular-thumb img, .recent-thumb img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  border-bottom: 1px solid var(--border-color);
}
.post-title a, .popular-title a, .recent-title a {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 700;
  transition: var(--transition);
  line-height: 1.4;
}
.post-title a:hover, .popular-title a:hover, .recent-title a:hover {
  color: var(--primary);
}
/* Fallback padding if popular post uses direct headers instead of wrapper */
.popular-card h2, .popular-card h3 {
  padding: 15px 20px 5px;
  margin: 0;
}

/* ===========================
   3. Header Section
   =========================== */
.site-header {
  background-color: var(--text-light);
  border-bottom: 1px solid var(--border-color);
  padding: 15px 0;
  position: sticky;
  top: 0;
  z-index: 10000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap; /* UPDATE: Added for responsive adjusting */
  gap: 20px; /* UPDATE: Added gap */
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}
/* UPDATE: Logo size fix */
.site-title img,
.custom-logo {
  max-width: 250px;
  height: auto;
  display: block;
}
.site-title a {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}
.site-tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.nav-menu {
  display: flex;
  flex-wrap: wrap; /* UPDATE: Allows menu to wrap if too long */
  gap: 30px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-menu a {
  color: var(--text-dark);
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
}
.nav-menu a:hover {
  color: var(--primary);
}
.nav-toggle, .nav-close {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: 0.3s;
  display: none;
}
.nav-close {
  background: #b94b6a;
}

/* ===========================
   4. Hero Section
   =========================== */
.hero-section {
  position: relative;
  min-height: 500px;
  background: url('../images/hero-bg.jpg') center/cover no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  padding: 40px 20px;
}
.hero-section::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1;
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}
.hero-content h1 {
  font-family: var(--font-heading);
  font-size: 3rem;
  margin-bottom: 20px;
  line-height: 1.2;
}
.hero-categories {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  margin-top: 40px;
  position: relative;
  z-index: 2;
}
.cat-box, .cat-card {
  background: var(--secondary);
  color: var(--text-dark);
  padding: 12px 24px;
  border-radius: 30px;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.hero-categories .cat-box {
  background: rgba(255,255,255,0.2);
  color: #fff;
  backdrop-filter: blur(5px);
}
.cat-box:hover, .cat-card:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-3px);
}

/* ===========================
   5. Two Column Layout & Sidebar
   =========================== */
.two-column-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  justify-content: center;
  align-items: flex-start;
  max-width: 1200px;
  margin: 0 auto;
}
.content-area {
  flex: 1 1 65%;
  max-width: 800px;
}
.sidebar-area {
  flex: 1 1 30%;
  max-width: 350px;
  position: sticky;
  top: 100px;
}

/* ===========================
   6. Single Post Layout
   =========================== */
.single-post-container {
  max-width: 860px;
  margin: 0 auto;
  padding: 60px 20px;
}
.single-title {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  line-height: 1.2;
  color: var(--text-dark);
  margin-bottom: 20px;
  text-align: center;
}
.single-meta {
  font-size: 0.95rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 40px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.single-thumb img {
  width: 100%;
  max-height: 450px; /* UPDATE: Restricts huge image heights */
  object-fit: cover; /* UPDATE: Ensures it scales perfectly */
  border-radius: 12px;
  margin: 0 auto 40px;
  box-shadow: var(--shadow-md);
}
.single-content {
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--text-dark);
  margin-bottom: 50px;
}
/* UPDATE: Fixed the cut-off code from your previous version */
.single-content h2, .single-content h3 {
  margin-top: 30px;
  margin-bottom: 15px;
  color: var(--text-dark);
}

/* ===========================
   7. Newsletter & Pagination
   =========================== */
.home-newsletter {
  background: var(--secondary);
  border-radius: 12px;
  padding: 50px 20px;
  text-align: center;
  margin: 60px auto;
  max-width: 800px;
}
.newsletter-form {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.newsletter-form input[type="email"] {
  padding: 14px 20px;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: var(--radius);
  flex: 1;
  min-width: 250px;
  font-family: var(--font-body);
}
.pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 40px;
}
.pagination a {
  background: var(--secondary);
  padding: 10px 18px;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 600;
  transition: var(--transition);
}
.pagination a:hover {
  background: var(--primary);
  color: #fff;
}

/* ===========================
   8. Footer Section
   =========================== */
.site-footer {
  background: var(--text-light);
  color: var(--text-dark);
  padding: 60px 20px; /* UPDATE: Increased padding for premium feel */
  text-align: center;
  border-top: 1px solid var(--border-color);
}
.footer-tagline {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--primary);
  margin-bottom: 25px;
}
.footer-menu {
  display: flex;
  justify-content: center;
  align-items: center; /* UPDATE: Align items properly */
  flex-wrap: wrap; /* UPDATE: Wrap for mobile */
  gap: 30px;
  list-style: none;
  margin-bottom: 30px;
  padding: 0;
}
/* UPDATE: Remove bullets from li just in case */
.footer-menu li {
  list-style-type: none;
  margin: 0;
}
.footer-menu a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600; /* UPDATE: Bolder text */
  text-transform: uppercase; /* UPDATE: Premium uppercase style */
  letter-spacing: 1px; /* UPDATE: Added spacing */
  font-size: 0.95rem; /* UPDATE: Slightly larger */
  transition: var(--transition);
}
.footer-menu a:hover {
  color: var(--primary);
}
.footer-social {
  display: flex;
  justify-content: center;
  gap: 20px;
}
.social-icon {
  font-size: 1.5rem;
  color: var(--text-muted);
  transition: var(--transition);
}
.social-icon:hover {
  color: var(--primary);
}

/* ===========================
   9. Responsive Design
   =========================== */

@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    align-items: center;
    gap: 15px;
  }
  .logo-area,
  .site-tagline {
    text-align: center;
  }
  /* =========================
     MOBILE OPEN BUTTON
     ========================= */
  .nav-toggle {
    display: block;
    cursor: pointer;
    position: relative;
    z-index: 10001;
  }
  /* =========================
     MOBILE NAVIGATION
     ========================= */
  .main-navigation {
    position: fixed;
    top: 0;
    right: 0;
    width: 260px;
    height: 100vh;
    background: var(--text-light);
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 80px 30px 30px;
    box-sizing: border-box;
    transform: translateX(100%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.4s ease, opacity 0.4s ease, visibility 0.4s ease;
    z-index: 10000;
  }
  /* =========================
     OPEN MENU
     ========================= */
  .main-navigation.active {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  /* =========================
     CLOSE BUTTON
     ========================= */
  .nav-close {
    display: block;
    position: absolute;
    top: 18px;
    right: 18px;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    color: var(--text-dark);
    border: none;
    font-size: 28px;
    font-weight: 700;
    line-height: 40px;
    cursor: pointer;
    z-index: 10002;
    text-align: center;
  }
  .nav-close:hover {
    color: var(--primary);
    opacity: 0.8;
  }
  /* =========================
     NAVIGATION MENU
     ========================= */
  .nav-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
    text-align: center;
  }
  .nav-menu li {
    width: 100%;
    text-align: center;
  }
  .nav-menu a {
    display: block;
    width: 100%;
    padding: 8px 0;
    text-align: center;
  }
  /* =========================
     DARK OVERLAY
     ========================= */
  body.menu-open::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
  }
}

@media (max-width: 576px) {
  .site-title a {
    font-size: 1.5rem;
  }
  .hero-content h1 {
    font-size: 1.8rem;
  }
  .section-title {
    font-size: 1.8rem;
  }
  .footer-menu {
    flex-direction: column;
    gap: 15px;
  }
  .newsletter-form {
    flex-direction: column;
  }
  .newsletter-btn {
    width: 100%;
  }
}

/* ===========================
   Archive / Breadcrumb / Author / Search / Comments
   =========================== */
.archive-page { max-width: 1200px; margin: 0 auto; padding: 80px 20px; }
.archive-hero { text-align: center; margin-bottom: 60px; padding-bottom: 40px; border-bottom: 1px solid var(--border-color); max-width: 800px; margin-left: auto; margin-right: auto; }
.archive-hero h1 { font-family: var(--font-heading); font-size: 2.8rem; color: var(--primary); font-weight: 700; margin-bottom: 15px; line-height: 1.2; }
.archive-hero p { font-size: 1.1rem; color: var(--text-muted); line-height: 1.7; }
.breadcrumbs { font-size: 0.9rem; margin-bottom: 20px; color: #777; }
.breadcrumbs a { color: var(--primary); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); }
.author-box { display: flex; align-items: flex-start; gap: 1rem; margin-top: 2.5rem; padding: 1.5rem; background: var(--secondary); border-radius: 8px; box-shadow: 0 2px 6px rgba(0,0,0,0.05); }
.author-avatar img { border-radius: 50%; border: 2px solid var(--primary); }
.search-page { padding: 60px 20px; }
.search-hero { text-align: center; margin-bottom: 40px; }
.search-hero h1 { font-size: 2rem; color: var(--primary); }
.comments-area { margin-top: 40px; padding: 25px; background: var(--secondary); border-radius: 8px; }
.comments-area h2 { font-size: 1.4rem; color: var(--primary); margin-bottom: 20px; }
.comment-list { list-style: none; padding: 0; margin: 0; }
.comment-list li { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid #eee; }
.comment-author { font-weight: 600; color: var(--primary); }
.comment-meta { font-size: 0.85rem; color: #777; margin-bottom: 10px; }
.comment-content { font-size: 0.95rem; color: #333; }
.comment-reply-link { font-size: 0.85rem; color: var(--accent); text-decoration: none; }
.comment-reply-link:hover { color: var(--primary); }

/* ===========================
   Dark Mode
   =========================== */
body.dark-mode { 
  background-color: #121212 !important; 
  color: #e0e0e0 !important; 
}

/* लिंक्स का कलर */
body.dark-mode a { 
  color: #bb86fc !important; 
}

/* हेडर और फुटर */
body.dark-mode .site-header,
body.dark-mode .site-footer { 
  background-color: #1f1f1f !important; 
  color: #e0e0e0 !important; 
  border-color: #333 !important;
}

/* सभी कार्ड्स, बॉक्सेस, ऑथर बॉक्स, न्यूज़लेटर और कमेंट्स को एक साथ फिक्स करना */
body.dark-mode .post-card,
body.dark-mode .popular-card,
body.dark-mode .recent-card,
body.dark-mode .cat-box,
body.dark-mode .cat-card,
body.dark-mode .author-box,
body.dark-mode .comments-area,
body.dark-mode .home-newsletter { 
  background-color: #1e1e1e !important; 
  border: 1px solid #333 !important; 
}

/* डार्क मोड में टेक्स्ट और हेडिंग्स को लाइट करना */
body.dark-mode p,
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6,
body.dark-mode li,
body.dark-mode span,
body.dark-mode td,
body.dark-mode th,
body.dark-mode strong,
body.dark-mode b,
body.dark-mode .single-content,
body.dark-mode .post-card-content,
body.dark-mode .site-title a,
body.dark-mode .nav-menu a,
body.dark-mode .footer-menu a,
body.dark-mode .post-title a,
body.dark-mode .recent-title a,
body.dark-mode .popular-title a {
  color: #e0e0e0 !important;
}

/* डार्क मोड बटन का होवर इफेक्ट */
.dark-toggle { 
  background: var(--primary); 
  color: #fff; 
  border: none; 
  padding: 8px 14px; 
  border-radius: 6px; 
  cursor: pointer; 
  font-size: 0.9rem; 
  transition: 0.3s; 
}
.dark-toggle:hover { 
  background: #b94b6a; 
}

.page-layout {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px 60px;
    box-sizing: border-box;
}

.page-layout .content-area {
    width: 100%;
}

.page-content {
    background: #fff;
    padding: 35px 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.page-content .entry-header {
    margin-bottom: 25px;
}

.page-content .entry-title {
    margin: 0;
    font-size: 36px;
    line-height: 1.3;
    font-weight: 700;
}

.page-content .entry-content {
    font-size: 17px;
    line-height: 1.8;
    color: #333;
}

.page-content .entry-content p {
    margin: 0 0 20px;
}

.page-content .entry-content h2 {
    margin: 35px 0 15px;
    font-size: 28px;
}

.page-content .entry-content h3 {
    margin: 28px 0 12px;
    font-size: 23px;
}

.page-content .entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

.page-content .entry-content a {
    color: #d45f78;
}

.page-content .entry-content ul,
.page-content .entry-content ol {
    margin: 0 0 20px;
    padding-left: 25px;
}

@media (max-width: 768px) {

    .page-layout {
        padding: 25px 15px 40px;
    }

    .page-content {
        padding: 25px 20px;
        border-radius: 10px;
    }

    .page-content .entry-title {
        font-size: 28px;
    }

    .page-content .entry-content {
        font-size: 16px;
        line-height: 1.75;
    }

    .page-content .entry-content h2 {
        font-size: 24px;
    }

    .page-content .entry-content h3 {
        font-size: 20px;
    }
}