/* ═══════════════════════════════════════════════════════════════════════
   The text of a blog post: headings, paragraphs, lists, images, quotes…
   ───────────────────────────────────────────────────────────────────────
   Used by the live post page (/blog/<slug>) AND the Preview in the CMS,
   so what you see in Preview is what readers get. Everything is inside
   .article so it can't affect the rest of the site.
   A single post can add its own styles under "Custom code" in the CMS.
   ═══════════════════════════════════════════════════════════════════════ */

.article {
  --a-text: #1a293f;
  --a-soft: #52637d;
  --a-line: #e3e9f3;
  --a-link: #2f74e8;
  max-width: 808px;           /* 760px of text + 24px padding each side, lining up with the title */
  margin: 0 auto;
  padding: 0 24px;
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  line-height: 1.7;
  color: var(--a-text);
}

.article > * + * { margin-top: 24px; }

.article p { margin-bottom: 0; }
.article a { color: var(--a-link); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.article a:hover { text-decoration-thickness: 2px; }
.article b, .article strong { font-weight: 600; }
.article mark { background: #e2f9b5; color: inherit; padding: 0 2px; border-radius: 3px; }
.article code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; background: #f1f5fb; padding: 2px 6px; border-radius: 6px; }

.article h2, .article h3, .article h4 { font-weight: 600; color: var(--a-text); scroll-margin-top: 24px; }
.article h2 { font-size: 32px; line-height: 1.25; letter-spacing: -0.6px; margin-top: 56px; }
.article h3 { font-size: 24px; line-height: 1.3; letter-spacing: -0.3px; margin-top: 40px; }
.article h4 { font-size: 20px; line-height: 1.4; margin-top: 32px; }
.article h2 + *, .article h3 + *, .article h4 + * { margin-top: 12px; }

.article ul, .article ol { padding-left: 1.3em; }
.article li + li { margin-top: 8px; }
.article li > ul, .article li > ol { margin-top: 8px; }
.article li::marker { color: #4791fe; }
.article .a-checklist { list-style: none; padding-left: 0; }
.article .a-checklist li { display: flex; gap: 12px; align-items: flex-start; }
.article .a-check { flex: none; width: 20px; height: 20px; margin-top: 5px; border-radius: 6px; border: 1.5px solid #cad6e9; }
.article .a-check.is-on { background: #4791fe url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3.2 3L15 7' stroke='white' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat; border-color: #4791fe; }

.article blockquote { border-left: 3px solid #4791fe; padding: 4px 0 4px 24px; }
.article blockquote p { font-size: 24px; line-height: 1.45; font-weight: 500; letter-spacing: -0.3px; }
.article blockquote cite { display: block; margin-top: 12px; font-size: 15px; font-style: normal; color: var(--a-soft); }

.article hr { border: 0; height: 1px; background: var(--a-line); margin: 48px 0; }

.article figure { margin-left: 0; margin-right: 0; }
.article .a-figure img { width: 100%; height: auto; border-radius: 16px; display: block; }
.article .a-figure.has-border img { border: 1px solid var(--a-line); }
.article .a-figure.has-bg { background: #f1f5fb; border-radius: 16px; padding: 24px; }
.article .a-figure.has-bg img { max-width: 60%; margin: 0 auto; }
.article .a-figure.is-wide { margin-left: calc(50% - min(50vw, 520px)); margin-right: calc(50% - min(50vw, 520px)); }
.article figcaption { margin-top: 10px; font-size: 14px; line-height: 1.5; color: var(--a-soft); text-align: center; }

.article .a-embed-frame { position: relative; width: 100%; border-radius: 16px; overflow: hidden; background: #0d1b2e; }
.article .a-embed-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.article .a-table { overflow-x: auto; }
.article table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.5; }
.article th, .article td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--a-line); vertical-align: top; }
.article th { font-weight: 600; background: #f1f5fb; }

.article pre { background: #0f1f36; color: #e6edf7; padding: 20px; border-radius: 14px; overflow-x: auto; font-size: 14px; line-height: 1.6; }
.article pre code { background: none; padding: 0; color: inherit; font-size: inherit; }

@media (max-width: 640px) {
  .article { font-size: 17px; padding: 0 16px; }
  .article h2 { font-size: 26px; margin-top: 44px; }
  .article h3 { font-size: 21px; }
  .article blockquote p { font-size: 20px; }
}

/* ── Advancly's own blocks (callout, app banner, key numbers) ───────────
   Made in the editor with custom blocks; drawn by src/lib/render-blocks.ts. */

.article .a-callout { border-radius: 16px; padding: 18px 22px; background: #f1f5fb; border: 1px solid #e3e9f3; }
.article .a-callout p { margin: 0; font-size: 17px; line-height: 1.6; }
.article .a-callout p + p { margin-top: 6px; }
.article .a-callout-title { font-weight: 700; font-size: 15px !important; letter-spacing: .2px; }
.article .a-callout--tip { background: #eefbd6; border-color: #d6f2a4; }
.article .a-callout--tip .a-callout-title { color: #3c6b28; }
.article .a-callout--note { background: #eaf2ff; border-color: #cfe0fb; }
.article .a-callout--note .a-callout-title { color: #1f4f9e; }
.article .a-callout--important { background: #fff4dc; border-color: #f6dfa6; }
.article .a-callout--important .a-callout-title { color: #7a5200; }

.article .a-app { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; background: #153461; color: #fff; border-radius: 20px; padding: 24px 26px; }
.article .a-app-copy { flex: 1 1 280px; }
.article .a-app p { margin: 0; }
.article .a-app-h { font-size: 20px; line-height: 1.3; font-weight: 700; color: #fff; letter-spacing: -0.2px; }
.article .a-app-t { margin-top: 6px !important; font-size: 15px; line-height: 1.5; color: #c9d6ea; }
.article .a-app .a-app-btn { flex: none; display: inline-block; background: #cff584; color: #153461; text-decoration: none; font-weight: 700; font-size: 15px; padding: 12px 22px; border-radius: 100px; }
.article .a-app .a-app-btn:hover { background: #bdef5b; }

.article .a-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.article .a-stats--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.article .a-stats--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.article .a-stat { display: flex; flex-direction: column; gap: 4px; padding: 18px 18px 16px; border-radius: 16px; background: #f1f5fb; }
.article .a-stat-v { font-size: 30px; line-height: 1.1; font-weight: 700; letter-spacing: -0.8px; color: #153461; }
.article .a-stat-l { font-size: 14px; line-height: 1.4; color: #52637d; }

@media (max-width: 640px) {
  .article .a-stats, .article .a-stats--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article .a-stat-v { font-size: 26px; }
}
