/* ============================================
   FINANCAS.CSS - Seção Finanças
   Consciência Monetária
   Escopo: classes .fin-* (não altera estilos globais)
   Paleta: reutiliza brand #0c1814, accent #0b7a56 e
   os tons emerald/interativo já usados no site.
   ============================================ */

/* ===== TÍTULOS ===== */
.fin-title {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
}

@media (max-width: 768px) {
  .fin-title {
    font-size: 2rem;
  }
}

.fin-eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3em;
}

.fin-section-label {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: #10b981;
}

/* ===== BREADCRUMB ===== */
.fin-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

.fin-breadcrumb a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
}

.fin-breadcrumb a:hover {
  color: #34d399;
}

.fin-breadcrumb .current {
  color: #34d399;
}

/* ===== CARTÕES DOS PILARES ===== */
.fin-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .fin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .fin-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.fin-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.3s ease, background 0.3s ease, transform 0.3s ease;
}

.fin-card:hover {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-3px);
}

.fin-card:focus-visible,
.fin-link:focus-visible,
.fin-cta:focus-visible,
.fin-modulo summary:focus-visible {
  outline: 2px solid #10b981;
  outline-offset: 3px;
}

.fin-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.fin-card-num {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: #34d399;
}

.fin-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  background: rgba(11, 122, 86, 0.2);
  color: #34d399;
}

.fin-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.35;
  color: #fff;
  margin-bottom: 0.5rem;
}

.fin-card p {
  font-size: 0.92rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 1rem;
}

.fin-card-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  color: #34d399;
}

/* ===== SELO DE STATUS ===== */
.fin-badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

/* ===== CAMINHOS POR NECESSIDADE ===== */
.fin-paths {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
}

.fin-path {
  flex: 1 1 100%;
  max-width: 100%;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
}

@media (min-width: 768px) {
  .fin-path {
    flex: 0 1 calc(50% - 0.625rem);
  }
}

.fin-path h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.35rem;
}

.fin-path p {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 1rem;
}

.fin-path ol {
  list-style: none;
  counter-reset: fin-step;
  margin: 0;
  padding: 0;
}

.fin-path li {
  counter-increment: fin-step;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.35rem 0;
}

.fin-path li::before {
  content: counter(fin-step);
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  line-height: 1.5rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 9999px;
  color: #0c1814;
  background: #34d399;
}

.fin-link {
  color: #34d399;
  text-decoration: none;
  font-weight: 500;
}

.fin-link:hover {
  text-decoration: underline;
}

/* ===== BOTÕES ===== */
.fin-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.6rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.fin-cta-primary {
  background: #0b7a56;
  color: #fff;
}

.fin-cta-primary:hover {
  background: #096545;
}

.fin-cta-secondary {
  color: #0b7a56;
  border: 1px solid #0b7a56;
  background: transparent;
}

.fin-cta-secondary:hover {
  background: rgba(11, 122, 86, 0.08);
}

/* ===== MÓDULOS (details/summary, sem JavaScript) ===== */
.fin-modulo {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.85rem;
  margin-bottom: 0.75rem;
}

.fin-modulo summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
  color: #fff;
  list-style: none;
}

.fin-modulo summary::-webkit-details-marker {
  display: none;
}

.fin-modulo summary::after {
  content: "+";
  flex: none;
  font-size: 1.25rem;
  line-height: 1;
  color: #34d399;
}

.fin-modulo[open] summary::after {
  content: "\2212";
}

.fin-modulo ul {
  margin: 0;
  padding: 0 1.25rem 1.1rem 2.5rem;
  list-style: disc;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.92rem;
  line-height: 1.7;
}

/* ===== LISTAS E BLOCOS DE TEXTO ===== */
.fin-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.fin-list li {
  position: relative;
  padding: 0.6rem 0 0.6rem 1.5rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
}

.fin-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.15rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: #10b981;
}

.fin-quote {
  margin: 0;
  padding: 1rem 1.25rem;
  border-left: 3px solid #10b981;
  background: rgba(16, 185, 129, 0.06);
  border-radius: 0 0.75rem 0.75rem 0;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.7;
}

.fin-notice {
  padding: 1.25rem 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.9rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.6);
}

@media (prefers-reduced-motion: reduce) {
  .fin-card,
  .fin-cta {
    transition: none;
  }

  .fin-card:hover {
    transform: none;
  }
}

/* ============================================
   ARTIGOS DE FINANÇAS (src/financas/<pilar>/*.md)
   Componentes de corpo de artigo que, no blog, ficam em <style>
   dentro de cada .md. Aqui ficam centralizados e escopados.
   ============================================ */
.data-highlight-card {
  background: rgba(16, 185, 129, 0.04);
  border-left: 3px solid #10b981;
  transition: background 0.2s ease;
  padding: 1.25rem;
  border-radius: 0 0.75rem 0.75rem 0;
  margin: 1.5rem 0;
}

.data-highlight-card:hover {
  background: rgba(16, 185, 129, 0.08);
}

/* Largura do artigo: o <main id="post-main-content"> é item flex (flex-1).
   Sem min-width: 0, um filho largo (tabela com white-space: nowrap) impede
   o main de encolher e ele ultrapassa a tela. Com min-width: 0 o main fica
   com a mesma largura dos artigos do blog e a tabela rola dentro do
   .table-wrapper. */
#post-main-content {
  min-width: 0;
  max-width: 100%;
}

/* ===== TABELAS (.table-wrapper > .fin-table) =====
   Padrão visual de tabelas da seção Finanças.
   - Desktop/tablet: o texto quebra linha, então a tabela cabe na largura
     do artigo e não precisa de barra de rolagem.
   - Celular (até 720px): cada linha vira um cartão, com o rótulo da coluna
     acima de cada informação. Os rótulos (data-label) e as classes
     fin-table--cards / fin-table--2col / fin-col-num são colocados por
     assets/js/post-template.js a partir do <thead>; sem JavaScript a
     tabela continua legível e o wrapper rola na horizontal, se precisar. */
.table-wrapper {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.75rem 0;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 0.875rem;
  background: rgba(255, 255, 255, 0.02);
}

.fin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.94rem;
  line-height: 1.55;
  text-align: left;
}

.fin-table caption {
  caption-side: bottom;
  padding: 0.9rem 1.15rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 0.8rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.5);
  text-align: left;
}

.fin-table th,
.fin-table td {
  padding: 0.9rem 1.15rem;
  text-align: left;
  vertical-align: top;
  overflow-wrap: break-word;
}

.fin-table thead th {
  background: rgba(16, 185, 129, 0.09);
  border-bottom: 1px solid rgba(16, 185, 129, 0.28);
  color: #6ee7b7;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.fin-table tbody td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.74);
  font-variant-numeric: tabular-nums;
  transition: background-color 0.2s ease;
}

.fin-table tbody td:first-child {
  color: #fff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 rgba(16, 185, 129, 0.55);
}

.fin-table tbody tr:hover td {
  background: rgba(16, 185, 129, 0.05);
}

.fin-table tbody tr:last-child td {
  border-bottom: 0;
}

.fin-table th.fin-col-num,
.fin-table td.fin-col-num {
  text-align: right;
  white-space: nowrap;
}

.fin-table td.destaque {
  color: #34d399;
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  .fin-table tbody td {
    transition: none;
  }
}

/* Celular: linhas viram cartões (sem rolagem horizontal) */
@media (max-width: 720px) {
  .table-wrapper {
    overflow-x: visible;
  }

  .fin-table--cards {
    display: flex;
    flex-direction: column;
  }

  .fin-table--cards caption {
    order: 2;
    display: block;
  }

  .fin-table--cards thead {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .fin-table--cards tbody,
  .fin-table--cards tr {
    display: block;
  }

  .fin-table--cards tbody tr {
    padding: 1rem 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .fin-table--cards tbody tr:last-child {
    border-bottom: 0;
  }

  .fin-table--cards tbody td,
  .fin-table--cards tbody td:first-child {
    display: block;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
  }

  .fin-table--cards tbody tr:hover td {
    background: transparent;
  }

  .fin-table--cards tbody td:first-child {
    font-size: 1.02rem;
    line-height: 1.35;
    padding-left: 0.75rem;
    border-left: 3px solid rgba(16, 185, 129, 0.6);
  }

  .fin-table--cards tbody td:not(:first-child) {
    margin-top: 0.7rem;
  }

  .fin-table--cards tbody td:not(:first-child)::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.15rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6ee7b7;
  }

  /* Tabelas de duas colunas: o título do cartão já diz do que se trata */
  .fin-table--2col tbody td:not(:first-child)::before {
    display: none;
  }

  /* Colunas numéricas: rótulo à esquerda, valor à direita */
  .fin-table--cards tbody td.fin-col-num {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.45rem;
    text-align: right;
  }

  .fin-table--cards tbody td.fin-col-num::before {
    display: block;
    margin-bottom: 0;
    text-align: left;
  }
}

/* ============================================
   HUB /financas/ (complementos ao financas-hub.css)
   ============================================ */
.fin-modulo-label {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #34d399;
}

.fin-filter-item-disabled {
  opacity: 0.45;
}

.fin-filter-item-disabled .blog-category-name {
  cursor: not-allowed;
}

.fin-list-modulo {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #34d399;
}

/* ============================================
   ITENS DOS TÓPICOS (página de módulo)
   ============================================ */
.fin-modulo .fin-itens {
  margin: 0;
  padding: 0 1.25rem 1.1rem 1.25rem;
  list-style: none;
  font-size: 0.95rem;
  line-height: 1.6;
}

.fin-modulo .fin-itens li {
  padding: 0.3rem 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
}

.fin-modulo .fin-itens li:last-child {
  border-bottom: 0;
}

.fin-item-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #34d399;
  font-weight: 500;
  text-decoration: none;
}

.fin-item-link i {
  font-size: 0.65rem;
  transition: transform 0.2s ease;
}

.fin-item-link:hover {
  text-decoration: underline;
}

.fin-item-link:hover i {
  transform: translateX(3px);
}

.fin-item-link:focus-visible {
  outline: 2px solid #10b981;
  outline-offset: 3px;
}

.fin-item-pendente {
  color: rgba(255, 255, 255, 0.45);
  cursor: default;
}

@media (prefers-reduced-motion: reduce) {
  .fin-item-link i {
    transition: none;
  }
}

/* ============================================
   CORREÇÕES DE LEITURA (páginas de módulo)
   ============================================ */

/* Badge "Em preparação" sobre o hero BRANCO: o amarelo claro do tema escuro
   não tinha contraste. Aqui: âmbar escuro sobre âmbar claro (contraste ~7:1). */
.hero-blog .fin-badge {
  color: #92400e;
  background: #fef3c7;
  border-color: #f59e0b;
  font-weight: 700;
}

/* Sem sublinhado no hover em "Ferramentas relacionadas" e "Você também pode
   gostar": o .prose a:hover do pilar.css sublinhava os cartões inteiros. */
.prose .fin-no-underline a,
.prose .fin-no-underline a:hover,
.prose .fin-no-underline a:focus,
.prose .fin-no-underline a:focus-visible {
  text-decoration: none;
}

/* ============================================
   NAVEGAÇÃO ANTERIOR/PRÓXIMO ENTRE MÓDULOS
   Mesmas regras de .post-navigation / .nav-link dos artigos do blog
   (extraídas de post-template.css, que as páginas de módulo não carregam).
   ============================================ */
.post-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 3rem 0;
  padding: 1.5rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  gap: 1rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 50px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none !important;
  max-width: 45%;
  flex: 1;
}

.nav-link:hover:not(.disabled) {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: #10b981;
  transform: translateY(-2px);
}

.nav-link.disabled {
  opacity: 0.3;
  pointer-events: none;
  cursor: not-allowed;
}

.nav-link .text-xs,
.nav-link .text-sm {
  text-decoration: none !important;
  color: inherit;
}

.nav-link .text-neutral-500 {
  color: rgba(255, 255, 255, 0.4) !important;
}

.nav-link .text-sm {
  color: rgba(255, 255, 255, 0.8) !important;
  transition: color 0.2s ease;
}

.nav-link:hover:not(.disabled) .text-sm {
  color: #10b981 !important;
}

.nav-link .line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  line-clamp: 1;
  overflow: hidden;
  max-width: 200px;
}

.nav-link.prev {
  justify-content: flex-start;
}

.nav-link.next {
  justify-content: flex-end;
}

.nav-link.disabled.next {
  justify-content: flex-end;
}

.nav-link.disabled.next .flex-col {
  align-items: flex-end;
}

.nav-link i {
  color: rgba(255, 255, 255, 0.4);
  transition: color 0.2s ease;
  flex-shrink: 0;
}

.nav-link:hover:not(.disabled) i {
  color: #10b981;
}

@media (max-width: 768px) {
  .post-navigation {
    flex-direction: column;
    gap: 1rem;
  }
  .nav-link {
    max-width: 100%;
    width: 100%;
    justify-content: center;
  }
  .nav-link .line-clamp-1 {
    max-width: 150px;
  }
}

@media (max-width: 640px) {
  .nav-link {
    padding: 0.75rem 1rem;
  }
  .nav-link .line-clamp-1 {
    max-width: 120px;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .nav-link .line-clamp-1 {
    max-width: 100px;
  }
}

/* ============================================================
   "Você também pode gostar" (Finanças): mesmo visual dos cards de
   "Explore os Pilares da Consciência Monetária" das ferramentas
   (.related-posts-* em ferramentas.css). Markup em
   _includes/financas-relacionados-cards.njk.
   ============================================================ */
.fin-rel-link,
.fin-rel-link:hover,
.fin-rel-link:focus,
.fin-rel-link:focus-visible {
  text-decoration: none !important;
}

.fin-rel-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  transition: all 0.3s ease;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.fin-rel-link:focus-visible {
  outline: 2px solid #10b981;
  outline-offset: 4px;
  border-radius: 20px;
}

.fin-rel-link:hover .fin-rel-card {
  transform: translateY(-6px);
  border-color: rgba(16, 185, 129, 0.2);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.fin-rel-icon {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: linear-gradient(to bottom, rgba(16, 185, 129, 0.05), transparent);
}

.fin-rel-icon i {
  font-size: 3rem;
  color: rgba(16, 185, 129, 0.6);
  transition: all 0.3s ease;
}

.fin-rel-link:hover .fin-rel-icon i {
  color: #10b981;
  transform: scale(1.1);
}

.fin-rel-content {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.fin-rel-category {
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(16, 185, 129, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.fin-rel-title {
  font-size: 1rem;
  font-weight: 700;
  color: white;
  margin: 0.5rem 0;
  line-height: 1.3;
  transition: color 0.2s ease;
}

.fin-rel-link:hover .fin-rel-title {
  color: #10b981;
}

.fin-rel-desc {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.4;
  margin-bottom: 1rem;
  flex: 1;
}

.fin-rel-action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #10b981;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.2s ease;
  margin-top: auto;
}

.fin-rel-action i {
  font-size: 0.7rem;
  transition: transform 0.2s ease;
}

.fin-rel-link:hover .fin-rel-action {
  gap: 0.75rem;
  color: #0d9668;
}

.fin-rel-link:hover .fin-rel-action i {
  transform: translateX(4px);
}
