/* base.css — as fontes, o reset e a escala tipográfica. Depende de tokens.css.
 *
 * As duas famílias são servidas por nós (`/publico/fontes/`), e não pelo Google Fonts.
 * Não é preferência de performance: o sistema guarda prontuário clínico de menor de
 * idade, e cada tela pedindo um arquivo a um terceiro conta a esse terceiro quem abriu
 * qual instituto e quando. Self-hosted, esse rastro não existe.
 *
 * Os dois arquivos por família são os subsets `latin` e `latin-ext` do próprio Google
 * Fonts, com o `unicode-range` original preservado: sem ele o navegador baixa os dois
 * sempre, e o latin-ext só carrega quando a página tiver um caractere que o exija.
 * Ambas as famílias são OFL — ver `src/publico/fontes/LICENCA.md`.
 */

/* Manrope — display e headline, com tracking negativo. Eixo variável 400–800. */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/publico/fontes/manrope-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: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/publico/fontes/manrope-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Plus Jakarta Sans — título e corpo, line-height 1.6. Eixo variável 400–700. */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/publico/fontes/plus-jakarta-sans-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: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/publico/fontes/plus-jakarta-sans-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* -------------------------------------------------------------------------- */
/* Reset — o mínimo, e nada além                                              */
/* -------------------------------------------------------------------------- */

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.6;
  background: var(--surface);
  color: var(--on-surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

/* Quem navega por teclado precisa enxergar onde está. O anel usa a cor da marca em vez
 * do default do navegador, que some sobre a superfície azulada. */
:focus-visible {
  outline: 2px solid var(--primary-container);
  outline-offset: 2px;
}

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

h1,
h2,
h3,
h4,
.display {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0;
}

.display-lg {
  font-size: clamp(2.4rem, 4.4vw, 3.5rem);
  font-weight: 800;
}

.display-md {
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  font-weight: 800;
}

.headline {
  font-size: 1.35rem;
  font-weight: 700;
}

/* Título de bloco: corpo, não display — em tamanho pequeno o tracking negativo do
 * Manrope aperta demais e a leitura de dado clínico sofre. */
.title {
  font-family: var(--font-body);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0;
}

.body-lg {
  font-size: 1.06rem;
  color: var(--on-surface-variant);
}

.body {
  font-size: 0.94rem;
}

.label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--on-surface-variant);
}

.muted {
  color: var(--on-surface-variant);
}

/* Escondido da tela, presente para o 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;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
