/* ============================================================
   YojanaViral - Main Stylesheet (Mobile First)
   ============================================================ */

:root {
  --primary: #c0392b;
  --primary-dark: #96281b;
  --secondary: #2c3e50;
  --accent: #f39c12;
  --bg: #f5f5f5;
  --white: #ffffff;
  --text: #2d2d2d;
  --text-light: #666;
  --border: #e0e0e0;
  --card-shadow: 0 2px 8px rgba(0,0,0,0.08);
  --card-hover: 0 6px 20px rgba(0,0,0,0.12);
  --radius: 8px;
  --font-hindi: 'Noto Sans Devanagari', 'Hind', Arial, sans-serif;
  --header-h: 64px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-hindi);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
}

a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-dark); }

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

/* ---- TYPOGRAPHY ---- */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.3; color: var(--secondary); }
h1 { font-size: clamp(1.4rem, 3.5vw, 2rem); }
h2 { font-size: clamp(1.2rem, 3vw, 1.6rem); }
h3 { font-size: clamp(1rem, 2.5vw, 1.3rem); }

/* ---- HEADER ---- */
.site-header {
  background: var(--primary);
  height: var(--header-h);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.site-logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { width: 36px; height: 36px; background: var(--white); border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.logo-icon svg { width: 22px; height: 22px; }
.logo-text { color: #fff; font-size: 1.3rem; font-weight: 800; letter-spacing: -0.5px; }
.logo-text span { color: var(--accent); }

.main-nav { display: none; }
.main-nav a {
  color: rgba(255,255,255,0.9);
  font-size: 0.88rem;
  padding: 6px 12px;
  border-radius: 4px;
  font-weight: 500;
  transition: background .2s;
}
.main-nav a:hover { background: rgba(255,255,255,0.15); color: #fff; }

.header-search { display: flex; align-items: center; gap: 8px; }
.search-input {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  width: 180px;
  font-family: var(--font-hindi);
  transition: background .2s;
}
.search-input::placeholder { color: rgba(255,255,255,0.7); }
.search-input:focus { outline: none; background: rgba(255,255,255,0.25); width: 220px; }
.search-btn {
  background: var(--accent);
  border: none;
  color: #fff;
  padding: 8px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
}

/* ---- TICKER ---- */
.news-ticker {
  background: var(--secondary);
  padding: 8px 0;
  overflow: hidden;
}
.ticker-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.ticker-label {
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 4px;
  flex-shrink: 0;
  text-transform: uppercase;
}
.ticker-wrap { overflow: hidden; flex: 1; }
.ticker-text {
  display: flex;
  gap: 40px;
  animation: ticker 30s linear infinite;
  white-space: nowrap;
}
.ticker-text a { color: rgba(255,255,255,0.85); font-size: 0.85rem; }
.ticker-text a:hover { color: var(--accent); }
@keyframes ticker { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ---- LAYOUT ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.main-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding: 24px 0;
}
.content-area {}
.sidebar {}

/* ---- SECTION TITLE ---- */
.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--secondary);
  border-left: 4px solid var(--primary);
  padding-left: 12px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-title a { font-size: 0.8rem; font-weight: 500; color: var(--primary); }

/* ---- HERO POST ---- */
.hero-post {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  margin-bottom: 24px;
}
.hero-post-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  background: #ddd;
}
.hero-post-body { padding: 18px; }
.hero-post-body h2 { font-size: 1.3rem; margin: 8px 0; }
.hero-post-body h2 a:hover { color: var(--primary); }

/* ---- CARDS GRID ---- */
.posts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.post-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: box-shadow .25s, transform .25s;
  display: flex;
  flex-direction: column;
}
.post-card:hover { box-shadow: var(--card-hover); transform: translateY(-2px); }
.post-card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: linear-gradient(135deg, #eee 25%, #ddd 100%);
}
.post-card-img-placeholder { height: 180px; background: linear-gradient(135deg, #e8e8e8, #d5d5d5); display: flex; align-items: center; justify-content: center; color: #bbb; font-size: 2rem; }
.post-card-body { padding: 14px; flex: 1; display: flex; flex-direction: column; }
.post-card-body h3 { font-size: 1rem; margin: 6px 0 8px; flex: 1; }
.post-card-body h3 a { color: var(--secondary); }
.post-card-body h3 a:hover { color: var(--primary); }
.post-card-meta { display: flex; align-items: center; gap: 10px; font-size: 0.78rem; color: var(--text-light); margin-top: auto; }
.post-card-meta svg { width: 12px; height: 12px; }

/* ---- CATEGORY BADGE ---- */
.cat-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ---- SIDEBAR WIDGETS ---- */
.widget {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--card-shadow);
  margin-bottom: 20px;
}
.widget-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--secondary);
  border-bottom: 2px solid var(--primary);
  padding-bottom: 10px;
  margin-bottom: 14px;
}
.trending-list { list-style: none; }
.trending-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.trending-list li:last-child { border-bottom: none; }
.trend-num {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--border);
  line-height: 1;
  min-width: 26px;
}
.trend-num.hot { color: var(--primary); }
.trending-list a { font-size: 0.88rem; color: var(--text); font-weight: 600; line-height: 1.4; }
.trending-list a:hover { color: var(--primary); }
.trend-views { font-size: 0.75rem; color: var(--text-light); margin-top: 3px; }

.category-list { list-style: none; }
.category-list li { padding: 8px 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.category-list li:last-child { border-bottom: none; }
.category-list a { font-size: 0.9rem; color: var(--text); }
.category-list a:hover { color: var(--primary); }
.cat-count { background: var(--bg); border-radius: 10px; padding: 1px 8px; font-size: 0.75rem; color: var(--text-light); }

/* ---- AD CONTAINERS ---- */
.ad-container {
  text-align: center;
  padding: 8px;
  background: var(--white);
  border-radius: var(--radius);
  margin: 20px 0;
  border: 1px solid var(--border);
  min-height: 50px;
}
.ad-container .ad-label {
  font-size: 0.65rem;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

/* ---- SINGLE POST ---- */
.post-header { background: var(--white); border-radius: var(--radius); padding: 20px; box-shadow: var(--card-shadow); margin-bottom: 20px; }
.post-header h1 { color: var(--secondary); margin: 12px 0; }
.post-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 0.82rem; color: var(--text-light); align-items: center; }
.post-meta svg { width: 14px; height: 14px; vertical-align: middle; margin-right: 3px; }
.post-featured-img { width: 100%; max-height: 400px; object-fit: cover; border-radius: var(--radius); margin-bottom: 20px; }

.post-content {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--card-shadow);
  margin-bottom: 20px;
  font-size: 1rem;
  line-height: 1.9;
}
.post-content h2 { margin: 24px 0 12px; padding-left: 12px; border-left: 3px solid var(--primary); }
.post-content h3 { margin: 20px 0 10px; color: var(--primary-dark); }
.post-content p { margin-bottom: 16px; }
.post-content ul, .post-content ol { margin: 12px 0 16px 24px; }
.post-content li { margin-bottom: 6px; }
.post-content table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 0.9rem; }
.post-content table th, .post-content table td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.post-content table th { background: var(--secondary); color: #fff; }
.post-content table tr:nth-child(even) { background: #f9f9f9; }
.post-content a { color: var(--primary); text-decoration: underline; }
.post-content strong { color: var(--secondary); }
.post-content .highlight-box { background: #fff3cd; border-left: 4px solid var(--accent); padding: 14px 16px; border-radius: 0 8px 8px 0; margin: 16px 0; }

/* FAQ Section */
.faq-section { margin-top: 24px; }
.faq-section h2 { color: var(--secondary); margin-bottom: 16px; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.faq-q {
  background: #f8f9fa;
  padding: 14px 16px;
  font-size: 0.95rem;
  cursor: pointer;
  margin: 0;
  color: var(--secondary);
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-hindi);
}
.faq-q::after { content: '+'; font-size: 1.2rem; flex-shrink: 0; }
.faq-item.open .faq-q::after { content: '−'; }
.faq-a { padding: 0 16px; max-height: 0; overflow: hidden; transition: max-height .3s ease, padding .3s; font-size: 0.93rem; color: var(--text); }
.faq-item.open .faq-a { max-height: 300px; padding: 14px 16px; }

/* ---- RELATED POSTS ---- */
.related-posts { background: var(--white); border-radius: var(--radius); padding: 20px; box-shadow: var(--card-shadow); }
.related-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.related-card img { width: 100%; height: 100px; object-fit: cover; border-radius: 6px; }
.related-card h4 { font-size: 0.85rem; margin: 6px 0 0; line-height: 1.4; }
.related-card h4 a { color: var(--text); }
.related-card h4 a:hover { color: var(--primary); }

/* ---- PAGINATION ---- */
.pagination { display: flex; justify-content: center; gap: 8px; padding: 24px 0; flex-wrap: wrap; }
.page-btn {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s;
  font-family: var(--font-hindi);
}
.page-btn:hover, .page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn.disabled { opacity: 0.5; pointer-events: none; }

/* ---- BREADCRUMB ---- */
.breadcrumb { padding: 10px 0; margin-bottom: 16px; }
.breadcrumb ol { display: flex; flex-wrap: wrap; list-style: none; gap: 0; align-items: center; font-size: 0.82rem; }
.breadcrumb li { display: flex; align-items: center; gap: 6px; color: var(--text-light); }
.breadcrumb a { color: var(--text-light); }
.breadcrumb a:hover { color: var(--primary); }
.bc-sep { color: var(--text-light); }

/* ---- FOOTER ---- */
.site-footer { background: var(--secondary); color: rgba(255,255,255,0.8); margin-top: 40px; }
.footer-top { padding: 40px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 28px; }
.footer-about h3 { color: #fff; margin-bottom: 10px; }
.footer-about p { font-size: 0.88rem; line-height: 1.7; }
.footer-links h4 { color: #fff; font-size: 0.95rem; margin-bottom: 12px; }
.footer-links ul { list-style: none; }
.footer-links li { padding: 4px 0; }
.footer-links a { color: rgba(255,255,255,0.7); font-size: 0.87rem; }
.footer-links a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding: 16px 0; text-align: center; font-size: 0.82rem; }
.footer-bottom a { color: rgba(255,255,255,0.6); margin: 0 8px; }

/* ---- LOADING SKELETON ---- */
.skeleton { background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 4px; }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* ---- SEARCH RESULTS ---- */
.search-header { padding: 20px; background: var(--white); border-radius: var(--radius); margin-bottom: 20px; box-shadow: var(--card-shadow); }
.search-header h1 { font-size: 1.1rem; }
.search-header span { color: var(--primary); }
.no-results { text-align: center; padding: 40px 20px; background: var(--white); border-radius: var(--radius); }
.no-results p { color: var(--text-light); margin: 10px 0; }

/* ---- TAGS ---- */
.tags-wrap { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tag { background: var(--bg); border: 1px solid var(--border); padding: 4px 12px; border-radius: 20px; font-size: 0.8rem; color: var(--text-light); }
.tag:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---- LOAD MORE ---- */
#load-more-btn {
  display: block;
  width: 100%;
  max-width: 300px;
  margin: 20px auto;
  padding: 12px 24px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-hindi);
  transition: background .2s;
}
#load-more-btn:hover { background: var(--primary-dark); }
#load-more-btn:disabled { background: #ccc; cursor: not-allowed; }

/* ---- RESPONSIVE ---- */
@media (min-width: 600px) {
  .posts-grid { grid-template-columns: 1fr 1fr; }
  .related-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero-post-img { height: 280px; }
}

@media (min-width: 900px) {
  .main-nav { display: flex; gap: 4px; }
  .main-layout { grid-template-columns: 1fr 320px; }
  .posts-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .hero-post { display: grid; grid-template-columns: 1fr 1fr; }
  .hero-post-img { height: 100%; min-height: 260px; }
  .hero-post-body { padding: 28px; display: flex; flex-direction: column; justify-content: center; }
}

@media (max-width: 599px) {
  .search-input { width: 130px; }
  .search-input:focus { width: 150px; }
  .related-grid { grid-template-columns: 1fr; }
}

/* ---- UTILITIES ---- */
.mt-20 { margin-top: 20px; }
.text-center { text-align: center; }
.text-red { color: var(--primary); }
.fw-bold { font-weight: 700; }
.hidden { display: none; }
