/*
 * conteudo.css — sistema visual dos artigos do hub (botize.ai/conteudo/)
 * ---------------------------------------------------------------------
 * Derivado da paleta e da tipografia do e-book, que ja se provou em
 * producao. A diferenca: o e-book e peca unica com CSS embutido; o
 * artigo e recorrente, entao o estilo mora aqui e e cacheado entre
 * paginas.
 *
 * REGRA: nenhum artigo pode depender de arquivo que possa sumir. Se este
 * CSS nao carregar, o HTML ainda precisa ser legivel — por isso o corpo
 * tem fallback de fonte de sistema e o texto nunca depende de CSS para
 * existir na pagina.
 *
 * Versionado por query string no <link>: conteudo.css?v=1.0
 * ---------------------------------------------------------------------
 */

:root {
  /* Fundos — herdados do e-book */
  --bg-primary: #05070d;
  --bg-secondary: #0a1020;
  --bg-card: rgba(20, 30, 50, 0.4);
  --bg-elevated: #0f1a2e;

  /* Textos */
  --text-primary: #f5f7fa;
  --text-secondary: #c5cdd8;
  --text-muted: #7a8699;
  --text-dim: #4a5568;

  /* Acentos de marca */
  --accent-orange: #ff6b1a;
  --accent-orange-soft: #ff8f4d;
  --accent-gold: #f5b942;
  --accent-gold-soft: #ffd27a;
  --accent-blue-light: #60a5fa;
  --accent-cyan: #22d3ee;

  /* Bordas */
  --border-subtle: rgba(245, 185, 66, 0.12);
  --border-emphasis: rgba(255, 107, 26, 0.35);

  /* Gradientes de titulo */
  --gradient-title: linear-gradient(135deg, #ff6b1a 0%, #f5b942 60%, #ffd27a 100%);
  --gradient-title-blue: linear-gradient(135deg, #60a5fa 0%, #22d3ee 100%);

  /* Tipografia */
  --font-display: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Fira Code', monospace;

  /* Medida de leitura — 65ch e o alvo de conforto */
  --measure: 65ch;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* =====================================================
   BARRA DE PROGRESSO — mesmo comportamento do e-book
   ===================================================== */
.progress-bar {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: var(--gradient-title); z-index: 200;
  transition: width .1s linear;
}

/* =====================================================
   CABECALHO
   ===================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .9rem 1.5rem;
  background: rgba(5, 7, 13, .88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}
.site-header .brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; }
.site-header .brand-logo {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  display: grid; place-items: center;
  background: var(--gradient-title);
  color: #05070d; font-family: var(--font-display); font-weight: 700;
}
.site-header .brand-name {
  font-family: var(--font-display); font-weight: 600;
  color: var(--text-primary); font-size: .95rem; line-height: 1.2;
}
.site-header .brand-tag {
  display: block; font-size: .68rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-muted);
}
.site-header .back-link {
  font-family: var(--font-display); font-size: .82rem;
  color: var(--text-muted); text-decoration: none;
  padding: .4rem .7rem; border-radius: 6px;
  border: 1px solid transparent; transition: color .2s, border-color .2s;
}
.site-header .back-link:hover { color: var(--accent-gold); border-color: var(--border-subtle); }

/* =====================================================
   ARTIGO
   ===================================================== */
.artigo { max-width: 46rem; margin: 0 auto; padding: 3.5rem 1.5rem 5rem; }

.artigo-kicker {
  font-family: var(--font-mono); font-size: .72rem;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent-gold); margin-bottom: 1rem;
  display: flex; flex-wrap: wrap; gap: .6rem; align-items: center;
}
.artigo-kicker .sep { color: var(--text-dim); }

.artigo h1 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 5vw, 2.9rem);
  line-height: 1.15; font-weight: 700; letter-spacing: -.02em;
  color: var(--text-primary); text-wrap: balance; margin-bottom: 1.1rem;
}

.artigo-lead {
  font-size: 1.2rem; line-height: 1.65; color: var(--text-secondary);
  text-wrap: pretty; margin-bottom: 1.5rem;
}

.artigo-meta {
  display: flex; flex-wrap: wrap; gap: .5rem 1.1rem;
  font-family: var(--font-mono); font-size: .74rem;
  color: var(--text-muted); padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle); margin-bottom: 2.5rem;
}

.artigo p { max-width: var(--measure); margin-bottom: 1.35rem; text-wrap: pretty; }

.artigo h2 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3.2vw, 1.75rem);
  line-height: 1.25; font-weight: 600; color: var(--text-primary);
  margin: 3rem 0 1.1rem; text-wrap: balance;
}
.artigo h3 {
  font-family: var(--font-display); font-size: 1.15rem; font-weight: 600;
  color: var(--text-primary); margin: 2.2rem 0 .8rem;
}

.artigo a { color: var(--accent-gold); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.artigo a:hover { color: var(--accent-gold-soft); }
.artigo a:focus-visible { outline: 2px solid var(--accent-gold); outline-offset: 3px; border-radius: 2px; }

.artigo strong { color: var(--text-primary); font-weight: 600; }
.artigo em { color: var(--text-secondary); }

.artigo ul, .artigo ol { max-width: var(--measure); margin: 0 0 1.35rem 1.2rem; }
.artigo li { margin-bottom: .6rem; }
.artigo li::marker { color: var(--accent-orange); }

/* destaque inline — o mesmo .hl do e-book */
.hl {
  color: var(--accent-gold); font-weight: 600;
  background: rgba(245, 185, 66, .08);
  padding: .05em .3em; border-radius: 3px;
}

/* =====================================================
   BLOCOS DE APOIO
   ===================================================== */
.dado {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent-gold);
  border-radius: 0 10px 10px 0; padding: 1.2rem 1.4rem;
  margin: 2rem 0; max-width: var(--measure);
}
.dado .dado-label {
  display: block; font-family: var(--font-display); font-size: .72rem;
  font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent-gold); margin-bottom: .5rem;
}
.dado p:last-child { margin-bottom: 0; }

.virada {
  background: var(--bg-elevated); border: 1px solid var(--border-emphasis);
  border-radius: 12px; padding: 1.4rem 1.5rem;
  margin: 2.2rem 0; max-width: var(--measure);
}
.virada .virada-label {
  display: block; font-family: var(--font-display); font-size: .72rem;
  font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent-orange); margin-bottom: .5rem;
}
.virada p:last-child { margin-bottom: 0; }

/* numeros com fonte — herda a ideia do .pillar.stat do e-book */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 14px; margin: 2rem 0; }
.stat {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: 10px; padding: 1rem 1.1rem; position: relative; overflow: hidden;
}
.stat::before { content: ''; position: absolute; top: 0; left: 0; width: 3px; height: 100%; background: var(--stat-color, var(--accent-orange)); }
.stat .stat-num {
  display: block; font-family: var(--font-display);
  font-size: clamp(1.7rem, 4vw, 2.2rem); font-weight: 700; line-height: 1;
  color: var(--stat-color, var(--accent-orange)); margin-bottom: .5rem;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}
.stat .stat-desc { font-size: .88rem; color: var(--text-muted); line-height: 1.5; }
.stat .stat-fonte {
  display: block; margin-top: .5rem; font-family: var(--font-mono);
  font-size: .68rem; color: var(--text-dim); font-style: normal;
}

/* =====================================================
   IMAGEM
   ===================================================== */
figure { margin: 2.4rem 0; }
figure img { width: 100%; height: auto; display: block; border-radius: 12px; border: 1px solid var(--border-subtle); }
figcaption { margin-top: .7rem; font-size: .82rem; color: var(--text-muted); line-height: 1.55; }
figcaption a { color: var(--text-dim); }

/* =====================================================
   PERGUNTAS (FAQPage)
   ===================================================== */
.faq { margin: 3rem 0 0; max-width: var(--measure); }
.faq h2 { margin-bottom: 1.2rem; }
.faq-item { border-bottom: 1px solid var(--border-subtle); padding: 1.1rem 0; }
.faq-item:last-child { border-bottom: none; }
.faq-item .pergunta {
  font-family: var(--font-display); font-size: 1.05rem; font-weight: 600;
  color: var(--text-primary); margin-bottom: .55rem;
}
.faq-item .resposta { color: var(--text-secondary); margin: 0; }

/* =====================================================
   RELACIONADOS — o vinculo com o "porque" obrigatorio
   ===================================================== */
.relacionados { margin: 3.5rem 0 0; padding-top: 2rem; border-top: 1px solid var(--border-subtle); }
.relacionados h2 { font-size: 1.15rem; margin: 0 0 1.1rem; }
.rel-item {
  display: block; text-decoration: none; padding: 1rem 1.2rem;
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: 10px; margin-bottom: .8rem; transition: border-color .2s;
}
.rel-item:hover { border-color: var(--border-emphasis); }
.rel-item .rel-titulo { display: block; font-family: var(--font-display); font-weight: 600; color: var(--text-primary); margin-bottom: .3rem; }
.rel-item .rel-porque { display: block; font-size: .89rem; color: var(--text-muted); line-height: 1.55; }

/* =====================================================
   NOTA FINAL — a unica mencao a Botize no corpo
   ===================================================== */
.nota-final {
  margin: 3rem 0 0; padding: 1.2rem 1.4rem;
  background: var(--bg-secondary); border: 1px solid var(--border-subtle);
  border-radius: 10px; max-width: var(--measure);
}
.nota-final p { font-size: .92rem; color: var(--text-muted); margin: 0; }
.nota-final a { color: var(--accent-gold); }

/* =====================================================
   RODAPE
   ===================================================== */
.site-footer {
  border-top: 1px solid var(--border-subtle); margin-top: 4rem;
  padding: 2.5rem 1.5rem 3rem; text-align: center;
}
.site-footer .footer-links { display: flex; flex-wrap: wrap; gap: 1.2rem; justify-content: center; margin-bottom: 1rem; }
.site-footer a { color: var(--text-muted); text-decoration: none; font-size: .88rem; }
.site-footer a:hover { color: var(--accent-gold); }
.site-footer .footer-copy { font-size: .78rem; color: var(--text-dim); }

/* =====================================================
   MOVIMENTO — respeita quem pediu para reduzir
   ===================================================== */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .progress-bar { display: none; }
  * { scroll-behavior: auto !important; }
}

@media (max-width: 640px) {
  .artigo { padding: 2.5rem 1.15rem 3.5rem; }
  .site-header { padding: .8rem 1.15rem; }
  .site-header .brand-tag { display: none; }
}

/* =====================================================
   BLOCO DE DECISAO — perguntas encadeadas que guiam escolha
   ===================================================== */
.comparativo-simples {
  background: var(--bg-secondary); border: 1px solid var(--border-subtle);
  border-radius: 12px; padding: 1.5rem 1.6rem; margin: 2rem 0;
  max-width: var(--measure);
}
.comparativo-simples h3 { margin-top: 1.4rem; font-size: 1.02rem; color: var(--accent-gold); }
.comparativo-simples h3:first-child { margin-top: 0; }
.comparativo-simples p { margin-bottom: 0; font-size: .96rem; }

/* =====================================================
   INDICE — navegacao por tema (nunca por data)
   ===================================================== */
.indice { max-width: 62rem; margin: 0 auto; padding: 3.5rem 1.5rem 5rem; }

.indice-topo { margin-bottom: 2.5rem; }
.indice-topo h1 {
  font-family: var(--font-display); font-size: clamp(2.1rem, 5vw, 3rem);
  font-weight: 700; letter-spacing: -.02em; color: var(--text-primary);
  margin-bottom: 1rem;
}
.indice-lead { font-size: 1.15rem; color: var(--text-secondary); max-width: var(--measure); text-wrap: pretty; }
.indice-meta {
  margin-top: .9rem; font-family: var(--font-mono); font-size: .76rem;
  color: var(--text-muted);
}

.indice-nav {
  display: flex; flex-wrap: wrap; gap: .5rem;
  padding: 1.1rem 0 2rem; margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}
.indice-nav a {
  font-family: var(--font-display); font-size: .84rem; text-decoration: none;
  color: var(--text-muted); padding: .4rem .8rem; border-radius: 20px;
  border: 1px solid var(--border-subtle); transition: color .2s, border-color .2s;
}
.indice-nav a:hover { color: var(--accent-gold); border-color: var(--border-emphasis); }
.indice-nav a:focus-visible { outline: 2px solid var(--accent-gold); outline-offset: 2px; }

.tema { margin: 3rem 0 0; scroll-margin-top: 5rem; }
.tema h2 {
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 600;
  color: var(--text-primary); margin-bottom: .5rem;
}
.tema-desc { color: var(--text-muted); font-size: .95rem; max-width: var(--measure); margin-bottom: 1.3rem; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1rem; }
.card {
  display: flex; flex-direction: column; gap: .5rem; text-decoration: none;
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: 12px; padding: 1.3rem 1.4rem;
  transition: border-color .2s, transform .2s;
}
.card:hover { border-color: var(--border-emphasis); transform: translateY(-2px); }
.card:focus-visible { outline: 2px solid var(--accent-gold); outline-offset: 3px; }
.card-tipo {
  font-family: var(--font-mono); font-size: .66rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent-gold);
}
.card-titulo {
  font-family: var(--font-display); font-size: 1.05rem; font-weight: 600;
  color: var(--text-primary); line-height: 1.35; text-wrap: balance;
}
.card-resumo { font-size: .9rem; color: var(--text-muted); line-height: 1.6; }
.card-min {
  font-family: var(--font-mono); font-size: .7rem; color: var(--text-dim);
  margin-top: auto; padding-top: .4rem;
}

@media (prefers-reduced-motion: reduce) { .card:hover { transform: none; } }
@media (max-width: 640px) { .indice { padding: 2.5rem 1.15rem 3.5rem; } }
