/* ================================================================
   TopFollow — Blog Post Styles (blog-post.css)
   Standalone stylesheet for all single blog post pages.
   ================================================================ */

/* ── Variables ───────────────────────────────────────────────── */
:root {
  --bp-bg:           #0d0e1a;
  --bp-surface:      #111221;
  --bp-card:         #171828;
  --bp-border:       rgba(255,255,255,0.08);
  --bp-border-hover: rgba(99,102,241,0.35);
  --bp-text:         #eaeaf2;
  --bp-muted:        #9b9bac;
  --bp-primary:      #6366f1;
  --bp-primary-h:    #818cf8;
  --bp-accent:       #a855f7;
  --bp-success:      #22c55e;
  --bp-radius:       12px;
  --bp-radius-lg:    18px;
  --bp-max-w:        740px;
  --bp-font:         'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── Reset helpers for blog pages ───────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

/* ── Page wrapper: push content below fixed nav ─────────────── */
.bp-page {
  background: var(--bp-bg);
  min-height: 100vh;
}

/* ── Hero / Header ───────────────────────────────────────────── */
.bp-hero {
  padding: 7rem 1.5rem 3rem;
  text-align: center;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(99,102,241,0.12), transparent),
    radial-gradient(ellipse 40% 30% at 80% 20%, rgba(168,85,247,0.08), transparent);
  border-bottom: 1px solid var(--bp-border);
}

.bp-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--bp-primary);
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  text-decoration: none;
  transition: color 0.2s;
}
.bp-back:hover { color: var(--bp-primary-h); text-decoration: underline; }

.bp-hero-inner {
  max-width: 820px;
  margin: 0 auto;
}

.bp-hero h1 {
  font-family: var(--bp-font);
  font-size: clamp(1.65rem, 3.5vw, 2.4rem);
  font-weight: 800;
  line-height: 1.22;
  color: var(--bp-text);
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

.bp-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
  color: var(--bp-muted);
  font-size: 0.88rem;
}
.bp-meta .bp-tag {
  background: rgba(99,102,241,0.15);
  color: var(--bp-primary-h);
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 20px;
  padding: 0.2rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Main layout: article + optional sidebar ─────────────────── */
.bp-layout {
  max-width: 1120px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 3rem;
  align-items: start;
}

@media (max-width: 900px) {
  .bp-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2rem 1.25rem 4rem;
  }
}
@media (max-width: 480px) {
  .bp-layout { padding: 1.5rem 1rem 3rem; }
}

/* ── Article body ────────────────────────────────────────────── */
.bp-article {
  background: var(--bp-surface);
  border: 1px solid var(--bp-border);
  border-radius: var(--bp-radius-lg);
  padding: 2.5rem 2.25rem;
  min-width: 0; /* prevent grid blowout */
}

@media (max-width: 600px) {
  .bp-article { padding: 1.5rem 1.25rem; border-radius: var(--bp-radius); }
}

/* Typography inside article */
.bp-article p {
  font-family: var(--bp-font);
  font-size: 1.025rem;
  line-height: 1.82;
  color: var(--bp-muted);
  margin: 0 0 1.35rem;
}

.bp-article h2 {
  font-family: var(--bp-font);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--bp-text);
  margin: 2.75rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(99,102,241,0.25);
}
.bp-article h2:first-of-type { margin-top: 1.5rem; }

.bp-article h3 {
  font-family: var(--bp-font);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--bp-text);
  margin: 2rem 0 0.6rem;
}

.bp-article a {
  color: var(--bp-primary);
  font-weight: 500;
  text-decoration: none;
}
.bp-article a:hover {
  color: var(--bp-primary-h);
  text-decoration: underline;
}

.bp-article ul,
.bp-article ol {
  color: var(--bp-muted);
  margin: 0.5rem 0 1.5rem 1.5rem;
  line-height: 1.8;
}
.bp-article li { margin-bottom: 0.45rem; }

.bp-article img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--bp-radius);
  border: 1px solid var(--bp-border);
  margin: 2rem 0 0.5rem;
}

.bp-img-caption {
  text-align: center;
  font-size: 0.82rem;
  color: var(--bp-muted);
  margin-bottom: 2rem;
  font-style: italic;
}

.bp-article blockquote {
  margin: 1.75rem 0;
  padding: 1rem 1.5rem;
  border-left: 3px solid var(--bp-primary);
  background: rgba(99,102,241,0.06);
  border-radius: 0 var(--bp-radius) var(--bp-radius) 0;
  color: var(--bp-muted);
  font-style: italic;
  font-size: 0.98rem;
  line-height: 1.75;
}

.bp-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.75rem 0;
  font-size: 0.92rem;
  overflow-x: auto;
  display: block;
}
.bp-article th,
.bp-article td {
  padding: 0.7rem 1rem;
  border: 1px solid var(--bp-border);
  text-align: left;
  color: var(--bp-muted);
  white-space: nowrap;
}
.bp-article th {
  background: var(--bp-card);
  color: var(--bp-text);
  font-weight: 600;
}
@media (max-width: 600px) {
  .bp-article th, .bp-article td { white-space: normal; }
}

/* ── TOC inside article (top of content) ─────────────────────── */
.bp-toc-inline {
  background: var(--bp-card);
  border: 1px solid var(--bp-border);
  border-left: 3px solid var(--bp-primary);
  border-radius: var(--bp-radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2.5rem;
}
.bp-toc-inline .bp-toc-title {
  font-family: var(--bp-font);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--bp-primary-h);
  margin: 0 0 0.9rem;
}
.bp-toc-inline ol {
  margin: 0;
  padding-left: 1.25rem;
  counter-reset: none;
}
.bp-toc-inline li {
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
  color: var(--bp-muted);
}
.bp-toc-inline a {
  color: var(--bp-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.bp-toc-inline a:hover { color: var(--bp-primary-h); text-decoration: underline; }

/* ── Sidebar ─────────────────────────────────────────────────── */
.bp-sidebar {
  position: sticky;
  top: 88px;
}

.bp-sidebar-card {
  background: var(--bp-card);
  border: 1px solid var(--bp-border);
  border-radius: var(--bp-radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.bp-sidebar-card h4 {
  font-family: var(--bp-font);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--bp-primary-h);
  margin: 0 0 1rem;
}

/* Sidebar TOC */
.bp-sidebar-toc ol {
  list-style: decimal;
  margin: 0;
  padding-left: 1.2rem;
}
.bp-sidebar-toc li {
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
  color: var(--bp-muted);
  line-height: 1.5;
}
.bp-sidebar-toc a {
  color: var(--bp-muted);
  text-decoration: none;
}
.bp-sidebar-toc a:hover {
  color: var(--bp-primary-h);
  text-decoration: underline;
}

/* Sidebar CTA */
.bp-sidebar-cta {
  background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(168,85,247,0.1));
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: var(--bp-radius-lg);
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1.25rem;
}
.bp-sidebar-cta p {
  font-family: var(--bp-font);
  font-size: 0.9rem;
  color: var(--bp-muted);
  margin: 0 0 1rem;
  line-height: 1.5;
}
.bp-sidebar-cta a.bp-cta-btn {
  display: inline-block;
  background: var(--bp-primary);
  color: #fff;
  font-family: var(--bp-font);
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.65rem 1.25rem;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s;
}
.bp-sidebar-cta a.bp-cta-btn:hover {
  background: var(--bp-primary-h);
  transform: translateY(-1px);
}

/* Hide sidebar on mobile (TOC is inline inside article) */
@media (max-width: 900px) {
  .bp-sidebar { display: none; }
}

/* ── Divider ─────────────────────────────────────────────────── */
.bp-divider {
  border: none;
  border-top: 1px solid var(--bp-border);
  margin: 2.5rem 0;
}

/* ── "Read more" related posts strip at bottom ───────────────── */
.bp-related {
  background: var(--bp-card);
  border: 1px solid var(--bp-border);
  border-radius: var(--bp-radius-lg);
  padding: 1.5rem 1.75rem;
  margin-top: 2.5rem;
}
.bp-related h4 {
  font-family: var(--bp-font);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--bp-primary-h);
  margin: 0 0 1rem;
}
.bp-related ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.bp-related li {
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--bp-border);
  font-size: 0.9rem;
}
.bp-related li:last-child { border-bottom: none; }
.bp-related a {
  color: var(--bp-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.bp-related a:hover { color: var(--bp-primary-h); }
