/* ==========================================================================
   VW Presença Digital — Base Reset & Accessibility Foundation
   css/base.css
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Reset Moderno & Box Model
   -------------------------------------------------------------------------- */

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

/* --------------------------------------------------------------------------
   2. Elementos Raiz & Tipografia Global
   -------------------------------------------------------------------------- */

html {
  color-scheme: dark;
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  width: 100%;
}

body {
  min-height: 100vh;
  background-color: var(--bg-base);
  color: var(--text-primary);
  overflow-x: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* --------------------------------------------------------------------------
   3. Acessibilidade & Foco Visível (WCAG 2.1 AA)
   -------------------------------------------------------------------------- */

:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.25);
}

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

/* Foco específico para botões e links navegáveis por teclado */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--border-focus) !important;
  outline-offset: 3px !important;
}

/* Link para pular direto ao conteúdo principal */
.skip-to-content {
  position: absolute;
  top: -120px;
  left: var(--space-md);
  z-index: 99999;
  background-color: var(--accent);
  color: var(--text-inverse);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-decoration: none;
  font-size: var(--text-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border-focus);
  transition: top var(--dur-fast) ease;
}

.skip-to-content:focus {
  top: var(--space-md);
}

/* Ocultação exclusiva para leitores de tela */
.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;
}

/* --------------------------------------------------------------------------
   4. Hierarquia de Títulos & Textos
   -------------------------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--text-primary);
  line-height: 1.15;
  letter-spacing: -0.025em;
  text-wrap: balance;
  font-weight: 700;
}

h1 {
  font-size: var(--text-4xl);
}

h2 {
  font-size: var(--text-3xl);
}

h3 {
  font-size: var(--text-2xl);
}

h4 {
  font-size: var(--text-xl);
}

p {
  color: var(--text-secondary);
  font-size: var(--text-base);
  line-height: 1.65;
}

p.lead {
  font-size: var(--text-lg);
  line-height: 1.55;
  color: var(--text-primary);
}

small {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   5. Elementos de Mídia & Links
   -------------------------------------------------------------------------- */

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

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out-expo);
}

a:hover {
  color: var(--accent);
}

ul, ol {
  list-style: none;
}

/* --------------------------------------------------------------------------
   6. Controles de Formulário e Botões
   -------------------------------------------------------------------------- */

button,
input,
optgroup,
select,
textarea {
  font: inherit;
  color: inherit;
  background: transparent;
  border: none;
}

button {
  cursor: pointer;
  user-select: none;
}

/* --------------------------------------------------------------------------
   7. Respeito a Preferência de Redução de Movimento
   -------------------------------------------------------------------------- */

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