/* reset.css — Modern reset + sensible defaults
   Author: ChatGPT
   Usage: import this BEFORE your main stylesheet
*/

/* 1) Box sizing — facilita layout e cálculo de larguras */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 2) Remove margem/padding padrão e definir linha base */
html,
body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
figure,
pre,
dl,
dd,
ol,
ul,
li,
fieldset,
legend,
textarea,
input,
button {
  margin: 0;
  padding: 0;
}

/* 3) Base tipográfica e acessibilidade */
html {
  /* 16px base. Use rem em todo o projeto. */
  font-size: 16px;
  -webkit-text-size-adjust: 100%; /* evita zoom automático em iOS */
  -ms-text-size-adjust: 100%;
  line-height: 1.5;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: #fff;
  color: #111;
}

/* 4) Headings — deixar o controle para o autor, mas prevenir saltos inesperados */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: inherit; /* permite controlar via tema */
  line-height: 1.25;
}

/* 5) Links — não remover estilos de foco (acessibilidade) */
a {
  color: inherit;
  text-decoration: none;
  background-color: transparent;
}
a:focus {
  outline: 2px solid Highlight;
  outline-offset: 2px;
}

/* 6) Lists — remover marcadores por padrão; controlar via CSS do projeto */
ul,
ol {
  list-style: none;
}

/* 7) Images & media — responsivas e sem overflow */
img,
picture,
svg,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 8) Tables — base limpa */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* 9) Forms — herdar tipografia e limpar estilos inconsistentes entre browsers */
input,
button,
textarea,
select {
  font: inherit; /* herda família, tamanho e estilo do pai */
  margin: 0;
  color: inherit;
  background: transparent;
  border: none;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  outline: none;
}

/* Provide sensible defaults for controls when you want them visible */
button {
  cursor: pointer;
  border: none;
  background: transparent;
}

/* 10) Accessible focus styles (do not remove!) */
:focus {
  outline: 2px solid Highlight;
  outline-offset: 2px;
}

/* 11) Remove animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* 12) Hidden utility — use semantic aria-hidden where possível,
       mas fornecemos uma classe utilitária para ocultar visualmente mantendo acessível se necessário. */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* 13) Default container behavior — evita overflow horizontal causado por elementos grandes */
main,
header,
footer,
section,
article,
nav {
  display: block;
}

/* 14) Inputs number - remover setas em WebKit quando não desejado */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* 15) Placeholder styling (opcional) — mantém legibilidade */
::placeholder {
  color: #9ca3af;
  opacity: 1;
}

/* 16) Small helper: make images/icons inside buttons inline and not cause extra gap */
button img,
a img {
  vertical-align: middle;
}

/* 17) Utility to reset link/buttons when needed (use com cautela) */
.reset-button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

/* 18) High-contrast fallback (opcional, útil em alguns projetos) */
@media (forced-colors: active) {
  :focus {
    outline: 2px solid WindowText;
  }
}
