/* Rico aos Poucos — bloco "Sobre o autor" no fim de cada artigo.
 *
 * Renderizado pelo HTML estático (snippet idempotente, sentinela rap-author-footer v1),
 * hidratado por author-footer.js que faz fetch da API de perfil.
 *
 * Design: card escuro alinhado com o resto do site, avatar redondo grande à esquerda
 * (no desktop), info do autor à direita com nome, bio, stats em chips e CTA.
 * Mobile-first: empilha avatar em cima, info embaixo, stats em grid 2x2.
 *
 * Sem conflito com .article-container: escopado em .article-author-footer.
 */

.article-author-footer {
  --aaf-bg:          #161b22;
  --aaf-border:      rgba(139, 148, 158, 0.20);
  --aaf-text:        #e6edf3;
  --aaf-muted:       #8b949e;
  --aaf-accent:      #58a6ff;
  --aaf-accent-soft: rgba(88, 166, 255, 0.14);
  --aaf-chip-bg:     rgba(255, 255, 255, 0.04);
  --aaf-chip-border: rgba(255, 255, 255, 0.08);

  margin: 48px 0 24px;
  padding: 0;
  background: transparent;
  color: var(--aaf-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
}

.article-author-footer > h3 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--aaf-muted);
  margin: 0 0 14px;
  padding: 0;
  border: 0;
}

.article-author-footer .author-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: flex-start;
  background: var(--aaf-bg);
  border: 1px solid var(--aaf-border);
  border-radius: 16px;
  padding: 22px 22px 24px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset,
              0 18px 50px -28px rgba(0, 0, 0, 0.6);
}

.article-author-footer .author-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 30%;
  border: 2px solid rgba(88, 166, 255, 0.35);
  background: #0d1117;
  flex-shrink: 0;
  display: block;
}

.article-author-footer .author-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-width: 0;
  width: 100%;
}

.article-author-footer .author-name {
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--aaf-text);
  text-decoration: none;
  line-height: 1.2;
  border: 0;
  padding: 0;
}

.article-author-footer .author-name:hover {
  color: var(--aaf-accent);
  text-decoration: underline;
}

.article-author-footer .author-bio {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--aaf-muted);
  margin: 0;
}

.article-author-footer .author-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 2px 0 4px;
}

.article-author-footer .author-stats > span {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  background: var(--aaf-chip-bg);
  border: 1px solid var(--aaf-chip-border);
  border-radius: 10px;
  padding: 9px 12px;
  min-width: 0;
}

.article-author-footer .author-stats strong {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--aaf-text);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.article-author-footer .author-stats small {
  font-size: 0.72rem;
  color: var(--aaf-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.1;
}

/* sufixo "/100" do chip de reputação fica menor e cinza */
.article-author-footer .author-stats > span:first-child {
  font-size: 0.82rem;
  color: var(--aaf-muted);
  /* chip reputação tem markup especial: <strong>N</strong>/100<small>reputação</small>
     o "/100" precisa ficar inline com o <strong>; <small> vai pra linha de baixo */
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 2px;
  row-gap: 2px;
}

.article-author-footer .author-stats > span:first-child small {
  flex-basis: 100%;
}

.article-author-footer .author-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  margin-top: 4px;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--aaf-accent-soft);
  color: var(--aaf-accent);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(88, 166, 255, 0.25);
  transition: background 0.15s ease, transform 0.15s ease;
}

.article-author-footer .author-cta:hover {
  background: rgba(88, 166, 255, 0.22);
  transform: translateX(2px);
}

/* Estado de carregamento: placeholder discreto. */
.article-author-footer .author-stats strong:empty::before,
.article-author-footer .author-stats strong[data-loading="1"]::before {
  content: "—";
  color: var(--aaf-muted);
}

/* ───────── Desktop: avatar à esquerda, info à direita ───────── */
@media (min-width: 640px) {
  .article-author-footer .author-card {
    flex-direction: row;
    gap: 22px;
    align-items: flex-start;
    padding: 26px 28px 28px;
  }

  .article-author-footer .author-avatar {
    width: 96px;
    height: 96px;
  }

  .article-author-footer .author-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Tema claro (defensivo — site é dark-first mas alguns leitores forçam) */
@media (prefers-color-scheme: light) {
  .article-author-footer {
    --aaf-bg:          #ffffff;
    --aaf-border:      rgba(15, 23, 42, 0.10);
    --aaf-text:        #0f172a;
    --aaf-muted:       #64748b;
    --aaf-accent:      #1e6dd6;
    --aaf-accent-soft: rgba(30, 109, 214, 0.10);
    --aaf-chip-bg:     rgba(15, 23, 42, 0.03);
    --aaf-chip-border: rgba(15, 23, 42, 0.08);
  }
}
