/* ============================================================================
   BASE.CSS — CORE RESET E ELEMENTOS GLOBAIS
   Fundação técnica reutilizável
   ============================================================================ */

/* ===== RESET ===== */

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-relaxed);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  overflow-x: hidden;
  max-width: 100vw;
}

/* ===== TIPOGRAFIA GLOBAL ===== */

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-snug);
  color: var(--text-primary);
  word-break: break-word;
  overflow-wrap: break-word;
}

h1 {
  font-size: var(--font-size-h1);
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-tight);
}

h2 {
  font-size: var(--font-size-h2);
  letter-spacing: var(--letter-spacing-tight);
}

h3 {
  font-size: var(--font-size-h3);
  font-weight: var(--font-weight-semibold);
}

p {
  margin-bottom: var(--space-4);
  word-break: break-word;
  overflow-wrap: break-word;
}

p:last-child {
  margin-bottom: 0;
}

/* ===== LINKS ===== */

a {
  color: var(--text-link);
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: all 150ms ease;
}

a:hover {
  color: var(--text-link-hover);
  text-decoration-color: currentColor;
}

a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

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

/* ===== IMAGENS E MÍDIA ===== */

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

/* ===== LISTAS ===== */

ul, ol {
  list-style-position: inside;
}

/* ===== BOTÕES E INPUTS ===== */

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* ===== ACESSIBILIDADE ===== */

/* Focus visível */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

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

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  html {
    scroll-behavior: auto !important;
  }
}

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

/* ===== OVERFLOW PREVENTION ===== */

html,
body {
  overflow-x: hidden;
  max-width: 100vw;
}

.container,
.section,
main,
header,
footer {
  max-width: 100%;
}

/* ===== UTILITY CLASSES ===== */

.text-center {
  text-align: center;
}

.text-primary {
  color: var(--text-primary);
}

.text-secondary {
  color: var(--text-secondary);
}

.text-accent {
  color: var(--color-primary);
}
