/*
Theme Name: Hipercode Blog
Theme URI: https://hipercode.com.br/blog
Author: Hipercode
Author URI: https://hipercode.com.br
Description: Tema do blog da Hipercode. Design system dark premium + azul de marca, idêntico ao site institucional (Astro). Feito pra conteúdo alimentado por agentes de IA, com SEO técnico embutido.
Version: 1.0.2
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: Proprietário
Text Domain: hipercode
*/

/* ============================================================
   Hipercode · Design System (blog)
   Base: contas/servicos/hipercode/site/app/src/styles/global.css
   ============================================================ */

:root {
  --bg: #0A0A0A;
  --bg-elevated: #0E0E10;
  --bg-surface: #141414;
  --bg-raised: #1A1A1A;

  --text: #F5F5F5;
  --text-secondary: #A3A3A3;
  --text-muted: #737373;
  --text-read: #E2E2E6;

  --accent: #2363FA;
  --accent-light: #3A6EFF;
  --accent-deep: #171EBE;
  --violet: #6C63FF;

  --success: #22C55E;
  --warning: #EAB308;
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);

  --paper: #F4F3F0;
  --ink: #12121A;
  --ink-secondary: #4A4A55;
  --ink-muted: #8A8A95;

  --grad-brand: linear-gradient(135deg, #3A6EFF 0%, #2363FA 50%, #171EBE 100%);
  --grad-brand-strong: linear-gradient(135deg, #3A6EFF 0%, #2363FA 55%, #171EBE 100%);

  --glass-blur: 16px;

  --shadow-card: 0 10px 28px rgba(18, 23, 46, 0.10);
  --shadow-soft: 0 8px 24px rgba(18, 23, 46, 0.08);

  --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;

  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-6: 24px; --sp-8: 32px; --sp-12: 48px; --sp-16: 64px;
  --sp-24: 96px; --sp-32: 128px;

  --container: 1200px;
  --reading: 860px;
  --gutter: clamp(16px, 5vw, 80px);
  --radius: 18px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-input: 11px;
  --radius-btn: 12px;
  --radius-pill: 999px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 240ms;

  color-scheme: dark;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }
ul { list-style: none; }
::selection { background: var(--accent); color: #fff; }

/* ---------- Tipografia ---------- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 800; line-height: 1.08; letter-spacing: -0.03em; }
h2 { font-weight: 700; letter-spacing: -0.02em; }
h3 { font-weight: 600; letter-spacing: -0.015em; }

/* Anti-viúvas/órfãs (line-balancing nativo). Reforço "hard" com nbsp na última
   dupla vem do filtro hipercode_widont() em functions.php. */
h1, h2, h3, h4, h5, h6,
.display, .h1, .h2, .h3, .kicker { text-wrap: balance; }
p, li, .lead, blockquote, figcaption,
.prose p, .prose li { text-wrap: pretty; }

.display { font-size: clamp(40px, 6.2vw, 76px); font-weight: 800; line-height: 1.04; letter-spacing: -0.03em; }
.h1 { font-size: clamp(36px, 5vw, 60px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.06; }
.h2 { font-size: clamp(30px, 3.6vw, 44px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.12; }
.h3 { font-size: clamp(22px, 2.2vw, 28px); font-weight: 600; letter-spacing: -0.015em; }
.lead { font-size: clamp(18px, 1.5vw, 21px); line-height: 1.6; color: var(--text-secondary); }
.small { font-size: 14px; }

.kicker {
  display: inline-flex; align-items: center;
  font-family: var(--font-body); font-weight: 600; font-size: 13px;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-light);
  padding: 8px 15px; border-radius: var(--radius-pill);
  background: var(--bg-surface); border: 1px solid var(--border);
}
.grad-text { background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Layout ---------- */
.section { padding-block: clamp(40px, 8vw, 100px); }
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section--paper { background: var(--paper); color: var(--ink); }
.section--elevated { background: var(--bg-elevated); }
.reading { max-width: var(--reading); }
.relative { position: relative; z-index: 1; }
.center { text-align: center; }

.grid { display: grid; gap: var(--sp-6); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: 16px;
  padding: 16px 28px; border-radius: 12px;
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out), background var(--dur);
  will-change: transform;
}
.btn--primary { background: var(--grad-brand); color: #fff; }
.btn--primary:hover { transform: translateY(-2px) scale(1.015); box-shadow: 0 12px 30px rgba(35, 99, 250, 0.35); }
.btn--ghost { border: 1px solid var(--border-strong); color: var(--text); }
.btn--ghost:hover { background: var(--bg-raised); border-color: var(--accent-light); }
.btn--light { background: #fff; color: var(--accent); }
.btn--light:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(0,0,0,0.25); }

/* ---------- Cards ---------- */
.card--paper { background: #fff; border: none; border-radius: var(--radius); padding: var(--sp-8); box-shadow: var(--shadow-card); color: var(--ink); }

/* ---------- Mesh / glow ---------- */
.mesh {
  position: absolute; pointer-events: none; z-index: 0;
  width: min(1100px, 90%); aspect-ratio: 1.6 / 1;
  background: radial-gradient(circle at center, rgba(35,99,250,0.32), transparent 70%);
  filter: blur(80px);
}

/* ---------- Motion ---------- */
[data-reveal] { opacity: 0; transform: translateY(20px); transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out); }
[data-reveal].is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  [data-reveal] { opacity: 1; transform: none; }
}

/* ============================================================
   Header (glass sticky) — espelha components/Header.astro
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10, 10, 10, 0.55);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: background var(--dur), border-color var(--dur);
}
.site-header.is-scrolled { background: rgba(10, 10, 10, 0.72); border-bottom-color: var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding-block: 18px; }
.logo img { height: 22px; width: auto; }
.nav { display: flex; align-items: center; gap: 34px; }
.nav > a { font-size: 16px; color: var(--text-secondary); transition: color var(--dur); }
.nav > a:hover, .nav > a.is-current { color: var(--text); }
.nav-cta-mobile { display: none; }
.header-cta { padding: 12px 22px; font-size: 15px; }
.menu-toggle { display: none; flex-direction: column; gap: 5px; padding: 8px; }
.menu-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: transform var(--dur), opacity var(--dur); }

@media (max-width: 900px) {
  .header-cta { display: none; }
  .menu-toggle { display: flex; }
  .nav {
    position: fixed; inset: 64px 0 auto 0;
    flex-direction: column; align-items: flex-start; gap: 4px;
    padding: 24px var(--gutter) 32px;
    background: rgba(10,10,10,0.96);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    transform: translateY(-120%); transition: transform 0.35s var(--ease-out);
  }
  .nav.is-open { transform: none; }
  .nav > a { font-size: 20px; padding-block: 10px; }
  .nav-cta-mobile { display: inline-flex; margin-top: 12px; }
}

/* ============================================================
   Listagem (index) — espelha pages/conteudo.astro
   ============================================================ */
.h-hero { position: relative; overflow: hidden; padding-top: clamp(72px, 10vh, 120px); }
.h-hero .kicker { margin-bottom: 20px; }
.h-hero .lead { margin-top: clamp(16px, 2vw, 22px); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.chip { padding: 9px 16px; border-radius: 999px; background: var(--bg-surface); border: 1px solid var(--border); color: var(--text-secondary); font-size: 14px; font-weight: 500; transition: color var(--dur), border-color var(--dur); }
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip--on { background: var(--accent); border-color: transparent; color: #fff; }

.destaque { display: grid; grid-template-columns: 1fr 1.1fr; background: #fff; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-card); margin-bottom: 40px; }
.destaque img { width: 100%; height: 100%; min-height: 300px; object-fit: cover; }
.destaque-body { padding: 48px; display: flex; flex-direction: column; gap: 14px; justify-content: center; color: var(--ink); }
.destaque-body h2 { color: var(--ink); }
.destaque-body p { color: var(--ink-secondary); font-size: 16px; line-height: 1.55; }
.pill-soft { align-self: flex-start; padding: 7px 13px; border-radius: 999px; background: rgba(35,99,250,.1); color: var(--accent); font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.link { color: var(--accent); font-weight: 600; font-size: 15px; }

.arts { align-items: stretch; }
.art { display: flex; flex-direction: column; justify-content: space-between; gap: 20px; min-height: 200px; padding: 26px 24px; transition: transform var(--dur) var(--ease-out), box-shadow var(--dur); }
.art:hover { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(18,23,46,0.14); }
.art-top { display: flex; flex-direction: column; gap: 11px; }
.art-cat { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.art h3 { font-size: 20px; line-height: 1.26; color: var(--ink); }
.art-m { font-size: 13px; color: var(--ink-muted); }

.nl { text-align: center; }
.nl-form { display: flex; gap: 10px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }
.nl-form input { padding: 15px 18px; border-radius: var(--radius-input); background: var(--bg-raised); border: 1px solid var(--border); color: var(--text); font: inherit; font-size: 15px; min-width: 260px; }
.nl-form input::placeholder { color: var(--text-muted); }

.pager { display: flex; justify-content: center; gap: 12px; margin-top: 48px; }
.pager a, .pager span { padding: 10px 16px; border-radius: var(--radius-btn); border: 1px solid var(--border); color: var(--text-secondary); font-size: 14px; font-weight: 600; }
.pager a:hover { color: var(--text); border-color: var(--border-strong); }
.pager .current { background: var(--accent); border-color: transparent; color: #fff; }

/* ============================================================
   Artigo (single) — espelha pages/conteudo/[...slug].astro
   ============================================================ */
.art-page { position: relative; overflow: hidden; padding-top: clamp(90px, 11vh, 124px); }
.back { color: var(--text-secondary); font-size: 14px; font-weight: 500; }
.back:hover { color: var(--text); }
.art-cat-single { display: inline-block; margin-top: 24px; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-light); }
.art-page .h1 { margin-top: 14px; }
.art-meta { color: var(--text-muted); font-size: 15px; margin-top: 16px; }
.art-cover { width: 100%; height: auto; aspect-ratio: 16 / 8; object-fit: cover; border-radius: var(--radius-lg); margin-top: 32px; border: 1px solid var(--border); }

/* Barra de progresso de leitura (topo, fixa) */
.reading-progress {
  position: fixed; top: 0; left: 0; z-index: 200;
  width: 100%; height: 3px; transform-origin: 0 50%; transform: scaleX(0);
  background: var(--grad-brand); will-change: transform;
  transition: transform 90ms linear;
}

/* Sumário (TOC) — caixa limpa no topo do artigo */
.toc {
  margin-top: 32px; padding: 22px 26px;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); border-left: 3px solid var(--accent);
}
.toc-title { font-family: var(--font-body); font-weight: 600; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 14px; }
.toc ul { display: flex; flex-direction: column; gap: 9px; }
.toc li.toc-h3 { padding-left: 18px; }
.toc a { color: var(--text-secondary); font-size: 15.5px; line-height: 1.4; transition: color var(--dur); border-bottom: 1px solid transparent; }
.toc a:hover { color: var(--accent-light); }
.toc li.toc-h3 a { font-size: 14.5px; color: var(--text-muted); }

/* offset de âncora pra não colar no header sticky */
.prose h2, .prose h3 { scroll-margin-top: 90px; }

.prose { margin-top: 36px; }
.prose > *:first-child { margin-top: 0; }
/* Hierarquia multi-tamanho + divisória entre seções (linha acima de cada H2) */
.prose h2 { font-family: var(--font-display); font-size: clamp(26px, 3vw, 32px); font-weight: 700; letter-spacing: -.02em; line-height: 1.15; color: var(--text); margin: 56px 0 16px; padding-top: 40px; border-top: 1px solid var(--border); }
.prose h2:first-child { margin-top: 4px; padding-top: 0; border-top: none; }
.prose h3 { font-family: var(--font-display); font-size: 22px; font-weight: 600; letter-spacing: -.01em; line-height: 1.25; margin-top: 36px; margin-bottom: 12px; color: var(--text); }
.prose h4 { font-family: var(--font-body); font-size: 14px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-light); margin-top: 28px; margin-bottom: 8px; }
.prose p { font-size: 19px; line-height: 1.85; color: var(--text-read); margin-bottom: 24px; }
.prose a { color: var(--accent-light); text-decoration: underline; }
.prose ul, .prose ol { margin: 0 0 24px; padding-left: 24px; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { font-size: 18px; line-height: 1.7; color: var(--text-read); margin-bottom: 8px; }
.prose img { border-radius: var(--radius-lg); margin: 28px 0; border: 1px solid var(--border); }
.prose blockquote { border-left: 3px solid var(--accent); padding-left: 22px; margin: 28px 0; color: var(--text-secondary); font-style: italic; }
.prose blockquote p { color: var(--text-secondary); }
.prose strong { color: var(--text); font-weight: 600; }
.prose code { font-family: ui-monospace, monospace; font-size: .9em; background: var(--bg-surface); padding: 2px 7px; border-radius: 6px; border: 1px solid var(--border); }
.prose figure { margin: 28px 0; }
.prose figcaption { font-size: 14px; color: var(--text-muted); margin-top: 10px; text-align: center; }

/* ============================================================
   Exhibits de dados no meio do texto (referência McKinsey)
   Kicker + título + unidade + gráfico de barras + fonte.
   ============================================================ */
.exhibit {
  margin: 44px 0; padding: 28px 30px;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); border-top: 3px solid var(--accent);
}
.exhibit-kicker { font-family: var(--font-body); font-weight: 600; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-light); margin: 0 0 8px; }
.exhibit-title { font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: -.01em; color: var(--text); margin: 0 0 4px; line-height: 1.2; }
.exhibit-unit { font-size: 13.5px; color: var(--text-muted); margin: 0 0 22px; }
.exhibit-chart { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }
.bar { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; align-items: center; gap: 14px; }
.bar-label { font-size: 14.5px; color: var(--text-secondary); line-height: 1.3; }
.bar-track { height: 12px; border-radius: 999px; background: var(--bg-raised); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--grad-brand); min-width: 4px; }
.bar-val { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--text); font-variant-numeric: tabular-nums; }
.exhibit-source { font-size: 12.5px; color: var(--text-muted); border-top: 1px solid var(--border); padding-top: 14px; margin: 0; }
.exhibit-source a { color: var(--text-secondary); }

/* Stat callouts — números grandes em destaque */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; margin: 44px 0; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.stat { background: var(--bg-surface); padding: 26px 24px; }
.stat-num { display: block; font-family: var(--font-display); font-weight: 800; font-size: clamp(32px, 5vw, 46px); letter-spacing: -.03em; line-height: 1; background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-label { display: block; margin-top: 10px; font-size: 14px; color: var(--text-secondary); line-height: 1.4; }

@media (max-width: 560px) {
  .exhibit { padding: 22px 20px; }
  .bar { grid-template-columns: 1fr auto; }
  .bar-label { grid-column: 1 / -1; }
}

.art-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 44px; }
.art-tags a { padding: 7px 14px; border-radius: var(--radius-pill); background: var(--bg-surface); border: 1px solid var(--border); color: var(--text-secondary); font-size: 13px; }
.art-tags a:hover { color: var(--text); border-color: var(--border-strong); }

.cta-wrap { }
.cta-card { text-align: center; padding: clamp(56px, 8vw, 80px) 40px; border-radius: var(--radius-xl); background: var(--grad-brand-strong); display: flex; flex-direction: column; align-items: center; gap: 22px; }
.cta-card .h1 { color: #fff; max-width: 18ch; }
.cta-card p { color: rgba(255,255,255,.92); font-size: 19px; }

/* Artigos relacionados */
.related { border-top: 1px solid var(--border); }
.related h2 { margin-bottom: 32px; }

/* ============================================================
   Footer — espelha components/Footer.astro
   ============================================================ */
.site-footer { background: #070707; padding-block: 72px 40px; border-top: 1px solid var(--border); }
.footer-top { display: flex; justify-content: space-between; gap: 64px; flex-wrap: wrap; }
.footer-brand { max-width: 340px; }
.footer-logo { height: 24px; width: auto; margin-bottom: 18px; }
.footer-tag { color: var(--text-secondary); font-size: 15px; line-height: 1.55; margin-bottom: 20px; }
.footer-nl-label { color: var(--text-muted); font-size: 14px; margin-bottom: 12px; }
.footer-nl { display: flex; gap: 8px; }
.footer-nl input { flex: 1; min-width: 0; padding: 13px 16px; border-radius: var(--radius-input); background: var(--bg-raised); border: 1px solid var(--border); color: var(--text); font: inherit; font-size: 14px; }
.footer-nl input::placeholder { color: var(--text-muted); }
.footer-nl .btn { padding: 13px 20px; font-size: 14px; }
.footer-cols { display: flex; gap: 72px; flex-wrap: wrap; }
.footer-col { display: flex; flex-direction: column; gap: 14px; }
.footer-col h4 { font-family: var(--font-body); font-weight: 600; font-size: 14px; color: var(--text); letter-spacing: 0; }
.footer-col a { color: var(--text-secondary); font-size: 15px; transition: color var(--dur); }
.footer-col a:hover { color: var(--accent-light); }
.footer-divider { height: 1px; background: var(--border); margin-block: 44px 24px; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; color: var(--text-muted); font-size: 13px; }

@media (max-width: 900px) {
  .site-footer { padding-block: 52px 32px; }
  .footer-top { flex-direction: column; gap: 40px; }
  .footer-brand { max-width: 100%; }
  .footer-cols { gap: 28px; }
}

/* ============================================================
   Responsivo geral
   ============================================================ */
@media (max-width: 900px) {
  .cols-2, .cols-3 { grid-template-columns: 1fr; }
  body { font-size: 16px; }
  .card--paper { padding: var(--sp-6); }
  .h-hero { padding-top: clamp(60px, 12vh, 100px); }
  .destaque { grid-template-columns: 1fr; }
  .destaque img { min-height: 220px; max-height: 260px; }
  .destaque-body { padding: 28px 24px; }
  .art-page { padding-top: clamp(70px, 12vh, 100px); }
  .prose p { font-size: 17px; line-height: 1.75; }
  .prose li { font-size: 16px; }
  .prose h2 { font-size: 22px; }
  .cta-card { padding: clamp(40px, 7vw, 60px) clamp(20px, 5vw, 40px); }
  .cta-card p { font-size: 17px; }
}
@media (min-width: 560px) and (max-width: 900px) {
  .cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 901px) and (max-width: 1100px) {
  .cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .btn { padding: 13px 20px; font-size: 15px; }
  .prose p { font-size: 16px; }
  .prose li { font-size: 15px; }
  .prose h2 { font-size: 20px; }
  .cta-card { padding: 36px clamp(16px, 5vw, 32px); }
  .nl-form { flex-direction: column; align-items: stretch; }
  .nl-form input { min-width: unset; width: 100%; }
  .nl-form .btn { width: 100%; }
  .footer-cols { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 20px; }
  .footer-nl { flex-direction: column; gap: 10px; }
  .footer-nl .btn { width: 100%; }
  .footer-bottom { flex-direction: column; gap: 6px; text-align: center; }
}
