/* ============================================================
   post.css — article pages generated from Sanity
   Uses the site's existing design tokens (colors_and_type.css).
   ============================================================ */

.post {
  padding: 120px 24px 96px;
  background: #fff;
}

.post-wrap {
  max-width: 720px;   /* ~70 chars per line — the readable measure */
  margin: 0 auto;
}

/* ---- back link ---- */
.post-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--ao-font-sans);
  font-size: 13px;
  color: var(--ao-ink-3);
  text-decoration: none;
  margin-bottom: 40px;
  transition: color .18s ease;
}
.post-back:hover { color: var(--ao-blue); }

/* ---- meta line ---- */
.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--ao-font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ao-ink-3);
  margin-bottom: 20px;
}
.post-meta .cat { color: var(--ao-green-900); font-weight: 600; }
.post-meta .sep {
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--ao-blue-300);
}

/* ---- headline ---- */
.post-title {
  font-family: var(--ao-font-display);
  font-weight: 700;
  font-size: clamp(30px, 4.4vw, 44px);
  line-height: 1.18;
  letter-spacing: -.015em;
  color: var(--ao-blue);
  margin: 0 0 20px;
}

.post-stand {
  font-family: var(--ao-font-sans);
  font-size: 19px;
  line-height: 1.6;
  color: var(--ao-ink-2);
  margin: 0 0 32px;
}

/* ---- byline ---- */
.post-author {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--ao-blue-100);
  margin-bottom: 40px;
}
.post-av {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ao-blue);
  color: #fff;
  font-family: var(--ao-font-mono);
  font-size: 13px;
  letter-spacing: .04em;
  flex: none;
}
.post-who { display: flex; flex-direction: column; line-height: 1.35; }
.post-who b {
  font-family: var(--ao-font-sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--ao-ink);
}
.post-who span {
  font-family: var(--ao-font-sans);
  font-size: 13px;
  color: var(--ao-ink-3);
}

/* ---- hero image ---- */
.post-hero {
  margin: 0 0 44px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--ao-blue-50);
}
.post-hero img { display: block; width: 100%; height: auto; }

/* ============================================================
   Article body
   ============================================================ */
.post-body {
  font-family: var(--ao-font-sans);
  font-size: 17px;
  line-height: 1.75;
  color: var(--ao-ink);
}
.post-body > * + * { margin-top: 1.35em; }

.post-body h2 {
  font-family: var(--ao-font-display);
  font-weight: 700;
  font-size: 26px;
  line-height: 1.3;
  color: var(--ao-blue);
  margin-top: 2.4em;
  letter-spacing: -.01em;
}
.post-body h3 {
  font-family: var(--ao-font-display);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.35;
  color: var(--ao-blue);
  margin-top: 2em;
}
.post-body h4 {
  font-family: var(--ao-font-sans);
  font-weight: 600;
  font-size: 17px;
  color: var(--ao-blue-700);
  margin-top: 1.8em;
}

.post-body a {
  color: var(--ao-blue);
  text-decoration: underline;
  text-decoration-color: var(--ao-green-500);
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
  transition: color .16s ease;
}
.post-body a:hover { color: var(--ao-green-900); }

.post-body strong { font-weight: 600; color: var(--ao-blue-900); }

.post-body ul,
.post-body ol { padding-left: 22px; }
.post-body li { margin-top: .5em; }
.post-body li::marker { color: var(--ao-green-700); }

.post-body blockquote {
  margin-left: 0;
  margin-right: 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--ao-green);
  font-size: 19px;
  line-height: 1.6;
  color: var(--ao-ink-2);
  font-style: normal;
}

.post-body code {
  font-family: var(--ao-font-mono);
  font-size: .88em;
  background: var(--ao-blue-50);
  border: 1px solid var(--ao-blue-100);
  border-radius: 4px;
  padding: 1px 5px;
}

.post-code {
  background: var(--ao-blue-950);
  border-radius: 8px;
  padding: 20px 22px;
  overflow-x: auto;
}
.post-code code {
  font-family: var(--ao-font-mono);
  font-size: 13.5px;
  line-height: 1.65;
  color: #D2DAE6;
  background: none;
  border: none;
  padding: 0;
}

.post-fig { margin: 2.4em 0; }
.post-fig img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}
.post-fig figcaption {
  margin-top: 10px;
  font-family: var(--ao-font-sans);
  font-size: 13px;
  color: var(--ao-ink-3);
  text-align: center;
}

/* ============================================================
   Case study metrics
   ============================================================ */
.case-hero-metric {
  background: var(--ao-green-200);
  border-radius: 10px;
  padding: 28px 32px;
  margin: 0 0 24px;
}
.case-hero-metric .num {
  font-family: var(--ao-font-display);
  font-weight: 700;
  font-size: 44px;
  line-height: 1;
  color: var(--ao-blue);
}
.case-hero-metric .lbl {
  margin-top: 8px;
  font-family: var(--ao-font-sans);
  font-size: 14px;
  color: var(--ao-ink-2);
}

.case-sub-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 40px;
}
.case-sub-metrics > div {
  flex: 1 1 160px;
  border: 1px solid var(--ao-blue-100);
  border-radius: 8px;
  padding: 16px 18px;
}
.case-sub-metrics b {
  display: block;
  font-family: var(--ao-font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--ao-blue);
}
.case-sub-metrics span {
  display: block;
  margin-top: 4px;
  font-family: var(--ao-font-sans);
  font-size: 12px;
  color: var(--ao-ink-3);
}

/* ============================================================
   Footer CTA
   ============================================================ */
.post-foot {
  margin-top: 64px;
  padding-top: 36px;
  border-top: 1px solid var(--ao-blue-100);
  text-align: center;
}
.post-foot p {
  font-family: var(--ao-font-sans);
  font-size: 16px;
  color: var(--ao-ink-2);
  margin: 0 0 20px;
}

/* ============================================================
   White paper email gate (modal on blog.html)
   ============================================================ */
.wp-gate {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 17, 31, .6);
  backdrop-filter: blur(3px);
}
.wp-gate.on { display: flex; }

.wp-gate-panel {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 440px;
  padding: 32px;
  position: relative;
}
.wp-gate-close {
  position: absolute;
  top: 14px; right: 14px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ao-ink-3);
  padding: 6px;
  line-height: 0;
}
.wp-gate-eyebrow {
  font-family: var(--ao-font-mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ao-green-900);
  margin-bottom: 8px;
}
.wp-gate-title {
  font-family: var(--ao-font-display);
  font-weight: 700;
  font-size: 21px;
  line-height: 1.3;
  color: var(--ao-blue);
  margin: 0 0 8px;
}
.wp-gate-sub {
  font-family: var(--ao-font-sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ao-ink-3);
  margin: 0 0 22px;
}
.wp-gate input {
  width: 100%;
  padding: 11px 14px;
  margin-bottom: 10px;
  border: 1px solid var(--ao-blue-200);
  border-radius: 7px;
  font-family: var(--ao-font-sans);
  font-size: 14px;
  color: var(--ao-ink);
  box-sizing: border-box;
}
.wp-gate input:focus {
  outline: none;
  border-color: var(--ao-green-700);
}
.wp-gate input.err { border-color: #C0644F; }
.wp-gate .btn { width: 100%; justify-content: center; margin-top: 6px; }
.wp-gate-note {
  margin: 14px 0 0;
  font-family: var(--ao-font-sans);
  font-size: 12px;
  line-height: 1.5;
  color: var(--ao-ink-3);
  text-align: center;
}
.wp-gate-err {
  margin-top: 10px;
  font-family: var(--ao-font-sans);
  font-size: 13px;
  color: #8A3B2E;
}
.wp-gate-ok {
  text-align: center;
  padding: 12px 0;
}
.wp-gate-ok p {
  font-family: var(--ao-font-sans);
  font-size: 14px;
  color: var(--ao-ink-2);
  margin: 12px 0 20px;
}

/* ============================================================
   Mobile
   ============================================================ */
@media (max-width: 720px) {
  .post { padding: 96px 20px 72px; }
  .post-body { font-size: 16px; }
  .post-stand { font-size: 17px; }
  .case-hero-metric .num { font-size: 34px; }
}
