/* =============================================
   Bandhan Blog — Shared Stylesheet
   https://bandhan.app/blog/
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;0,800;1,700&family=Inter:wght@400;500;600;700&display=swap');

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

/* ── Theme tokens (Light default) ── */
:root {
  --bg:            #ffffff;
  --bg-soft:       #f9fafb;
  --bg-card:       #f3f4f6;
  --text:          #111827;
  --text-body:     #1f2937;
  --text-muted:    #6b7280;
  --text-faint:    #9ca3af;
  --border:        #e5e7eb;
  --border-strong: #d1d5db;
  --link:          #4338ca;
  --link-hover:    #312e81;
  --tag-bg:        #f3f4f6;
  --tag-text:      #374151;
  --quote-border:  #d1d5db;
  --quote-bg:      #f9fafb;
  --toc-bg:        #f9fafb;
  --header-bg:     rgba(255,255,255,0.96);
  --shadow-sm:     0 1px 3px rgba(0,0,0,0.07);
  --shadow-md:     0 4px 20px rgba(0,0,0,0.08);
  --cta-bg:        #0a0a0a;
  --cta-text:      #ffffff;
}

/* ── Dark theme ── */
html[data-theme="dark"] {
  --bg:            #0c0c10;
  --bg-soft:       #141418;
  --bg-card:       #1c1c24;
  --text:          #f3f4f6;
  --text-body:     #e5e7eb;
  --text-muted:    #9ca3af;
  --text-faint:    #6b7280;
  --border:        #2d2d3a;
  --border-strong: #3d3d4e;
  --link:          #818cf8;
  --link-hover:    #a5b4fc;
  --tag-bg:        #1c1c24;
  --tag-text:      #d1d5db;
  --quote-border:  #4338ca;
  --quote-bg:      #141418;
  --toc-bg:        #141418;
  --header-bg:     rgba(12,12,16,0.96);
  --shadow-sm:     0 1px 3px rgba(0,0,0,0.35);
  --shadow-md:     0 4px 20px rgba(0,0,0,0.5);
  --cta-bg:        #C8960C;
  --cta-text:      #1a0800;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s, color 0.25s;
}

/* ── Site Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}
.site-logo__icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--cta-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.site-logo__icon span {
  font-family: Georgia, serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--cta-text);
  line-height: 1;
}
.site-logo__name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}
.header-nav a {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.header-nav a:hover, .header-nav a.active { color: var(--text); }
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.btn-header-cta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 15px;
  border-radius: 9px;
  background: var(--cta-bg);
  color: var(--cta-text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s;
}
.btn-header-cta:hover { opacity: 0.82; }
.theme-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: background 0.2s;
  flex-shrink: 0;
}
.theme-btn:hover { background: var(--bg-soft); }

/* ── Blog listing hero ── */
.blog-hero {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  padding: 64px 24px 52px;
  text-align: center;
}
.eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.blog-hero__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 800;
  color: var(--text);
  line-height: 1.15;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}
.blog-hero__desc {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 460px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ── Blog card grid ── */
.blog-grid-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 52px 24px 80px;
}
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 24px;
}
.blog-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.blog-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.blog-card__thumb {
  height: 152px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 54px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
  flex-shrink: 0;
}
.blog-card__body {
  padding: 20px 22px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.card-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.blog-card__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  flex: 1;
}
.blog-card__meta {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 4px;
}

/* ── Article layout ── */
.article-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--link); }
.breadcrumb__sep { color: var(--text-faint); font-size: 10px; }

.article-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--tag-bg);
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 16px;
}
.article-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(26px, 5vw, 40px);
  font-weight: 800;
  line-height: 1.13;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}
.article-meta {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-bottom: 32px;
}
.article-meta__dot { color: var(--text-faint); }
.article-divider {
  height: 1px;
  background: var(--border);
  margin: 0 0 36px;
}

/* ── Table of contents ── */
.toc {
  background: var(--toc-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 40px;
}
.toc__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.toc ol {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.toc li { font-size: 14px; line-height: 1.5; }
.toc a { color: var(--link); text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* ── Article body typography ── */
.article-body {
  color: var(--text-body);
  font-size: 17px;
  line-height: 1.82;
}
.article-body h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(21px, 3vw, 27px);
  font-weight: 700;
  color: var(--text);
  margin: 52px 0 16px;
  letter-spacing: -0.015em;
  line-height: 1.25;
  scroll-margin-top: 80px;
}
.article-body h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 32px 0 12px;
  scroll-margin-top: 80px;
}
.article-body p { margin-bottom: 22px; }
.article-body p:last-child { margin-bottom: 0; }
.article-body a { color: var(--link); }
.article-body a:hover { color: var(--link-hover); }
.article-body strong { font-weight: 600; color: var(--text); }
.article-body ul, .article-body ol {
  padding-left: 24px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.article-body li { line-height: 1.75; }
.article-body blockquote {
  border-left: 3px solid var(--quote-border);
  background: var(--quote-bg);
  padding: 16px 20px;
  margin: 28px 0;
  border-radius: 0 8px 8px 0;
  color: var(--text-muted);
}
.article-body blockquote p {
  margin-bottom: 0;
  font-size: 16px;
  font-style: italic;
}

/* ── Callout ── */
.callout {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--link);
  border-radius: 0 10px 10px 0;
  padding: 16px 20px;
  margin: 28px 0;
}
.callout p { margin-bottom: 0; font-size: 15px; color: var(--text-muted); }

/* ── CTA box ── */
.cta-box {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 32px;
  margin: 52px 0;
  text-align: center;
}
.cta-box__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}
.cta-box__desc {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 22px;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.65;
}
.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 12px;
  background: var(--cta-bg);
  color: var(--cta-text);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s;
}
.btn-cta:hover { opacity: 0.84; }

/* ── FAQ ── */
.faq-section { margin-top: 52px; }
.faq-section__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 24px;
}
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
}
.faq-item:last-child { border-bottom: none; }
.faq-q {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.faq-a {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ── Related posts ── */
.related-section { margin-top: 52px; }
.related-section__title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 18px;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.related-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}
.related-card:hover { border-color: var(--border-strong); background: var(--bg-card); }
.related-card__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 5px;
}
.related-card__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 28px 24px;
}
.site-footer__inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-copy { font-size: 13px; color: var(--text-faint); }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { font-size: 13px; color: var(--text-muted); text-decoration: none; }
.footer-links a:hover { color: var(--link); }

/* ── Responsive ── */
@media (max-width: 640px) {
  .site-header__inner { padding: 0 16px; height: 52px; }
  .header-nav { display: none; }
  .site-logo__name { display: none; }
  .article-wrap { padding: 28px 16px 60px; }
  .blog-grid-wrap { padding: 32px 16px 60px; }
  .blog-hero { padding: 44px 16px 36px; }
  .cta-box { padding: 26px 18px; }
  .toc { padding: 16px 18px; }
  .site-footer__inner { flex-direction: column; align-items: flex-start; }
}
