/* ══════════════════════════════════════════
   BLOG — páginas de post (blog-*.html). A lista (blog.html / cases.html) está em components.css (.list-*)
   Só tokens do design system. Animações: apenas transform/opacity.
   ══════════════════════════════════════════ */

/* ── POST: cabeçalho e capa ──────────────── */
.post-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-24);
  width: 100%; /* mesma largura do container (alinha com a capa); só o texto do artigo é estreito */
}

.post-header__title {
  font-size: var(--font-size-h2);
  line-height: var(--line-height-tight);
  color: var(--color-dark);
}

.post-header__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-8) var(--space-12);
  font-size: var(--font-size-regular);
  line-height: var(--line-height-loose);
  color: var(--color-gray-700);
}

.post-header__sep {
  width: 4px;
  height: 4px;
  background-color: var(--color-gray-300);
}

.post-cover {
  width: 100%;
  margin: var(--space-48) 0 0;
  padding: var(--space-4);
  border: 1px solid var(--color-blue-100);
  border-radius: var(--radius-12);
}

.post-cover__img {
  display: block;
  width: 100%;
  height: auto; /* o atributo height do HTML venceria o aspect-ratio */
  aspect-ratio: 19 / 10;
  object-fit: cover;
  border-radius: var(--radius-8);
  background-color: var(--color-blue-100);
}

/* ── POST: texto ─────────────────────────── */
.post-body {
  max-width: 760px;
  margin: var(--space-64) auto 0;
  font-size: var(--font-size-medium);
  line-height: var(--line-height-loose);
  color: var(--color-gray-800);
}

.post-body > * + * {
  margin-top: var(--space-24);
}

.post-body strong {
  font-weight: var(--font-weight-semibold);
  color: var(--color-dark);
}

.post-body h2 {
  margin-top: var(--space-64);
  font-size: var(--font-size-h4);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-snug);
  letter-spacing: var(--letter-spacing-tighter);
  color: var(--color-dark);
  text-wrap: balance;
}

.post-body h3 {
  margin-top: var(--space-48);
  font-size: var(--font-size-h6);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-normal);
  letter-spacing: var(--letter-spacing-tighter);
  color: var(--color-blue-700);
}

.post-body h2 + *,
.post-body h3 + * {
  margin-top: var(--space-16);
}

.post-body a {
  color: var(--color-blue-700);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity var(--transition-fast);
}

.post-body a:hover,
.post-body a:active {
  opacity: 0.7;
}

.post-body a:focus-visible {
  outline: 2px solid var(--color-blue-700);
  outline-offset: 2px;
  border-radius: var(--radius-2);
}

/* Listas — base.css zera list-style, então os marcadores são desenhados aqui. */
.post-body ul,
.post-body ol {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.post-body ol {
  counter-reset: post-ol;
}

.post-body li {
  position: relative;
  padding-left: var(--space-32);
}

.post-body ul > li::before {
  content: '';
  position: absolute;
  top: 0.6em;
  left: var(--space-4);
  width: 8px;
  height: 8px;
  background-color: var(--color-brand-orange);
}

.post-body ol > li {
  counter-increment: post-ol;
}

.post-body ol > li::before {
  content: counter(post-ol);
  position: absolute;
  top: 0;
  left: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background-color: var(--color-blue-50);
  color: var(--color-blue-700);
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-semibold);
  line-height: 1;
}

/* Citação / "Para compartilhar" */
.post-body blockquote {
  padding: var(--space-24) var(--space-32);
  border-left: 4px solid var(--color-brand-orange);
  border-radius: var(--radius-8);
  background-color: var(--color-blue-50);
  font-size: var(--font-size-large);
  line-height: var(--line-height-relaxed);
  color: var(--color-dark);
}

.post-body blockquote strong {
  color: var(--color-blue-700);
}

/* Imagem com legenda */
.post-body figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--color-blue-100);
  border-radius: var(--radius-12);
}

.post-body figcaption {
  margin-top: var(--space-8);
  font-size: var(--font-size-small);
  line-height: var(--line-height-loose);
  color: var(--color-gray-700);
}

/* Tabela — rola na horizontal em telas estreitas (wrapper focável por teclado). */
.post-table {
  overflow-x: auto;
  border: 1px solid var(--color-blue-100);
  border-radius: var(--radius-12);
}

.post-table:focus-visible {
  outline: 2px solid var(--color-blue-700);
  outline-offset: 2px;
}

.post-table table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: var(--font-size-small);
  line-height: var(--line-height-loose);
  text-align: left;
}

.post-table th,
.post-table td {
  padding: var(--space-12) var(--space-16);
  vertical-align: top;
}

.post-table thead th {
  background-color: var(--color-blue-50);
  color: var(--color-blue-900);
  font-weight: var(--font-weight-semibold);
}

.post-table tbody tr + tr td {
  border-top: 1px solid var(--color-blue-50);
}

.post-table td:first-child {
  font-weight: var(--font-weight-medium);
  color: var(--color-dark);
}

/* ── "Leia também" (fundo azul, só nos posts) ──
   Progressão do escuro para o claro: seção blue-900 → barra "Ver todos" blue-700 → rodapé. */
.blog-more {
  background-color: var(--color-blue-900);
  border-top: 0;
}

.blog-more .case-mais__header .tagline__text,
.blog-more .case-mais__title {
  color: var(--color-white);
}

/* O contorno de foco padrão (blue-700) some no fundo escuro. */
.blog-more .card-post:focus-visible {
  outline-color: var(--color-white);
}

@media (max-width: 768px) {
  .post-body {
    margin-top: var(--space-48);
  }

  .post-body h2 {
    margin-top: var(--space-48);
  }

  .post-body blockquote {
    padding: var(--space-20) var(--space-24);
  }
}
