/* ============================================================================
   FreeSoftwareX Blog — listing page + article template
   Original layout (hero/featured/grid/newsletter for the index; banner/TOC/
   content/callouts/FAQ/related for posts) — a common, generic blog pattern
   used across many sites, built fresh for this site's own colours, type and
   spacing tokens (reuses fsx.css variables). No third-party content or
   imagery — banner art is original inline SVG. (Rohit, 18-Sep)
   ========================================================================== */

/* ── shared page chrome ───────────────────────────────────────────────── */
.blog-crumb { font-size: 13px; color: var(--ink-3); margin: 0 0 var(--s3); }
.blog-crumb a { color: var(--ink-3); }
.blog-crumb a:hover { color: var(--brand-ink); }

/* ── listing: page head ───────────────────────────────────────────────── */
.blog-head { text-align: center; max-width: 640px; margin: 0 auto var(--s5); }
.blog-head span.badge { margin-bottom: 10px; }
.blog-head h1 { margin: 0 0 10px; font-size: clamp(28px, 3.6vw, 42px); letter-spacing: -.02em; }
.blog-head h1 em { font-style: normal; color: var(--brand-ink); }
.blog-head p { margin: 0; color: var(--ink-2); font-size: 15.5px; line-height: 1.6; }

/* ── listing: featured + recent ───────────────────────────────────────── */
.blog-featured { display: grid; grid-template-columns: 1.6fr 1fr; gap: var(--s4); margin-bottom: var(--s6); }
.blog-featured-main {
  display: block; border-radius: var(--r-card); overflow: hidden; background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--sh-2); transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.blog-featured-main:hover { transform: translateY(-3px); box-shadow: var(--sh-3); text-decoration: none; }
.blog-featured-banner { aspect-ratio: 16/8; display: block; }
.blog-featured-banner svg { width: 100%; height: 100%; display: block; }
.blog-featured-body { padding: 24px 26px 26px; }
.blog-tag {
  display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 700; letter-spacing: .03em;
  text-transform: uppercase; color: var(--brand-ink); background: var(--brand-soft); padding: 4px 10px; border-radius: 999px;
}
.blog-featured-body h2 { margin: 12px 0 8px; font-size: 24px; line-height: 1.25; color: var(--ink); }
.blog-featured-body p { margin: 0 0 14px; color: var(--ink-2); font-size: 14.5px; line-height: 1.6; }
.blog-meta { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-3); }
.blog-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-3); flex: 0 0 auto; }

.blog-recent { display: flex; flex-direction: column; gap: 14px; }
.blog-recent-h { font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 2px; }
.blog-recent-item {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px;
  transition: background .15s var(--ease);
}
.blog-recent-item:hover { background: var(--surface-2); text-decoration: none; }
.blog-recent-thumb { flex: 0 0 64px; width: 64px; height: 64px; border-radius: 10px; overflow: hidden; }
.blog-recent-thumb svg { width: 100%; height: 100%; display: block; }
.blog-recent-item h3 { margin: 0 0 4px; font-size: 14px; line-height: 1.35; color: var(--ink); }
.blog-recent-item .blog-meta { font-size: 11.5px; }

/* ── listing: category filter pills ───────────────────────────────────── */
.blog-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 var(--s4); }
.blog-filter {
  border: 1px solid var(--border-2); background: var(--surface); color: var(--ink-2);
  font: 600 13px/1 var(--font); padding: 9px 16px; border-radius: 999px; cursor: pointer;
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.blog-filter:hover { border-color: var(--brand-line); color: var(--brand-ink); }
.blog-filter.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ── listing: card grid ───────────────────────────────────────────────── */
.blog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-bottom: var(--s6); }
.blog-card {
  display: flex; flex-direction: column; border-radius: var(--r-card); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--sh-1);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.blog-card:hover { transform: translateY(-3px); box-shadow: var(--sh-2); text-decoration: none; }
.blog-card-banner { aspect-ratio: 16/9; display: block; }
.blog-card-banner svg { width: 100%; height: 100%; display: block; }
.blog-card-body { padding: 18px 18px 20px; display: flex; flex-direction: column; flex: 1; }
.blog-card-body h3 { margin: 10px 0 8px; font-size: 16.5px; line-height: 1.35; color: var(--ink); }
.blog-card-body p { margin: 0 0 12px; font-size: 13.5px; color: var(--ink-2); line-height: 1.55; flex: 1; }

/* ── listing: newsletter ──────────────────────────────────────────────── */
.blog-news {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s4); flex-wrap: wrap;
  padding: 30px 34px; border-radius: var(--r-card); background: var(--brand-soft); border: 1px solid var(--brand-line);
}
.blog-news h2 { margin: 0 0 6px; font-size: 20px; }
.blog-news p { margin: 0; color: var(--ink-2); font-size: 14px; max-width: 42ch; }
.blog-news form { display: flex; gap: 8px; flex: 0 0 auto; }
.blog-news .input { min-width: 240px; background: var(--surface); }
@media (max-width: 560px) {
  .blog-news form { width: 100%; flex-direction: column; }
  .blog-news .input { min-width: 0; width: 100%; }
  .blog-news .btn { width: 100%; }
}

@media (max-width: 900px) {
  .blog-featured { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .blog-grid { grid-template-columns: 1fr; }
}

/* ── post: banner + meta ──────────────────────────────────────────────── */
.post-banner { aspect-ratio: 21/8; border-radius: var(--r-card); overflow: hidden; margin-bottom: var(--s4); }
.post-banner svg { width: 100%; height: 100%; display: block; }
.post-head { max-width: 78ch; margin: 0 auto var(--s2); }
.post-head h1 { margin: 10px 0 12px; font-size: clamp(26px, 3.4vw, 38px); line-height: 1.2; letter-spacing: -.01em; }
.post-byline { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink-3); }
.post-byline .avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; font-size: 12.5px; flex: 0 0 auto; }
.post-byline b { color: var(--ink-2); font-weight: 650; }
.post-byline .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-3); }

/* ── post: two-column layout with sticky TOC ──────────────────────────── */
.post-layout { display: grid; grid-template-columns: 220px 1fr; gap: var(--s5); align-items: start; margin-top: var(--s4); }
.post-toc { position: sticky; top: 90px; }
.post-toc-h { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 10px; }
.post-toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; border-left: 2px solid var(--border); }
.post-toc a {
  display: block; padding: 6px 0 6px 14px; margin-left: -2px; border-left: 2px solid transparent;
  font-size: 13px; color: var(--ink-2); line-height: 1.4;
}
.post-toc a:hover, .post-toc a.is-active { color: var(--brand-ink); border-left-color: var(--brand); text-decoration: none; }
@media (max-width: 900px) { .post-layout { grid-template-columns: 1fr; } .post-toc { position: static; margin-bottom: var(--s3); } .post-toc ol { display: grid; grid-template-columns: repeat(2, 1fr); border-left: 0; gap: 4px 12px; } .post-toc a { border-left: 0; padding: 3px 0; } }

/* ── post: article typography ─────────────────────────────────────────── */
.post-content { max-width: 78ch; font-size: 16px; line-height: 1.75; color: var(--ink-2); }
.post-content h2 { margin: 2.1em 0 .6em; font-size: 23px; color: var(--ink); scroll-margin-top: 90px; }
.post-content h2:first-child { margin-top: 0; }
.post-content h3 { margin: 1.6em 0 .5em; font-size: 18px; color: var(--ink); scroll-margin-top: 90px; }
.post-content p { margin: 0 0 1.1em; }
.post-content ul, .post-content ol { margin: 0 0 1.1em; padding-left: 1.4em; }
.post-content li { margin-bottom: .45em; }
.post-content strong { color: var(--ink); }
.post-content a { text-decoration: underline; text-decoration-color: var(--brand-line); text-underline-offset: 2px; }

.post-callout {
  display: flex; gap: 12px; padding: 16px 18px; margin: 1.6em 0; border-radius: 12px;
  background: var(--brand-soft); border: 1px solid var(--brand-line);
}
.post-callout .ico { flex: 0 0 auto; width: 20px; height: 20px; color: var(--brand-ink); margin-top: 1px; }
.post-callout b { display: block; color: var(--ink); margin-bottom: 2px; }
.post-callout p { margin: 0; font-size: 14.5px; }

.post-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  margin: 2.2em 0; padding: 24px 26px; border-radius: var(--r-card); background: var(--ink); color: #fff;
}
.post-cta h3 { margin: 0 0 4px; font-size: 18px; color: #fff; }
.post-cta p { margin: 0; font-size: 13.5px; color: #c3c9e0; }
.post-cta .btn { flex: 0 0 auto; background: #fff; color: var(--ink); border-color: #fff; }
.post-cta .btn:hover { background: #e5e8ef; border-color: #e5e8ef; color: var(--ink); }

/* ── post: FAQ ─────────────────────────────────────────────────────────── */
.post-faq { max-width: 78ch; margin: var(--s5) 0; }
.post-faq h2 { font-size: 23px; margin: 0 0 14px; color: var(--ink); }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-q {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%;
  padding: 16px 2px; background: none; border: 0; text-align: left; font: 650 15.5px/1.4 var(--font);
  color: var(--ink); cursor: pointer;
}
.faq-q .ico { flex: 0 0 auto; width: 18px; height: 18px; color: var(--ink-3); transition: transform .18s var(--ease); }
.faq-item.is-open .faq-q .ico { transform: rotate(180deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .22s var(--ease); }
.faq-a p { margin: 0 0 16px; font-size: 14.5px; line-height: 1.65; color: var(--ink-2); max-width: 72ch; }

/* ── post: related ─────────────────────────────────────────────────────── */
.post-related { margin: var(--s6) 0 0; }
.post-related h2 { font-size: 20px; margin: 0 0 16px; }
.post-related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 760px) { .post-related-grid { grid-template-columns: 1fr; } }
