/* ============================================================
   ONE ANALYTIC — BLOCOS DO ARTIGO (público)
   Complementa css/site.css com os blocos que js/post-render.js
   monta: meta do autor, capa com crédito, "Em resumo" no fim,
   foto e links do autor, chamada final. Usa só os tokens do site
   (--ink, --accent, --line, --soft, --muted, --r...).
   ============================================================ */

/* Meta: autor com link para a página dele */
.pt-meta a { color: inherit; text-decoration: none; }
.pt-meta a:hover strong, .pt-meta a:focus-visible strong { color: var(--accent); }
.pt-meta .pt-by strong { color: var(--ink); }

/* Capa: altura reservada pelo width/height, crédito discreto */
.pt-cover { display: block; height: auto; aspect-ratio: auto; background: var(--soft); }
.pt-cover-fig { margin: 0 0 36px; }
.pt-cover-fig .pt-cover { margin-bottom: 0; }
.pt-cover-fig figcaption { margin-top: 8px; font-size: 12.5px; color: var(--muted); text-align: right; }

/* Imagens do corpo nunca estouram a coluna */
.post-body img { max-width: 100%; height: auto; }
.post-body figure { margin: 28px 0; }

/* Âncoras do sumário param abaixo do cabeçalho fixo */
.pt-keys, .pt-faq, .pt-sources { scroll-margin-top: 96px; }

/* "Em resumo" agora fecha o texto */
.post-body + .pt-keys { margin-top: 48px; margin-bottom: 0; }
.pt-keys ul { margin: 0; padding: 0; list-style: none; }
.pt-keys li:last-child { margin-bottom: 0; }

/* Perguntas frequentes: foco visível no resumo da pergunta */
.pt-faq summary:focus-visible { border-radius: var(--r-sm); }
.pt-faq summary:hover { color: var(--accent); }
.pt-faq-a p + p { margin-top: 10px; }

/* Autor */
.pt-author { align-items: flex-start; }
.pt-author-photo { flex: 0 0 64px; width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--soft); border: 1px solid var(--line); }
.pt-author .pt-author-name span { color: var(--muted); font-weight: 500; }
.pt-author-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; }
.pt-author-links a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.pt-author-links a:hover { text-decoration-thickness: 2px; }

/* Chamada final (só aparece quando o corpo não tem a sua) */
.pt-cta-final {
  display: flex; align-items: center; justify-content: flex-start;
  margin-top: 40px; padding: 24px; border-radius: var(--r);
  background: var(--accent-soft); border: 1px solid var(--line);
}
.pt-cta-btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 22px;
  border-radius: 999px; background: var(--accent); color: var(--surface);
  font-size: 15px; font-weight: 600; line-height: 1.2; text-decoration: none;
  box-shadow: 0 10px 24px -12px rgba(232, 0, 29, 0.7);
  transition: background 0.2s var(--ease), transform 0.25s var(--ease);
}
.pt-cta-btn:hover { background: var(--accent-2); color: var(--surface); transform: translateY(-1px); }
.pt-cta-btn svg { flex: none; }

@media (max-width: 640px) {
  .pt-author { flex-direction: column; gap: 12px; }
  .pt-cta-final { padding: 20px; }
  .pt-cta-btn { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .pt-cta-btn { transition: none; }
  .pt-cta-btn:hover { transform: none; }
}

/* Respiro entre o CTA final e os posts relacionados */
.pt-cta, .pt-cta-final { margin-bottom: 0; }
.pt-related { margin-top: clamp(56px, 8vw, 96px); padding-top: clamp(32px, 4vw, 48px); border-top: 1px solid var(--line); }

/* Espaços de anúncio (lib/ads.js). Tamanhos fixos do AdSense por largura de tela;
   a caixa já nasce do tamanho do anúncio para a página não pular quando ele carrega. */
.ad { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 40px auto; text-align: center; }
.ad-label { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.ad-unit { display: inline-block; max-width: none; background: var(--soft); }
.ad:has(ins[data-ad-status="unfilled"]) { display: none; }
.pt-ad-top .ad { margin: 0 auto 32px; }
.ad-topo .ad-unit { width: 320px; height: 100px; }
.ad-meio .ad-unit, .ad-fim .ad-unit { width: 300px; height: 250px; }
.ad-lateral { margin: 32px 0 0; position: sticky; top: 96px; }
.ad-lateral .ad-unit { width: 300px; height: 600px; }
.pt-side:has(.ad-lateral) { position: static; align-self: stretch; }
@media (min-width: 400px) {
  .ad-meio .ad-unit, .ad-fim .ad-unit { width: 336px; height: 280px; }
}
@media (min-width: 820px) {
  .ad-topo .ad-unit { width: 728px; height: 90px; }
}
@media (max-width: 1080px) {
  .ad-lateral { display: none; }
}
/* Prévia: caixa marcada no lugar do anúncio */
.ad-ph { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 8px; border: 1px dashed var(--line-2); border-radius: 6px; color: var(--muted); font-size: 13px; }
.ad-ph strong { color: var(--ink); font-weight: 600; }
