/* =========================================================
   Mylennzy
   Estrutura do Manager do brittinho (barra, menu, conteúdo, sumário),
   leitura de enciclopédia e regras da ABNT (NBR 14724):
   Arial 12 pt em tudo, entrelinha 1,5, recuo de 1,25 cm no parágrafo,
   títulos do mesmo tamanho, diferenciados por negrito e caixa alta.
   12 pt = 16 px = 1rem no padrão do navegador; usar rem respeita o zoom
   e a fonte maior que a pessoa escolheu no navegador.
   ========================================================= */

:root {
  --fundo: #ffffff;
  --cinza: #f6f6f7;
  --cinza-2: #eeeef0;
  --borda: #dcdde0;
  --borda-forte: #a2a9b1;
  --texto: #202122;
  --texto-2: #54595d;
  --link: #0645ad;
  --link-visitado: #0b0080;
  --marca: #b3141c;
  --creme: #fdf0dc;
  --foco: #0645ad;
  --veu: rgba(0, 0, 0, 0.35);
  color-scheme: light;

  --fonte: Arial, "Helvetica Neue", Helvetica, Arimo, "Liberation Sans", sans-serif;
  --nav-h: 3.5rem;
  --side-w: 15rem;
  --rail-w: 16rem;
  --r: 8px;
  --r-g: 12px;
}

/* tema escuro: segue o sistema, a menos que a pessoa escolha no botão do topo */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --fundo: #101214;
  --cinza: #181a1d;
  --cinza-2: #24272b;
  --borda: #30343a;
  --borda-forte: #5d636b;
  --texto: #e8e9eb;
  --texto-2: #aab0b7;
  --link: #8fb3ff;
  --link-visitado: #c4a8ff;
  --marca: #ff7b74;
  --foco: #8fb3ff;
  --veu: rgba(0, 0, 0, 0.6);
  color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --fundo: #101214;
  --cinza: #181a1d;
  --cinza-2: #24272b;
  --borda: #30343a;
  --borda-forte: #5d636b;
  --texto: #e8e9eb;
  --texto-2: #aab0b7;
  --link: #8fb3ff;
  --link-visitado: #c4a8ff;
  --marca: #ff7b74;
  --foco: #8fb3ff;
  --veu: rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; scroll-padding-top: calc(var(--nav-h) + 1rem); }
body {
  margin: 0;
  background: var(--fundo);
  color: var(--texto);
  font-family: var(--fonte);
  font-size: 1rem;
  line-height: 1.5;
}
/* ABNT: um tamanho só, em todo lugar */
h1, h2, h3, h4, p, li, td, th, caption, figcaption, button, input, small, dt, dd { font-size: 1rem; }
img { max-width: 100%; height: auto; display: block; }

a { color: var(--link); text-underline-offset: 0.15em; }
a:visited { color: var(--link-visitado); }
a:hover { text-decoration-thickness: 2px; }

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

.ic {
  width: 1.25rem; height: 1.25rem; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.pular {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--texto); color: var(--fundo); padding: 0.75rem 1rem; border-radius: var(--r);
}
.pular:focus { top: 0.5rem; color: var(--fundo); }

/* ---------- barra de cima ---------- */
.nav {
  position: sticky; top: 0; z-index: 50; height: var(--nav-h);
  display: flex; align-items: center; gap: 1rem; padding: 0 1rem;
  background: var(--fundo); border-bottom: 1px solid var(--borda);
}
.nav__menu {
  display: none; align-items: center; justify-content: center;
  width: 2.75rem; height: 2.75rem; margin-left: -0.5rem;
  border: 0; background: none; color: var(--texto); border-radius: var(--r); cursor: pointer;
}
.nav__menu:hover { background: var(--cinza-2); }
.nav__marca {
  display: flex; align-items: center; gap: 0.5rem;
  color: var(--texto); text-decoration: none; font-weight: bold;
}
.nav__marca:visited { color: var(--texto); }
.nav__marca img { width: 2rem; height: 2rem; }

.crumbs ol { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; color: var(--texto-2); }
.crumbs li + li::before { content: "›"; margin: 0 0.5rem; color: var(--borda-forte); }
.crumbs a { color: var(--texto-2); }
.crumbs [aria-current] { color: var(--texto); }

.nav__acao {
  margin-left: auto; display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.875rem; border: 1px solid var(--borda-forte); border-radius: var(--r);
  color: var(--texto); text-decoration: none; background: var(--fundo); white-space: nowrap;
}
.nav__acao:visited { color: var(--texto); }
.nav__acao:hover { background: var(--cinza); }

/* ---------- casca: menu | conteúdo | sumário ---------- */
.casca {
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr) var(--rail-w);
  max-width: 90rem; margin: 0 auto;
}

.side {
  position: sticky; top: var(--nav-h); align-self: start;
  max-height: calc(100vh - var(--nav-h)); overflow-y: auto;
  padding: 1.25rem 0.75rem 2rem; border-right: 1px solid var(--borda);
}
.side ul { list-style: none; margin: 0; padding: 0; }
.side__item {
  display: flex; align-items: center; gap: 0.625rem;
  padding: 0.5rem 0.75rem; border-radius: var(--r);
  color: var(--texto); text-decoration: none;
}
.side__item:visited { color: var(--texto); }
.side__item:hover { background: var(--cinza-2); }
.side__item .ic { color: var(--texto-2); }
.side__item.is-active { background: var(--cinza-2); font-weight: bold; }
.side__item.is-active .ic, .side__item.is-pai .ic { color: var(--marca); }
.side__item.is-pai { font-weight: bold; }
.side__sub { margin: 0.125rem 0 0.375rem 1.4rem !important; border-left: 1px solid var(--borda); }
.side__item--sub { border-radius: 0 var(--r) var(--r) 0; padding-left: 1rem; }

.main { min-width: 0; padding: 2rem clamp(1rem, 4vw, 3rem) 4rem; }

/* ---------- artigo (ABNT) ---------- */
.artigo { max-width: 48rem; }
.artigo h1 {
  margin: 0 0 0.25rem; font-weight: bold; text-transform: uppercase; letter-spacing: 0.02em;
  padding-bottom: 0.5rem; border-bottom: 1px solid var(--borda-forte);
}
.subtitulo { margin: 0.5rem 0 1.5rem; color: var(--texto-2); }

.artigo h2, .artigo h3 { margin: 2.25rem 0 0.75rem; line-height: 1.5; }
/* seção primária: NEGRITO E CAIXA ALTA; secundária: CAIXA ALTA sem negrito */
.artigo h2 { overflow: hidden; font-weight: bold; text-transform: uppercase; padding-bottom: 0.25rem; border-bottom: 1px solid var(--borda); }
.artigo h3 { overflow: hidden; font-weight: normal; text-transform: uppercase; }
.artigo .num { margin-right: 0.25rem; }
/* títulos sem número (Referências) ficam centralizados, como manda a ABNT */
.artigo h2.centro { text-align: center; border-bottom: 0; }

.artigo p {
  margin: 0 0 0.75rem;
  text-indent: 1.25cm;
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}
.artigo p.sem-recuo, .artigo .infobox p, .artigo .cartao p, .artigo figcaption, .artigo .chamada p { text-indent: 0; text-align: left; }
.artigo ul, .artigo ol { padding-left: 1.5rem; margin: 0 0 0.75rem; }
.artigo li { margin-bottom: 0.25rem; }

/* citação longa (mais de 3 linhas): recuo de 4 cm, entrelinha simples */
.artigo blockquote {
  margin: 1rem 0 1rem 4cm; line-height: 1.15; color: var(--texto);
}
.artigo blockquote p { text-indent: 0; }

/* referências: alinhadas à esquerda, entrelinha simples, linha em branco entre elas */
.referencias { list-style: none; padding: 0 !important; }
.referencias li { line-height: 1.15; margin-bottom: 1rem; text-align: left; overflow-wrap: anywhere; }

/* ---------- quadro de informações (infobox) ---------- */
.infobox {
  float: right; clear: right; width: 18rem; margin: 0 0 1rem 1.5rem;
  background: var(--cinza); border: 1px solid var(--borda); border-radius: var(--r-g);
  overflow: hidden;
}
.artigo .infobox__titulo { margin: 0; padding: 0.625rem 0.875rem; font-weight: bold; text-align: center; background: var(--cinza-2); }
.infobox figure { margin: 0; padding: 0.75rem; background: var(--fundo); border-bottom: 1px solid var(--borda); }
.infobox figure img { margin: 0 auto; width: 80%; }
.infobox figcaption { margin-top: 0.5rem; color: var(--texto-2); text-align: center !important; }
.infobox table { width: 100%; border-collapse: collapse; }
.infobox th, .infobox td { padding: 0.375rem 0.875rem; vertical-align: top; text-align: left; border-top: 1px solid var(--borda); }
.infobox th { width: 42%; font-weight: bold; }
.infobox tr:first-child th, .infobox tr:first-child td { border-top: 0; }

.foto-vazia {
  display: grid; place-items: center; aspect-ratio: 1; width: 100%;
  background: var(--cinza-2); border-radius: var(--r); color: var(--texto-2);
}
.foto-vazia .ic { width: 3rem; height: 3rem; stroke-width: 1.2; }

/* ---------- cartões (como os atalhos do Manager) ---------- */
.cartoes {
  display: grid; gap: 1rem; margin: 1.25rem 0 1.5rem; padding: 0; list-style: none;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  clear: both;
}
.cartao {
  position: relative; display: flex; flex-direction: column; gap: 0.5rem;
  padding: 1.125rem; border: 1px solid var(--borda); border-radius: var(--r-g); background: var(--fundo);
}
.cartao:hover { border-color: var(--borda-forte); background: var(--cinza); }
.cartao__foto { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--r); }
.cartao__icone {
  display: grid; place-items: center; width: 2.75rem; height: 2.75rem;
  border-radius: 10px; background: var(--cinza-2); color: var(--marca);
}
.artigo .cartao__titulo { margin: 0; padding: 0; border: 0; font-weight: bold; text-transform: none; }
.cartao__titulo a { color: var(--texto); text-decoration: none; }
.cartao__titulo a:visited { color: var(--texto); }
/* o cartão inteiro é clicável, mas o link de verdade é só o título */
.cartao__titulo a::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-g); }
.cartao__titulo a:focus-visible { outline: none; }
.cartao:has(a:focus-visible) { outline: 3px solid var(--foco); outline-offset: 2px; }
.cartao p { margin: 0; color: var(--texto-2); }
.cartao__etiqueta {
  margin-top: auto; align-self: flex-start; padding: 0.125rem 0.625rem; border-radius: 999px;
  background: var(--cinza-2); color: var(--texto-2);
}

/* ---------- tabelas ---------- */
.tabela-rolagem { overflow-x: auto; margin: 1rem 0 1.25rem; clear: both; }
table.dados { width: 100%; border-collapse: collapse; }
table.dados caption { text-align: left; font-weight: bold; padding-bottom: 0.5rem; }
table.dados th, table.dados td { padding: 0.5rem 0.75rem; border: 1px solid var(--borda); text-align: left; }
table.dados thead th { background: var(--cinza); }
.fonte-tabela { margin-top: 0.375rem !important; text-indent: 0 !important; color: var(--texto-2); }

/* ---------- caixa de destaque ---------- */
.chamada {
  display: flex; gap: 0.875rem; align-items: flex-start;
  margin: 1.5rem 0; padding: 1rem 1.125rem; background: var(--cinza);
  border: 1px solid var(--borda); border-radius: var(--r-g); clear: both;
}
.chamada .ic { color: var(--marca); margin-top: 0.125rem; }
.chamada p { margin: 0; }

.botao {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.625rem 1rem; border-radius: var(--r);
  background: var(--texto); color: var(--fundo); text-decoration: none; font-weight: bold;
}
.botao:visited { color: var(--fundo); }
.botao:hover { opacity: 0.88; }

/* lista de links (redes) */
.links { list-style: none; padding: 0 !important; display: grid; gap: 0.5rem; clear: both; }
.links a {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem;
  border: 1px solid var(--borda); border-radius: var(--r); color: var(--texto); text-decoration: none;
}
.links a:visited { color: var(--texto); }
.links a:hover { background: var(--cinza); border-color: var(--borda-forte); }
.links .ic { color: var(--marca); }
.links .ext { margin-left: auto; color: var(--texto-2); width: 1rem; height: 1rem; }
.links small { color: var(--texto-2); }

/* ---------- sumário ---------- */
.rail {
  position: sticky; top: var(--nav-h); align-self: start;
  max-height: calc(100vh - var(--nav-h)); overflow-y: auto;
  padding: 2rem 1.25rem; border-left: 1px solid var(--borda);
}
.rail__label { margin: 0 0 0.75rem; font-weight: bold; text-transform: uppercase; }
.toc { list-style: none; margin: 0; padding: 0; }
.toc a {
  display: block; padding: 0.25rem 0.625rem; border-left: 2px solid var(--borda);
  color: var(--texto-2); text-decoration: none; line-height: 1.35;
}
.toc a:hover { color: var(--texto); border-left-color: var(--marca); }
.toc__l2 a { text-transform: uppercase; }
.toc__l3 a { padding-left: 1.5rem; }

/* ---------- rodapé ---------- */
.rodape { max-width: 48rem; margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--borda); color: var(--texto-2); clear: both; }
.rodape p { margin: 0 0 0.375rem; }

/* ---------- 404 ---------- */
.prato { display: block; width: 9rem; height: 9rem; margin: 1rem auto 1.5rem; color: var(--marca); }

/* ---------- telas menores ---------- */
@media (max-width: 75rem) {
  .casca { grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .rail { display: none; }
}
@media (max-width: 50rem) {
  .casca { grid-template-columns: minmax(0, 1fr); }
  .nav__menu { display: inline-flex; }
  .crumbs { display: none; }
  .side {
    position: fixed; top: var(--nav-h); left: 0; bottom: 0; z-index: 40;
    width: min(18rem, 85vw); max-height: none; background: var(--fundo);
    box-shadow: 0 0 0 100vmax var(--veu);
    visibility: hidden; transform: translateX(-100%);
    transition: transform 0.2s ease, visibility 0.2s;
  }
  .side.is-open { visibility: visible; transform: none; }
  /* sem JavaScript, o menu aparece normal no topo */
  .sem-js .side { position: static; visibility: visible; transform: none; box-shadow: none; border-right: 0; border-bottom: 1px solid var(--borda); }
  .infobox { float: none; width: 100%; margin: 0 0 1.25rem; }
  /* tela estreita: texto justificado abre buracos entre as palavras */
  .artigo p { text-align: left; }
  .artigo blockquote { margin-left: 1.25cm; }
  .nav__acao span { display: none; }
  .nav__acao { padding: 0.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

@media print {
  .nav, .side, .rail, .pular { display: none; }
  .casca { display: block; }
  body { font-size: 12pt; }
  a { color: inherit; }
}

.cartao__capa { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r); }

/* botão de tema: mostra a lua no claro e o sol no escuro */
.nav__tema { font: inherit; cursor: pointer; }
.nav__tema[hidden] { display: none; }
.nav__tema .ic-sol { display: none; }
.nav__tema[aria-pressed="true"] .ic-lua { display: none; }
.nav__tema[aria-pressed="true"] .ic-sol { display: block; }
.nav__tema .nav__tema-txt { display: none; }
.nav__tema { padding: 0.5rem; }
