/* ==============================================================
   POST.CSS - shared layout for /knowledge/<post>/ pages
   Sits on top of page.css.
   ============================================================== */

.post-hero {
  background: linear-gradient(160deg, var(--tint-blue) 0%, var(--white) 70%);
  padding: var(--s9) 0 var(--s7);
  border-bottom: 1px solid var(--border);
  position: relative;
}
.post-hero::before {
  content: ""; position: absolute;
  right: -100px; top: -80px;
  width: 360px; height: 360px;
  background: radial-gradient(circle, rgba(79,189,240,.15), transparent 70%);
  border-radius: 50%; pointer-events: none;
}
.post-hero .container { max-width: 760px; position: relative; z-index: 1; }
.post-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--ink-soft);
  margin-bottom: var(--s5);
}
.post-back:hover { color: var(--blue); }
.post-back svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; transition: transform .2s; }
.post-back:hover svg { transform: translateX(-3px); }

.post-tag {
  display: inline-block;
  font-family: var(--mono); font-size: 11px;
  font-weight: 700; color: var(--blue);
  letter-spacing: 0.10em; text-transform: uppercase;
  margin-bottom: var(--s4);
}
.post-hero h1 {
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.05; font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: var(--s5);
}
.post-meta {
  display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap;
  font-size: 13px; color: var(--ink-mute);
  padding-top: var(--s5); border-top: 1px solid var(--border);
}
.post-meta b { color: var(--ink); font-weight: 600; }
.post-meta-divider { width: 4px; height: 4px; border-radius: 50%; background: var(--ink-faint); }

/* --------------------------------------------------------------
   Photographic hero variant - self-hosted photo + brand overlay
   -------------------------------------------------------------- */
.post-hero.has-photo { background: #0D1B4A; border-bottom: 0; }
.post-hero.has-photo::before { display: none; }
.post-hero-photo {
  position: absolute; inset: 0; z-index: 0;
  background-image:
    linear-gradient(118deg, rgba(9,18,46,0.95) 0%, rgba(11,23,62,0.90) 40%, rgba(1,96,226,0.62) 76%, rgba(32,155,212,0.46) 100%),
    var(--hero-img, none);
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
}
.post-hero-grid {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0.07;
  background-image:
    linear-gradient(rgba(255,255,255,1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,1) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse at 78% 22%, #000 6%, transparent 72%);
  mask-image: radial-gradient(ellipse at 78% 22%, #000 6%, transparent 72%);
}
.post-hero.has-photo .container { position: relative; z-index: 1; }
.post-hero.has-photo h1 { color: #fff; text-shadow: 0 2px 22px rgba(8,16,40,0.5); }
.post-hero.has-photo .post-standfirst { color: rgba(255,255,255,0.94); text-shadow: 0 1px 12px rgba(8,16,40,0.45); }
/* Back link as a prominent chip on its own line */
.post-hero.has-photo .post-back {
  display: flex; width: fit-content; align-items: center; gap: 6px;
  padding: 8px 16px 8px 12px; margin-bottom: var(--s4);
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.34);
  border-radius: var(--r-pill);
  color: #fff; font-weight: 700; font-size: 13px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: background .2s, border-color .2s;
}
.post-hero.has-photo .post-back:hover { color: #fff; background: rgba(255,255,255,0.26); border-color: rgba(255,255,255,0.55); }
.post-hero.has-photo .post-back svg { width: 15px; height: 15px; }
.post-hero.has-photo .post-tag { color: var(--spotlight, #8DD2F2); display: block; text-shadow: 0 1px 8px rgba(8,16,40,0.4); }
.post-hero.has-photo .post-meta { color: rgba(255,255,255,0.82); border-top-color: rgba(255,255,255,0.22); }
.post-hero.has-photo .post-meta b { color: #fff; }
.post-hero.has-photo .post-meta-divider { background: rgba(255,255,255,0.45); }

.post-body { padding: var(--s9) 0; }
.post-body .container { max-width: 760px; }

.post-content > * { max-width: 720px; }
.post-content h2 {
  font-size: clamp(26px, 2.6vw, 32px);
  font-weight: 700; line-height: 1.15;
  letter-spacing: -0.02em;
  margin: var(--s8) 0 var(--s4);
  color: var(--ink);
  scroll-margin-top: 100px;
}
.post-content h3 {
  font-size: 20px; font-weight: 700;
  letter-spacing: -0.01em;
  margin: var(--s6) 0 var(--s3);
  color: var(--ink);
}
.post-content p {
  font-size: 17px; line-height: 1.75;
  color: var(--ink-soft);
  margin: 0 0 var(--s4);
}
.post-content p strong, .post-content b { color: var(--ink); font-weight: 600; }
.post-content a { color: var(--blue); font-weight: 500; text-decoration: underline; text-decoration-color: rgba(1,96,226,.3); text-underline-offset: 3px; }
.post-content a:hover { text-decoration-color: var(--blue); }
.post-content ul, .post-content ol {
  list-style: none; padding: 0; margin: var(--s4) 0;
  display: flex; flex-direction: column; gap: var(--s3);
}
.post-content ul li {
  position: relative; padding-left: var(--s5);
  font-size: 16px; color: var(--ink-soft); line-height: 1.65;
}
.post-content ul li::before {
  content: ""; position: absolute;
  left: 0; top: 11px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--gradient);
}
.post-content ol { counter-reset: post-ol; }
.post-content ol li {
  position: relative; padding-left: var(--s7);
  font-size: 16px; color: var(--ink-soft); line-height: 1.65;
  counter-increment: post-ol;
}
.post-content ol li::before {
  content: counter(post-ol);
  position: absolute; left: 0; top: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--gradient); color: white;
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  display: grid; place-items: center;
}
.post-content blockquote {
  margin: var(--s7) 0;
  padding: var(--s5) var(--s6);
  background: var(--tint-blue);
  border-left: 4px solid var(--blue);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  font-size: 18px; line-height: 1.55; color: var(--ink); font-weight: 500;
  font-style: italic;
}
.post-content blockquote p { margin: 0; color: var(--ink); font-size: 18px; }
.post-content code {
  font-family: var(--mono); font-size: 14px;
  background: var(--paper);
  padding: 2px 6px; border-radius: 4px;
  color: var(--blue);
  border: 1px solid var(--border);
}
.post-content pre {
  margin: var(--s5) 0;
  padding: var(--s5);
  background: #0D1B4A; color: #E5EAF2;
  border-radius: var(--r-md);
  overflow-x: auto;
  font-family: var(--mono); font-size: 13px; line-height: 1.6;
}
.post-content pre code { background: transparent; border: 0; color: inherit; padding: 0; }
.post-content hr { border: 0; border-top: 1px solid var(--border); margin: var(--s7) 0; }

.callout {
  margin: var(--s7) 0;
  padding: var(--s5) var(--s6);
  background: linear-gradient(135deg, var(--white) 0%, var(--tint-blue) 100%);
  border: 1px solid var(--border-blue);
  border-radius: var(--r-lg);
}
.callout-h {
  font-size: 13px; font-weight: 700;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--blue); margin-bottom: var(--s2);
}
.callout p { color: var(--ink); font-size: 15px; line-height: 1.6; margin: 0; }

.tldr {
  margin-bottom: var(--s7);
  padding: var(--s5) var(--s6);
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.tldr-h {
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--cyan); margin-bottom: var(--s2);
}
.tldr p { margin: 0; font-size: 16px; color: var(--ink); line-height: 1.6; }

.post-author {
  margin-top: var(--s8);
  padding: var(--s5) var(--s6);
  background: var(--paper);
  border-radius: var(--r-lg);
  display: flex; align-items: center; gap: var(--s4);
}
.post-author-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--gradient);
  display: grid; place-items: center;
  color: white; font-size: 18px; font-weight: 700;
  flex-shrink: 0; overflow: hidden;
}
.post-author-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.post-author-name { font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.post-author-role { font-size: 13px; color: var(--ink-soft); margin: 0; }

.post-next {
  margin-top: var(--s8);
  padding: var(--s6);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  display: grid; grid-template-columns: 1fr auto; gap: var(--s5);
  align-items: center;
  text-decoration: none; color: var(--ink);
  transition: all .25s;
}
.post-next:hover { border-color: var(--cyan); transform: translateY(-2px); box-shadow: var(--sh-sm); color: var(--ink); }
.post-next-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--blue); margin-bottom: 6px; display: block; }
.post-next-h { font-size: 18px; font-weight: 700; line-height: 1.25; color: var(--ink); }
.post-next-arrow { width: 44px; height: 44px; border-radius: 50%; background: var(--gradient); color: white; display: grid; place-items: center; flex-shrink: 0; }
.post-next-arrow svg { width: 18px; height: 18px; stroke: white; stroke-width: 2; fill: none; }

/* --------------------------------------------------------------
   Standfirst (deck) - one-line summary under the H1 in the hero
   -------------------------------------------------------------- */
.post-standfirst {
  font-size: 20px; line-height: 1.55; font-weight: 400;
  color: var(--ink-soft);
  margin: 0 0 var(--s5); max-width: 60ch;
}

/* --------------------------------------------------------------
   Inline service CTA - topic-matched, sits mid-article
   -------------------------------------------------------------- */
.post-inline-cta {
  margin: var(--s7) 0;
  padding: var(--s5) var(--s6);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s4); flex-wrap: wrap;
  background: var(--paper);
  border: 1px solid var(--border);
  border-left: 3px solid var(--cyan);
  border-radius: var(--r-md);
}
.post-inline-cta-text { flex: 1; min-width: 240px; }
.post-inline-cta-eyebrow {
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--cyan); margin-bottom: 6px;
}
.post-content .post-inline-cta p { margin: 0; font-size: 15px; color: var(--ink); line-height: 1.5; }
.post-content a.post-inline-cta-link {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 700; color: var(--blue);
  text-decoration: none; white-space: nowrap;
}
.post-inline-cta-link svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2.5; fill: none; transition: transform .2s; }
.post-inline-cta-link:hover svg { transform: translateX(4px); }

/* --------------------------------------------------------------
   Stat / data callout - gradient numbers, caption, source line
   -------------------------------------------------------------- */
.post-stat {
  margin: var(--s7) 0;
  padding: var(--s6);
  background: linear-gradient(135deg, var(--white) 0%, var(--tint-blue) 100%);
  border: 1px solid var(--border-blue);
  border-radius: var(--r-lg);
}
.post-stat-grid { display: flex; flex-wrap: wrap; gap: var(--s5) var(--s7); margin-bottom: var(--s4); }
.post-stat-num {
  font-size: clamp(32px, 5vw, 46px); font-weight: 700;
  line-height: 1; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  background: var(--gradient);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.post-stat-label { font-size: 13px; color: var(--ink-soft); line-height: 1.4; margin-top: 8px; max-width: 26ch; }
.post-content .post-stat-caption { font-size: 14px; color: var(--ink-soft); line-height: 1.55; margin: 0; }
.post-stat-source {
  display: block; margin-top: var(--s3);
  font-family: var(--mono); font-size: 11px; color: var(--ink-mute); letter-spacing: 0.02em;
}

/* --------------------------------------------------------------
   FAQ section - visible Q&A pairs (also marked up as FAQPage schema)
   -------------------------------------------------------------- */
.post-faq { margin-top: var(--s8); }
.post-faq-h {
  font-size: clamp(26px, 2.6vw, 32px); font-weight: 700;
  letter-spacing: -0.02em; margin: 0 0 var(--s5); color: var(--ink);
}
.post-faq-item { padding: var(--s5) 0; border-top: 1px solid var(--border); }
.post-faq-item:last-child { border-bottom: 1px solid var(--border); }
.post-content .post-faq-q { font-size: 18px; font-weight: 700; color: var(--ink); margin: 0 0 var(--s2); line-height: 1.3; }
.post-content .post-faq-a { font-size: 16px; color: var(--ink-soft); line-height: 1.65; margin: 0; }

@media (max-width: 700px) {
  .post-content h2 { font-size: 22px; }
  .post-next { grid-template-columns: 1fr; }
  .post-next-arrow { display: none; }
  .post-author { flex-wrap: wrap; }
  .post-standfirst { font-size: 18px; }
  .post-inline-cta { flex-direction: column; align-items: flex-start; }
  .post-stat-grid { gap: var(--s5); }
}
