/* =============================================================================
   OpenRadar — blog · folha de estilo ÚNICA
   =============================================================================
   Compartilhada por public/blog/index.html e por TODOS os posts. Nenhum post
   repete CSS: se um post precisa de um bloco visual novo, o bloco entra AQUI
   com uma classe nova, nunca num <style> local.

   Vive em public/ de propósito: arquivos de public/ são copiados crus para
   dist/ sem passar pelo bundler (ver web/vite.config.ts — o blog não tem
   entrada de bundle e não deve ter). Consequência prática: o caminho
   /blog/blog.css é estável, sem hash, e pode ser referenciado à mão.

   Paleta e tipografia idênticas a src/lp/base.css e public/verificar.html —
   o site é escuro, e o blog não inventa uma segunda identidade.

   Zero JavaScript. Todo post tem de renderizar completo com JS desligado.
   Mobile-first: a base é uma coluna; media queries só ampliam.
   ========================================================================== */

:root {
  /* Tokens — cópia intencional de src/lp/base.css. Se a paleta do site
     mudar lá, mude aqui também (o blog não importa o CSS das LPs para não
     arrastar o design system inteiro numa página de leitura). */
  --bg: #0b0f14;
  --panel: #141c26;
  --panel2: #101822;
  --panel3: #182231;
  --line: #22303f;
  --line2: #2c3b4d;
  --tx: #e6edf3;
  --mut: #8b98a5;
  --mut2: #6f7d8b;
  --blue: #2f81f7;
  --red: #f85149;
  --green: #3fb950;
  --gold: #d29922;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;

  /* Coluna de leitura longa: ~68ch é a faixa em que a linha tem entre 60 e
     75 caracteres na maioria das telas — o intervalo em que o olho não perde
     a linha seguinte. Tudo no artigo herda esta largura. */
  --col: 68ch;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* Diz ao navegador que a página é escura: barras de rolagem, campos e
   widgets nativos vêm no tom certo sem CSS extra. */
:root {
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  /* Sem scroll-behavior: smooth global — âncora de sumário com movimento
     forçado atrapalha quem tem sensibilidade vestibular. */
  scroll-padding-top: 24px;
}

body {
  background: var(--bg);
  color: var(--tx);
  font-family: var(--sans);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  /* 17px de corpo e 1.65 de entrelinha: o par que sustenta leitura de
     1.200 palavras sem cansaço. Não reduzir. */
  font-size: 17px;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

@media (min-width: 760px) {
  body {
    font-size: 18px;
  }
}

img,
svg,
iframe,
video {
  display: block;
  max-width: 100%;
}

a {
  color: var(--blue);
  /* Sublinhado com deslocamento: em texto corrido o link fica óbvio sem
     brigar com as descendentes das letras. */
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  text-decoration-thickness: 2px;
}

/* Foco SEMPRE visível — o blog é navegado por teclado e por leitor de tela. */
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
}

.skip:focus {
  left: 12px;
  top: 12px;
  background: var(--panel);
  border: 1px solid var(--blue);
  padding: 10px 14px;
  border-radius: 8px;
  text-decoration: none;
}

/* Qualquer transição/animação desta folha é suprimida para quem pediu menos
   movimento no sistema. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ───────────────────────────────────────────────────────────── marca ── */
/* Mesmo desenho de public/verificar.html: três arcos e um ponto, em CSS,
   sem imagem. */
.mark {
  position: relative;
  width: 34px;
  height: 24px;
  flex: 0 0 auto;
}

.mark i {
  position: absolute;
  left: 50%;
  bottom: 3px;
  border-radius: 50%;
  border: 3px solid var(--blue);
  border-bottom-color: transparent;
  border-left-color: transparent;
  border-right-color: transparent;
  transform: translateX(-50%);
}

.mark i.a1 {
  width: 13px;
  height: 13px;
}

.mark i.a2 {
  width: 24px;
  height: 24px;
  opacity: 0.72;
}

.mark i.a3 {
  width: 36px;
  height: 36px;
  opacity: 0.42;
}

.mark .dot {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
  transform: translateX(-50%);
  box-shadow: 0 0 12px 3px rgba(47, 129, 247, 0.55);
}

/* ──────────────────────────────────────────────────────────── header ── */
.hdr {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(180deg, #111a24, #0d151e);
  border-bottom: 1px solid var(--line);
}

.hdr .brand {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  color: var(--tx);
  text-decoration: none;
}

.hdr .brand b {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1;
}

.hdr .brand em {
  font-style: normal;
  font-size: 10px;
  color: var(--mut2);
  font-weight: 700;
  letter-spacing: 0.6px;
  padding-bottom: 1px;
}

.hdr .hdr-nav {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px 16px;
  font-size: 14px;
  font-weight: 700;
}

.hdr .hdr-nav a {
  text-decoration: none;
  color: var(--mut);
}

.hdr .hdr-nav a:hover {
  color: var(--tx);
}

/* ──────────────────────────────────────────────────────────── layout ── */
main {
  flex: 1 1 auto;
  width: 100%;
  /* --col é a medida do TEXTO, não da caixa: o padding lateral entra somado,
     senão a coluna de leitura fica ~4ch mais estreita do que o pretendido. */
  max-width: calc(var(--col) + 40px);
  margin: 0 auto;
  padding: 22px 18px 48px;
}

@media (min-width: 760px) {
  main {
    padding: 34px 20px 64px;
  }
}

/* Blocos que podem sangrar um pouco além da coluna de texto (tabela larga,
   figura). Em telas estreitas o valor cai para zero sozinho. */
.bleed {
  margin-left: clamp(-24px, -2vw, 0px);
  margin-right: clamp(-24px, -2vw, 0px);
}

/* ─────────────────────────────────────────────────────── breadcrumb ── */
.crumb {
  font-size: 13.5px;
  color: var(--mut2);
  margin-bottom: 18px;
}

.crumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: baseline;
}

.crumb li + li::before {
  content: '›';
  margin-right: 8px;
  color: var(--line2);
}

.crumb a {
  color: var(--mut);
  text-decoration: none;
}

.crumb a:hover {
  color: var(--blue);
  text-decoration: underline;
}

.crumb [aria-current='page'] {
  color: var(--mut2);
}

/* ─────────────────────────────────────────────────────── tipografia ── */
h1 {
  font-size: 28px;
  line-height: 1.18;
  font-weight: 800;
  letter-spacing: -0.5px;
  text-wrap: balance;
}

@media (min-width: 760px) {
  h1 {
    font-size: 38px;
  }
}

/* Escala clara: h2 é visivelmente maior que o corpo e visivelmente menor que
   o h1; h3 fica entre o h2 e o corpo. Sem ambiguidade de nível — importa
   para leitor de tela e para LLM que monta o sumário do texto. */
article h2 {
  font-size: 22px;
  line-height: 1.28;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin: 44px 0 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  text-wrap: balance;
}

@media (min-width: 760px) {
  article h2 {
    font-size: 26px;
  }
}

article h3 {
  font-size: 18.5px;
  line-height: 1.35;
  font-weight: 700;
  margin: 30px 0 10px;
  color: #d7e2ee;
}

@media (min-width: 760px) {
  article h3 {
    font-size: 20px;
  }
}

article p {
  margin: 0 0 18px;
}

article p:last-child {
  margin-bottom: 0;
}

article strong,
article b {
  color: #fff;
  font-weight: 700;
}

article em {
  color: #d7e2ee;
}

article ul,
article ol {
  margin: 0 0 20px 22px;
  display: grid;
  gap: 10px;
}

article li {
  padding-left: 2px;
}

article li > ul,
article li > ol {
  margin-top: 10px;
  margin-bottom: 0;
}

article ul ul {
  list-style: circle;
}

article code {
  font-family: var(--mono);
  font-size: 0.92em;
  background: #0b131c;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
}

article hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 36px 0;
}

/* Unidade + referência da unidade andam juntas e não devem quebrar linha no
   meio: <span class="nb">25 px/m</span>. */
.nb {
  white-space: nowrap;
}

/* ───────────────────────────────────────────── cabeçalho do artigo ── */
.post-meta {
  margin: 14px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-size: 13.5px;
  color: var(--mut);
}

.post-meta .cat {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line2);
  background: #0e1620;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--mut);
}

.post-meta .sep {
  color: var(--line2);
}

/* ─────────────────────────────────────────── bloco Resposta curta ── */
/* O bloco que abre TODO post: 2–4 frases autossuficientes e citáveis, antes
   de qualquer contexto. É o pedaço que um LLM tende a extrair — por isso
   fica no topo, curto, e nunca depende do que vem depois. */
.resposta {
  margin: 26px 0 8px;
  border: 1px solid var(--line2);
  border-left: 4px solid var(--blue);
  border-radius: 12px;
  background: var(--panel2);
  padding: 18px 20px;
}

.resposta h2 {
  /* Anula a borda/margem do h2 de artigo: aqui é rótulo, não seção. */
  all: unset;
  display: block;
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 8px;
}

.resposta p {
  margin: 0 0 12px;
  font-size: 1.02em;
}

.resposta p:last-child {
  margin-bottom: 0;
}

/* ───────────────────────────────────────────── caixa de destaque ── */
/* "Nota": observação lateral que o leitor pode pular sem perder o fio. */
.nota {
  margin: 26px 0;
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 12px;
  background: var(--panel3);
  padding: 16px 18px;
  font-size: 0.96em;
}

.nota > .rot {
  display: block;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 7px;
}

.nota p {
  margin-bottom: 12px;
}

.nota p:last-child {
  margin-bottom: 0;
}

/* Variação para delimitar o alcance do texto — "O que este texto não
   afirma". Mesma anatomia da nota, cor de ressalva. */
.nota.limites {
  border-left-color: var(--red);
}

.nota.limites > .rot {
  color: var(--red);
}

/* ─────────────────────────────────────────────────────── citação ── */
blockquote {
  margin: 26px 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--blue);
  color: #cfdae6;
  font-size: 1.04em;
}

blockquote p {
  margin-bottom: 12px;
}

blockquote p:last-child {
  margin-bottom: 0;
}

blockquote cite {
  display: block;
  margin-top: 10px;
  font-style: normal;
  font-size: 0.82em;
  color: var(--mut2);
}

/* ──────────────────────────────────────────────────────── tabela ── */
/* O wrapper com overflow-x é obrigatório: tabela de dados em tela de 360px
   precisa rolar sozinha, sem estourar o layout da página. */
.tbl {
  margin: 26px 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  -webkit-overflow-scrolling: touch;
}

.tbl table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.tbl caption {
  caption-side: top;
  text-align: left;
  padding: 12px 14px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--mut);
  border-bottom: 1px solid var(--line);
  background: #0f1823;
}

.tbl th,
.tbl td {
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.tbl thead th {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--mut2);
  background: #0f1823;
  white-space: nowrap;
}

.tbl tbody tr:last-child th,
.tbl tbody tr:last-child td {
  border-bottom: 0;
}

.tbl tbody th {
  font-weight: 700;
  color: #fff;
}

.tbl td.num {
  font-family: var(--mono);
  font-size: 14px;
  white-space: nowrap;
}

/* ───────────────────────────────────────────── figura e legenda ── */
figure {
  margin: 28px 0;
}

figure img,
figure svg {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel2);
}

figcaption {
  margin-top: 9px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--mut);
}

figcaption b {
  color: #d7e2ee;
}

/* ─────────────────────────────────── caixa de fontes/referências ── */
.fontes {
  margin: 34px 0 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel2);
  padding: 18px 20px;
}

.fontes h2 {
  all: unset;
  display: block;
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--mut2);
  margin-bottom: 12px;
}

.fontes ol,
.fontes ul {
  margin: 0 0 0 20px;
  display: grid;
  gap: 12px;
  font-size: 14.5px;
  line-height: 1.55;
}

.fontes li {
  color: #c2cfdb;
}

.fontes a {
  /* URLs longas não podem estourar a coluna em tela estreita. */
  word-break: break-word;
}

.fontes .quando {
  display: block;
  color: var(--mut2);
  font-size: 12.5px;
  margin-top: 3px;
}

/* ────────────────────────────────────────────── CTA reutilizável ── */
/* Discreto de propósito: o texto é o produto principal desta página. Cor
   sólida e botão gigante iriam contra a leitura. */
.cta {
  margin: 34px 0;
  border: 1px solid var(--line2);
  border-radius: 12px;
  background: linear-gradient(180deg, #131d29, #101822);
  padding: 18px 20px;
}

.cta .rot {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--mut2);
  margin-bottom: 8px;
}

.cta p {
  margin-bottom: 14px;
  font-size: 0.97em;
  color: #cfdae6;
}

.cta p:last-of-type {
  margin-bottom: 14px;
}

.cta .btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 9px;
  background: var(--blue);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.2px;
  text-decoration: none;
}

.cta .btn:hover {
  background: #1b5fc4;
  text-decoration: none;
}

/* ───────────────────────────────────── índice do blog (lista) ── */
.tagline {
  margin-top: 12px;
  color: var(--mut);
  font-size: 1.02em;
}

.grupo {
  margin-top: 40px;
}

.grupo > h2 {
  font-size: 20px;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: -0.2px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

@media (min-width: 760px) {
  .grupo > h2 {
    font-size: 23px;
  }
}

.grupo > p.grupo-sub {
  margin-top: 6px;
  color: var(--mut2);
  font-size: 14.5px;
}

.posts {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.posts > li {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 16px 18px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.posts > li:hover {
  border-color: var(--line2);
  background: var(--panel3);
}

.posts h3 {
  font-size: 18px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.2px;
}

@media (min-width: 760px) {
  .posts h3 {
    font-size: 19.5px;
  }
}

.posts h3 a {
  color: var(--tx);
  text-decoration: none;
}

.posts h3 a:hover {
  color: var(--blue);
  text-decoration: underline;
}

.posts .resumo {
  margin-top: 7px;
  font-size: 15px;
  color: #c2cfdb;
}

.posts .linha {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 10px;
  font-size: 12.5px;
  color: var(--mut2);
}

.posts .linha .cat {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line2);
  background: #0e1620;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--mut);
}

.posts .linha .sep {
  color: var(--line2);
}

/* ──────────────────────────────────────────────── navegação final ── */
.pos-nav {
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  font-size: 15px;
}

.pos-nav .rot {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--mut2);
}

/* ─────────────────────────────────────────────────────── rodapé ── */
footer.rodape {
  border-top: 1px solid var(--line);
  background: #0d151e;
  padding: 22px 18px 30px;
  text-align: center;
}

footer.rodape .lnks {
  margin-bottom: 10px;
  display: flex;
  gap: 10px 18px;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 14px;
  font-weight: 700;
}

footer.rodape p {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--mut2);
  max-width: 72ch;
  margin: 0 auto 8px;
}

footer.rodape p:last-child {
  margin-bottom: 0;
}

footer.rodape p b {
  color: var(--mut);
}

/* ────────────────────────────────────────────────────── impressão ── */
/* Síndico imprime o post para levar à assembleia. Fundo escuro no papel
   gasta tinta e fica ilegível. */
@media print {
  :root {
    color-scheme: light;
  }

  body {
    background: #fff;
    color: #111;
    font-size: 11.5pt;
  }

  .hdr,
  .cta,
  .pos-nav,
  .skip,
  footer.rodape .lnks {
    display: none;
  }

  a {
    color: #111;
    text-decoration: underline;
  }

  .resposta,
  .nota,
  .fontes,
  .tbl {
    border-color: #999;
    background: #fff;
    break-inside: avoid;
  }

  article h2,
  article h3 {
    break-after: avoid;
  }

  /* No papel o leitor não pode clicar: o destino do link vira texto. */
  .fontes a::after {
    content: ' (' attr(href) ')';
    font-size: 9pt;
    word-break: break-all;
  }
}
