/* Blog post — editorial extension of the AbitAI system */

/* ─── Animation primitives ───────────────────────────────────── */
/* Generic reveal — hidden by default once JS arms it */
.post-anim-ready .rv {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 700ms cubic-bezier(.2,.7,.2,1),
    transform 700ms cubic-bezier(.2,.7,.2,1);
  transition-delay: var(--rv-delay, 0ms);
  will-change: opacity, transform;
}
.post-anim-ready .rv-in {
  opacity: 1;
  transform: translateY(0);
}
/* Slightly different motion per element */
.post-anim-ready .post-prose > h2.rv { transform: translate(-12px, 8px); }
.post-anim-ready .post-prose > h2.rv-in { transform: translate(0, 0); }
.post-anim-ready .post-prose > blockquote.rv { transform: translateX(-10px); }
.post-anim-ready .post-prose > blockquote.rv-in { transform: translateX(0); }
.post-anim-ready .post-stat.rv { transform: translateY(20px) scale(0.985); }
.post-anim-ready .post-stat.rv-in { transform: translateY(0) scale(1); }
.post-anim-ready .post-more-card.rv { transform: translateY(22px); }
.post-anim-ready .post-more-card.rv-in { transform: translateY(0); }
.post-anim-ready .post-cover.rv {
  opacity: 0;
  transform: scale(0.985);
  transition:
    opacity 900ms cubic-bezier(.2,.7,.2,1),
    transform 900ms cubic-bezier(.2,.7,.2,1);
}
.post-anim-ready .post-cover.rv-in {
  opacity: 1;
  transform: scale(1);
}

/* Masthead staged intro */
.post-anim-ready .post-hero .post-meta,
.post-anim-ready .post-hero .post-lede,
.post-anim-ready .post-hero .post-byline {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 800ms cubic-bezier(.2,.7,.2,1),
    transform 800ms cubic-bezier(.2,.7,.2,1);
}
.post-anim-ready .post-hero.intro-play .post-meta    { opacity: 1; transform: translateY(0); transition-delay: 80ms; }
.post-anim-ready .post-hero.intro-play .post-lede    { opacity: 1; transform: translateY(0); transition-delay: 360ms; }
.post-anim-ready .post-hero.intro-play .post-byline  { opacity: 1; transform: translateY(0); transition-delay: 520ms; }

/* Title — character-by-character ink reveal (mirrors home RevealTitle) */
.post-anim-ready .post-title.reveal-title { color: transparent; }
.post-anim-ready .post-title.reveal-title .rword {
  display: inline-block;
  white-space: nowrap;
}
.post-anim-ready .post-title.reveal-title .rch {
  color: #E8E8E8;
  transition: color var(--fade, 650ms) cubic-bezier(.45,.05,.3,.99);
  will-change: color;
}
.post-anim-ready .post-title.reveal-title.play .rch {
  color: var(--c-near-black);
  transition-delay: var(--d, 0ms);
}
.post-anim-ready .post-title.reveal-title.play .rch.rch-accent {
  color: var(--c-accent);
}

/* Cover parallax — set by JS as --parallax */
.post-cover-frame {
  background-position: center calc(50% + var(--parallax, 0px));
  transition: background-position 60ms linear;
}

/* Stat number — gentle on count completion */
.post-anim-ready .post-stat .num {
  font-variant-numeric: tabular-nums;
}

/* Body */

.post-body {
  background: var(--c-bg);
  color: var(--c-near-black);
  font-family: var(--font-sans);
}

/* ─── Static header (mirrors .hdr but always solid) ───────────── */
.post-hdr {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247,247,245,0.85);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--c-light);
}
.post-hdr-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.post-hdr .wordmark { display: flex; align-items: center; }
.post-hdr .wordmark-logo { height: 26px; width: auto; }
.post-back {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--c-mid); text-decoration: none;
  transition: color 160ms ease;
}
.post-back:hover { color: var(--c-near-black); }
/* Back link nudge */
.post-back .arrow {
  width: 22px; height: 8px; display: block;
  transition: transform 220ms cubic-bezier(.2,.8,.2,1);
}
.post-back:hover .arrow { transform: translateX(-3px); }

/* Sticky ToC — active section highlight */
.post-aside a {
  display: inline-flex; align-items: baseline;
  position: relative;
  transition: color 240ms ease, padding-left 240ms cubic-bezier(.2,.8,.2,1);
}
.post-aside a::before {
  content: ""; position: absolute;
  left: -14px; top: 0.55em;
  width: 8px; height: 1px;
  background: var(--c-accent);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 280ms cubic-bezier(.2,.8,.2,1);
}
.post-aside a.is-active {
  color: var(--c-near-black);
}
.post-aside a.is-active .idx { color: var(--c-accent); }
.post-aside a.is-active::before {
  transform: scaleX(1);
  transform-origin: left center;
}

/* "Ler artigo" — arrow nudge on more cards */
.post-more-card { position: relative; }
.post-more-card .body { position: relative; }
.post-more-card h4 {
  transition: transform 240ms cubic-bezier(.2,.8,.2,1);
}
.post-more-card:hover h4 { transform: translateX(2px); }

/* CTA pill — subtle dot pulse on hover (inherits .btn-pill from styles.css) */

/* ─── Hero / masthead ─────────────────────────────────────────── */
.post-hero {
  padding: clamp(72px, 9vw, 140px) 0 clamp(48px, 5vw, 72px);
  border-bottom: 1px solid var(--c-light);
}
.post-meta {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--c-mid);
  margin-bottom: clamp(24px, 3vw, 36px);
}
.post-meta .dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--c-accent); display: inline-block;
}
.post-meta .num { color: var(--c-near-black); font-weight: 500; }
.post-meta .kicker { color: var(--c-near-black); font-weight: 500; }

.post-title {
  font-size: clamp(40px, 5.6vw, 84px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  font-weight: 600;
  margin: 0 0 clamp(20px, 2.2vw, 32px) 0;
  color: var(--c-near-black);
  text-wrap: balance;
  max-width: 18ch;
}
.post-title em {
  font-style: normal;
  font-weight: 600;
  color: var(--c-accent);
}

.post-lede {
  font-size: clamp(18px, 1.5vw, 22px);
  line-height: 1.55;
  color: var(--c-dark);
  max-width: 56ch;
  margin: 0;
  text-wrap: pretty;
}

.post-byline {
  display: flex; align-items: center; gap: 16px;
  margin-top: clamp(36px, 4vw, 56px);
  padding-top: 24px;
  border-top: 1px solid var(--c-light);
  font-size: 13px;
  color: var(--c-mid);
}
.post-byline .author { color: var(--c-near-black); font-weight: 500; }
.post-byline .sep {
  width: 16px; height: 1px; background: var(--c-light);
}

/* ─── Cover image ────────────────────────────────────────────── */
.post-cover {
  margin: clamp(56px, 6vw, 96px) 0 0;
}
.post-cover-frame {
  aspect-ratio: 16 / 9;
  background: var(--c-light) center / cover no-repeat;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}
.post-cover-frame::after {
  content: ""; position: absolute; inset: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.04);
  border-radius: 6px;
  pointer-events: none;
}
.post-cover-caption {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.06em;
  color: var(--c-mid);
  margin-top: 14px;
  text-transform: uppercase;
}

/* ─── Body grid ──────────────────────────────────────────────── */
.post-article {
  padding: clamp(72px, 8vw, 120px) 0 clamp(72px, 8vw, 120px);
}
.post-article .grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 32px;
  row-gap: 0;
}
.post-aside {
  grid-column: 2 / span 2;
  position: sticky; top: 96px;
  align-self: start;
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--c-soft);
}
.post-aside ol {
  margin: 0; padding: 0; list-style: none;
  display: flex; flex-direction: column; gap: 14px;
  border-top: 1px solid var(--c-light);
  padding-top: 18px;
}
.post-aside .idx { color: var(--c-mid); margin-right: 10px; }
.post-aside a { color: var(--c-mid); text-decoration: none; }
.post-aside a:hover { color: var(--c-near-black); }

.post-prose {
  grid-column: 5 / span 7;
  max-width: 64ch;
}
.post-prose > * + * { margin-top: 1.75em; }
.post-prose > p + p,
.post-prose > p + ul,
.post-prose > p + ol,
.post-prose > ul + p,
.post-prose > ol + p,
.post-prose > p + .post-stat,
.post-prose > p + .post-stat-pair,
.post-prose > p + .post-table-wrap,
.post-prose > p + blockquote,
.post-prose > blockquote + p,
.post-prose > .post-stat + p,
.post-prose > .post-stat-pair + p,
.post-prose > .post-table-wrap + p { margin-top: 1.75em; }
.post-prose > h2 + * { margin-top: 1.1em; }
.post-prose > p + h2 { margin-top: 2.25em; }
.post-prose h2 {
  font-size: clamp(26px, 2.4vw, 34px);
  line-height: 1.18;
  letter-spacing: -0.02em;
  font-weight: 600;
  color: var(--c-near-black);
  margin-top: clamp(48px, 4vw, 64px);
  margin-bottom: 0.6em;
  text-wrap: balance;
}
.post-prose h2 .num {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.12em;
  color: var(--c-accent);
  display: block;
  margin-bottom: 14px;
  font-weight: 500;
}
.post-prose p {
  font-size: 17px;
  line-height: 1.65;
  color: var(--c-dark);
  text-wrap: pretty;
  margin: 0;
}
.post-prose p.dropcap::first-letter {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 4em;
  line-height: 0.86;
  float: left;
  padding: 8px 14px 0 0;
  color: var(--c-near-black);
  letter-spacing: -0.03em;
}
.post-prose strong { color: var(--c-near-black); font-weight: 600; }
.post-prose em {
  font-style: normal;
  font-weight: 500;
  color: var(--c-near-black);
  background-image: linear-gradient(to top, rgba(255,61,93,0.18) 0, rgba(255,61,93,0.18) 38%, transparent 38%);
  padding: 0 2px;
}
.post-prose a {
  color: var(--c-near-black);
  text-decoration: none;
  border-bottom: 1px solid var(--c-accent);
  padding-bottom: 1px;
  transition: color 160ms ease;
}
.post-prose a:hover { color: var(--c-accent); }

.post-prose blockquote {
  margin: clamp(36px, 4vw, 56px) 0;
  padding: 0 0 0 28px;
  border-left: 2px solid var(--c-accent);
  font-family: var(--font-sans);
  font-style: normal;
  font-weight: 500;
  font-size: clamp(20px, 1.9vw, 26px);
  line-height: 1.35;
  color: var(--c-near-black);
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.post-prose blockquote cite {
  display: block;
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-style: normal;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-mid);
}

.post-prose ul {
  margin: 0; padding: 0; list-style: none;
}
.post-prose ul li {
  position: relative;
  padding-left: 22px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--c-dark);
  margin-bottom: 12px;
}
.post-prose ul li::before {
  content: ""; position: absolute;
  left: 0; top: 0.7em;
  width: 8px; height: 1px;
  background: var(--c-near-black);
}

/* Editorial stat callout */
.post-stat {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: baseline;
  padding: clamp(28px, 3vw, 36px) 0;
  border-top: 1px solid var(--c-light);
  border-bottom: 1px solid var(--c-light);
  margin: clamp(36px, 4vw, 56px) 0;
}
.post-stat .num {
  font-size: clamp(48px, 5vw, 72px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  font-weight: 500;
  color: var(--c-near-black);
  font-feature-settings: "tnum", "lnum";
}
.post-stat .num em {
  font-style: normal;
  font-weight: 600;
  color: var(--c-accent);
}
.post-stat .label {
  font-size: 14px;
  line-height: 1.5;
  color: var(--c-mid);
  max-width: 36ch;
}

/* Stat pair — two stats side-by-side (ITBI vs. anúncio) */
.post-stat-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: clamp(32px, 4vw, 56px);
  row-gap: 28px;
  padding: clamp(28px, 3vw, 36px) 0;
  border-top: 1px solid var(--c-light);
  border-bottom: 1px solid var(--c-light);
  margin: clamp(36px, 4vw, 56px) 0;
}
.post-stat-pair .post-stat {
  margin: 0;
  padding: 0;
  border: 0;
  grid-template-columns: 1fr;
  gap: 14px;
}
.post-stat-pair .post-stat .num {
  font-size: clamp(40px, 4.2vw, 60px);
  white-space: nowrap;
}
@media (max-width: 640px) {
  .post-stat-pair { grid-template-columns: 1fr; }
}

/* Editorial table */
.post-table-wrap {
  margin: clamp(28px, 3vw, 40px) 0;
  overflow-x: auto;
}
.post-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.5;
}
.post-table thead th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-mid);
  font-weight: 500;
  padding: 0 14px 14px;
  border-bottom: 1px solid var(--c-near-black);
  vertical-align: bottom;
}
.post-table tbody td {
  padding: 14px;
  border-bottom: 1px solid var(--c-light);
  color: var(--c-near-black);
  vertical-align: top;
}
.post-table tbody tr:last-child td { border-bottom: 0; }
.post-table th:first-child,
.post-table td:first-child { padding-left: 0; }
.post-table th:last-child,
.post-table td:last-child { padding-right: 0; }
.post-table .num-col { white-space: nowrap; }
.post-table .num-cell {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.post-table tbody td:first-child {
  font-weight: 500;
  color: var(--c-near-black);
}
@media (max-width: 700px) {
  .post-table { font-size: 13px; }
  .post-table thead th,
  .post-table tbody td { padding-left: 8px; padding-right: 8px; }
  .post-table th:first-child,
  .post-table td:first-child { padding-left: 0; }
  .post-table th:last-child,
  .post-table td:last-child { padding-right: 0; }
}

/* Footnote inline references */
.post-prose sup.fn {
  font-size: 0.62em;
  line-height: 0;
  vertical-align: super;
  margin-left: 1px;
}
.post-prose sup.fn a {
  color: var(--c-accent);
  text-decoration: none;
  border-bottom: 0;
  padding: 0 1px;
  transition: color 160ms ease;
}
.post-prose sup.fn a:hover { color: var(--c-near-black); }

/* Footnotes / sources block */
.post-footnotes {
  margin-top: clamp(56px, 6vw, 88px);
  padding-top: 24px;
  border-top: 1px solid var(--c-light);
}
.post-footnotes-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--c-accent);
  margin: 0 0 14px;
}
.post-footnotes ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.post-footnotes li {
  font-size: 13px;
  line-height: 1.5;
  color: var(--c-mid);
  display: flex;
  gap: 10px;
}
.post-footnotes li::before { content: none; }
.post-footnotes .fn-mark {
  color: var(--c-accent);
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
  min-width: 16px;
}

@media (max-width: 900px) {
  .post-aside { display: none; }
  .post-prose { grid-column: 1 / -1; }
}

/* ─── Continue reading ───────────────────────────────────────── */
.post-more {
  background: var(--c-white);
  border-top: 1px solid var(--c-light);
  border-bottom: 1px solid var(--c-light);
  padding: clamp(72px, 8vw, 120px) 0;
}
.post-more-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: clamp(36px, 4vw, 56px);
  border-bottom: 1px solid var(--c-light);
  padding-bottom: 24px;
}
.post-more-head h3 {
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 600;
  margin: 0;
  color: var(--c-near-black);
}
.post-more-head .label {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--c-mid);
}
.post-more-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}
@media (max-width: 700px) {
  .post-more-grid { grid-template-columns: 1fr; gap: 24px; }
}
.post-more-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--c-light);
  border-radius: 6px;
  background: var(--c-white);
  overflow: hidden;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}
.post-more-card:hover {
  transform: translateY(-2px);
  border-color: var(--c-near-black);
  box-shadow: 0 18px 30px -22px rgba(0,0,0,0.18);
}
.post-more-card .img {
  aspect-ratio: 16/10;
  background: var(--c-light) center / cover no-repeat;
}
.post-more-card .body { padding: 24px 24px 28px; }
.post-more-card .k {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: 12px;
  display: inline-flex; align-items: center; gap: 8px;
}
.post-more-card .k::before {
  content: ""; width: 4px; height: 4px; border-radius: 50%;
  background: var(--c-accent);
}
.post-more-card h4 {
  font-size: 22px;
  line-height: 1.18;
  letter-spacing: -0.015em;
  font-weight: 500;
  color: var(--c-near-black);
  margin: 0 0 10px 0;
  text-wrap: balance;
}
.post-more-card p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--c-mid);
  margin: 0;
}

/* ─── Sticky CTA strip ───────────────────────────────────────── */
.post-cta {
  background: var(--c-near-black);
  color: var(--c-white);
  padding: clamp(64px, 7vw, 100px) 0;
}
.post-cta .grid {
  display: grid; grid-template-columns: 1.4fr 1fr;
  gap: 48px; align-items: center;
}
@media (max-width: 800px) {
  .post-cta .grid { grid-template-columns: 1fr; gap: 28px; }
}
.post-cta h3 {
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 600;
  margin: 0;
  color: var(--c-white);
  text-wrap: balance;
}
.post-cta h3 em {
  font-style: normal;
  font-weight: 600;
  color: var(--c-accent);
}
.post-cta p {
  font-size: 15px;
  line-height: 1.55;
  color: rgba(255,255,255,0.6);
  margin: 0 0 20px 0;
  max-width: 36ch;
}
.post-cta .btn-pill {
  background: #FFF7EA;
  color: #15110D;
  border-color: #FFF7EA;
}
.post-cta .btn-pill:hover { background: #FFF7EA; }
.post-cta .btn-pill .pill-arrow { color: #15110D; }
.post-cta .btn-pill .btn-dot { background: var(--c-accent); }
