/* ============================================================
   Amar Matka Blog — Frontend Styles
   Inspired by Infina Finance blog design
   ============================================================ */

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand:       #6739B7;
  --brand-dark:  #4e2b8e;
  --brand-light: #f3eeff;
  --gold:        #FFB80C;
  --text-main:   #1a1a2e;
  --text-body:   #4a4a6a;
  --text-muted:  #8888aa;
  --bg-page:     #f8f7fc;
  --bg-white:    #ffffff;
  --border:      #e8e4f0;
  --radius-sm:   8px;
  --radius-md:   14px;
  --radius-lg:   20px;
  --shadow-sm:   0 2px 8px rgba(103,57,183,.08);
  --shadow-md:   0 6px 24px rgba(103,57,183,.13);
  --shadow-lg:   0 12px 48px rgba(103,57,183,.18);
  --font:        'Segoe UI', system-ui, -apple-system, sans-serif;
  --max-w:       1160px;
}

html { scroll-behavior: smooth; }

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

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

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

/* ── Container ── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Site Header ── */
.site-header {
  background: var(--brand);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,.18);
}
.site-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  max-width: var(--max-w);
  margin: 0 auto;
  height: 64px;
}
.site-logo {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.5px;
}
.site-logo span { color: var(--gold); }
.site-nav { display: flex; gap: 6px; align-items: center; }
.site-nav a {
  color: rgba(255,255,255,.85);
  font-size: 14px;
  font-weight: 500;
  padding: 7px 15px;
  border-radius: var(--radius-sm);
  transition: background .2s, color .2s;
}
.site-nav a:hover { background: rgba(255,255,255,.15); color: #fff; }
.site-nav a.active { background: rgba(255,255,255,.2); color: #fff; }
.nav-btn {
  background: var(--gold) !important;
  color: var(--text-main) !important;
  font-weight: 700 !important;
  border-radius: var(--radius-sm) !important;
}
.nav-btn:hover { background: #e5a500 !important; }

/* ── Hero Banner (Blog Listing) ── */
.blog-hero {
  background: linear-gradient(135deg, var(--brand) 0%, #3b1f8c 100%);
  padding: 64px 24px 72px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.blog-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.blog-hero .container { position: relative; }
.blog-hero-tag {
  display: inline-block;
  background: rgba(255,184,12,.2);
  color: var(--gold);
  border: 1px solid rgba(255,184,12,.4);
  border-radius: 20px;
  padding: 4px 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.blog-hero h1 {
  font-size: clamp(26px, 4vw, 42px);
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 14px;
}
.blog-hero p {
  font-size: 16px;
  color: rgba(255,255,255,.8);
  max-width: 540px;
  margin: 0 auto;
}

/* ── Search Bar ── */
.search-bar {
  max-width: 520px;
  margin: -28px auto 0;
  position: relative;
  z-index: 10;
}
.search-bar input {
  width: 100%;
  padding: 16px 56px 16px 20px;
  border-radius: var(--radius-lg);
  border: none;
  font-size: 14px;
  font-family: var(--font);
  box-shadow: var(--shadow-lg);
  outline: none;
  color: var(--text-main);
}
.search-bar button {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--brand);
  border: none;
  border-radius: var(--radius-md);
  padding: 9px 16px;
  cursor: pointer;
  color: #fff;
}
.search-bar button svg { width: 18px; height: 18px; stroke: #fff; fill: none; }

/* ── Section Layout ── */
.blog-section { padding: 56px 0 72px; }
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 16px;
  flex-wrap: wrap;
}
.section-header h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
}
.section-header h2 span { color: var(--brand); }
.section-header a {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  white-space: nowrap;
}

/* ── Blog Cards Grid ── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}

/* Featured card (first) takes full width row */
.blog-grid .card-featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 0;
  border-radius: var(--radius-lg);
}
.blog-grid .card-featured .blog-card-img {
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  height: 340px;
}
.blog-grid .card-featured .blog-card-body {
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.blog-grid .card-featured .blog-card-title {
  font-size: 22px;
}

/* ── Blog Card ── */
.blog-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: transform .22s ease, box-shadow .22s ease;
  display: flex;
  flex-direction: column;
}
.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}
.blog-card-img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  background: var(--brand-light);
  flex-shrink: 0;
}
.blog-card-img-placeholder {
  width: 100%;
  height: 210px;
  background: linear-gradient(135deg, var(--brand-light) 0%, #e8d5ff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 48px;
}
.blog-card-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.blog-card-cat {
  background: var(--brand-light);
  color: var(--brand);
  border-radius: 20px;
  padding: 3px 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.blog-card-date {
  font-size: 12px;
  color: var(--text-muted);
}
.blog-card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
  margin-bottom: 10px;
  transition: color .2s;
}
.blog-card:hover .blog-card-title { color: var(--brand); }
.blog-card-excerpt {
  font-size: 13px;
  color: var(--text-body);
  line-height: 1.65;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.read-more {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: gap .2s;
}
.read-more:hover { gap: 8px; }
.read-more svg { width: 14px; height: 14px; stroke: currentColor; fill: none; }
.read-time {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Category Filter Chips ── */
.cat-filter {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.cat-chip {
  padding: 6px 18px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-body);
  cursor: pointer;
  transition: .18s;
  background: var(--bg-white);
}
.cat-chip:hover, .cat-chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* ── Pagination ── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 48px;
  flex-wrap: wrap;
}
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-body);
  background: var(--bg-white);
  transition: .18s;
}
.pagination a:hover { background: var(--brand-light); border-color: var(--brand); color: var(--brand); }
.pagination .active { background: var(--brand); border-color: var(--brand); color: #fff; }
.pagination .dots { border: none; background: none; }

/* ── Blog Detail Page ── */
.detail-hero {
  background: linear-gradient(135deg, var(--brand) 0%, #3b1f8c 100%);
  padding: 52px 24px 80px;
  color: #fff;
  text-align: center;
}
.detail-hero .breadcrumb {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255,255,255,.7);
  margin-bottom: 20px;
}
.detail-hero .breadcrumb a { color: rgba(255,255,255,.8); }
.detail-hero .breadcrumb a:hover { color: #fff; }
.detail-hero .breadcrumb span { color: rgba(255,255,255,.4); }
.detail-hero .cat-badge {
  display: inline-block;
  background: rgba(255,184,12,.2);
  color: var(--gold);
  border: 1px solid rgba(255,184,12,.4);
  border-radius: 20px;
  padding: 4px 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.detail-hero h1 {
  font-size: clamp(22px, 3.5vw, 38px);
  font-weight: 800;
  line-height: 1.25;
  max-width: 780px;
  margin: 0 auto 18px;
}
.detail-hero .post-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  font-size: 13px;
  color: rgba(255,255,255,.75);
  flex-wrap: wrap;
}
.detail-hero .post-meta span { display: flex; align-items: center; gap: 5px; }
.detail-hero .post-meta svg { width: 14px; height: 14px; stroke: currentColor; fill: none; opacity: .7; }

/* ── Article Layout ── */
.article-wrap {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 36px;
  max-width: var(--max-w);
  margin: -40px auto 0;
  padding: 0 24px 72px;
  align-items: start;
}

.article-main {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}
.article-featured-img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}
.article-body {
  padding: 40px 48px;
}

/* Article content typography */
.article-body h1, .article-body h2, .article-body h3, .article-body h4 {
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.35;
  margin: 30px 0 14px;
}
.article-body h2 { font-size: 22px; }
.article-body h3 { font-size: 18px; }
.article-body h4 { font-size: 16px; }
.article-body p { margin-bottom: 18px; color: var(--text-body); }
.article-body ul, .article-body ol {
  padding-left: 22px;
  margin-bottom: 18px;
}
.article-body li { margin-bottom: 8px; }
.article-body blockquote {
  border-left: 4px solid var(--brand);
  background: var(--brand-light);
  padding: 16px 20px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 24px 0;
  font-style: italic;
  color: var(--text-body);
}
.article-body hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 32px 0;
}
.article-body img {
  border-radius: var(--radius-md);
  margin: 20px auto;
  box-shadow: var(--shadow-sm);
}
.article-body a { color: var(--brand); font-weight: 500; }
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
}
.article-body th, .article-body td {
  padding: 10px 14px;
  text-align: left;
  border: 1px solid var(--border);
}
.article-body th { background: var(--brand-light); color: var(--brand); font-weight: 700; }
.article-body tr:nth-child(even) td { background: #fafafa; }

/* Article Tags */
.article-tags {
  padding: 22px 40px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.article-tags .lbl { font-size: 13px; font-weight: 700; color: var(--text-muted); }
.tag-chip {
  background: var(--brand-light);
  color: var(--brand);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 600;
}

/* ── Sidebar ── */
.article-sidebar { display: flex; flex-direction: column; gap: 24px; }
.sidebar-widget {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.widget-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  background: var(--brand-light);
}
.widget-body { padding: 18px 20px; }
.recent-post-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.recent-post-item:last-child { border-bottom: none; padding-bottom: 0; }
.recent-thumb {
  width: 60px;
  height: 50px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  background: var(--brand-light);
}
.recent-post-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.recent-post-date { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

/* ── Share Bar ── */
.share-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 20px 40px;
  border-top: 1px solid var(--border);
  background: #fafafa;
}
.share-bar .lbl { font-size: 13px; font-weight: 700; color: var(--text-muted); }
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: .18s;
  text-decoration: none;
}
.share-btn:hover { opacity: .85; }
.share-wa  { background: #25D366; color: #fff; }
.share-tw  { background: #1da1f2; color: #fff; }
.share-fb  { background: #1877f2; color: #fff; }
.share-copy { background: var(--brand-light); color: var(--brand); }

/* ── Related Posts ── */
.related-section {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  margin: 0 24px 60px;
  max-width: var(--max-w);
  margin-left: auto;
  margin-right: auto;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.related-section h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 24px;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

/* ── Site Footer ── */
.site-footer {
  background: var(--text-main);
  color: rgba(255,255,255,.7);
  padding: 40px 24px 28px;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-brand {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}
.footer-brand span { color: var(--gold); }
.footer-brand p { font-size: 12px; color: rgba(255,255,255,.5); font-weight: 400; margin-top: 3px; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { font-size: 13px; color: rgba(255,255,255,.6); transition: color .2s; }
.footer-links a:hover { color: #fff; }
.footer-copy {
  text-align: center;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: 12px;
  color: rgba(255,255,255,.35);
  max-width: var(--max-w);
  margin-left: auto;
  margin-right: auto;
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}
.empty-state svg { width: 60px; height: 60px; stroke: var(--text-muted); fill: none; margin: 0 auto 16px; }
.empty-state h3 { font-size: 18px; color: var(--text-main); margin-bottom: 8px; }
.empty-state p { font-size: 14px; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .article-wrap { grid-template-columns: 1fr; }
  .article-sidebar { display: none; }
  .blog-grid .card-featured {
    grid-column: 1;
    grid-template-columns: 1fr;
  }
  .blog-grid .card-featured .blog-card-img { border-radius: var(--radius-lg) var(--radius-lg) 0 0; height: 220px; }
  .blog-grid .card-featured .blog-card-body { padding: 24px; }
  .related-section { margin: 0 0 40px; }
}
@media (max-width: 600px) {
  .article-body { padding: 24px 20px; }
  .article-tags, .share-bar { padding: 16px 20px; }
  .blog-hero { padding: 44px 20px 60px; }
  .site-nav a:not(.nav-btn) { display: none; }
  .blog-grid { grid-template-columns: 1fr; }
}
