/* ============================================================================================
   base.css — o chão: reset, tipografia, layout e acessibilidade

   Nada aqui é de uma tela só. Se uma regra menciona "inventário" ou "catálogo", ela está na
   folha errada.
   ============================================================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Âncora e foco por teclado não podem ficar atrás do cabeçalho grudento (WCAG 2.4.11). */
  scroll-padding-top: calc(var(--topo-h) + var(--faixa-h) + var(--e4));
}

body {
  margin: 0;
  background: var(--pagina);
  color: var(--texto);
  font: 400 var(--t-4) / 1.55 var(--fonte-texto);
  /* Numeral de largura fixa em toda a interface: a coluna de preço tem de alinhar descendo a
     grade, a tabela e o pedido. */
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1 0 auto; outline: none; }

img, svg { display: block; max-width: 100%; }
img { height: auto; }

a { color: inherit; text-decoration: none; }
p, ul, ol, dl, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; }

[hidden] { display: none !important; }

::selection { background: var(--acao); color: var(--sobre-acao); }

/* ---------- Tipografia ---------- */

h1, h2, h3, h4 { margin: 0; font-weight: 600; }

h1, h2 {
  font-family: var(--fonte-titulo);
  letter-spacing: -.015em;
  line-height: 1.1;
  color: var(--texto);
  /* O eixo óptico da Fraunces: títulos grandes pedem traço mais fino e contraste mais alto. */
  font-optical-sizing: auto;
}
h1 { font-size: clamp(var(--t-7), 4.2vw, var(--t-8)); }
h2 { font-size: var(--t-6); }
h3 { font-family: var(--fonte-texto); font-size: var(--t-4); line-height: 1.3; }

.texto-2 { color: var(--texto-2); }
.texto-3 { color: var(--texto-3); }
.pequeno { font-size: var(--t-2); }

/* ---------- Layout ---------- */

.limite {
  width: min(1280px, 100% - var(--margem) * 2);
  margin-inline: auto;
}
.limite-largo { width: min(1520px, 100% - var(--margem) * 2); margin-inline: auto; }

/* ---------- Acessibilidade ---------- */

/* Só para leitor de tela. */
.so-leitor {
  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: fixed; top: -80px; left: var(--e4); z-index: 100;
  padding: var(--e3) var(--e5);
  background: var(--acao); color: var(--sobre-acao);
  border-radius: var(--r2); font-weight: 600;
  transition: top var(--mov-1) var(--curva);
}
.pular:focus { top: var(--e3); }

/* O anel de foco é da cor do texto de destaque, com folga: sobre o roxo cheio um anel roxo
   sumiria, mas por fora do botão ele cai na página, onde o contraste é alto. */
:focus-visible {
  outline: 2px solid var(--foco);
  outline-offset: 2px;
  border-radius: var(--r1);
}
:focus:not(:focus-visible) { outline: none; }

/* Alvo mínimo de 24x24 (WCAG 2.5.8); o conforto de 44 é decidido nos componentes. */
button, [role="button"], select, input[type="checkbox"], input[type="radio"] { min-height: 24px; }

/* Barra de rolagem fina e da família: a nativa clara brigava com o fundo escuro. */
* { scrollbar-width: thin; scrollbar-color: var(--linha-forte) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--linha-forte); border-radius: var(--r-total); border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* Movimento só responde a uma ação, e some para quem pediu menos movimento. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
