/* ==========================================================================
   base.css — reset leve, tipografia global e utilitários de acessibilidade
   ========================================================================== */

/* ---------- Fontes (auto-hospedadas, licença OFL em assets/fonts/) ----------
   Fontes variáveis: um arquivo cobre todos os pesos do intervalo.
   unicode-range: o navegador só baixa o "latin-ext" se a página usar esses caracteres. */
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../assets/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../assets/fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: Lexend;
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url("../assets/fonts/lexend-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: Lexend;
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url("../assets/fonts/lexend-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

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

/* Rolagem suave nas âncoras, só para quem aceita movimento. */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

html {
  /* Ao focar pelo Tab, o navegador rola até o elemento: sem isto ele pode parar atrás do
     header fixo (WCAG 2.4.11, foco não encoberto). Mesma folga das âncoras. */
  scroll-padding-top: calc(var(--header-height-compact) + 1px + var(--space-4));

  /* Safari iOS ainda só entende a versão com prefixo (evita fonte inflada no modo paisagem). */
  /* stylelint-disable-next-line property-no-vendor-prefix */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: var(--leading-body);
  color: var(--color-ink);
  background: var(--color-white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizelegibility;

  /* Palavra maior que o espaço (ex.: fonte do navegador em 200%) quebra em vez de estourar a tela. */
  overflow-wrap: break-word;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  hyphens: auto; /* hifeniza em português (lang="pt-BR") quando a palavra não cabe */
  hyphenate-limit-chars: 12 5 5; /* só palavras longas ("institucionais"); "fazem", "empresa" pulam de linha */
  font-family: var(--font-display);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-tight);
}

p,
figure,
blockquote {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

img {
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

/* "hidden" vence qualquer display de componente (ex.: card com display:flex escondido pelo filtro). */
[hidden] {
  display: none !important;
}

/* ---------- Foco visível (só para teclado) ---------- */
:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
  box-shadow: var(--focus-inner);
}

:focus:not(:focus-visible) {
  outline: none;
}

/* ---------- Link "pular para o conteúdo" ---------- */
.skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: var(--z-skip-link);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-pill);
  background: var(--color-ink);
  color: var(--color-white);
  font-weight: var(--weight-semibold);
  transform: translateY(-200%);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

/* ---------- Somente leitores de tela ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* O alvo do skip link recebe foco via tabindex="-1"; não precisa de anel */
main:focus {
  outline: none;
  box-shadow: none;
}
