:root {
  color-scheme: dark;
  --texto: #e6e3dc;
  --suave: #98938a;
  --tenue: #35332e;
  --fundo: #171614;
  --realce: #d08c78;
  --medida: 34rem;
  --medida-larga: 62rem;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 0 1.5rem;
  background: var(--fundo);
  color: var(--texto);
  font-family: Iowan Old Style, Palatino Linotype, Palatino, Georgia, serif;
  font-size: 1.15rem;
  line-height: 1.7;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration-color: var(--tenue); text-underline-offset: 0.15em; }
a:hover { text-decoration-color: var(--realce); }

/* ---------- cabeçalho ---------- */

.site-header {
  max-width: var(--medida);
  margin: 0 auto;
  padding: 3.5rem 0 2.5rem;
  text-align: center;
}

.site-title {
  display: block;
  font-size: 1.5rem;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.site-tagline {
  margin: 0.4rem 0 0;
  color: var(--suave);
  font-size: 0.9rem;
  font-style: italic;
}

.site-nav {
  margin-top: 1.5rem;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.site-nav a { margin: 0 0.6rem; color: var(--suave); text-decoration: none; }
.site-nav a:hover { color: var(--realce); }

/* ---------- lista ---------- */

.lista {
  max-width: var(--medida);
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.lista-item {
  padding: 2rem 0;
  border-top: 1px solid var(--tenue);
}

.lista-meta {
  margin: 0;
  color: var(--suave);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.lista-titulo {
  margin: 0.4rem 0 0;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.35;
}

.lista-titulo a { text-decoration: none; }
.lista-titulo a:hover { color: var(--realce); }

.lista-resumo { margin: 0.5rem 0 0; color: var(--suave); font-size: 1rem; }

/* ---------- home: fluxo único em duas colunas ---------- */
/* Não são duas listas, é uma só. O DOM continua sendo um único <ul> na ordem
   cronológica, e quem distribui em duas colunas é o navegador. Isso importa:
   leitor de tela e buscador leem na ordem certa, e a coluna da direita é a
   continuação da esquerda, não outra categoria. */

.lista-fluxo {
  max-width: var(--medida-larga);
  columns: 2;
  column-gap: 3.5rem;
  column-rule: 1px solid var(--tenue);
}

.lista-fluxo .lista-item {
  /* Sem isto um texto pode ser cortado ao meio pela quebra de coluna. */
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  padding: 1.5rem 0;
}

.lista-fluxo .lista-titulo { font-size: 1.2rem; }
.lista-fluxo .lista-resumo { font-size: 0.95rem; }

.home-rodape {
  max-width: var(--medida-larga);
  margin: 3rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--tenue);
  color: var(--suave);
  font-size: 0.9rem;
  text-align: center;
}

.home-rodape a { text-decoration: none; }
.home-rodape a:hover { color: var(--realce); }

/* Abaixo de 52rem não cabem duas medidas de leitura lado a lado; vira uma. */
@media (max-width: 52rem) {
  .lista-fluxo { columns: 1; max-width: var(--medida); }
  .home-rodape { max-width: var(--medida); }
}

/* ---------- texto ---------- */

.post, .pagina {
  max-width: var(--medida);
  margin: 0 auto;
}

.post-header { padding-bottom: 2rem; }

.post-title, .pagina h1 {
  margin: 0.5rem 0 0;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.post-meta {
  margin: 0.6rem 0 0;
  color: var(--suave);
  font-size: 0.85rem;
}

.lead { color: var(--suave); font-style: italic; }

.post-content h2 {
  margin: 3rem 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.35;
}

.post-content p { margin: 0 0 1.4rem; }

.post-content blockquote {
  margin: 2rem 0;
  padding-left: 1.25rem;
  border-left: 2px solid var(--tenue);
  color: var(--suave);
  font-style: italic;
}

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

.post-content strong { font-weight: 600; }

/* ---------- destaque dentro da citação ---------- */
/* No trecho citado o texto já é itálico e já vive apagado, então o negrito
   muda pouco e some. Aqui o destaque não acrescenta ornamento nenhum: tira o
   apagamento. O que estava em cinza sobe para o branco do texto corrido, e um
   filete fino sublinha. Fora de citação o texto já está claro, então sobra só
   o filete, que é uma marca mais fraca de propósito.

   text-decoration, e não borda ou sombra, para o filete acompanhar cada linha
   quando o destaque quebra em várias. */

.post-content mark {
  background: none;
  color: var(--texto);
  text-decoration: underline;
  text-decoration-color: var(--realce);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.post-content hr {
  margin: 3rem auto;
  width: 4rem;
  border: 0;
  border-top: 1px solid var(--tenue);
}

.post-content img { max-width: 100%; height: auto; }

/* ---------- tabela ---------- */
/* Sem isto o navegador usa o padrão dele: colunas espremidas, cabeçalho
   quebrando em duas linhas e célula vazia parecendo defeito. */

.post-content table {
  width: 100%;
  margin: 2rem 0;
  border-collapse: collapse;
  font-size: 0.9rem;
  line-height: 1.5;
}

.post-content th,
.post-content td {
  padding: 0.7rem 1rem 0.7rem 0;
  border-bottom: 1px solid var(--tenue);
  text-align: left;
  vertical-align: top;
}

.post-content th {
  border-bottom-color: var(--suave);
  color: var(--suave);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}

.post-content th:last-child,
.post-content td:last-child { padding-right: 0; }

.post-content tbody tr:last-child td { border-bottom: 0; }

/* A medida de leitura é estreita: em tela pequena a tabela rola dentro da
   própria caixa, em vez de empurrar a página inteira para o lado. */
.tabela { overflow-x: auto; }
.tabela table { min-width: 30rem; }

/* ---------- comentário do editor ---------- */
/* Em post de Referência o corpo é de outro autor. Isto marca onde falo eu. */

.comentario {
  margin: 3.5rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--tenue);
}

.comentario::before {
  content: "Nota";
  display: block;
  margin-bottom: 0.75rem;
  color: var(--realce);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.datacao {
  margin-top: 1.5rem;
  color: var(--suave);
  font-size: 0.8rem;
  font-style: italic;
}

.creditos {
  margin: 3rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--tenue);
  color: var(--suave);
  font-size: 0.9rem;
  line-height: 1.6;
}

.creditos p { margin: 0; }

/* ---------- grafo das relações ---------- */

.pagina-larga { max-width: var(--medida-larga); }

.grafo {
  margin: 2.5rem 0 0;
  padding: 1rem 0;
  border-top: 1px solid var(--tenue);
  border-bottom: 1px solid var(--tenue);
}

.grafo svg { display: block; width: 100%; height: auto; }

.aresta { stroke: var(--tenue); stroke-width: 1; }

.no-texto { cursor: pointer; }
.no circle { fill: var(--suave); }

/* O elo (tema ou autor) é losango, não ponto: não se clica, não é texto. */
.no-elo rect { fill: none; stroke: var(--suave); stroke-width: 1.5; }
.no-elo text { font-style: italic; font-size: 12px; }

.no text {
  fill: var(--suave);
  font-family: inherit;
  font-size: 13px;
  /* Contorno da cor do fundo para o rótulo não sumir sobre as linhas. */
  paint-order: stroke;
  stroke: var(--fundo);
  stroke-width: 3px;
  stroke-linejoin: round;
}

.no:focus { outline: none; }
.no-texto:focus text, .no-texto:hover text { fill: var(--texto); }

/* Ao passar o cursor num ponto, o resto do grafo recua. */
.em-foco .aresta { stroke-opacity: 0.12; }
.em-foco .no circle,
.em-foco .no rect { opacity: 0.18; }
.em-foco .no text { fill-opacity: 0.12; stroke-opacity: 0.12; }

.em-foco .aresta.vizinho { stroke-opacity: 1; stroke: var(--realce); }
.em-foco .no.vizinho circle,
.em-foco .no.vizinho rect { opacity: 1; }
.em-foco .no.vizinho text { fill-opacity: 1; stroke-opacity: 1; fill: var(--texto); }

.grafo-legenda {
  margin-top: 0.75rem;
  color: var(--suave);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-align: center;
}

.chave { display: inline-block; margin: 0 0.6rem; white-space: nowrap; }

.chave::before {
  content: "";
  display: inline-block;
  margin-right: 0.4rem;
  vertical-align: middle;
}

.chave-texto::before {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--suave);
}

.chave-elo::before {
  width: 0.45rem;
  height: 0.45rem;
  border: 1px solid var(--suave);
  transform: rotate(45deg);
}

.grafo-instrucao {
  margin: 1rem 0 0;
  color: var(--suave);
  font-size: 0.85rem;
  font-style: italic;
}

.grafo-aviso { color: var(--suave); font-style: italic; }

.indice-temas { margin: 1.5rem 0 0; }

.indice-temas dt {
  margin-top: 1.25rem;
  color: var(--realce);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.indice-temas dd {
  margin: 0.35rem 0 0;
  color: var(--suave);
  font-size: 0.95rem;
}

.indice-temas dd a { color: var(--texto); text-decoration: none; }
.indice-temas dd a:hover { color: var(--realce); }

.pagina-larga h2 {
  margin: 3rem 0 0;
  font-size: 1.25rem;
  font-weight: 600;
}

/* ---------- notas de rodapé ---------- */

.footnotes {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--tenue);
  color: var(--suave);
  font-size: 0.9rem;
  line-height: 1.6;
}

.footnotes ol { padding-left: 1.2rem; }
.footnotes li { margin-bottom: 0.8rem; }

/* O kramdown já envolve a chamada num <sup>; não superscrever de novo. */
sup[id^="fnref"] { line-height: 0; }

a.footnote {
  padding: 0 0.1em;
  color: var(--realce);
  text-decoration: none;
}

a.reversefootnote { text-decoration: none; }

/* ---------- rodapé do texto ---------- */

.post-footer {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--tenue);
}

.nota-autor {
  margin: 0;
  color: var(--suave);
  font-size: 0.9rem;
  line-height: 1.6;
}

.resposta {
  margin: 1rem 0 0;
  color: var(--suave);
  font-size: 0.9rem;
}

.post-footer .nota-autor + .resposta { margin-top: 0.75rem; }

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  max-width: var(--medida);
  margin: 3rem auto 0;
  font-size: 0.9rem;
}

.post-nav a { color: var(--suave); text-decoration: none; }
.post-nav a:hover { color: var(--realce); }
.post-nav .next { margin-left: auto; text-align: right; }

/* ---------- rodapé do site ---------- */

.site-footer {
  max-width: var(--medida);
  margin: 5rem auto 0;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--tenue);
  color: var(--suave);
  font-size: 0.85rem;
  text-align: center;
}

@media (max-width: 34rem) {
  body { font-size: 1.05rem; }
  .post-title, .pagina h1 { font-size: 1.6rem; }
  .site-header { padding-top: 2.5rem; }
}
