/* Rico aos Poucos — bloco "Sobre o autor" no fim de cada artigo.
 *
 * Versão COMPACTA v2 (2026-05-22):
 *  - Desktop (>=640px): grid 3-cols (avatar | info | CTA à direita), 1 linha.
 *  - Mobile (<640px):   grid 2-cols (avatar | info); CTA quebra pra nova linha.
 *  - Header "SOBRE O AUTOR" oculto.
 *
 * HTML do snippet (v2 do injetor): .author-cta é IRMÃO DIRETO de .author-card,
 * NÃO está mais dentro de .author-info.
 *
 * Renderizado pelo HTML estático (snippet idempotente, sentinela rap-author-footer v2),
 * hidratado por author-footer.js que faz fetch da API de perfil.
 */

.article-author-footer {
  --aaf-bg:          #161b22;
  --aaf-border:      rgba(139, 148, 158, 0.18);
  --aaf-text:        #e6edf3;
  --aaf-muted:       #8b949e;
  --aaf-accent:      #58a6ff;
  --aaf-accent-soft: rgba(88, 166, 255, 0.12);

  margin: 28px 0 16px;
  padding: 0;
  background: transparent;
  color: var(--aaf-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
}

/* Header "SOBRE O AUTOR" — escondido na versão compacta. */
.article-author-footer > h3 {
  display: none;
}

/* Mobile-first: avatar | info na primeira linha, CTA na segunda (largura total). */
.article-author-footer .author-card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "avatar info"
    "cta    cta";
  gap: 10px 12px;
  align-items: center;
  background: var(--aaf-bg);
  border: 1px solid var(--aaf-border);
  border-radius: 12px;
  padding: 12px 14px;
}

.article-author-footer .author-avatar {
  grid-area: avatar;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 30%;
  border: 1px solid rgba(88, 166, 255, 0.30);
  background: #0d1117;
  flex-shrink: 0;
  display: block;
}

.article-author-footer .author-info {
  grid-area: info;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

/* Label pequena identificando que o card é sobre o autor do artigo
   (substitui o <h3>Sobre o autor</h3> que escondemos pra economizar espaço). */
.article-author-footer .author-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--aaf-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1;
  margin-bottom: 2px;
}

.article-author-footer .author-name {
  font-size: 0.98rem;
  font-weight: 600;
  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.78rem;
  line-height: 1.35;
  color: var(--aaf-muted);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Stats inline (mobile: ocultos pra economizar espaço; desktop: visíveis) */
.article-author-footer .author-stats {
  display: none;
}

.article-author-footer .author-cta {
  grid-area: cta;
  justify-self: stretch;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 6px;
  background: var(--aaf-accent-soft);
  color: var(--aaf-accent);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(88, 166, 255, 0.22);
  transition: background 0.15s ease;
  white-space: nowrap;
}

.article-author-footer .author-cta:hover {
  background: rgba(88, 166, 255, 0.20);
}

/* Placeholder dos números enquanto a API hidrata */
.article-author-footer .author-stats strong:empty::before,
.article-author-footer .author-stats strong[data-loading="1"]::before {
  content: "—";
  color: var(--aaf-muted);
}

/* ───────── Desktop ≥640px: 3 colunas (avatar | info | CTA) ───────── */
@media (min-width: 640px) {
  .article-author-footer .author-card {
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "avatar info cta";
    gap: 14px;
    padding: 12px 16px;
  }

  .article-author-footer .author-avatar {
    width: 56px;
    height: 56px;
  }

  .article-author-footer .author-stats {
    display: flex;
    flex-wrap: nowrap;
    align-items: baseline;
    gap: 10px;
    margin-top: 2px;
    font-size: 0.72rem;
    color: var(--aaf-muted);
  }

  .article-author-footer .author-stats > span {
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
    white-space: nowrap;
  }

  .article-author-footer .author-stats > span:not(:last-child)::after {
    content: "·";
    margin-left: 10px;
    color: var(--aaf-border);
  }

  .article-author-footer .author-stats strong {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--aaf-text);
    font-variant-numeric: tabular-nums;
  }

  .article-author-footer .author-stats small {
    font-size: 0.72rem;
    color: var(--aaf-muted);
    text-transform: lowercase;
    letter-spacing: 0;
  }

  .article-author-footer .author-cta {
    justify-self: end;
    padding: 7px 14px;
  }
}

/* Tema claro defensivo */
@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);
  }
}
