@import url('v6.css');

/* =====================================================================
   Blog — Signature Leadgen. Navy header band, cream reading surface,
   720px measure, sticky "on this page" rail on wide screens.
   ===================================================================== */

.blogpage .nav__links a.is-current { color: var(--ink); }
.blogpage main { position: relative; z-index: 1; }

/* Reading progress */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; pointer-events: none; }
.progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), var(--sky)); transition: width .1s linear; }

/* ---------- Blog index ---------- */
.blog-hero { padding: 72px 0 64px; position: relative; overflow: hidden; }
.blog-hero::before { content: ''; position: absolute; inset: -40% -20% auto; height: 120%; background: radial-gradient(ellipse at 30% 20%, rgba(37,99,235,0.28), transparent 60%); pointer-events: none; }
.blog-hero .wrap { position: relative; }
.blog-hero .ttl { font-size: clamp(32px, 4.6vw, 52px); max-width: 780px; }
.blog-hero .sub { margin-top: 18px; max-width: 600px; }
.blog-main { padding: 64px 0 96px; }

.pcard { background: #fff; border: 1px solid var(--neutral); border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; transition: transform .25s ease, box-shadow .25s ease; }
.pcard:hover { transform: translateY(-3px); box-shadow: 0 24px 50px -30px rgba(11,31,59,0.35); }
.pcard__body { padding: 28px 28px 26px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.pcard__meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--slate); font-weight: 500; }
.pcard__cat { color: var(--blue); font-weight: 600; }
.pcard__title { font-size: 22px; line-height: 1.25; font-weight: 700; letter-spacing: -0.02em; color: var(--navy); }
.pcard__title a { color: inherit; text-decoration: none; }
.pcard__title a:hover { color: var(--blue); }
.pcard__desc { font-size: 15px; line-height: 1.6; color: var(--slate); flex: 1; }
.pcard__more { font-size: 14px; font-weight: 600; color: var(--blue); text-decoration: none; margin-top: 4px; }
.pcard__more:hover { text-decoration: underline; }
.card__cover { display: block; aspect-ratio: 1200 / 630; overflow: hidden; background: var(--sand); }
.card__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card__cover--auto { position: relative; background: radial-gradient(ellipse at 20% 15%, rgba(37,99,235,0.55), transparent 55%), radial-gradient(ellipse at 85% 90%, rgba(96,165,250,0.25), transparent 50%), var(--navy); display: flex; align-items: center; justify-content: center; text-decoration: none; }
.card__cover--auto img { width: 22%; height: auto; object-fit: contain; opacity: .92; filter: drop-shadow(0 12px 24px rgba(0,0,0,.35)); }
.card__cover--auto span { position: absolute; left: 20px; bottom: 16px; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--sky); }
.pcard:not(.pcard--featured) .card__cover--auto { aspect-ratio: 2 / 1; }
.pcard:not(.pcard--featured) .card__cover--auto img { width: 18%; }

.pcard--featured { flex-direction: row; margin-bottom: 28px; }
.pcard--featured .card__cover { flex: 0 0 52%; aspect-ratio: auto; }
.pcard--featured .pcard__body { padding: 40px; justify-content: center; }
.pcard--featured .pcard__title { font-size: clamp(26px, 3.2vw, 36px); }
.pcard--featured .pcard__desc { font-size: 17px; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }

/* ---------- Post header ---------- */
.post-hero { padding: 40px 0 56px; position: relative; overflow: hidden; }
.post-hero::before { content: ''; position: absolute; inset: -30% -10% auto; height: 120%; background: radial-gradient(ellipse at 25% 30%, rgba(37,99,235,0.26), transparent 62%); pointer-events: none; }
.post-hero__in { position: relative; max-width: 860px; }
.crumbs { display: flex; gap: 10px; font-size: 13px; color: var(--slate-on-dark); margin-bottom: 28px; }
.crumbs a { color: var(--slate-on-dark); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.post-hero__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: 14px; color: var(--slate-on-dark); margin-bottom: 18px; }
.post-hero__cat { color: var(--sky); font-weight: 600; text-decoration: none; }
.post-hero__upd { color: var(--slate-on-dark); opacity: .85; }
.post-hero__title { font-size: clamp(30px, 4.4vw, 48px); line-height: 1.12; font-weight: 700; letter-spacing: -0.025em; color: var(--ink); }
.post-hero__dek { margin-top: 18px; font-size: clamp(17px, 1.6vw, 20px); line-height: 1.55; color: var(--slate-on-dark); max-width: 680px; }
.byline { display: flex; align-items: center; gap: 12px; margin-top: 28px; }
.byline img { width: 44px; height: 44px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.2); object-fit: cover; }
.byline strong { display: block; font-size: 15px; font-weight: 600; color: var(--ink); }
.byline span { font-size: 13px; color: var(--slate-on-dark); }

/* ---------- Post body ---------- */
.post-main { padding: 56px 0 0; }
.post-grid { display: grid; grid-template-columns: minmax(0, 720px) 1fr; gap: 64px; align-items: start; }
.post { min-width: 0; }
.post-cover { margin: 0 0 40px; border-radius: 16px; overflow: hidden; border: 1px solid var(--neutral); }
.post-cover img { display: block; width: 100%; height: auto; }

.rail { position: sticky; top: 96px; }
.toc { border-left: 2px solid var(--neutral); padding-left: 18px; font-size: 14px; max-width: 280px; }
.toc__label { display: block; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--slate); margin-bottom: 12px; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc ul ul { padding-left: 14px; margin-top: 6px; }
.toc li + li { margin-top: 8px; }
.toc a { color: var(--slate); text-decoration: none; line-height: 1.45; display: block; }
.toc a:hover, .toc a.is-active { color: var(--navy); font-weight: 600; }

.prose { font-size: 17px; line-height: 1.75; color: #1E293B; }
.prose > * + * { margin-top: 1.25em; }
.prose h2 { font-size: 28px; line-height: 1.25; font-weight: 700; letter-spacing: -0.02em; color: var(--navy); margin-top: 2em; scroll-margin-top: 90px; }
.prose h3 { font-size: 21px; line-height: 1.3; font-weight: 700; letter-spacing: -0.015em; color: var(--navy); margin-top: 1.75em; scroll-margin-top: 90px; }
.prose h4 { font-size: 17px; font-weight: 600; color: var(--navy); margin-top: 1.5em; }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: .75em; }
.prose p.lead, .prose > p:first-child { font-size: 19px; color: var(--navy); }
.prose a { color: var(--blue); text-decoration: underline; text-decoration-color: rgba(37,99,235,.35); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--blue); }
.prose strong { font-weight: 600; color: var(--navy); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: .5em; }
.prose li::marker { color: var(--blue); font-weight: 600; }
.prose blockquote { margin: 1.75em 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--blue); color: var(--navy); font-size: 19px; line-height: 1.6; font-weight: 500; }
.prose blockquote p + p { margin-top: .6em; }
.prose blockquote cite { display: block; margin-top: .6em; font-size: 14px; font-style: normal; font-weight: 500; color: var(--slate); }
.prose hr { border: 0; border-top: 1px solid var(--neutral); margin: 2.5em 0; }
.prose img { max-width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--neutral); display: block; }
.prose figure { margin: 2em 0; }
.prose figcaption { font-size: 14px; color: var(--slate); margin-top: 10px; text-align: center; }
.prose code { font-family: var(--font-mono); font-size: .88em; background: #E8EEF6; color: var(--navy); padding: .15em .4em; border-radius: 6px; }
.prose pre { background: var(--navy); color: var(--clean); padding: 20px 22px; border-radius: 12px; overflow-x: auto; font-size: 14px; line-height: 1.6; }
.prose pre code { background: none; color: inherit; padding: 0; font-size: inherit; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--neutral); vertical-align: top; }
.prose th { font-weight: 600; color: var(--navy); background: #E8EEF6; }
.prose .admonition { margin: 1.75em 0; padding: 18px 22px 18px 22px; border-radius: 12px; background: #fff; border: 1px solid var(--neutral); border-left: 4px solid var(--blue); font-size: 16px; }
.prose .admonition-title { font-weight: 600; color: var(--navy); margin: 0 0 6px; }
.prose .admonition p:last-child { margin-bottom: 0; }
.prose .admonition.warning { border-left-color: #D97706; }
.prose .admonition.example { border-left-color: var(--sky); }
.prose .admonition.example .admonition-title::before { content: ''; }
.prose .admonition p + p { margin-top: .75em; }

/* ---------- After the article ---------- */
.post-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 40px 0 0; }
.post-tags li { font-size: 13px; font-weight: 500; color: var(--slate); background: #E8EEF6; border-radius: 999px; padding: 6px 12px; }
.share { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--neutral); font-size: 14px; }
.share > span { color: var(--slate); font-weight: 500; }
.share a, .share__copy { color: var(--navy); font-weight: 600; text-decoration: none; background: none; border: 1px solid var(--neutral); border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.share a:hover, .share__copy:hover { border-color: var(--navy); }
.share__copy.is-done { border-color: var(--blue); color: var(--blue); }

.author { display: flex; gap: 20px; align-items: flex-start; margin-top: 40px; padding: 28px; background: #fff; border: 1px solid var(--neutral); border-radius: 16px; }
.author__photo { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 2px solid var(--neutral); }
.author__text strong { display: block; font-size: 17px; color: var(--navy); }
.author__role { display: block; font-size: 13px; color: var(--slate); margin-top: 2px; }
.author__text p { margin-top: 10px; font-size: 15px; line-height: 1.6; color: var(--slate); }
.author__text a { display: inline-block; margin-top: 10px; font-size: 14px; font-weight: 600; color: var(--blue); text-decoration: none; }
.author__text a:hover { text-decoration: underline; }

/* CTA finale: a sticky stage; --p (0..1) is scroll progress set by blog.js.
   The card starts at the reading column's width and grows until it covers the viewport. */
.cta-stage { --p: 0; --w0: min(720px, 100vw - 48px); height: 220vh; position: relative; margin-top: 24px; }
.cta-stage__sticky { position: sticky; top: 0; height: 100vh; height: 100svh; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.post-cta {
  --ease: var(--p);
  width: calc(var(--w0) + (100vw - var(--w0)) * var(--ease));
  min-height: calc(100svh * var(--ease));
  border-radius: calc(20px * (1 - var(--ease)));
  padding: calc(40px + 24px * var(--ease)) calc(40px + 24px * var(--ease));
  background: var(--navy); color: var(--clean);
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  box-shadow: 0 40px 90px -40px rgba(11,31,59, calc(0.55 * (1 - var(--ease))));
  will-change: width, min-height, border-radius;
}
.post-cta::before { content: ''; position: absolute; right: -10%; bottom: -60%; width: 60%; height: 160%; background: radial-gradient(ellipse, rgba(37,99,235,0.38), transparent 65%); pointer-events: none; transform: scale(calc(1 + 0.9 * var(--ease))); transform-origin: 70% 70%; }
.post-cta::after { content: ''; position: absolute; left: -20%; top: -40%; width: 55%; height: 120%; background: radial-gradient(ellipse, rgba(96,165,250,0.16), transparent 65%); pointer-events: none; opacity: var(--ease); }
.post-cta__in { position: relative; width: 100%; max-width: calc(640px + 320px * var(--ease)); display: flex; gap: 32px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.post-cta__text { max-width: calc(520px + 120px * var(--ease)); }
.post-cta .kicker { color: var(--sky); font-size: calc(13px + 2px * var(--ease)); }
.post-cta h2 { font-size: calc(26px + 16px * var(--ease)); line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
.post-cta p { margin-top: 12px; font-size: calc(15px + 3px * var(--ease)); line-height: 1.6; color: var(--slate-on-dark); }
.post-cta__act { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.post-cta__alt { font-size: 14px; color: var(--slate-on-dark); }
.post-cta__alt:hover { color: var(--clean); }
@media (prefers-reduced-motion: reduce) {
  .cta-stage { height: auto; padding: 64px 0 96px; }
  .cta-stage__sticky { position: static; height: auto; display: block; }
  .post-cta { --ease: 0; width: var(--w0); margin: 0 auto; min-height: 0; }
}

.more { padding: 80px 0 40px; }
.more .kicker { margin-bottom: 20px; }
.more__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .post-grid { grid-template-columns: minmax(0, 720px); }
  .rail { display: none; }
}
@media (max-width: 860px) {
  .pcard--featured { flex-direction: column; }
  .pcard--featured .card__cover { flex: none; aspect-ratio: 1200 / 630; }
  .pcard--featured .pcard__body { padding: 28px; }
}
@media (max-width: 640px) {
  .blog-hero { padding: 48px 0 40px; }
  .blog-main { padding: 40px 0 64px; }
  .post-hero { padding: 24px 0 40px; }
  .post-main { padding-top: 36px; }
  .prose { font-size: 16px; }
  .prose h2 { font-size: 24px; }
  .prose h3 { font-size: 19px; }
  .prose blockquote { font-size: 17px; }
  .author { flex-direction: column; padding: 22px; }
  .cta-stage { height: 200vh; }
  .post-cta { padding: calc(28px + 12px * var(--ease)) calc(22px + 8px * var(--ease)); }
  .post-cta h2 { font-size: calc(22px + 8px * var(--ease)); }
  .more { padding: 56px 0 24px; }
}
