/* Blog Ápia — camada editorial sobre apia-landing.css (mesmos tokens, mesma família) */

/* tokens do site também fora de .apia-site (topo e rodapé) */
:root {
  --ink: #35205C;
  --ink-soft: #6D4EA2;
  --green: #78B42B;
  --green-soft: #A6D96A;
  --cream: #F7F2EA;
  --cream-deep: #E9DFD0;
  --paper: #FFFCFA;
  --max: 1160px;
}
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: #F7F2EA;
  color: #35205C;
  font-family: "Manrope", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.apia-site.apia-blog { box-shadow: none; z-index: 1; min-height: 100dvh; }

/* ── Topo ── */
.blog-top {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, #F7F2EA 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(53,32,92,.08);
}
.blog-top__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 68px;
}
.blog-top__logo img { height: 32px; width: auto; display: block; }
.blog-top nav { display: flex; align-items: center; gap: 1.2rem; }
.blog-top nav a {
  color: #35205C;
  font-weight: 600;
  font-size: .92rem;
  text-decoration: none;
}
.blog-top nav a:hover, .blog-top nav a[aria-current="page"] { color: #78B42B; }
.blog-top .apia-btn { padding: .65rem 1.05rem; font-size: .86rem; }
@media (max-width: 640px) {
  .blog-top nav a.blog-top__home { display: none; }
  .blog-top__logo img { height: 26px; }
}

/* ── Trilha ── */
.blog-crumbs {
  margin: 0;
  padding: 1.4rem 0 0;
  font-size: .82rem;
  color: #6D4EA2;
}
.blog-crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.blog-crumbs li + li::before { content: "/"; margin-right: .4rem; color: rgba(53,32,92,.35); }
.blog-crumbs a { color: inherit; text-decoration: none; }
.blog-crumbs a:hover { color: #35205C; text-decoration: underline; text-decoration-color: #78B42B; }

/* ── Capa do índice ── */
.blog-hero { padding: clamp(2.4rem, 6vw, 4.4rem) 0 clamp(1.6rem, 4vw, 2.6rem); }
.blog-hero .apia-display {
  font-size: clamp(2.3rem, 5.6vw, 4.4rem);
  max-width: 16ch;
  margin: .2rem 0 1.1rem;
}
.blog-hero__lead {
  max-width: 60ch;
  font-size: clamp(1.02rem, 1.4vw, 1.16rem);
  line-height: 1.65;
  color: #4a3a66;
  margin: 0;
}

/* ── Grade de artigos ── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(1rem, 2.2vw, 1.6rem);
  padding-bottom: clamp(3rem, 7vw, 5rem);
}
.blog-card {
  grid-column: span 4;
  display: flex;
  flex-direction: column;
  background: #FFFCFA;
  border: 1px solid rgba(53,32,92,.08);
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(53,32,92,.08);
  transition: transform .45s cubic-bezier(.2,.8,.2,1), box-shadow .45s ease;
}
.blog-card:hover, .blog-card:focus-within {
  transform: translateY(-6px);
  box-shadow: 0 30px 70px rgba(53,32,92,.16);
}
.blog-card--lead { grid-column: span 12; flex-direction: row; }
.blog-card--lead .blog-card__fig { flex: 1.25; }
.blog-card--lead .blog-card__body { flex: 1; justify-content: center; padding: clamp(1.4rem, 3vw, 2.6rem); }
.blog-card--lead h3 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
.blog-card__fig { margin: 0; position: relative; background: #E9DFD0; }
.blog-card__fig img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.blog-card__fig figcaption {
  position: absolute;
  left: .8rem; bottom: .8rem;
  max-width: calc(100% - 1.6rem);
  padding: .32rem .7rem;
  border-radius: 999px;
  background: rgba(53,32,92,.82);
  color: #FFFCFA;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.blog-card__body { display: flex; flex-direction: column; gap: .7rem; padding: 1.25rem 1.35rem 1.5rem; flex: 1; }
.blog-card__meta { font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #6D4EA2; }
.blog-card h3 {
  margin: 0;
  font-family: "Sora", system-ui, sans-serif;
  font-size: 1.22rem;
  line-height: 1.22;
  letter-spacing: -.02em;
}
.blog-card h3 a { color: #35205C; text-decoration: none; }
.blog-card h3 a::after { content: ""; position: absolute; inset: 0; }
.blog-card { position: relative; }
.blog-card p { margin: 0; line-height: 1.6; color: #4a3a66; font-size: .97rem; }
.blog-card__more { margin-top: auto; font-weight: 700; font-size: .9rem; color: #78B42B; }
/* 1 destaque + 2 médios + 3 pequenos = sem buraco na grade */
.blog-grid > .blog-card--lead ~ .blog-card:nth-child(2),
.blog-grid > .blog-card--lead ~ .blog-card:nth-child(3) { grid-column: span 6; }
@media (max-width: 980px) {
  .blog-card, .blog-grid > .blog-card--lead ~ .blog-card:nth-child(n) { grid-column: span 6; }
  .blog-card--lead { grid-column: span 12; flex-direction: column; }
}
@media (max-width: 640px) {
  .blog-card, .blog-card--lead, .blog-grid > .blog-card--lead ~ .blog-card:nth-child(n) { grid-column: span 12; }
}

/* ── Artigo ── */
.post-head { padding: clamp(1.6rem, 4vw, 2.6rem) 0 1.4rem; max-width: 52rem; }
.post-head h1 {
  font-family: "Sora", system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  line-height: 1.06;
  letter-spacing: -.035em;
  margin: .3rem 0 1.1rem;
}
.post-head__dek { font-size: clamp(1.05rem, 1.5vw, 1.2rem); line-height: 1.6; color: #4a3a66; margin: 0 0 1.2rem; max-width: 60ch; }
.post-head__meta { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; font-size: .85rem; color: #6D4EA2; font-weight: 600; }

.post-cover { margin: 0 0 clamp(2rem, 5vw, 3.2rem); }
.post-cover img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  max-height: 68vh;
  object-fit: cover;
  border-radius: 26px;
  background: #E9DFD0;
  box-shadow: 0 28px 70px rgba(53,32,92,.14);
}
.post-cover figcaption, .post-figure figcaption {
  margin-top: .75rem;
  font-size: .86rem;
  color: #6D4EA2;
  padding-left: 1rem;
  border-left: 3px solid #78B42B;
}

.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 17rem;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
  padding-bottom: clamp(2.5rem, 6vw, 4rem);
}
@media (max-width: 980px) { .post-layout { grid-template-columns: 1fr; } }

.post-body { max-width: 68ch; font-size: 1.06rem; line-height: 1.75; color: #3a2d52; }
.post-body > p:first-child { font-size: 1.14rem; color: #35205C; }
.post-body h2 {
  font-family: "Sora", system-ui, sans-serif;
  font-size: clamp(1.45rem, 2.4vw, 1.9rem);
  line-height: 1.18;
  letter-spacing: -.025em;
  color: #35205C;
  margin: 2.6rem 0 .9rem;
  scroll-margin-top: 90px;
}
.post-body h3 {
  font-family: "Sora", system-ui, sans-serif;
  font-size: 1.16rem;
  letter-spacing: -.015em;
  color: #35205C;
  margin: 1.8rem 0 .5rem;
}
.post-body p { margin: 0 0 1.1rem; }
.post-body ul, .post-body ol { margin: 0 0 1.2rem; padding-left: 1.3rem; }
.post-body li { margin-bottom: .45rem; }
.post-body li::marker { color: #78B42B; font-weight: 700; }
.post-body a {
  color: #6D4EA2;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: #78B42B;
  text-underline-offset: 3px;
}
.post-body a:hover, .post-body a:focus-visible { color: #35205C; }
.post-body strong { color: #35205C; }

.post-tldr {
  margin: 0 0 2rem;
  padding: 1.3rem 1.4rem 1.2rem;
  border-radius: 22px;
  background: #35205C;
  color: #FFFCFA;
}
.post-tldr p.post-tldr__label {
  margin: 0 0 .6rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #A6D96A;
}
.post-tldr ul { margin: 0; padding-left: 1.1rem; }
.post-tldr li { margin-bottom: .4rem; line-height: 1.55; font-size: 1rem; }
.post-tldr li::marker { color: #A6D96A; }

.post-table-wrap { overflow-x: auto; margin: 0 0 1.4rem; border-radius: 18px; border: 1px solid rgba(53,32,92,.12); background: #FFFCFA; }
.post-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.post-table th, .post-table td { text-align: left; padding: .75rem .9rem; border-bottom: 1px solid rgba(53,32,92,.08); vertical-align: top; }
.post-table th { font-family: "Sora", system-ui, sans-serif; font-size: .82rem; letter-spacing: .02em; background: #EFE8DC; }
.post-table tr:last-child td { border-bottom: 0; }

.post-sources {
  margin: 2.4rem 0 0;
  padding: 1.2rem 1.3rem;
  border-radius: 18px;
  background: #EFE8DC;
  font-size: .92rem;
}
.post-sources h2 { margin-top: 0 !important; font-size: 1.1rem !important; }
.post-sources ol { margin: 0; }

/* lateral */
.post-aside { position: sticky; top: 96px; display: grid; gap: 1rem; }
.post-aside__box {
  padding: 1.2rem;
  border-radius: 20px;
  background: #FFFCFA;
  border: 1px solid rgba(53,32,92,.08);
}
.post-aside__box p.apia-label { margin-bottom: .6rem; }
.post-aside__box ol { margin: 0; padding-left: 1.1rem; font-size: .9rem; line-height: 1.45; }
.post-aside__box li { margin-bottom: .45rem; }
.post-aside__box a { color: #35205C; text-decoration: none; }
.post-aside__box a:hover { color: #78B42B; }
.post-aside__cta { background: #35205C; color: #FFFCFA; }
.post-aside__cta p { margin: 0 0 .9rem; line-height: 1.5; font-size: .95rem; }
.post-aside__cta strong { font-family: "Sora", system-ui, sans-serif; display: block; font-size: 1.05rem; margin-bottom: .35rem; color: #A6D96A; }
@media (max-width: 980px) { .post-aside { position: static; } }

/* relacionados */
.post-related { padding: clamp(2.5rem, 6vw, 4rem) 0; border-top: 1px solid rgba(53,32,92,.08); }
.post-related .blog-grid { padding-bottom: 0; }

/* FAQ do blog usa .apia-faq; só o espaçamento muda */
.apia-faq.blog-faq { padding: clamp(2.6rem, 6vw, 4rem) 0; }
.apia-faq.blog-faq .apia-display { font-size: clamp(1.8rem, 3.6vw, 2.6rem); margin-bottom: .9rem; }

/* CTA final */
.blog-cta { background: #35205C; color: #FFFCFA; padding: clamp(2.8rem, 6vw, 4.2rem) 0; }
.blog-cta__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.4rem; }
.blog-cta p.blog-cta__title { font-family: "Sora", system-ui, sans-serif; font-weight: 700; font-size: clamp(1.5rem, 3vw, 2.2rem); letter-spacing: -.03em; margin: 0 0 .4rem; }
.blog-cta p { margin: 0; color: rgba(255,252,250,.78); max-width: 52ch; line-height: 1.55; }

/* entrada */
@media (prefers-reduced-motion: no-preference) {
  .blog-hero > *, .post-head > *, .post-cover {
    animation: blog-rise .7s cubic-bezier(.2,.8,.2,1) both;
  }
  .blog-hero > *:nth-child(2), .post-head > *:nth-child(2) { animation-delay: .06s; }
  .blog-hero > *:nth-child(3), .post-head > *:nth-child(3) { animation-delay: .12s; }
  .post-cover { animation-delay: .16s; }
  @keyframes blog-rise { from { opacity: 0; transform: translateY(18px); } }
}
:focus-visible { outline: 3px solid #78B42B; outline-offset: 3px; }

.post-figure { margin: 2rem 0; }
.post-figure img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 22px; background: #E9DFD0; }
