/* isaacmoura — folha de estilos única do site estático.
   Sem fontes externas, sem imagens, sem JavaScript. */

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --fg: #1c1e21;
  --muted: #555c67;
  --border: #dfe2e6;
  --surface: #f5f6f8;
  --link: #0a58ca;
  --link-hover: #083f91;
  --focus: #0a58ca;
  --content: 45rem; /* ~720px de largura de leitura */
  --gutter: 1.25rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317;
    --fg: #e6e8eb;
    --muted: #a3aab5;
    --border: #2b2f36;
    --surface: #191c21;
    --link: #8ab4f8;
    --link-hover: #b8d0fb;
    --focus: #8ab4f8;
  }
}

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

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

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", "Liberation Sans", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}

main {
  flex: 1 0 auto;
  padding-block: 2.5rem 3.5rem;
}

.container {
  width: 100%;
  max-width: calc(var(--content) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Link para pular direto ao conteúdo (teclado e leitores de tela) */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  color: var(--link);
  border: 2px solid var(--focus);
  border-radius: 0.375rem;
}

.skip-link:focus {
  top: 1rem;
}

/* Cabeçalho */
.site-header {
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  min-height: 3.5rem;
}

.brand {
  color: var(--fg);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand:hover {
  color: var(--link);
}

/* Tipografia */
h1,
h2,
h3 {
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.375rem);
  margin: 0 0 0.75rem;
}

h2 {
  font-size: 1.375rem;
  margin: 2.75rem 0 0.75rem;
}

h3 {
  font-size: 1.125rem;
  margin: 1.75rem 0 0.5rem;
}

p,
ul,
ol {
  margin: 0 0 1rem;
}

ul,
ol {
  padding-left: 1.4rem;
}

li + li {
  margin-top: 0.35rem;
}

strong {
  font-weight: 600;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
  padding: 0.1em 0.3em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.25rem;
}

[id] {
  scroll-margin-top: 1rem;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--link-hover);
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

.meta {
  color: var(--muted);
  font-size: 0.9375rem;
  margin-bottom: 2rem;
}

.lead {
  font-size: 1.1875rem;
  color: var(--muted);
}

.note {
  color: var(--muted);
  font-size: 0.9375rem;
}

/* Página inicial */
.hero {
  padding-block: 1rem 0.5rem;
}

.hero h1 {
  max-width: 34rem;
}

/* Caixas: resumo e sumário */
.box,
.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  margin: 0 0 2rem;
}

.box h2,
.toc h2 {
  font-size: 1.0625rem;
  margin: 0 0 0.5rem;
}

.box ul,
.toc ol {
  margin: 0;
}

.toc li + li {
  margin-top: 0.2rem;
}

/* Tabelas */
.table-wrap {
  overflow-x: auto;
  margin: 0 0 1.25rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.96875rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

thead th {
  background: var(--surface);
  font-weight: 600;
  border-bottom-width: 2px;
}

/* Rodapé */
.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9375rem;
  padding-block: 1.5rem 2rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0 0 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

.footer-links li + li {
  margin-top: 0;
}

.site-footer p {
  margin: 0;
}

/* Impressão: sempre claro, sem elementos de navegação */
@media print {
  :root {
    --bg: #ffffff;
    --fg: #000000;
    --muted: #333333;
    --border: #bbbbbb;
    --surface: #ffffff;
    --link: #000000;
    --link-hover: #000000;
  }

  body {
    font-size: 11pt;
  }

  .skip-link,
  .site-footer nav {
    display: none;
  }

  .toc,
  .box,
  table {
    break-inside: avoid;
  }
}
