/* SpinConvert blog (/blog, /blog/<slug>, /blog/topic/<id>, /blog/all). Loaded after main.css and v2.css and uses
   their tokens, so light and dark mode come for free. Mobile first, CSS only. */

.blog {
  --read: 720px;   /* the reading column */
  --wide: 920px;   /* figures and related cards */
  --pill-mix: #000;
  --pill-ink: 72%;
  --pill-bg: 12%;
  overflow-wrap: break-word;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .blog { --pill-mix: #fff; --pill-ink: 58%; --pill-bg: 24%; } }
:root[data-theme='dark'] .blog { --pill-mix: #fff; --pill-ink: 58%; --pill-bg: 24%; }

/* ---------- breadcrumbs ---------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0 0 18px; font-size: 0.88rem; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; font-weight: 600; }
.crumbs a:hover { color: var(--brand); text-decoration: underline; }
.crumbs span { color: var(--muted-2, var(--muted)); }

/* ---------- topic pill (post header and cards); the colour comes from --topic ---------- */
.post__topic,
.post-card__topic {
  display: inline-flex; align-items: center; gap: 7px; align-self: flex-start;
  padding: 4px 11px 4px 9px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 800; letter-spacing: 0.03em; text-transform: uppercase; line-height: 1.4;
  color: color-mix(in srgb, var(--topic, var(--brand)) var(--pill-ink), var(--pill-mix));
  background: color-mix(in srgb, var(--topic, var(--brand)) var(--pill-bg), var(--card));
  text-decoration: none;
}
.post__topic::before,
.post-card__topic::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--topic, var(--brand)); flex: none; }
a.post__topic:hover { color: color-mix(in srgb, var(--topic, var(--brand)) var(--pill-ink), var(--pill-mix)); box-shadow: inset 0 0 0 1.5px var(--topic, var(--brand)); }

/* ========== the article ========== */
.post { max-width: calc(var(--wide) + 48px); padding-top: 28px; }
.post > * { max-width: var(--read); margin-left: auto; margin-right: auto; }
.post > .post__figure,
.post > .post__related { max-width: var(--wide); }

.post__head { margin-bottom: 26px; }
.post__head h1 { margin: 14px 0 14px; font-size: clamp(2rem, 4.6vw, 2.85rem); line-height: 1.12; letter-spacing: -0.025em; text-wrap: balance; }
.post__meta { margin: 0 0 22px; font-size: 0.92rem; color: var(--muted); }
.post__meta time { white-space: nowrap; }

/* the direct answer: the first thing people (and answer engines) read */
.post__answer {
  margin: 0; padding: 18px 20px 18px 22px;
  border-left: 4px solid var(--brand); border-radius: 4px var(--radius) var(--radius) 4px;
  background: var(--brand-50); color: var(--ink);
  font-size: 1.1rem; line-height: 1.65; font-weight: 500;
}
.post__answer a { font-weight: 700; }

/* figures */
.post__figure { margin: 0 auto 34px; }
.post__figure img { width: 100%; height: auto; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-2); box-shadow: var(--shadow-card, var(--shadow)); }
.post__figure figcaption { margin-top: 10px; padding: 0 6px; text-align: center; font-size: 0.88rem; line-height: 1.5; color: var(--muted); }
.post__figure--cover img { border-radius: 20px; }
.post__figure--infographic img { max-width: 760px; margin: 0 auto; }

/* key takeaways */
.post__takeaways { margin-bottom: 26px; padding: 20px 22px 18px; border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow-card, var(--shadow)); }
.post__takeaways-title,
.post__toc-title { margin: 0 0 10px; font-size: 0.8rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand); }
.post__takeaways ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.post__takeaways li { position: relative; padding-left: 30px; line-height: 1.55; color: var(--ink-2); }
.post__takeaways li::before {
  content: ''; position: absolute; left: 0; top: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--success) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 13px no-repeat;
}

/* table of contents */
.post__toc { margin-bottom: 34px; padding: 16px 20px; border-radius: var(--radius); background: var(--soft); border: 1px solid var(--line); }
.post__toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; display: grid; gap: 2px 28px; }
.post__toc li { counter-increment: toc; display: flex; gap: 10px; font-size: 0.95rem; line-height: 1.45; }
.post__toc li::before { content: counter(toc) '.'; flex: none; min-width: 1.4em; color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; padding-top: 5px; }
.post__toc a { display: block; padding: 5px 0; color: var(--ink-2); font-weight: 600; text-decoration: none; }
.post__toc a:hover { color: var(--brand); text-decoration: underline; }
@media (min-width: 760px) { .post__toc ol { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- body text ---------- */
.post__body { font-size: 1.0625rem; line-height: 1.7; color: var(--ink-2); }
@media (min-width: 720px) { .post__body { font-size: 1.15rem; } }
.post__body > :first-child { margin-top: 0; }
.post__body p { margin: 0 0 1.15em; }
.post__body strong { color: var(--ink); }
.post__body a { color: var(--brand); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--brand) 45%, transparent); }
.post__body a:hover { text-decoration-color: currentColor; }
.post__body h2 { margin: 2.1em 0 0.6em; font-size: clamp(1.5rem, 3.2vw, 1.85rem); line-height: 1.22; letter-spacing: -0.02em; text-wrap: balance; }
.post__body h3 { margin: 1.7em 0 0.45em; font-size: clamp(1.18rem, 2.4vw, 1.3rem); line-height: 1.3; letter-spacing: -0.01em; }
.post__body h2 + h3 { margin-top: 0.9em; }
.post h2[id], .post h3[id], .post__faq, .post__related { scroll-margin-top: 96px; }
.post__body ul, .post__body ol { margin: 0 0 1.25em; padding-left: 1.4em; }
.post__body li { margin: 0 0 0.5em; padding-left: 0.2em; }
.post__body li::marker { color: var(--brand); font-weight: 700; }
.post__body em { color: var(--ink); }
.post__body > p:last-child em:only-child { display: block; padding-top: 6px; color: var(--muted); font-size: 0.95em; }

/* tip box: a markdown "> " paragraph */
.post__body .tip { position: relative; margin: 1.6em 0; padding: 16px 18px 16px 54px; border-radius: var(--radius); background: color-mix(in srgb, var(--accent) 13%, var(--card)); border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); }
.post__body .tip::before {
  content: ''; position: absolute; left: 16px; top: 17px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 18h6M10 21h4M12 3a6 6 0 0 0-3.5 10.9c.6.5 1 1.2 1 2.1h5c0-.9.4-1.6 1-2.1A6 6 0 0 0 12 3z' fill='none' stroke='%231b1530' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 15px no-repeat;
}
.post__body .tip p { margin: 0; color: var(--ink); font-size: 0.97em; line-height: 1.6; }

/* tables scroll inside their box, never the page */
.post__body .table-wrap { margin: 1.6em 0; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.post__body table { width: 100%; border-collapse: collapse; font-size: 0.9em; line-height: 1.5; }
.post__body th, .post__body td { min-width: 8.5rem; padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.post__body thead th { background: var(--surface-2); color: var(--ink); font-weight: 800; font-size: 0.92em; }
.post__body tbody tr:last-child td, .post__body tbody tr:last-child th { border-bottom: 0; }
.post__body tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }

/* figures inside the body go a little wider than the text on big screens */
.post__body .post__figure { margin: 2em auto; }
@media (min-width: 1000px) { .post__body .post__figure { margin-left: -60px; margin-right: -60px; } }

/* ---------- FAQ (same accordion as the rest of the site) ---------- */
.post__faq { margin-top: 56px; }
.post__faq h2, .post__related h2, .post__cta h2 { font-size: clamp(1.5rem, 3.2vw, 1.85rem); letter-spacing: -0.02em; }
.post__faq h2 { margin-bottom: 18px; }
.post__faq .faq { max-width: none; margin: 0; gap: 10px; }
.post__faq .faq summary { line-height: 1.4; }
.post__faq .faq details[open] { border-color: var(--line-strong); }

/* ---------- CTA panel ---------- */
.post__cta {
  position: relative; overflow: hidden; margin-top: 56px; padding: 32px 22px; border-radius: var(--radius-lg); text-align: center; color: #fff;
  background: radial-gradient(600px 260px at 100% 0%, rgba(255, 77, 141, 0.35), transparent 60%), linear-gradient(140deg, #5b2ee6 0%, #3a1aa8 55%, #1b1035 100%);
  box-shadow: 0 30px 60px -30px rgba(48, 22, 140, 0.7);
}
.post__cta h2 { color: #fff; margin-bottom: 10px; }
.post__cta p { margin: 0 auto 18px; max-width: 34em; color: rgba(255, 255, 255, 0.88); }
.post__cta .post__cta-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 10px; }
.post__cta .btn--primary { background: #fff; color: #4a22c9; box-shadow: 0 8px 22px rgba(10, 4, 40, 0.35); }
.post__cta .btn--primary:hover { background: #f3efff; color: #4a22c9; }
.post__cta .btn--ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.55); }
.post__cta .btn--ghost:hover { background: rgba(255, 255, 255, 0.12); color: #fff; border-color: #fff; }
.post__cta .small { margin: 0 auto; font-size: 0.86rem; color: rgba(255, 255, 255, 0.75); }
@media (min-width: 720px) { .post__cta { padding: 44px 40px; } }
@media (max-width: 420px) { .post__cta .post__cta-btns .btn { width: 100%; } }

/* ---------- related (Keep reading) ---------- */
.post__related { margin-top: 64px; }
.post__related h2 { margin-bottom: 20px; }

/* ========== cards (index, topics, related) ========== */
.post-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .post-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 980px) { .post-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; } }
.post-card { min-width: 0; }
.post-card a {
  display: flex; flex-direction: column; height: 100%; overflow: hidden;
  border-radius: 18px; border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow-card, var(--shadow));
  color: inherit; text-decoration: none; transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.post-card a:hover, .post-card a:focus-visible { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--shadow-lg); color: inherit; }
@media (prefers-reduced-motion: reduce) { .post-card a, .post-card a:hover { transition: none; transform: none; } }
.post-card img { width: 100%; height: auto; aspect-ratio: 600 / 315; object-fit: cover; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.post-card__topic { margin: 16px 18px 0; }
.post-card h2, .post-card h3 { margin: 10px 18px 8px; font-size: 1.14rem; line-height: 1.3; letter-spacing: -0.01em; color: var(--ink); }
.post-card a:hover h2, .post-card a:hover h3 { color: var(--brand); }
.post-card p { margin: 0 18px 20px; font-size: 0.93rem; line-height: 1.55; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ========== /blog and topic pages ========== */
.blog-hero { padding: 40px 0 36px; background: radial-gradient(1000px 420px at 90% -20%, var(--brand-100), transparent 60%), radial-gradient(700px 360px at -10% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%); border-bottom: 1px solid var(--line); }
@media (min-width: 720px) { .blog-hero { padding: 64px 0 52px; } }
.blog-hero h1 { max-width: 18em; font-size: clamp(2.1rem, 5vw, 3.2rem); text-wrap: balance; }
.blog-hero .lead { max-width: 40em; margin-bottom: 0; font-size: clamp(1.05rem, 2vw, 1.2rem); }
.blog-hero .crumbs { margin-bottom: 14px; }
.blog .section { padding: 48px 0 24px; }
@media (min-width: 720px) { .blog .section { padding: 60px 0 32px; } }
.blog .section h2 { margin-bottom: 22px; font-size: clamp(1.5rem, 3vw, 2rem); }
.blog .section .post-cards + h2, .pillar + h2 { margin-top: 48px; }

.topic-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.topic-chips a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 7px 14px 7px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2); font-size: 0.92rem; font-weight: 700; text-decoration: none;
  transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}
.topic-chips a::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--topic, var(--brand)); flex: none; }
.topic-chips a:hover { border-color: var(--topic, var(--brand)); background: color-mix(in srgb, var(--topic, var(--brand)) var(--pill-bg), var(--card)); color: var(--ink); }

.blog-more { margin: 32px 0 0; text-align: center; }

/* the pillar guide: one big card, side by side on wide screens */
.pillar { margin-bottom: 8px; }
.pillar .eyebrow { margin-bottom: 14px; }
.pillar .post-cards { grid-template-columns: minmax(0, 1fr); }
.pillar .post-card a { border-color: var(--line-strong); }
.pillar .post-card h2 { font-size: clamp(1.3rem, 2.6vw, 1.7rem); margin-bottom: 10px; }
.pillar .post-card p { font-size: 1rem; -webkit-line-clamp: 4; }
@media (min-width: 760px) {
  .pillar .post-card a { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); grid-template-rows: auto auto 1fr; column-gap: 8px; }
  .pillar .post-card img { grid-row: 1 / span 3; height: 100%; border-bottom: 0; border-right: 1px solid var(--line); }
  .pillar .post-card__topic { margin-top: 26px; justify-self: start; }
  .pillar .post-card h2, .pillar .post-card p { margin-left: 18px; margin-right: 26px; }
}

/* /blog/all */
.blog-archive { max-width: calc(820px + 48px); }
.blog .blog-archive h2 { margin: 40px 0 10px; font-size: 1.35rem; }
.blog .blog-archive h2:first-child { margin-top: 0; }
.blog-archive h2 a { color: var(--ink); text-decoration: none; }
.blog-archive h2 a:hover { color: var(--brand); }
.blog-archive ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.blog-archive li { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 16px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.blog-archive li a { flex: 1 1 18em; min-width: 0; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.blog-archive li a:hover { color: var(--brand); text-decoration: underline; }
.blog-archive time { flex: none; font-size: 0.86rem; color: var(--muted); font-variant-numeric: tabular-nums; }
