/* Blog: artigos e índice. Usa os tokens, fontes e botões de institucional.css (carregado antes). */

body.blog {
  background: var(--claro);
}

/* ---------- Cabeçalho: faixa azul-noite com a logo e atalhos para a página inicial ---------- */
.blog-topo {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--escuro);
  color: #e8e0dc;
  border-bottom: 2px solid var(--linha-troca);
}
.blog-topo .container {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: var(--topo-altura);
}
.blog-topo .marca img {
  display: block;
  height: 42px;
  width: auto;
}
.blog-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 28px;
}
.blog-nav ul {
  display: flex;
  gap: 24px;
  font-size: 0.9375rem;
  color: #a7afcb;
}
.blog-nav ul a {
  transition: color 160ms ease;
}
.blog-nav ul a:hover,
.blog-nav ul a[aria-current] {
  color: #e8e0dc;
}
.blog-topo .botao {
  --botao-bg: #e8e0dc;
  --botao-texto: #121b3a;
  --botao-hover: #ffffff;
}

/* ---------- Trilha de navegação ---------- */
.trilha {
  padding-top: clamp(28px, 4vw, 48px);
  font-size: 0.875rem;
  color: var(--texto-3);
}
.trilha ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
}
.trilha li:not(:last-child)::after {
  content: "/";
  margin-inline: 10px;
  color: var(--linha-forte);
}
.trilha a {
  color: var(--texto-2);
  transition: color 160ms ease;
}
.trilha a:hover {
  color: var(--destaque);
}
.trilha [aria-current] {
  display: inline-block;
  max-width: 48ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

/* ---------- Cabeça do artigo ---------- */
.artigo-cabeca {
  max-width: 860px;
  padding-top: 20px;
}
.artigo-cabeca h1,
.blog-cabeca h1 {
  font-family: var(--f-display);
  font-weight: 640;
  font-stretch: 104%;
  font-size: clamp(2rem, 1.2rem + 2.6vw, 3.25rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.artigo-resumo {
  margin-top: 18px;
  max-width: 62ch;
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
  line-height: 1.55;
  color: var(--texto-2);
}
.artigo-meta {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  font-size: 0.875rem;
  color: var(--texto-3);
}
.artigo-capa {
  margin-top: clamp(28px, 4vw, 44px);
  border-radius: var(--raio);
  overflow: hidden;
  background: var(--superficie);
  aspect-ratio: 1216 / 640;
}
.artigo-capa img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Corpo: coluna de leitura + sumário lateral ---------- */
.artigo-grade {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: clamp(40px, 6vw, 88px);
  align-items: start;
  padding-block: clamp(36px, 5vw, 64px) clamp(64px, 8vw, 112px);
}
.artigo-lateral {
  position: sticky;
  top: calc(var(--topo-altura) + 28px);
  display: grid;
  gap: 28px;
}
.sumario {
  font-size: 0.875rem;
}
.sumario-titulo {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
  color: var(--texto-3);
  margin-bottom: 12px;
}
.sumario ol {
  display: grid;
  gap: 2px;
  border-left: 1px solid var(--linha);
}
.sumario a {
  display: block;
  padding: 6px 0 6px 14px;
  margin-left: -1px;
  border-left: 1px solid transparent;
  color: var(--texto-2);
  line-height: 1.4;
  transition:
    color 160ms ease,
    border-color 160ms ease;
}
.sumario a:hover {
  color: var(--destaque);
  border-left-color: var(--destaque);
}
/* No celular o sumário vira um bloco recolhível antes do texto */
.sumario-movel {
  display: none;
  margin-bottom: 32px;
  border: 1px solid var(--linha);
  border-radius: var(--raio);
  background: var(--superficie);
}
.sumario-movel summary {
  cursor: pointer;
  padding: 14px 18px;
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 0.9375rem;
}
.sumario-movel .sumario {
  padding: 0 18px 14px;
}

.lateral-chamada {
  padding: 22px;
  border-radius: var(--raio);
  background: var(--escuro);
  color: #e8e0dc;
}
.lateral-chamada p:first-child {
  font-family: var(--f-display);
  font-weight: 620;
  font-size: 1.0625rem;
  line-height: 1.25;
}
.lateral-chamada p + p {
  margin-top: 8px;
  font-size: 0.875rem;
  color: #a7afcb;
}
.lateral-chamada .botao {
  margin-top: 16px;
  width: 100%;
}

/* ---------- Texto do artigo ---------- */
.texto {
  max-width: 70ch;
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--texto-2);
}
.texto > * + * {
  margin-top: 1.1em;
}
.texto h2 {
  margin-top: 2.2em;
  font-family: var(--f-display);
  font-weight: 620;
  font-stretch: 104%;
  font-size: clamp(1.4rem, 1.15rem + 0.8vw, 1.75rem);
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--texto);
  text-wrap: balance;
}
.texto h3 {
  margin-top: 1.8em;
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 1.1875rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--texto);
}
.texto h2 + *,
.texto h3 + * {
  margin-top: 0.6em;
}
.texto strong {
  color: var(--texto);
  font-weight: 600;
}
.texto a {
  color: var(--destaque);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--destaque) 40%, transparent);
  transition: text-decoration-color 160ms ease;
}
.texto a:hover {
  text-decoration-color: currentColor;
}
.texto ul,
.texto ol {
  display: grid;
  gap: 0.5em;
  padding-left: 1.4em;
}
.texto ul {
  list-style: none;
}
.texto ul > li {
  position: relative;
}
.texto ul > li::before {
  content: "";
  position: absolute;
  left: -1.1em;
  top: 0.78em;
  width: 7px;
  height: 2px;
  background: var(--destaque);
}
.texto ol {
  list-style: decimal;
}
.texto ol > li::marker {
  color: var(--destaque);
  font-weight: 600;
}
.texto blockquote {
  margin-inline: 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--destaque);
  font-family: var(--f-display);
  font-size: 1.1875rem;
  line-height: 1.45;
  color: var(--texto);
}
.texto blockquote p {
  margin: 0;
}
.texto img {
  width: 100%;
  margin-block: 1.4em;
  border-radius: var(--raio);
  background: var(--superficie);
}

/* ---------- Chamada no fim do artigo ---------- */
.artigo-fim {
  margin-top: 56px;
  max-width: 70ch;
}
.artigo-fim .contato-chamada {
  min-height: 0;
}

/* ---------- Relacionados e índice ---------- */
.relacionados {
  padding-block: clamp(56px, 7vw, 96px);
  background: var(--superficie);
  border-top: 1px solid var(--linha);
}
.relacionados h2 {
  font-family: var(--f-display);
  font-weight: 620;
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  letter-spacing: -0.02em;
  margin-bottom: 28px;
}
.cartoes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 24px;
}
.cartao a {
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  align-content: start;
  gap: 12px;
  height: 100%;
}
.cartao-imagem {
  border-radius: var(--raio);
  overflow: hidden;
  aspect-ratio: 1216 / 640;
  background: var(--superficie);
}
.cartao-imagem img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms var(--ease-out);
}
.cartao h2,
.cartao h3 {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 1.125rem;
  line-height: 1.28;
  letter-spacing: -0.01em;
  color: var(--texto);
  text-wrap: balance;
  transition: color 160ms ease;
}
.cartao p {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--texto-2);
}
.cartao time {
  font-size: 0.8125rem;
  color: var(--texto-3);
}
@media (hover: hover) and (pointer: fine) {
  .cartao a:hover .cartao-imagem img {
    transform: scale(1.03);
  }
  .cartao a:hover h2,
  .cartao a:hover h3 {
    color: var(--destaque);
  }
}

.blog-cabeca {
  padding-top: 20px;
  max-width: 760px;
}
.blog-lista {
  padding-block: clamp(36px, 5vw, 56px) clamp(72px, 9vw, 120px);
}

/* ---------- Rodapé ---------- */
.blog-rodape {
  background: var(--escuro);
  color: #a7afcb;
  font-size: 0.9375rem;
}
.blog-rodape .container {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  padding-block: 48px 32px;
}
.blog-rodape img {
  height: 40px;
  width: auto;
}
.blog-rodape h2 {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 0.8125rem;
  color: #e8e0dc;
  margin-bottom: 12px;
}
.blog-rodape ul {
  display: grid;
  gap: 6px;
}
.blog-rodape a {
  transition: color 160ms ease;
}
.blog-rodape a:hover {
  color: #e8e0dc;
}
.blog-rodape .direitos {
  grid-column: 1 / -1;
  padding-top: 20px;
  border-top: 1px solid rgb(232 224 220 / 0.12);
  font-size: 0.8125rem;
  color: #8a93b3;
}

@media (max-width: 1080px) {
  .artigo-grade {
    grid-template-columns: minmax(0, 1fr);
  }
  .artigo-lateral {
    display: none;
  }
  .sumario-movel {
    display: block;
  }
  .texto {
    max-width: none;
  }
}
@media (max-width: 860px) {
  .blog-nav ul {
    display: none;
  }
  .cartoes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .blog-rodape .container {
    grid-template-columns: 1fr 1fr;
  }
  .blog-rodape .container > :first-child {
    grid-column: 1 / -1;
  }
}
@media (max-width: 560px) {
  .blog-topo .marca img {
    height: 34px;
  }
  .cartoes {
    grid-template-columns: 1fr;
  }
  .trilha [aria-current] {
    max-width: 28ch;
  }
}
