/* ════════════════════════════════════════════════════════════════════════
   cnpj/ob — páginas públicas de leitura (blog, termos, privacidade)
   Mesmo sistema do portal: neutros frios, um azul de destaque, Inter.
   ════════════════════════════════════════════════════════════════════════ */
:root, [data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff; --surface: #ffffff; --surface2: #f7f7f7;
  --border: #ebebeb; --border-subtle: #f0f0f0;
  --text: #0a0a0a; --body: #262626; --muted: #525252; --subtle: #737373; --faint: #a3a3a3;
  --accent: #2563eb; --accent-hover: #1d4ed8; --accent-soft: #eff6ff; --accent-text: #1d4ed8;
  --code-bg: #f7f7f7;
  --grad-from: #3b82f6; --grad-to: #2563eb; --ring: #3b82f6; --sheen: rgba(255,255,255,.25);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;
  --radius: 10px;
}
/* Escuro: segue o seletor de tema do site (cookie cnpjob_theme), não o sistema */
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121212; --surface: #171717; --surface2: #1c1c1c;
  --border: #262626; --border-subtle: #1f1f1f;
  --text: #fafafa; --body: #d4d4d4; --muted: #b5b5b5; --subtle: #8f8f8f; --faint: #525252;
  --accent: #5b8def; --accent-hover: #7aa2f3; --accent-soft: rgba(30,58,138,.45); --accent-text: #93b4ff;
  --code-bg: #1c1c1c;
  --grad-from: #5b8def; --grad-to: #3b6fd8; --ring: #5b8def; --sheen: rgba(255,255,255,.2);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; height: auto; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* Cabeçalho */
.site-top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-top .wrap { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 16px; letter-spacing: -0.01em; text-decoration: none; color: var(--text); }
.brand img { width: 24px; height: 24px; border-radius: 6px; }
.site-nav { display: flex; align-items: center; gap: 20px; margin-left: auto; font-size: 14px; }
.site-nav a { text-decoration: none; color: var(--muted); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: var(--radius);
  font: 500 14px/1 var(--font); text-decoration: none; white-space: nowrap;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  transition: background-color 120ms ease, border-color 120ms ease, transform 160ms cubic-bezier(.23,1,.32,1);
}
.btn:hover { background: var(--surface2); }
.btn:active { transform: scale(0.98); }
.btn-primary { background: linear-gradient(180deg, var(--grad-from), var(--grad-to)); border-color: transparent; color: #fff; box-shadow: 0 0 0 1px var(--ring), inset 0 1px 0 var(--sheen); }
.btn-primary:hover { filter: brightness(1.08); }
.site-nav .btn { color: var(--text); }
.site-nav .btn-primary { color: #fff; }
@media (max-width: 640px) { .site-nav .hide-sm { display: none; } .site-nav { gap: 14px; } }

/* Cabeçalho da página */
.page-head { padding: 64px 0 32px; border-bottom: 1px solid var(--border-subtle); }
.page-head h1 {
  margin: 0; max-width: 24ch;
  font-size: clamp(30px, 4.4vw, 44px); line-height: 1.12; font-weight: 500; letter-spacing: -0.02em;
  text-wrap: balance;
}
.page-head .lede { margin: 12px 0 0; max-width: 62ch; font-size: 17px; color: var(--muted); }
.meta { margin: 14px 0 0; font-size: 14px; color: var(--subtle); display: flex; flex-wrap: wrap; gap: 6px 14px; }
.meta .tag { color: var(--accent-text); font-weight: 500; }

/* Leitura */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 56px; padding: 40px 0 80px; align-items: start; }
.layout--single { grid-template-columns: minmax(0, 1fr); }
.toc { position: sticky; top: 84px; font-size: 13px; }
.toc p { margin: 0 0 8px; font-weight: 500; color: var(--text); }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.toc a { display: block; padding: 4px 0 4px 12px; margin-left: -1px; border-left: 1px solid transparent; color: var(--subtle); text-decoration: none; line-height: 1.4; }
.toc a:hover { color: var(--text); border-left-color: var(--faint); }
@media (max-width: 900px) { .layout { grid-template-columns: minmax(0, 1fr); } .toc { display: none; } }

.prose { max-width: 70ch; color: var(--body); font-size: 16.5px; line-height: 1.7; }
.prose > :first-child { margin-top: 0; }
.prose h2 { margin: 2.2em 0 .6em; font-size: 22px; line-height: 1.3; font-weight: 600; letter-spacing: -0.015em; color: var(--text); scroll-margin-top: 84px; }
.prose h3 { margin: 1.8em 0 .5em; font-size: 18px; line-height: 1.35; font-weight: 600; color: var(--text); scroll-margin-top: 84px; }
.prose h4 { margin: 1.5em 0 .4em; font-size: 16px; font-weight: 600; color: var(--text); }
.prose p { margin: 0 0 1.1em; }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.3em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--faint); }
.prose strong { color: var(--text); font-weight: 600; }
.prose a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose a.btn { text-decoration: none; }
.prose code { font-family: var(--mono); font-size: .88em; padding: .12em .38em; border-radius: 5px; background: var(--code-bg); border: 1px solid var(--border-subtle); color: var(--text); }
.prose pre {
  margin: 0 0 1.4em; padding: 16px 18px; overflow-x: auto;
  border-radius: 16px; background: var(--code-bg); border: 1px solid var(--border);
  font-family: var(--mono); font-size: 13px; line-height: 1.65; color: var(--body);
}
.prose pre code { padding: 0; border: none; background: none; font-size: inherit; color: inherit; }
.prose blockquote { margin: 0 0 1.2em; padding: 2px 0 2px 16px; border-left: 2px solid var(--border); color: var(--muted); }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 2em 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.4em; font-size: 14.5px; display: block; overflow-x: auto; }
.prose th, .prose td { padding: 10px 12px; border-bottom: 1px solid var(--border-subtle); text-align: left; vertical-align: top; }
.prose th { font-weight: 600; color: var(--text); border-bottom-color: var(--border); }
.prose img { border-radius: 10px; border: 1px solid var(--border); }

.callout { margin: 2.4em 0 0; padding: 24px; border-radius: 24px; border: 0; background: var(--surface2); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.callout p { margin: 0; color: var(--muted); max-width: 46ch; font-size: 15px; }
.callout strong { display: block; color: var(--text); font-size: 16px; margin-bottom: 2px; }

/* Índice do blog */
.post-list { list-style: none; margin: 0; padding: 32px 0 80px; display: grid; gap: 0; }
.post-list li { border-bottom: 1px solid var(--border-subtle); }
.post-list a { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 8px 32px; padding: 24px 0; text-decoration: none; }
.post-list .tag { font-size: 13px; font-weight: 500; color: var(--accent-text); padding-top: 3px; }
.post-list h2 { margin: 0 0 6px; font-size: 19px; line-height: 1.35; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
.post-list p { margin: 0; color: var(--muted); font-size: 15px; max-width: 64ch; }
.post-list a:hover h2 { color: var(--accent-text); }
@media (max-width: 640px) { .post-list a { grid-template-columns: minmax(0, 1fr); } }

/* Rodapé */
.site-foot { border-top: 1px solid var(--border); padding: 28px 0 40px; font-size: 13px; color: var(--subtle); }
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.site-foot a { text-decoration: none; color: var(--subtle); }
.site-foot a:hover { color: var(--text); }
