/* ============================================================
   artigos.css — Estilos Universais para Artigos Educativos
   logicabr.dev — Otimizado para Leitura, SEO e Google AdSense
   ============================================================ */

:root {
  --bg: #0a0e14;
  --surface: #131922;
  --surface-raised: #18202c;
  --border: #1e2633;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #00e5ff;
  --accent-hover: #33ebff;
  --accent-purple: #a78bfa;
  --code-bg: #0d1117;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

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

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.75;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

/* Lucide Icons */
[data-lucide], svg.lucide {
  width: 1.15em;
  height: 1.15em;
  stroke-width: 2px;
  vertical-align: -0.18em;
  display: inline-block;
}
.brand-icon [data-lucide], .brand-icon svg.lucide {
  width: 1.25em;
  height: 1.25em;
  color: var(--accent);
  vertical-align: -0.15em;
}
.stats-icon [data-lucide], .stats-icon svg.lucide {
  width: 1.2em;
  height: 1.2em;
  color: var(--accent);
  vertical-align: -0.15em;
}

/* Header */
header.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.site-logo {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.site-logo span { color: var(--accent); }
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.btn-nav {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  transition: all 0.2s;
}
.btn-nav:hover { color: #fff; background: rgba(255,255,255,0.05); }
.btn-open-ide {
  background: var(--accent);
  color: #0a0e14;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  padding: 8px 18px;
  border-radius: 8px;
  transition: all 0.2s;
}
.btn-open-ide:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

/* Layout Principal em 2 Colunas (Artigo + Sidebar) */
.article-layout {
  max-width: 1200px;
  margin: 32px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 40px;
  align-items: start;
}

/* Breadcrumbs */
.breadcrumb {
  display: flex;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
  align-items: center;
  flex-wrap: wrap;
}
.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span.sep { opacity: 0.5; }
.breadcrumb span.current { color: var(--accent); font-weight: 600; }

/* Cabeçalho do Artigo */
.article-header {
  margin-bottom: 32px;
}
.article-meta {
  display: flex;
  gap: 16px;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 12px;
  align-items: center;
}
.badge-category {
  background: rgba(0, 229, 255, 0.12);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
}
h1.article-title {
  font-size: clamp(26px, 4vw, 38px);
  color: #fff;
  line-height: 1.25;
  margin-bottom: 16px;
  font-weight: 800;
}
p.article-lead {
  font-size: 19px;
  color: #cbd5e1;
  line-height: 1.6;
}

/* Corpo do Texto */
.article-body h2 {
  font-size: 24px;
  color: #fff;
  margin: 40px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.article-body h3 {
  font-size: 20px;
  color: var(--accent);
  margin: 28px 0 12px;
}
.article-body p {
  color: #c9d1d9;
  margin-bottom: 20px;
}
.article-body ul, .article-body ol {
  color: #c9d1d9;
  margin-bottom: 20px;
  padding-left: 28px;
}
.article-body li {
  margin-bottom: 8px;
}
.article-body strong { color: #fff; }
.article-body a {
  color: var(--accent);
  text-decoration: underline;
}

/* Imagens e Ilustrações Didáticas */
figure.article-figure {
  margin: 32px 0;
  text-align: center;
}
figure.article-figure img, figure.article-figure svg {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  background: var(--surface);
}
figcaption {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 10px;
  font-style: italic;
}

/* Blocos de Código */
.code-block {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 24px 0;
  overflow: hidden;
}
.code-header {
  background: var(--surface);
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.code-header .lang-tag {
  color: var(--accent);
  font-weight: 700;
}
pre {
  padding: 18px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 14.5px;
  line-height: 1.6;
  color: #e6edf3;
}
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
}
pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* Caixas de Destaque */
.callout {
  padding: 20px 24px;
  border-radius: 12px;
  margin: 28px 0;
  border-left: 4px solid var(--accent);
  background: var(--surface);
}
.callout.tip {
  border-left-color: var(--accent);
}
.callout.warning {
  border-left-color: #ffd54f;
  background: rgba(255, 213, 79, 0.05);
}
.callout h4 {
  font-size: 16px;
  color: #fff;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.callout p {
  font-size: 15px;
  margin: 0;
}

/* Banner de CTA para a IDE */
.article-cta-box {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.1), rgba(167, 139, 250, 0.1));
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  margin: 48px 0 24px;
}
.article-cta-box h3 {
  font-size: 22px;
  color: #fff;
  margin-bottom: 8px;
}
.article-cta-box p {
  color: #c9d1d9;
  margin-bottom: 20px;
}
.btn-cta-big {
  display: inline-block;
  background: var(--accent);
  color: #0a0e14;
  font-weight: 800;
  text-decoration: none;
  padding: 14px 28px;
  border-radius: 10px;
  font-size: 16px;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(0, 229, 255, 0.25);
}
.btn-cta-big:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 229, 255, 0.35);
}

/* Navegação Anterior / Próximo */
.article-nav-links {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.nav-card {
  flex: 1;
  min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  text-decoration: none;
  transition: all 0.2s;
  display: block;
}
.nav-card:hover { 
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.03);
}
.nav-card .nav-label { 
  font-size: 12px; 
  color: var(--accent) !important; 
  text-transform: uppercase; 
  font-weight: 800; 
  margin-bottom: 4px; 
}
.nav-card .nav-title { 
  font-size: 15px; 
  color: #ffffff !important; 
  font-weight: 700; 
}

/* Tabelas Didáticas */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}
th {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  padding: 12px 14px;
  text-align: left;
  font-weight: 700;
  border: 1px solid var(--border);
  font-size: 14px;
}
td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  color: #cbd5e1;
  font-size: 14px;
}
tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}

/* Seção de FAQ / Perguntas Frequentes */
.faq-box {
  margin: 36px 0;
}
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 12px;
  padding: 16px 20px;
}
.faq-question {
  color: #ffffff !important;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.faq-answer {
  color: #cbd5e1;
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

/* Caixa de Métricas / Contador de Palavras e Caracteres */
.article-stats-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 24px;
  margin: 36px 0 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
.stats-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
}
.stats-grid {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.stat-card {
  flex: 1;
  min-width: 120px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 12px 16px;
  text-align: center;
}
.stat-number {
  display: block;
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  font-family: 'Space Grotesk', var(--font-sans);
}
.stat-desc {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-top: 3px;
}

/* Sidebar Direita */
.article-sidebar {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.sidebar-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}
.sidebar-box h4 {
  font-size: 14px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.toc-list li {
  margin-bottom: 8px;
}
.toc-list a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  display: block;
  transition: color 0.2s;
}
.toc-list a:hover { color: #fff; }

/* Espaço do Anúncio do Google AdSense */
.ad-slot-sidebar {
  background: var(--surface);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ad-badge {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

/* Footer Universal */
footer.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 60px;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}
.footer-links a:hover { color: var(--accent); }

/* Responsividade */
@media (max-width: 900px) {
  .article-layout {
    grid-template-columns: 1fr;
  }
  .article-sidebar {
    position: static;
  }
}
