/* Página "Conteúdos". Figma: "Conteúdos - Desktop (Estado vazio)" (483:332) e
   "Conteúdos — Mobile — Estado vazio" (519:106). Reaproveita header, footer e .btn do site;
   este arquivo só acrescenta o que é próprio da página e só usa classes "cd-". Tamanhos do
   Figma, sem escala fluida (mesmo padrão de canais-page.css).

   A listagem de artigos (.cd-lista, .cd-featured, .cd-grid) foi acrescentada na integração com
   o Supabase — segue a mesma proporção/tratamento de card já usada no resto do site (raio 16,
   borda padrão, sombra ao passar o mouse), adaptada do design já aprovado no Figma pra essa
   página ("Conteúdos - Desktop", 490:693). */

.cd-hero {
  padding-block: 32px;
}

.cd-hero__inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cd-eyebrow {
  display: inline-flex;
  width: fit-content;
  padding: 6px 12px;
  border: 1px solid var(--verde-30);
  border-radius: 999px;
  background: var(--verde-10);
  color: var(--verde-90);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cd-hero__title {
  color: var(--texto-titulo);
  font-family: var(--fonte-titulo);
  font-size: 36px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.cd-hero__description {
  color: var(--texto-apoio);
  font-size: 18px;
  line-height: 1.56;
}

/* ---------- Estado vazio ---------- */

.cd-empty {
  padding-block: 0 56px;
}

.cd-empty__panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 40px 28px;
  border: 1px solid var(--verde-30);
  border-radius: 20px;
  background: var(--verde-10);
  text-align: center;
}

.cd-empty__icon {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: var(--verde-20);
}

.cd-empty__copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.cd-empty__title {
  color: var(--texto-titulo);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.36;
}

.cd-empty__description {
  max-width: 400px;
  color: var(--texto-apoio);
  font-size: 16px;
  line-height: 1.5;
}

.cd-empty .btn {
  width: 100%;
}

/* ---------- CTA institucional (mesma composição usada no resto do site) ---------- */

.cd-cta {
  padding-block: 0 56px;
}

.cd-cta__box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 32px 28px;
  border: 1px solid var(--verde-30);
  border-radius: 20px;
  background: var(--verde-10);
  text-align: center;
}

.cd-cta__icon {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: var(--verde-20);
}

.cd-cta__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cd-cta__title {
  color: var(--texto-titulo);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
}

.cd-cta__description {
  color: var(--texto-apoio);
  font-size: 16px;
  line-height: 1.5;
}

.cd-cta .btn {
  width: 100%;
}

@media (min-width: 1024px) {
  .cd-hero {
    padding-block: 80px 56px;
  }

  .cd-hero__title {
    max-width: 760px;
    font-size: 56px;
    line-height: 64px;
    letter-spacing: -1.5px;
  }

  .cd-hero__description {
    max-width: 620px;
    font-size: 20px;
    line-height: 32px;
  }

  .cd-empty {
    padding-block: 8px 80px;
  }

  .cd-empty__panel {
    gap: 32px;
    padding: 64px;
    border-radius: 24px;
  }

  .cd-empty__title {
    font-size: 24px;
    line-height: 32px;
  }

  .cd-empty__description {
    max-width: 440px;
    font-size: 18px;
    line-height: 28px;
  }

  .cd-empty .btn {
    width: auto;
  }

  .cd-cta {
    padding-block: 0 80px;
  }

  .cd-cta__box {
    flex-direction: row;
    align-items: center;
    gap: 24px;
    padding: 40px;
    border-radius: 24px;
    text-align: left;
  }

  .cd-cta__text {
    flex: 1 1 0%;
  }

  .cd-cta .btn {
    width: auto;
    flex: none;
  }
}

/* ---------- Entrada ---------- */
/* Hero: mesma receita do Hero da Home (`hero-enter`, definida em motion.css), eyebrow → título →
   descrição em sequência curta. Estado vazio e CTA institucional: mesmo scroll-reveal das sections
   internas da Home (data-reveal-group/data-reveal, ver reveal.js). */

@media (prefers-reduced-motion: no-preference) {
  .cd-hero {
    --enter-y: 16px;
  }

  .cd-eyebrow,
  .cd-hero__title,
  .cd-hero__description {
    animation: hero-enter var(--dur-enter) var(--ease-out) var(--enter-delay, 0ms) backwards;
  }

  .cd-eyebrow {
    --enter-delay: 40ms;
  }

  .cd-hero__title {
    --enter-delay: 140ms;
  }

  .cd-hero__description {
    --enter-delay: 240ms;
  }
}

@media (min-width: 1024px) and (prefers-reduced-motion: no-preference) {
  .cd-hero {
    --enter-y: 28px;
  }
}

/* ---------- Listagem de artigos (dados publicados, vindos do Supabase) ---------- */

.cd-lista {
  padding-block: 0 56px;
}

.cd-lista__carregando,
.cd-lista__erro {
  padding: 32px;
  text-align: center;
  color: var(--texto-apoio);
}

.cd-featured {
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
  border: 1px solid var(--borda-padrao);
  border-radius: 20px;
  background: var(--fundo-superficie);
  overflow: hidden;
  transition: box-shadow 0.15s ease;
}
.cd-featured:hover {
  box-shadow: var(--sombra-card);
}

/* .cd-featured__image é a DIV que recorta; a <img> dentro dela só preenche.
   Precisa ser assim (e não aspect-ratio direto na <img>) porque no desktop a
   altura vem do conteúdo ao lado (ver media query abaixo) — numa <img> isso
   cria um cálculo circular (a proporção natural da foto acaba decidindo a
   largura, ignorando o tamanho que a gente pediu). */
.cd-featured__image {
  aspect-ratio: 16 / 9;
  background: var(--neutra-20);
  overflow: hidden;
}

.cd-featured__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cd-featured__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
}

.cd-featured__category {
  color: var(--verde-90);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cd-featured__title {
  margin: 0;
  color: var(--texto-titulo);
  font-family: var(--fonte-titulo);
  font-size: 24px;
  font-weight: 600;
}

.cd-featured__excerpt {
  margin: 0;
  color: var(--texto-apoio);
  font-size: 16px;
  line-height: 1.5;
}

.cd-featured__link {
  color: var(--texto-destaque);
  font-size: 16px;
  font-weight: 600;
}

/* ---------- Filtros por categoria (Figma: "Filtro de categorias", nó 490:729) ---------- */

.cd-filtros {
  margin-bottom: 32px;
}

.cd-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cd-pill {
  display: inline-flex;
  align-items: center;
  height: 46px;
  padding: 0 21px;
  border: 1px solid var(--borda-padrao);
  border-radius: 999px;
  background: var(--fundo-superficie);
  color: var(--texto-titulo);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.cd-pill:hover {
  border-color: var(--verde-60);
}

.cd-pill[aria-pressed="true"] {
  border-color: var(--verde-30);
  background: var(--verde-10);
  color: var(--verde-90);
  font-weight: 600;
}

.cd-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.cd-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--borda-padrao);
  border-radius: 16px;
  background: var(--fundo-superficie);
  overflow: hidden;
  transition: box-shadow 0.15s ease;
}
.cd-card:hover {
  box-shadow: var(--sombra-card);
}

.cd-card__image {
  aspect-ratio: 346 / 180; /* Figma: card 346×328, imagem 346×180 */
  background: var(--neutra-20);
  object-fit: cover;
}

.cd-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
}

.cd-card__category {
  color: var(--verde-90);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cd-card__title {
  margin: 0;
  color: var(--texto-titulo);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
}

.cd-card__meta {
  margin: 0;
  color: var(--texto-apoio);
  font-size: 13px;
}

@media (min-width: 768px) {
  .cd-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .cd-featured {
    flex-direction: row;
    align-items: stretch;
  }

  /* Figma (nó 490:721 "Card destaque"): 1104×388, imagem 460×388 (41,7% de
     largura, altura FIXA igual à do card — não depende da foto nem do
     texto). Altura em px (não stretch/auto) de propósito: uma foto fora de
     16:9 não pode esticar o card, e um título mais longo também não — a
     imagem sempre corta via object-fit/object-position, o texto sempre tem
     a mesma caixa de 388px pra trabalhar. */
  .cd-featured {
    height: 388px;
    margin-bottom: 56px; /* Figma: vão entre o card e os filtros */
  }

  .cd-featured__image {
    flex: 0 0 41.7%;
    height: 388px;
    aspect-ratio: auto;
  }

  .cd-featured__body {
    justify-content: center;
    gap: 16px;
    padding: 48px;
  }

  .cd-featured__title {
    font-size: 28px;
  }

  .cd-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 32px; /* Figma: 32px entre linhas e colunas, não 20px */
  }
}
