/* ==========================================================================
   Sima — Blog Stylesheet
   Persian-first (RTL safe), dark-canvas, violet brand. Pairs with style.css
   which defines :root tokens (--primary, --bg, --text, --radius, etc).
   v=2 — 2026-06-17 enriched articles
   ========================================================================== */

/* -------------------------------------------------------------------------- */
/* Shared blog page chrome                                                     */
/* -------------------------------------------------------------------------- */
.blog-page {
  padding-top: clamp(40px, 6vw, 72px);
  padding-bottom: clamp(64px, 8vw, 120px);
}

/* Reusable narrow column for editorial reading (~70ch) */
.blog-prose-col {
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
}

/* Breadcrumb — appears on both index and single post */
.post-breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 6px 10px;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: clamp(20px, 3vw, 32px);
}
/* Real DOM is <nav class="post-breadcrumb"><ol><li>…</li></ol></nav>.
   The <ol>/<li> need explicit resets — otherwise they fall back to UA
   defaults (decimal numbers, block stacking, padding-inline-start: 40px). */
.post-breadcrumb ol,
.post-breadcrumb ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}
.post-breadcrumb li {
  display: inline-flex;
  align-items: center;
  margin: 0;
}
.post-breadcrumb a {
  color: var(--text-mute);
  transition: color 0.2s;
}
.post-breadcrumb a:hover { color: var(--primary); }
.post-breadcrumb .sep,
.post-breadcrumb li[aria-hidden="true"] {
  color: var(--text-dim);
  opacity: 0.6;
  font-size: 0.75rem;
}
.post-breadcrumb .current,
.post-breadcrumb li[aria-current="page"] {
  color: var(--text);
  font-weight: 500;
  /* Truncate gracefully if the title is long */
  max-width: 60ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* -------------------------------------------------------------------------- */
/* Blog index — hero                                                           */
/* -------------------------------------------------------------------------- */
.blog-hero {
  position: relative;
  text-align: center;
  max-width: 820px;
  margin: 0 auto clamp(40px, 6vw, 72px);
}
.blog-hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.8rem; font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid rgba(139, 92, 246, 0.28);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.blog-hero h1 {
  margin: 0 0 16px;
  font-size: clamp(1.9rem, 4.6vw, 2.875rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.blog-hero p {
  margin: 0 auto;
  max-width: 60ch;
  font-size: clamp(1rem, 1.5vw, 1.0625rem);
  color: var(--text-mute);
  line-height: 1.8;
}

/* -------------------------------------------------------------------------- */
/* Blog index — card grid                                                      */
/* -------------------------------------------------------------------------- */
.blog-list {
  display: grid;
  gap: clamp(20px, 2.5vw, 32px);
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .blog-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .blog-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  /* Lightweight shadow — heavy shadows trigger paint cost on grids */
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  color: inherit;
  /* Improves LCP for off-screen cards */
  content-visibility: auto;
  contain-intrinsic-size: 420px;
}
.blog-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow:
    0 14px 32px -12px rgba(0, 0, 0, 0.45),
    0 4px 12px -4px rgba(139, 92, 246, 0.25);
}
.blog-card:hover .blog-card__title { color: var(--accent); }
.blog-card:hover .blog-card__image img {
  transform: scale(1.05);
  filter: saturate(1.05);
}

.blog-card__image {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;          /* clip the inner img to rounded corners */
  border-radius: 14px;
  background: var(--bg-elev-2);
}
.blog-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease, filter 0.3s ease;
}
.blog-card__category {
  position: absolute;
  inset-block-start: 12px;
  inset-inline-start: 12px;
  padding: 5px 12px;
  font-size: 0.72rem;
  font-weight: 600;
  color: white;
  background: rgba(9, 9, 11, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
}

.blog-card__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: clamp(18px, 2vw, 24px);
  flex: 1;
}
.blog-card__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--text);
  transition: color 0.2s;
  /* clamp to 3 lines */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-card__excerpt {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--text-mute);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-card__meta {
  margin-top: auto;
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 6px 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-dim);
}
.blog-card__meta .dot { opacity: 0.5; }
.blog-card__meta svg { width: 14px; height: 14px; margin-inline-end: 4px; vertical-align: -2px; }

/* -------------------------------------------------------------------------- */
/* Single post — layout shell                                                  */
/* -------------------------------------------------------------------------- */
.post-article {
  position: relative;
  padding-top: clamp(24px, 4vw, 48px);
}

/* Two-column layout on wide screens: TOC sidebar + reading column */
@media (min-width: 1100px) {
  .post-shell {
    display: grid;
    grid-template-columns: 1fr minmax(0, 720px) 220px;
    gap: clamp(28px, 3vw, 56px);
    align-items: start;
  }
  .post-shell > .post-header,
  .post-shell > .post-body,
  .post-shell > .post-footer { grid-column: 2; }
  .post-shell > .post-toc      { grid-column: 3; }
  .post-shell > .post-side-pad { grid-column: 1; }
}

/* -------------------------------------------------------------------------- */
/* Post hero / header                                                          */
/* -------------------------------------------------------------------------- */
.post-hero {
  margin-bottom: clamp(28px, 4vw, 48px);
}
.post-hero h1 {
  margin: 0 0 18px;
  font-size: clamp(1.85rem, 4.4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.post-hero .post-lede {
  margin: 0 0 24px;
  font-size: clamp(1.02rem, 1.6vw, 1.15rem);
  line-height: 1.85;
  color: var(--text-mute);
  max-width: 64ch;
}

.post-featured {
  position: relative;
  margin: clamp(20px, 3vw, 32px) 0 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
}
.post-featured img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* -------------------------------------------------------------------------- */
/* Post meta strip (author, date, reading time, category)                      */
/* -------------------------------------------------------------------------- */
.post-meta {
  display: flex; flex-wrap: wrap;
  gap: 10px 18px;
  font-size: 0.88rem;
  color: var(--text-mute);
  padding: 14px 0;
  border-block: 1px solid var(--border);
  margin-bottom: 8px;
}
.post-meta .post-meta__item {
  display: inline-flex; align-items: center; gap: 6px;
}
.post-meta .post-meta__item svg {
  width: 16px; height: 16px;
  color: var(--primary);
}
.post-meta .post-meta__category {
  color: var(--accent);
  background: var(--primary-soft);
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.78rem;
}

/* -------------------------------------------------------------------------- */
/* Post body — long-form reading typography                                    */
/* -------------------------------------------------------------------------- */
.post-body {
  font-size: 1.05rem;
  line-height: 1.95;
  color: var(--text);
  /* Long posts get expensive to paint; skip work for off-screen sections */
  content-visibility: auto;
  contain-intrinsic-size: 1px 1800px;
}

.post-body > * + * { margin-top: 1.1em; }

.post-body h2 {
  margin: 2.2em 0 0.6em;
  font-size: clamp(1.4rem, 2.6vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.35;
  scroll-margin-top: 96px;
}
.post-body h2::before {
  content: "";
  display: block;
  width: 44px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent-pink) 100%);
  border-radius: 3px;
  margin-bottom: 14px;
}
.post-body h3 {
  margin: 1.8em 0 0.5em;
  font-size: clamp(1.15rem, 2vw, 1.3rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.4;
  color: var(--text);
  scroll-margin-top: 96px;
}
.post-body p {
  margin: 0 0 1em;
  color: var(--text);
}
.post-body a:not(.btn) {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(196, 181, 253, 0.4);
  text-underline-offset: 4px;
  transition: color 0.2s, text-decoration-color 0.2s;
}
.post-body a:not(.btn):hover {
  color: white;
  text-decoration-color: var(--primary);
}

.post-body strong { color: var(--text); font-weight: 700; }
.post-body em { color: var(--accent); font-style: normal; }

.post-body ul,
.post-body ol {
  margin: 0 0 1.2em;
  padding-inline-start: 1.4em;
  color: var(--text);
}
.post-body li { margin-bottom: 0.55em; }
.post-body li::marker { color: var(--primary); }

.post-body blockquote {
  margin: 1.6em 0;
  padding: 18px clamp(18px, 2.5vw, 28px);
  border-inline-start: 4px solid var(--primary);
  background: var(--bg-elev-1);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.85;
}
.post-body blockquote p:last-child { margin-bottom: 0; }

.post-body figure {
  margin: 1.8em 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
}
.post-body figure img {
  width: 100%;
  height: auto;
  display: block;
}
.post-body figcaption {
  padding: 12px 18px;
  font-size: 0.85rem;
  color: var(--text-dim);
  text-align: center;
  border-top: 1px solid var(--border);
  background: var(--bg-elev-1);
}

.post-body hr {
  margin: 2.2em 0;
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
}

/* Inline highlight box (callout) */
.post-body .post-callout {
  margin: 1.6em 0;
  padding: 18px clamp(18px, 2vw, 24px);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(139, 92, 246, 0.10), rgba(236, 72, 153, 0.06));
  border: 1px solid rgba(139, 92, 246, 0.28);
}
.post-body .post-callout strong { color: var(--accent); }

/* Comparison / how-to tables */
.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.6em 0;
  font-size: 0.95rem;
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.post-body th,
.post-body td {
  padding: 12px 14px;
  text-align: start;
  border-bottom: 1px solid var(--border);
}
.post-body th {
  background: var(--bg-elev-2);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.88rem;
}
.post-body tr:last-child td { border-bottom: 0; }

/* -------------------------------------------------------------------------- */
/* Table of contents (sticky sidebar on desktop)                               */
/* -------------------------------------------------------------------------- */
.post-toc {
  border: 1px solid var(--border);
  background: var(--bg-elev-1);
  border-radius: var(--radius);
  padding: 18px 18px 14px;
  font-size: 0.9rem;
}
.post-toc h2 {
  margin: 0 0 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.post-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.post-toc li { margin: 0; }
.post-toc a {
  display: block;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--text-mute);
  line-height: 1.5;
  transition: color 0.2s, background 0.2s;
  /* clip overflow without spilling */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.post-toc a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}
.post-toc a.is-active {
  color: var(--accent);
  background: var(--primary-soft);
}

/* ------------------------------------------------------------------ */
/* TOC stacking + sticky safety (definitive overlap fix)               */
/* ------------------------------------------------------------------ */
/* Root cause of TOC vs. comparison-table overlap: sticky TOC inside   */
/* the narrow prose column had no z-index/isolation, so it painted    */
/* over later blocks. Defaults to in-flow; only sticks when it is a   */
/* direct child of .post-shell (side-rail layout).                    */
.post-toc {
  position: relative;
  z-index: 5;
  isolation: isolate;
  margin: 0 auto 32px;
  /* Keep TOC aligned with the article reading column even when the
     element also carries `.container` (which would otherwise stretch
     it to 1200px). */
  max-width: 760px;
}

/* Title heading inside the TOC card. Both `.post-toc h2` and
   `.post-toc__title` are addressed for HTMLs that use either markup. */
.post-toc h2,
.post-toc .post-toc__title {
  margin: 0 0 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* Mobile/tablet: collapse into <details>-friendly card.
   IMPORTANT: do NOT zero out .post-toc padding here — the actual HTML
   uses <aside><h2><ol> (no <summary>/.post-toc__inner), so removing
   padding would let the list sit flush against the frame edge. */
@media (max-width: 1099px) {
  .post-toc {
    padding: 18px;
    background: var(--bg-elev-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
  }
  /* Only style summary if author opted into <details><summary> markup. */
  .post-toc > summary {
    list-style: none;
    cursor: pointer;
    padding: 14px 18px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: var(--radius);
  }
  .post-toc > summary::-webkit-details-marker { display: none; }
  .post-toc > summary::after {
    content: "";
    width: 10px; height: 10px;
    border-inline-end: 2px solid currentColor;
    border-block-end: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
  }
  .post-toc[open] > summary::after { transform: rotate(-135deg); }
  .post-toc > .post-toc__inner { padding: 0; }
  .post-toc nav { max-height: 40vh; overflow-y: auto; }
}

/* Desktop: stick ONLY when placed in .post-shell side rail. */
@media (min-width: 1100px) {
  .post-shell > .post-toc {
    position: sticky;
    inset-block-start: 96px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
  }
}

/* Give following content its own stacking context — nothing can */
/* paint over these blocks regardless of TOC placement.          */
.post-table-wrap,
.post-table,
.post-section,
.post-cta,
.post-related,
.post-howto,
.post-faq,
.post-pros-cons,
.post-takeaways,
.post-tldr {
  position: relative;
  z-index: 1;
  isolation: isolate;
}

/* -------------------------------------------------------------------------- */
/* Post CTA box (repeats mid-article + at end)                                 */
/* -------------------------------------------------------------------------- */
.post-cta {
  margin: clamp(36px, 5vw, 56px) 0;
  padding: clamp(24px, 3vw, 36px);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(139, 92, 246, 0.18), transparent 60%),
    radial-gradient(120% 90% at 100% 100%, rgba(236, 72, 153, 0.14), transparent 60%),
    var(--bg-elev-1);
  border: 1px solid rgba(139, 92, 246, 0.28);
  display: grid;
  gap: 18px;
  align-items: center;
}
@media (min-width: 768px) {
  .post-cta { grid-template-columns: 1fr auto; gap: clamp(20px, 3vw, 40px); }
}
.post-cta__title {
  margin: 0 0 8px;
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.4;
}
.post-cta__desc {
  margin: 0;
  color: var(--text-mute);
  font-size: 0.95rem;
  line-height: 1.7;
  max-width: 56ch;
}
.post-cta__actions {
  display: flex; flex-wrap: wrap; gap: 10px;
}

/* -------------------------------------------------------------------------- */
/* Related posts (3-up grid)                                                   */
/* -------------------------------------------------------------------------- */
.post-related {
  margin-top: clamp(48px, 6vw, 80px);
  padding-top: clamp(36px, 4vw, 56px);
  border-top: 1px solid var(--border);
}
.post-related__title {
  margin: 0 0 24px;
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  font-weight: 800;
  letter-spacing: -0.015em;
}
.post-related__grid {
  display: grid;
  gap: clamp(16px, 2vw, 24px);
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .post-related__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* -------------------------------------------------------------------------- */
/* Share buttons                                                               */
/* -------------------------------------------------------------------------- */
.post-share {
  margin: clamp(36px, 4vw, 48px) 0 0;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev-1);
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 14px;
}
.post-share__label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-mute);
  margin-inline-end: 4px;
}
.post-share__list {
  display: flex; flex-wrap: wrap;
  gap: 8px;
  margin: 0; padding: 0;
  list-style: none;
}
.post-share__btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-mute);
  transition: color 0.2s, background 0.2s, border-color 0.2s, transform 0.15s;
}
.post-share__btn svg { width: 18px; height: 18px; }
.post-share__btn:hover {
  color: white;
  background: var(--primary-soft);
  border-color: var(--primary);
  transform: translateY(-1px);
}
.post-share__btn[data-network="telegram"]:hover  { background: rgba(56, 189, 248, 0.18);  border-color: var(--accent-sky); }
.post-share__btn[data-network="whatsapp"]:hover  { background: rgba(16, 185, 129, 0.18);  border-color: var(--accent-emerald); }
.post-share__btn[data-network="twitter"]:hover   { background: rgba(255, 255, 255, 0.10); border-color: var(--text-mute); }
.post-share__btn[data-network="linkedin"]:hover  { background: rgba(56, 189, 248, 0.18);  border-color: var(--accent-sky); }

/* -------------------------------------------------------------------------- */
/* Responsive niceties                                                         */
/* -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  .post-hero h1 { font-size: 1.65rem; }
  .post-body { font-size: 1rem; line-height: 1.85; }
  .post-meta { font-size: 0.82rem; gap: 6px 12px; }
  .post-breadcrumb .current { max-width: 30ch; }
}

/* Reduced-motion users get no card lift */
@media (prefers-reduced-motion: reduce) {
  .blog-card,
  .blog-card__image img,
  .post-share__btn {
    transition: none;
  }
  .blog-card:hover { transform: none; }
  .blog-card:hover .blog-card__image img { transform: none; }
  .post-share__btn:hover { transform: none; }
}

/* ==========================================================================
   Enrichment patterns — v2 2026-06-17
   Optional editorial modules: TL;DR badge, takeaways, figures, FAQ,
   HowTo steps, comparison tables, pros/cons, examples, updated pill,
   inline CTA. All Persian RTL safe (logical properties), dark theme,
   responsive at 768px / 1100px, accessible focus + reduced-motion.
   ========================================================================== */

/* --- TL;DR badge -------------------------------------------------------- */
/* Small pill placed at the very top of the hero, above the H1.            */
.post-tldr-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-block-end: 14px;
  padding: 5px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: var(--primary-soft);
  border: 1px solid rgba(139, 92, 246, 0.32);
  border-radius: 999px;
  text-transform: none;
}
.post-tldr-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18);
}

/* --- Key takeaways callout --------------------------------------------- */
/* Sits near the top of .post-body to give scanners a quick summary.       */
.post-takeaways {
  margin: 0 0 1.8em;
  padding: 20px clamp(18px, 2.2vw, 26px);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(139, 92, 246, 0.10), rgba(56, 189, 248, 0.05));
  border: 1px solid rgba(139, 92, 246, 0.28);
  border-inline-start: 4px solid var(--primary);
}
.post-takeaways__title {
  margin: 0 0 10px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.post-takeaways__title::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  background: var(--primary);
  -webkit-mask: radial-gradient(circle at center, transparent 35%, #000 36%) center/100% 100%;
          mask: radial-gradient(circle at center, transparent 35%, #000 36%) center/100% 100%;
  border-radius: 4px;
}
.post-takeaways ul {
  margin: 0;
  padding-inline-start: 1.3em;
  list-style: none;
}
.post-takeaways li {
  position: relative;
  margin-bottom: 0.5em;
  padding-inline-start: 1.4em;
  line-height: 1.85;
  color: var(--text);
}
.post-takeaways li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: 0.7em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

/* --- Inline figure (mid-article images) -------------------------------- */
/* Distinct from .post-hero__figure: smaller, sits inside .post-body.      */
.post-figure {
  margin: 1.8em 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
}
.post-figure img,
.post-figure picture,
.post-figure video {
  width: 100%;
  height: auto;
  display: block;
}
.post-figure--wide {
  /* Optional break-out variant on wide screens */
  margin-inline: calc(-1 * clamp(0px, 3vw, 40px));
}

.post-figcaption {
  padding: 12px clamp(14px, 2vw, 20px);
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-dim);
  text-align: center;
  border-top: 1px solid var(--border);
  background: var(--bg-elev-1);
}
.post-figcaption strong { color: var(--text-mute); font-weight: 600; }

/* --- FAQ section (accordion-friendly via <details>/<summary>) ----------- */
.post-faq {
  margin: clamp(28px, 4vw, 44px) 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.post-faq > h2 {
  margin: 0 0 6px;
}

/* Individual Q&A: works for either <details> or plain divs */
.post-faq details,
.post-faq .post-faq__item {
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.post-faq details[open],
.post-faq .post-faq__item:hover {
  border-color: var(--border-strong);
}
.post-faq summary {
  /* Question */
  list-style: none;
  cursor: pointer;
  padding: 16px clamp(16px, 2vw, 22px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
}
.post-faq summary::-webkit-details-marker { display: none; }
.post-faq summary::after {
  /* Chevron — flips on open */
  content: "";
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-inline-end: 2px solid var(--primary);
  border-block-end: 2px solid var(--primary);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  margin-inline-start: auto;
}
.post-faq details[open] summary::after {
  transform: rotate(-135deg);
}
.post-faq summary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}
.post-faq h3 {
  /* If author uses <h3> inside summary or as standalone question */
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.005em;
  line-height: 1.5;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.post-faq details > *:not(summary) {
  padding: 0 clamp(16px, 2vw, 22px) 18px;
  color: var(--text-mute);
  line-height: 1.9;
}
.post-faq details > p:not(:first-of-type) { margin-top: 0.8em; }

/* --- HowTo (numbered step cards) --------------------------------------- */
.post-howto {
  margin: clamp(28px, 4vw, 44px) 0;
}
.post-howto > h2 { margin-bottom: 18px; }
.post-howto ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  counter-reset: howto;
}
.post-howto li {
  counter-increment: howto;
  position: relative;
  padding: 18px clamp(18px, 2.2vw, 24px) 18px calc(clamp(18px, 2.2vw, 24px) + 56px);
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  /* Logical inline-start padding for RTL: counter on the start side */
  padding-inline-start: calc(clamp(18px, 2.2vw, 24px) + 56px);
  padding-inline-end: clamp(18px, 2.2vw, 24px);
  line-height: 1.85;
  color: var(--text);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.post-howto li::before {
  content: counter(howto);
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: clamp(14px, 1.8vw, 18px);
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.95rem;
  color: white;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent-pink) 100%);
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.28);
}
.post-howto li:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.post-howto li strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.02rem;
}

/* --- Responsive table (stacks to cards on mobile) ---------------------- */
.post-table {
  width: 100%;
  margin: 1.8em 0;
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.post-table thead {
  background: var(--bg-elev-2);
}
.post-table th,
.post-table td {
  padding: 14px 16px;
  text-align: start;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.7;
}
.post-table th {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.01em;
}
.post-table tr:last-child td { border-bottom: 0; }
.post-table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }

/* Mobile: stack each row as a card, header re-emitted via data-label */
@media (max-width: 767px) {
  .post-table,
  .post-table thead,
  .post-table tbody,
  .post-table tr,
  .post-table th,
  .post-table td {
    display: block;
    width: 100%;
  }
  .post-table {
    border: 0;
    background: transparent;
    overflow: visible;
  }
  .post-table thead {
    /* Visually hide but keep accessible */
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .post-table tr {
    margin-bottom: 14px;
    background: var(--bg-elev-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 0;
  }
  .post-table td {
    border: 0;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    gap: 14px;
  }
  .post-table td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    font-weight: 700;
    color: var(--accent);
    font-size: 0.82rem;
  }
}

/* --- Pros / Cons two-column ------------------------------------------- */
.post-pros-cons {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(14px, 2vw, 20px);
  margin: clamp(24px, 3vw, 36px) 0;
}
.post-pros,
.post-cons {
  flex: 1 1 280px;
  padding: 20px clamp(18px, 2vw, 24px);
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-inline-start-width: 4px;
}
.post-pros { border-inline-start-color: var(--accent-emerald, #10b981); }
.post-cons { border-inline-start-color: #f59e0b; }

.post-pros__title,
.post-cons__title {
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.post-pros__title { color: var(--accent-emerald, #10b981); }
.post-cons__title { color: #f59e0b; }

.post-pros ul,
.post-cons ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.post-pros li,
.post-cons li {
  position: relative;
  padding-inline-start: 1.8em;
  margin-bottom: 0.55em;
  line-height: 1.8;
  color: var(--text);
}
.post-pros li::before {
  /* Checkmark */
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: 0.55em;
  width: 14px;
  height: 8px;
  border-inline-start: 2px solid var(--accent-emerald, #10b981);
  border-block-end: 2px solid var(--accent-emerald, #10b981);
  transform: rotate(-45deg);
}
.post-cons li::before {
  /* X mark */
  content: "\00d7";
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: 0;
  width: 1.2em;
  height: 1.2em;
  line-height: 1.2;
  font-size: 1.25rem;
  font-weight: 800;
  color: #f59e0b;
  text-align: center;
}

/* --- Examples / case studies (alternating layout) --------------------- */
.post-examples {
  margin: clamp(28px, 4vw, 44px) 0;
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2.4vw, 24px);
}
.post-examples > h2 { margin-bottom: 10px; }

.post-examples__item {
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 2vw, 22px);
  padding: clamp(18px, 2.2vw, 26px);
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.post-examples__item:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.post-examples__media {
  flex: 0 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
}
.post-examples__media img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.post-examples__body { flex: 1 1 auto; }
.post-examples__body h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.post-examples__body p {
  margin: 0 0 0.8em;
  color: var(--text-mute);
  line-height: 1.85;
}
.post-examples__body p:last-child { margin-bottom: 0; }

/* Side-by-side at tablet+, alternating direction */
@media (min-width: 768px) {
  .post-examples__item {
    flex-direction: row;
    align-items: center;
  }
  .post-examples__media { flex: 0 0 42%; }
  /* Alternate: even items reverse so media swaps side */
  .post-examples__item:nth-child(even) {
    flex-direction: row-reverse;
  }
}

/* --- "Last reviewed" pill (sits inside .post-meta) -------------------- */
.post-updated {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--accent-emerald, #10b981);
  background: rgba(16, 185, 129, 0.10);
  border: 1px solid rgba(16, 185, 129, 0.32);
  border-radius: 999px;
  line-height: 1.6;
}
.post-updated::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-emerald, #10b981);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}
.post-updated time { color: inherit; }

/* --- Inline CTA (lighter variant of .post-cta) ------------------------ */
.post-cta--inline {
  margin: clamp(24px, 3vw, 36px) 0;
  padding: clamp(16px, 2vw, 22px) clamp(18px, 2.4vw, 26px);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(139, 92, 246, 0.10), rgba(236, 72, 153, 0.06));
  border: 1px solid rgba(139, 92, 246, 0.28);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.post-cta--inline .post-cta__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
}
.post-cta--inline .post-cta__desc {
  margin: 4px 0 0;
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text-mute);
  max-width: 52ch;
}
.post-cta--inline .post-cta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 0 0 auto;
}
.post-cta--inline .btn { padding: 8px 16px; font-size: 0.9rem; }

/* --- Responsive tuning ------------------------------------------------ */
@media (max-width: 767px) {
  .post-tldr-badge { font-size: 0.72rem; }
  .post-takeaways { padding: 16px; }
  .post-howto li {
    padding-inline-start: calc(clamp(14px, 2vw, 18px) + 48px);
    padding-block: 14px;
  }
  .post-howto li::before { width: 32px; height: 32px; font-size: 0.88rem; }
  .post-faq summary { font-size: 0.95rem; padding: 14px 16px; }
  .post-cta--inline {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (min-width: 1100px) {
  /* On wide screens, takeaways can sit slightly more prominent */
  .post-takeaways { padding-block: 24px; }
}

/* --- Focus & motion --------------------------------------------------- */
.post-faq summary:focus-visible,
.post-howto li:focus-visible,
.post-examples__item:focus-visible,
.post-cta--inline .btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius);
}

@media (prefers-reduced-motion: reduce) {
  .post-faq details,
  .post-faq summary::after,
  .post-howto li,
  .post-examples__item,
  .post-figure img {
    transition: none;
  }
  .post-howto li:hover,
  .post-examples__item:hover {
    transform: none;
  }
}

/* ==========================================================================
   Appended hardening pass — image rounding, search/pills, responsive fixes
   ========================================================================== */

/* --- Inline figures: tighter rounding + clipping --------------------- */
.post-figure {
  border-radius: 14px;
  /* overflow:hidden already set above — kept for safety */
  overflow: hidden;
}
.post-figure img {
  border-radius: 0;          /* parent clips */
}

/* --- Hero figure (previously unstyled in blog.css) ------------------- */
.post-hero__figure {
  margin: clamp(24px, 4vw, 40px) 0 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-elev-2);
  isolation: isolate;
}
.post-hero__figure img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
}
.post-hero__figcaption {
  padding: 10px 16px;
  font-size: 0.85rem;
  color: var(--text-mute);
  background: var(--bg-elev-1);
  border-block-start: 1px solid var(--border);
}

/* --- Blog index search field + filter pills (was missing entirely) --- */
.blog-search {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 18px;
  align-items: stretch;
}
.blog-search__field {
  flex: 1 1 320px;
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.blog-search__field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18);
}
/* Hard cap on the in-field SVG — root cause of the giant icon was no width rule */
.blog-search__field svg,
.blog-search__field .icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  max-width: 18px;
  max-height: 18px;
  color: var(--text-mute);
  margin-inline-end: 8px;
}
.blog-search__field input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  padding: 12px 0;
  color: var(--text);
  font: inherit;
}
.blog-search__field input::placeholder { color: var(--text-mute); }
.blog-search .btn { flex: 0 0 auto; }

/* Fallback: any uncontrolled SVG inside .blog-hero is hidden */
.blog-hero svg:not([width]):not([class]) { display: none; }

.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 8px;
}
.blog-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  color: var(--text-mute);
  font-size: 0.88rem;
  text-decoration: none;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.blog-pill:hover { color: var(--text); border-color: var(--border-strong); }
.blog-pill.is-active {
  background: var(--primary-soft, rgba(139, 92, 246, 0.18));
  color: var(--accent);
  border-color: var(--accent);
}

/* --- Table wrapper actually scrolls horizontally ---------------------- */
.post-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.8em 0;
  border-radius: var(--radius);
}
.post-table-wrap > .post-table { margin: 0; }

/* Tables inside .post-body without .post-table class — same mobile scroll */
@media (max-width: 767px) {
  .post-body table:not(.post-table) {
    display: block;
    overflow-x: auto;
    width: 100%;
  }
  /* When <td> has no data-label, suppress the empty pseudo-label */
  .post-table td:not([data-label])::before { content: none; }
  .post-table td:not([data-label]) { justify-content: flex-start; }
}

/* --- Mobile figure spacing + rounding --------------------------------- */
@media (max-width: 767px) {
  .post-figure,
  .post-hero__figure {
    margin-inline: calc(var(--container-pad, 16px) * -0.5);
    border-radius: 10px;
  }
  .post-body > figure + figure { margin-top: 18px; }
}

/* --- FAQ summary chevron alignment + RTL padding ---------------------- */
.post-faq details > summary {
  padding-inline-end: 40px;            /* clear space for chevron in RTL */
  position: relative;
}
.post-faq details > summary::after {
  position: absolute;
  inset-inline-end: 14px;
  inset-block-start: 50%;
  transform: translateY(-50%) rotate(45deg);
  margin: 0;                            /* override any flex-gap margins */
}
.post-faq details[open] > summary::after {
  transform: translateY(-50%) rotate(-135deg);
}

/* --- Pros/Cons stack on very small phones ----------------------------- */
@media (max-width: 479px) {
  .post-pros-cons { flex-direction: column; }
  .post-pros, .post-cons { flex: 1 1 auto; }
}

/* --- RTL fix for alternating example rows ----------------------------- */
html[dir="rtl"] .post-examples__item:nth-child(even) {
  flex-direction: row;     /* neutralize LTR-only swap */
}

/* --- Page-wide horizontal overflow guard ------------------------------ */
body { overflow-x: hidden; }
