/**
 * base.css — reset leve + tipografia + utilitários gerais
 * Depende de variables.css (deve ser carregado antes deste arquivo).
 */

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

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

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--line-height-normal);
    color: var(--text-color);
    background-color: var(--background-color);
    -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    margin: 0 0 var(--space-4);
    /* Sem "color" explícito de propósito — mesma razão do seletor `p`
       acima: precisa herdar var(--text-color) do body em fundo claro, ou
       a cor clara do contêiner em seções escuras (.hero, .cta-section...). */
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
    margin: 0 0 var(--space-4);
    /* Sem "color" explícito de propósito: herda de body (var(--text-color))
       ou do contêiner escuro mais próximo (.hero, .site-footer, .cta-section
       etc.) — declarar a cor aqui quebraria essa herança em seções com
       fundo escuro. Ver includes/partials/footer.php + site.css. */
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover { color: var(--primary-color-dark); }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

ul, ol {
    padding-left: var(--space-5);
}

table {
    border-collapse: collapse;
    width: 100%;
}

button {
    font-family: inherit;
}

/* -------------------------------------------------------------------
 * Layout utilitário
 * ------------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--container-max-width);
    margin-inline: auto;
    padding-inline: var(--space-5);
}

.section {
    padding-block: var(--space-8);
}

.section-header {
    max-width: 640px;
    margin-bottom: var(--space-6);
}

.section-header--center {
    margin-inline: auto;
    text-align: center;
}

.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }

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

.visually-hidden { display: none !important; }

/* -------------------------------------------------------------------
 * Grids utilitários
 * ------------------------------------------------------------------- */
.grid {
    display: grid;
    gap: var(--space-5);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 992px) {
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    h1 { font-size: var(--text-3xl); }
    h2 { font-size: var(--text-2xl); }
}
