/* ============================================================
   02-BASE.CSS  →  RESET + ESTILOS GLOBAIS + UTILITÁRIOS
   ============================================================
   Mobile-First. Raramente precisa de edição — ele consome
   as variáveis do 01-variables.css automaticamente.
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family-body);
  font-size: var(--fs-body);
  line-height: var(--lh-base);
  color: var(--color-text-base);
  background-color: var(--color-bg-main);
  -webkit-font-smoothing: antialiased;
}

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

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

ul,
ol {
  list-style: none;
}

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

/* ---------- TIPOGRAFIA GLOBAL ---------- */
h1, h2, h3 {
  font-family: var(--font-family-heading);
  line-height: var(--lh-tight);
  font-weight: var(--fw-bold);
  color: var(--color-text-base);
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

p { max-width: 65ch; } /* limita largura p/ leitura confortável */


/* ============================================================
   CLASSES UTILITÁRIAS
   Pequenas peças reutilizáveis. Combine no HTML.
   ============================================================ */

/* ---- Container central ---- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-sm);
}

/* ---- Seção (respiro vertical responsivo) ---- */
.section {
  padding-block: var(--space-xl);
}
@media (min-width: 768px) {
  .section { padding-block: var(--space-2xl); }
}

/* ---- Alinhamento de texto ---- */
.text-center { text-align: center; }
.text-left   { text-align: left; }

/* ---- Flexbox ---- */
.d-flex          { display: flex; }
.flex-col        { flex-direction: column; }
.flex-wrap       { flex-wrap: wrap; }
.items-center    { align-items: center; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* ---- Grid auto-responsivo (cards) ---- */
.grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: 1fr; /* mobile: 1 coluna */
}
@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* ---- Cores de fundo ---- */
.bg-main      { background-color: var(--color-bg-main); }
.bg-alt       { background-color: var(--color-bg-alt); }
.bg-primary   { background-color: var(--color-primary); color: var(--color-text-invert); }
.bg-accent    { background-color: var(--color-accent);  color: var(--color-text-invert); }

/* ---- Cores de texto ---- */
.text-muted  { color: var(--color-text-muted); }
.text-invert { color: var(--color-text-invert); }

/* ---- Espaçamentos (margin-top / padding) ---- */
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.p-md  { padding: var(--space-md); }
.p-lg  { padding: var(--space-lg); }

/* ---- Helpers diversos ---- */
.rounded   { border-radius: var(--border-radius-md); }
.shadow    { box-shadow: var(--shadow-md); }
.full-width { width: 100%; }

/* Esconde visualmente, mas mantém acessível p/ leitores de tela */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
