/* ==========================================================================
   Alvance — páginas editoriais: índice do blog e artigo.

   Carrega sempre depois de style.css e só acrescenta: os tokens, o cabeçalho,
   o rodapé e os botões continuam vindo de lá.

   O HTML destas páginas é gerado pelo servidor (server/src/render.js). Mexer
   numa classe daqui pede uma olhada lá.
   ========================================================================== */

/* ---------------------------- índice do blog ------------------------------ */

/* Filtro por categoria. Sem JS os botões somem e a grade continua inteira. */
.blog-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 8vw;
  border-bottom: 1px solid #c4d0db;
}

.blog-toolbar > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.blog-toolbar button {
  padding: 9px 16px;
  border: 1px solid #c4d0db;
  background: none;
  color: #5a6a7d;
  font: 700 11px var(--font-body);
  cursor: pointer;
  transition: all 0.2s;
}

.blog-toolbar button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.blog-toolbar button.ativo {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.blog-toolbar span {
  color: #5a6a7d;
  font: 9px var(--font-mono);
  letter-spacing: 0.14em;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  padding: 46px 8vw 92px;
}

.post-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #dbe3eb;
  transition:
    transform 0.25s,
    box-shadow 0.25s;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px #071a3518;
}

.post-card > img {
  width: 100%;
  height: 195px;
  object-fit: cover;
}

.post-card > div {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 26px 28px 30px;
}

.post-card p {
  margin: 0;
  color: #5a6a7d;
  font: 9px var(--font-mono);
  letter-spacing: 0.13em;
}

.post-card h2 {
  margin: 16px 0 12px;
  color: var(--blue);
  font: 500 25px / 1.14 var(--font-display);
}

.post-card small {
  color: #7a8798;
  font-size: 11px;
}

.post-card > div > a {
  margin-top: auto;
  padding-top: 20px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
}

/* O destaque abre a grade ocupando a linha inteira, com a capa ao lado. */
.post-card.destaque {
  grid-column: 1 / -1;
  flex-direction: row;
  background: var(--ink);
  border-color: var(--ink);
}

.post-card.destaque > img {
  width: 46%;
  min-height: 300px;
  height: auto;
}

.post-card.destaque > div {
  justify-content: center;
  padding: 44px 48px;
}

.post-card.destaque p {
  color: #b9c6d5;
}

.post-card.destaque h2 {
  color: #fff;
  font-size: clamp(28px, 3.2vw, 42px);
  letter-spacing: -0.03em;
}

.post-card.destaque small {
  color: #aebccc;
}

/* No destaque o cartão é alto e o texto está centrado: empurrar o link para
   o rodapé abriria um vão. Ele fica logo abaixo da data. */
.post-card.destaque > div > a {
  margin-top: 0;
  padding-top: 24px;
  color: #fff;
}

.blog-vazio {
  grid-column: 1 / -1;
  padding: 40px 0;
  color: #5a6a7d;
  text-align: center;
}

/* ------------------------------- o artigo --------------------------------- */

.article-hero {
  padding: 80px 8vw 64px;
  background: var(--ink);
  color: #fff;
}

.article-hero .voltar {
  display: inline-block;
  margin-bottom: 26px;
  color: #9fb0c4;
  font: 9px var(--font-mono);
  letter-spacing: 0.14em;
}

.article-hero .voltar:hover {
  color: #fff;
}

.article-hero .eyebrow {
  color: #b9c6d5;
}

.article-hero h1 {
  max-width: 920px;
  margin: 0;
  font: 600 clamp(34px, 4.4vw, 58px) / 1.04 var(--font-display);
  letter-spacing: -0.045em;
}

.article-hero > p:last-child {
  max-width: 660px;
  margin-top: 20px;
  color: #cfdae5;
  font-size: 16px;
  line-height: 1.7;
}

.article-cover {
  margin: 0;
}

.article-cover img {
  width: 100%;
  height: clamp(240px, 42vw, 480px);
  object-fit: cover;
}

/* Corpo em duas colunas: sumário grudado à esquerda, texto à direita. */
.article-content {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 60px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 72px 28px 40px;
}

.article-content > aside {
  position: sticky;
  top: 110px;
  display: grid;
  align-self: start;
  gap: 10px;
  height: max-content;
}

.article-content > aside span {
  color: #5a6a7d;
  font: 9px var(--font-mono);
  letter-spacing: 0.16em;
}

.article-content > aside a {
  padding-left: 12px;
  border-left: 2px solid #c4d0db;
  color: #5a6a7d;
  font-size: 13px;
  line-height: 1.4;
  transition: all 0.2s;
}

.article-content > aside a:hover,
.article-content > aside a.ativo {
  border-color: var(--blue);
  color: var(--blue);
}

.article-body > .lead {
  margin-bottom: 28px;
  color: var(--blue);
  font-size: 20px;
  line-height: 1.65;
}

.article-body p,
.article-body li {
  color: #46586d;
  font-size: 16px;
  line-height: 1.8;
}

.article-body p {
  margin-bottom: 18px;
}

.article-body ul {
  margin: 0 0 18px;
  padding-left: 22px;
  list-style: disc;
}

.article-body li {
  margin-bottom: 8px;
}

.article-body section {
  margin-bottom: 42px;
}

.article-body .kicker {
  margin: 0 0 6px;
  color: #7a8798;
  font: 10px var(--font-mono);
}

.article-body h2 {
  margin: 0 0 14px;
  color: var(--blue);
  font: 500 clamp(26px, 3vw, 35px) / 1.1 var(--font-display);
}

/* Chamada dentro do artigo. */
.article-cta {
  margin: 54px 0 0;
  padding: 32px;
  background: var(--ink);
  border-left: 4px solid var(--blue-2);
  color: #fff;
}

.article-cta p {
  margin: 0 0 20px;
  color: #d7e1ec;
  font: 500 22px / 1.35 var(--font-display);
}

/* Crédito da foto e da pauta — a licença do Commons costuma exigir. */
.article-fontes {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 28px 60px;
  color: #6d7c8f;
  font-size: 12px;
  line-height: 1.7;
}

.article-fontes strong {
  display: block;
  margin-bottom: 6px;
  color: #5a6a7d;
  font: 9px var(--font-mono);
  letter-spacing: 0.16em;
}

.article-fontes a {
  color: #46586d;
  text-decoration: underline;
}

/* Aviso fixo: o que vale é o regulamento do grupo e a apólice, não o post.
   Aparece em todo artigo. */
.article-note {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 28px 60px;
}

.article-note p {
  margin: 0;
  padding: 18px 20px;
  background: var(--pale);
  border-left: 3px solid var(--blue-2);
  color: #566577;
  font-size: 12px;
  line-height: 1.7;
}

.article-more {
  padding: 70px 8vw 92px;
  background: #e3eaf0;
}

.article-more h2 {
  margin: 0 0 28px;
  color: var(--blue);
  font: 600 clamp(28px, 3.4vw, 42px) / 1.1 var(--font-display);
  letter-spacing: -0.04em;
}

.article-more .posts-grid {
  grid-template-columns: repeat(2, 1fr);
  padding: 0;
}

/* ------------------------------ responsivo -------------------------------- */

@media (max-width: 1000px) {
  .posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .article-content {
    grid-template-columns: 1fr;
    gap: 30px;
    padding-top: 52px;
  }

  .article-content > aside {
    position: static;
  }
}

@media (max-width: 800px) {
  .blog-toolbar,
  .posts-grid,
  .article-hero,
  .article-more {
    padding-right: 8vw;
    padding-left: 8vw;
  }

  .posts-grid,
  .article-more .posts-grid {
    grid-template-columns: 1fr;
  }

  .post-card.destaque {
    flex-direction: column;
  }

  .post-card.destaque > img {
    width: 100%;
    min-height: 0;
    height: 200px;
  }

  .post-card.destaque > div {
    padding: 28px;
  }

  .article-content,
  .article-fontes,
  .article-note {
    padding-right: 8vw;
    padding-left: 8vw;
  }
}
