/*
Theme Name: Samachar
Theme URI: https://samachar.com
Author: Samachar Team
Description: A modern Hindi news portal WordPress theme with section management and trending logic.
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: samachar
Tags: news, hindi, portal, magazine
*/

/* ===== CSS VARIABLES ===== */
:root {
  --primary: #1a1a2e;
  --accent: #e63946;
  --accent2: #f4a261;
  --bg: #ffffff;
  --surface: #ffffff;
  --border: #e8e4dc;
  --text-main: #1a1a1a;
  --text-muted: #6b6b6b;
  --text-light: #999;
  --font-head: 'Playfair Display', Georgia, serif;
  --font-body: 'Noto Sans', 'Noto Sans Devanagari', sans-serif;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 32px rgba(0,0,0,0.15);
  --radius: 4px;
  --nav-h: 64px;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: #ffffff;
  color: var(--text-main);
  line-height: 1.6;
  font-size: 15px;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.3; }

/* ===== LAYOUT ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

/* ===== NAVBAR ===== */
#site-header {
  background: var(--primary);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.header-inner {
  display: flex;
  align-items: center;
  height: var(--nav-h);
  gap: 32px;
}
.site-logo {
  font-family: var(--font-head);
  font-size: 28px;
  color: #fff;
  font-weight: 900;
  letter-spacing: -1px;
  flex-shrink: 0;
}
.site-logo span { color: var(--accent); }
.site-nav { flex: 1; }
.site-nav ul { display: flex; gap: 4px; }
.site-nav a {
  color: rgba(255,255,255,0.8);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.2s;
}
.site-nav a:hover { color: #fff; background: rgba(255,255,255,0.1); }

/* ===== SECTION HEADING ===== */
.section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.section-heading h2 {
  font-size: 22px;
  color: var(--primary);
  font-weight: 800;
}
.section-heading .dash {
  width: 32px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

/* ===== TRENDING SECTION ===== */
.trending-section {
  padding: 36px 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.trending-section .section-heading {
  justify-content: center;
}
.trending-section .section-heading h2 { font-size: 26px; }
.trending-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.trending-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
  cursor: pointer;
}
.trending-item:hover { background: #f9f9f9; }
.trending-item:nth-child(odd) { border-right: 1px solid var(--border); }
.trending-thumb {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius);
  flex-shrink: 0;
  background: #ddd;
}
.trending-info { flex: 1; }
.trending-info h4 {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-main);
  margin-bottom: 4px;
}
.trending-info h4:hover { color: var(--accent); }
.trending-meta { font-size: 11px; color: var(--text-light); }
.trending-rank {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: #fff0f0;
  padding: 2px 6px;
  border-radius: 10px;
  flex-shrink: 0;
}

/* ===== NEWS SECTION (CATEGORY) ===== */
.news-section { padding: 36px 0; }
.news-section + .news-section { padding-top: 0; }
.news-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  transition: all 0.2s;
}
.news-card:last-child { border-bottom: none; }
.news-card:hover .news-card-thumb { transform: scale(1.03); }
.news-card-thumb {
  width: 90px;
  height: 68px;
  object-fit: cover;
  border-radius: var(--radius);
  flex-shrink: 0;
  background: #e0e0e0;
  transition: transform 0.3s;
}
.news-card-info { flex: 1; }
.news-card-info h3 {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-main);
  margin-bottom: 4px;
}
.news-card-info h3:hover { color: var(--accent); }
.news-card-meta { font-size: 11px; color: var(--text-light); }

/* ===== MAIN CONTENT AREA ===== */
.site-main { padding: 40px 0; }
.content-sidebar { display: grid; grid-template-columns: 1fr 320px; gap: 40px; }

/* ===== SIDEBAR ===== */
.sidebar-widget {
  background: var(--surface);
  border: none;
  border-radius: 0;
  padding: 0 0 20px 0;
  margin-bottom: 24px;
}
.sidebar-widget h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
}
.sidebar-news-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.sidebar-news-item:last-child { border-bottom: none; }
.sidebar-news-thumb {
  width: 60px;
  height: 46px;
  object-fit: cover;
  border-radius: var(--radius);
  flex-shrink: 0;
  background: #ddd;
}
.sidebar-news-title { font-size: 12.5px; font-weight: 600; line-height: 1.4; }
.sidebar-news-title:hover { color: var(--accent); }

/* ===== SINGLE POST PAGE ===== */
.single-post-wrap { max-width: 820px; }
.post-category-tag {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 2px;
  margin-bottom: 14px;
}
.post-title {
  font-size: 34px;
  line-height: 1.25;
  color: var(--primary);
  margin-bottom: 16px;
  font-weight: 900;
}
.post-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.post-meta-item { display: flex; align-items: center; gap: 5px; }
.post-featured-image {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
}
.post-content {
  font-size: 16px;
  line-height: 1.85;
  color: #2a2a2a;
  margin-bottom: 32px;
}
.post-content p { margin-bottom: 18px; }
.post-content h2, .post-content h3 { margin: 28px 0 12px; color: var(--primary); }
.post-content blockquote {
  border-left: 4px solid var(--accent);
  padding: 12px 20px;
  background: #fff5f5;
  margin: 20px 0;
  font-style: italic;
  color: var(--text-muted);
}

/* ===== SHARE BUTTONS ===== */
.share-section {
  background: #f9f9f9;
  border: none;
  border-radius: 6px;
  padding: 20px 24px;
  margin-bottom: 28px;
}
.share-section h4 { font-size: 14px; font-weight: 700; color: var(--text-muted); margin-bottom: 14px; text-transform: uppercase; letter-spacing: 1px; }
.share-buttons { display: flex; gap: 12px; flex-wrap: wrap; }
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.share-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.share-btn.whatsapp { background: #25D366; color: #fff; }
.share-btn.facebook { background: #1877F2; color: #fff; }
.share-btn.twitter { background: #000; color: #fff; }
.share-btn.copy-link { background: var(--bg); color: var(--text-main); border: 1px solid var(--border); }

/* ===== TAGS ===== */
.post-tags {
  margin-bottom: 32px;
}
.post-tags h4 { font-size: 13px; font-weight: 700; color: var(--text-muted); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 1px; }
.tags-wrap { display: flex; gap: 8px; flex-wrap: wrap; }
.tag-badge {
  display: inline-block;
  background: #f0ede8;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  transition: all 0.2s;
}
.tag-badge:hover { background: var(--accent); color: #fff; }

/* ===== COMMENTS ===== */
.comments-section {
  background: var(--surface);
  border: none;
  border-radius: 0;
  padding: 28px;
  margin-bottom: 40px;
}
.comments-section h3 { font-size: 20px; margin-bottom: 24px; color: var(--primary); }
.comment-item {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.comment-item:last-of-type { border-bottom: none; }
.comment-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}
.comment-body { flex: 1; }
.comment-author { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.comment-date { font-size: 11px; color: var(--text-light); margin-bottom: 6px; }
.comment-text { font-size: 14px; color: var(--text-muted); line-height: 1.6; }
.comment-form { margin-top: 24px; }
.comment-form h4 { font-size: 16px; margin-bottom: 16px; }
.comment-form input,
.comment-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 14px;
  background: var(--bg);
  margin-bottom: 12px;
  outline: none;
  transition: border-color 0.2s;
}
.comment-form input:focus,
.comment-form textarea:focus { border-color: var(--accent); }
.comment-form textarea { min-height: 100px; resize: vertical; }
.comment-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn-submit {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 28px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-submit:hover { background: #c1121f; transform: translateY(-1px); }

/* ===== FOOTER ===== */
#site-footer {
  background: var(--primary);
  color: rgba(255,255,255,0.6);
  padding: 8px 0;
}
.footer-bottom { display: flex; justify-content: center; font-size: 12px; text-align: center; line-height: 1; }

/* ===== ADMIN NOTICE (non-WP) ===== */
.admin-bar-notice { display: none; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .site-nav { display: none; }
  .trending-grid { grid-template-columns: 1fr; }
  .trending-item:nth-child(odd) { border-right: none; }
  .content-sidebar { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .post-title { font-size: 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .comment-form .form-row { grid-template-columns: 1fr; }
}

/* ===== AD BLOCKS ===== */
.top-ad-block {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    text-align: center;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.top-ad-block .container { display: flex; justify-content: center; align-items: center; }
.top-ad-block img { max-width: 100%; height: auto; }

.sidebar-ad-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 24px;
    text-align: center;
}
.single-post-ad {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 28px;
    text-align: center;
}

/* ===== SHORTCODE GRID ===== */
.samachar-shortcode-grid .news-card { border-bottom: none !important; }
