/* ==========================================================================  
   Página do Autor — author.css
   ========================================================================== */

/* Container principal */
.author-page.container {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2rem;
  margin: 2rem auto;
  max-width: 1200px;
  padding: 2rem;
  background: rgba(255,255,255,0.9);
  backdrop-filter: saturate(180%) blur(10px);
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.1);
}

/* --------------------------------------------------------------------------  
   1. Header do Autor — avatar, nome, credenciais, contatos
   -------------------------------------------------------------------------- */
.author-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-bg-alt);
  /* garante que nada fique cortado */
  overflow: visible;
}

.author-avatarpage {
  flex-shrink: 0;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.author-header .author-details {
  flex: 1;
}

.author-name {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  margin: 0 0 .25rem;
  color: var(--color-heading);
}

.author-credentials {
  font-size: 0.95rem;
  color: var(--color-text);
  margin: 0 0 1rem;
}

/* Contatos (e-mail + sociais) */
.author-contacts {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.author-contacts a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: var(--color-link);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  transition: background .2s, color .2s;
}

.author-contacts a:hover {
  background: var(--color-link);
  color: #fff;
}

/* FORÇA OS ÍCONES A SEMPRE APARECEREM */
.author-contacts i {
  display: inline-block;
  font-size: 1.25rem;
  color: inherit;
  line-height: 1;
}

/* --------------------------------------------------------------------------  
   2. Biografia
   -------------------------------------------------------------------------- */
.author-bio {
  grid-column: 1 / -1;
  margin: 2rem auto;
  max-width: 800px;
  font-size: 1rem;
  line-height: var(--line-height);
  color: var(--color-text);
}

/* --------------------------------------------------------------------------  
   3. Artigos do Autor
   -------------------------------------------------------------------------- */
.author-articles {
  grid-column: 1 / -1;
  margin-top: 2rem;
}

.author-articles h2 {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  margin: 0 0 1rem;
  color: var(--color-heading);
  position: relative;
}

.author-articles h2::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 3rem;
  height: 3px;
  background: var(--color-link);
  border-radius: 2px;
}

/* Grid de cards */
.author-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px,1fr));
  gap: 1.5rem;
  margin: 1rem 0;
}

/* Cartão individual */
.author-post-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
  transition: transform .3s, box-shadow .3s;
  display: flex;
  flex-direction: column;
}

.author-post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.1);
}

/* Miniatura */
.post-card-thumb img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}

/* Conteúdo */
.post-card-content {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.post-card-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  margin: 0;
}

.post-card-title a {
  color: var(--color-heading);
  text-decoration: none;
  transition: color .2s;
}

.post-card-title a:hover {
  color: var(--color-link);
}

.post-card-date {
  font-size: .875rem;
  color: var(--color-meta-alt);
}

.post-card-excerpt {
  font-size: .95rem;
  color: var(--color-text);
  line-height: var(--line-height);
  margin-top: auto;
}

/* Mensagem “nenhum artigo” */
.no-posts-author {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 1rem;
  color: var(--color-text);
  padding: 2rem 0;
}

/* 1) evita scroll lateral indesejado */
.author-page.container {
  overflow-x: hidden;
}

/* 2) wrapper que unifica nome/creds/contatos */
.author-details {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

/* --------------------------------------------------------------------------
   Responsividade extra (mobile)
   -------------------------------------------------------------------------- */
@media (max-width: var(--bp-md)) {
  .author-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    padding-bottom: 1rem;
  }

  .author-avatarpage {
    width: 120px;
    height: 120px;
    margin-bottom: 1rem;
  }

  .author-details {
    width: 100%;
  }

  .author-contacts {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .5rem;
    margin: 1rem auto;
  }

  .author-contacts a {
    margin: .25rem;
  }

  .author-contacts i {
    display: inline-block;
    font-size: 1.5rem;
  }

  .author-articles h2 {
    font-size: 1.5rem;
  }

  .author-posts-grid {
    grid-template-columns: 1fr;
  }
}
