/* ============================================================
   KRIOSA — BLOG.CSS
   Extends the same token system as documentation.css.
   Import documentation.css BEFORE this file on every blog page.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* ── TOKENS (mirrors home.css) ──────────────────────────────── */
:root {
  --ink:        #080c0a;
  --surface-1:  #0d1117;
  --surface-2:  #111a14;
  --surface-3:  #161e18;
  --rim:        #1e2d22;
  --green:      #23c65a;
  --green-dim:  #1a8f3f;
  --green-glow: rgba(35,198,90,.18);
  --green-faint:rgba(35,198,90,.06);
  --text-hi:    #eef4ef;
  --text-mid:   #9db89f;
  --text-lo:    #516354;
  --border:     rgba(35,198,90,.12);
  --border-hi:  rgba(35,198,90,.28);
  --mono: 'Fira Code', 'Courier New', monospace;
  --sans: 'Inter', system-ui, sans-serif;
  --max: 1280px;
  --sidebar-w: 260px;
  --r: 10px;
}

/* ── RESET ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--ink);
  color: var(--text-hi);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  padding-top: 70px; /* header height */
}
/* ── BLOG SHELL ─────────────────────────────────────────────── */
.blog-shell { max-width: var(--max); margin: 0 auto; padding: 48px 24px 80px; }

.blog-header { text-align: center; margin-bottom: 48px; }
.blog-eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(35,198,90,.1);
  border: 1px solid var(--border-hi);
  padding: 5px 15px; border-radius: 40px;
  font-family: var(--mono); font-size: .78rem; color: var(--green);
  letter-spacing: .5px; margin-bottom: 16px;
}
.blog-title { font-family: var(--mono); font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; color: var(--text-hi); margin-bottom: 12px; }
.blog-subtitle { color: var(--text-mid); max-width: 620px; margin: 0 auto; font-size: 1rem; line-height: 1.7; }

/* ── CATEGORY FILTER BAR ────────────────────────────────────── */
.category-bar { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 32px 0 44px; }
.category-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px; border-radius: 40px;
  border: 1px solid var(--border-hi);
  font-family: var(--mono); font-size: .8rem; color: var(--text-mid);
  text-decoration: none; transition: all .15s;
}
.category-chip:hover { color: var(--green); border-color: var(--green); text-decoration: none; }
.category-chip.active { background: var(--green); border-color: var(--green); color: var(--ink); font-weight: 700; }

/* ── POST GRID / CARDS ──────────────────────────────────────── */
.post-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 22px; }

.post-card {
  display: flex; flex-direction: column;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.post-card:hover { border-color: var(--border-hi); transform: translateY(-3px); box-shadow: 0 12px 30px -10px rgba(35,198,90,.15); text-decoration: none; }

.post-card-cover { aspect-ratio: 16/9; background: var(--surface-3); overflow: hidden; }
.post-card-cover img { width: 100%; height: 100%; object-fit: cover; }

.post-card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.post-card-cat {
  display: inline-flex; align-self: flex-start; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: .68rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--green); margin-bottom: 10px;
}
.post-card-cat::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.post-card h3 { font-size: 1.08rem; font-weight: 700; color: var(--text-hi); line-height: 1.4; margin-bottom: 10px; }
.post-card p { color: var(--text-mid); font-size: .88rem; line-height: 1.65; margin-bottom: 16px; flex: 1; }
.post-card-meta { display: flex; align-items: center; gap: 10px; font-size: .76rem; color: var(--text-lo); font-family: var(--mono); }
.post-card-meta span::after { content: '•'; margin-left: 10px; color: var(--rim); }
.post-card-meta span:last-child::after { content: none; }

.post-card.featured { grid-column: span 2; }
.post-card.featured .post-card-cover { aspect-ratio: 21/9; }
@media (max-width: 760px) { .post-card.featured { grid-column: span 1; } }

/* ── ARTICLE LAYOUT ─────────────────────────────────────────── */
.article-shell { max-width: 760px; margin: 0 auto; padding: 40px 24px 80px; }

.breadcrumbs { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--text-lo); margin-bottom: 28px; font-family: var(--mono); flex-wrap: wrap; }
.breadcrumbs a { color: var(--text-mid); }
.breadcrumbs a:hover { color: var(--green); }

.article-cat {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px; color: var(--green);
  margin-bottom: 16px;
}
.article-title { font-family: var(--mono); font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 700; color: var(--text-hi); line-height: 1.3; margin-bottom: 18px; }
.article-excerpt { font-size: 1.05rem; color: var(--text-mid); line-height: 1.75; margin-bottom: 24px; }

.article-meta {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 16px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  margin-bottom: 32px; font-size: .85rem; color: var(--text-mid);
}
.article-author-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--surface-3); border: 1px solid var(--border-hi); object-fit: cover; }
.article-meta strong { color: var(--text-hi); }
.article-meta .dot { color: var(--rim); }

.article-cover { border-radius: 14px; overflow: hidden; border: 1px solid var(--border); margin-bottom: 36px; aspect-ratio: 16/9; background: var(--surface-2); }
.article-cover img { width: 100%; height: 100%; object-fit: cover; }

/* ── AI SUMMARY / TL;DR BOX ─────────────────────────────────── */
.ai-summary-box {
  display: flex; gap: 14px;
  background: rgba(35,198,90,.05);
  border: 1px solid var(--border-hi);
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 32px;
}
.ai-summary-box .icon {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: 8px;
  background: rgba(35,198,90,.12); color: var(--green);
  display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.ai-summary-box h2 { font-family: var(--mono); font-size: .78rem; text-transform: uppercase; letter-spacing: 1px; color: var(--green); margin-bottom: 6px; }
.ai-summary-box p { color: var(--text-hi); font-size: .92rem; line-height: 1.7; }

/* ── KEY TAKEAWAYS ──────────────────────────────────────────── */
.takeaways-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 22px 24px; margin-bottom: 32px; }
.takeaways-box h2 { font-family: var(--mono); font-size: .85rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-hi); margin-bottom: 14px; }
.takeaways-list { list-style: none; }
.takeaways-list li { display: flex; gap: 10px; padding: 8px 0; font-size: .92rem; color: var(--text-mid); line-height: 1.6; border-bottom: 1px solid rgba(35,198,90,.06); }
.takeaways-list li:last-child { border-bottom: none; }
.takeaways-list li i { color: var(--green); margin-top: 3px; flex-shrink: 0; }

/* ── ARTICLE BODY TYPOGRAPHY ─────────────────────────────────── */
.article-body { font-size: 1.02rem; color: var(--text-hi); line-height: 1.85; }
.article-body h2 { font-family: var(--mono); font-size: 1.35rem; font-weight: 700; margin: 40px 0 16px; padding-top: 8px; }
.article-body h3 { font-family: var(--mono); font-size: 1.1rem; font-weight: 700; margin: 28px 0 12px; }
.article-body p { margin-bottom: 18px; color: var(--text-mid); }
.article-body ul, .article-body ol { margin: 0 0 18px 22px; color: var(--text-mid); }
.article-body li { margin-bottom: 8px; line-height: 1.75; }
.article-body strong { color: var(--text-hi); }
.article-body pre { background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; padding: 20px; overflow-x: auto; margin: 20px 0; font-family: var(--mono); font-size: .85rem; line-height: 1.65; }
.article-body pre code { background: none; border: none; padding: 0; color: var(--text-hi); }
.article-body a { color: var(--green); }

/* ── CITATIONS ──────────────────────────────────────────────── */
.citations-box { margin: 36px 0; padding: 20px 22px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }
.citations-box h2 { font-family: var(--mono); font-size: .78rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-lo); margin-bottom: 12px; }
.citations-list { list-style: none; counter-reset: cite; }
.citations-list li { counter-increment: cite; padding: 6px 0; font-size: .85rem; }
.citations-list li::before { content: '[' counter(cite) '] '; color: var(--green); font-family: var(--mono); }
.citations-list a { color: var(--text-mid); word-break: break-word; }
.citations-list a:hover { color: var(--green); }

/* ── FAQ (reuses documentation.css faq-item) ───────────────── */
.article-faq-section { margin: 36px 0; }
.article-faq-section > h2 { font-family: var(--mono); font-size: 1.2rem; margin-bottom: 16px; color: var(--text-hi); }

/* ── TAGS ───────────────────────────────────────────────────── */
.article-tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 32px 0; }
.article-tag { font-family: var(--mono); font-size: .76rem; color: var(--text-mid); background: var(--surface-2); border: 1px solid var(--border); padding: 5px 12px; border-radius: 40px; text-decoration: none; }
.article-tag:hover { color: var(--green); border-color: var(--border-hi); text-decoration: none; }

/* ── AUTHOR CARD ────────────────────────────────────────────── */
.author-card { display: flex; gap: 16px; align-items: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 20px 22px; margin: 36px 0; }
.author-card img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border-hi); flex-shrink: 0; }
.author-card h3 { font-family: var(--mono); font-size: .95rem; color: var(--text-hi); margin-bottom: 2px; }
.author-card .role { font-size: .78rem; color: var(--green); margin-bottom: 6px; }
.author-card p { font-size: .85rem; color: var(--text-mid); line-height: 1.6; }

/* ── RELATED POSTS ──────────────────────────────────────────── */
.related-section { margin-top: 56px; }
.related-section > h2 { font-family: var(--mono); font-size: 1.2rem; margin-bottom: 20px; color: var(--text-hi); }

/* ── PAGINATION ─────────────────────────────────────────────── */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 44px; }
.page-link {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 38px; padding: 0 10px;
  border: 1px solid var(--border-hi); border-radius: 6px;
  font-family: var(--mono); font-size: .85rem; color: var(--text-mid);
  text-decoration: none;
}
.page-link:hover { color: var(--green); border-color: var(--green); text-decoration: none; }
.page-link.active { background: var(--green); border-color: var(--green); color: var(--ink); font-weight: 700; }

/* ── EMPTY STATE ────────────────────────────────────────────── */
.blog-empty { text-align: center; padding: 60px 20px; color: var(--text-mid); }
.blog-empty i { font-size: 2rem; color: var(--green); margin-bottom: 14px; display: block; }

@media (max-width: 640px) {
  .blog-shell { padding: 32px 16px 60px; }
  .article-shell { padding: 28px 16px 60px; }
}
 /* ===== INTERACTION BAR ===== */
    .interaction-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 1.5rem;
      padding: 1.25rem 0;
      border-top: 1px solid #1f2a3e;
      border-bottom: 1px solid #1f2a3e;
      margin: 1.5rem 0;
    }

    .tick-section {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      flex-wrap: wrap;
    }

    .tick-btn {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.5rem 1.25rem;
      border-radius: 40px;
      border: 2px solid #1f2a3e;
      background: transparent;
      color: #94a3b8;
      font-size: 0.9rem;
      cursor: pointer;
      transition: all 0.2s ease;
      font-weight: 600;
    }

    .tick-btn:hover {
      border-color: #3b82f6;
      background: rgba(59, 130, 246, 0.05);
      color: #3b82f6;
      transform: translateY(-1px);
    }

    .tick-btn i {
      font-size: 1.2rem;
      transition: all 0.2s ease;
    }

    .tick-btn.ticked {
      border-color: #10b981;
      background: rgba(16, 185, 129, 0.1);
      color: #10b981;
    }

    .tick-btn.ticked:hover {
      background: rgba(16, 185, 129, 0.15);
    }

    .tick-count {
      background: #1f2a3e;
      padding: 0.15rem 0.6rem;
      border-radius: 20px;
      font-size: 0.75rem;
      font-weight: 700;
      color: #94a3b8;
    }

    .tick-btn.ticked .tick-count {
      background: rgba(16, 185, 129, 0.2);
      color: #10b981;
    }

    .interaction-success {
      color: #10b981;
      font-size: 0.85rem;
      font-weight: 500;
    }

    .interaction-error {
      color: #ef4444;
      font-size: 0.85rem;
      font-weight: 500;
    }

    /* Share Section */
    .share-section {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      flex-wrap: wrap;
    }

    .share-label {
      color: #94a3b8;
      font-size: 0.85rem;
      font-weight: 500;
    }

    .share-buttons {
      display: flex;
      gap: 0.4rem;
      flex-wrap: wrap;
    }

    .share-btn {
      width: 34px;
      height: 34px;
      border-radius: 50%;
      border: none;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s ease;
      text-decoration: none;
      color: white;
      font-size: 0.85rem;
    }

    .share-btn:hover {
      transform: translateY(-2px);
    }

    .share-btn.twitter {
      background: #000;
    }

    .share-btn.linkedin {
      background: #0a66c2;
    }

    .share-btn.facebook {
      background: #1877f2;
    }

    .share-btn.whatsapp {
      background: #25d366;
    }

    .share-btn.email {
      background: #6c757d;
    }

    .share-btn.copy {
      background: #3b82f6;
      cursor: pointer;
      border: none;
      color: white;
    }

    /* ===== NEWSLETTER SECTION ===== */
    .newsletter-section {
      margin: 2.5rem 0;
      padding: 2rem 1.5rem;
      background: linear-gradient(135deg, #111827, #0f1420);
      border: 1px solid #1f2a3e;
      border-radius: 16px;
      text-align: center;
    }

    .newsletter-icon {
      font-size: 2.5rem;
      color: #3b82f6;
      margin-bottom: 0.75rem;
    }

    .newsletter-section h3 {
      font-size: 1.2rem;
      margin-bottom: 0.25rem;
      color: #f1f5f9;
    }

    .newsletter-section p {
      color: #94a3b8;
      font-size: 0.9rem;
      margin-bottom: 1rem;
    }

    .newsletter-form {
      display: flex;
      gap: 0.5rem;
      max-width: 450px;
      margin: 0 auto;
      flex-wrap: wrap;
      justify-content: center;
    }

    .newsletter-form input {
      flex: 1;
      min-width: 200px;
      padding: 0.6rem 1rem;
      background: #0a0e1a;
      border: 1px solid #1f2a3e;
      border-radius: 8px;
      color: #f1f5f9;
      font-size: 0.9rem;
    }

    .newsletter-form input:focus {
      outline: none;
      border-color: #3b82f6;
    }

    .newsletter-form button {
      padding: 0.6rem 1.25rem;
      border-radius: 8px;
      border: none;
      background: #3b82f6;
      color: white;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s ease;
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      white-space: nowrap;
    }

    .newsletter-form button:hover {
      background: #2563eb;
      transform: translateY(-1px);
    }

    .newsletter-note {
      display: block;
      font-size: 0.7rem;
      color: #475569;
      margin-top: 0.75rem;
    }

    /* Responsive */
    @media (max-width: 640px) {
      .interaction-bar {
        flex-direction: column;
        align-items: stretch;
      }

      .tick-section {
        justify-content: center;
      }

      .share-section {
        justify-content: center;
      }

      .newsletter-form {
        flex-direction: column;
        align-items: stretch;
      }

      .newsletter-form button {
        justify-content: center;
      }
    }

