/* ============================================================
   MOTORHOME FRIENDS · BASE STYLES (reset + typography + utils)
   Requer: tokens.css carregado antes
   Mobile-first: estilos base são pra mobile, MQ ampliam pra maior.
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: var(--header-height);
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--neutro-ink);
  background: var(--neutro-branco);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;   /* previne scroll horizontal em mobile */
}

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

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

a {
  color: var(--mhf-azul);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease);
}
a:hover, a:focus-visible { color: var(--mhf-laranja); }
a:focus-visible { outline: 2px solid var(--mhf-laranja); outline-offset: 2px; border-radius: 2px; }

ul, ol { list-style: none; }

input, textarea, select {
  font: inherit;
  color: inherit;
  font-size: var(--text-base);   /* 16px mínimo evita zoom em iOS */
}

/* Remove default focus outline em favor do :focus-visible */
:focus { outline: 0; }
:focus-visible {
  outline: 2px solid var(--mhf-laranja);
  outline-offset: 2px;
}

/* ============ TIPOGRAFIA — hierarquia responsiva ============ */

/* H1 — página, hero */
h1, .h1 {
  font-family: var(--font-display);
  font-weight: var(--fw-extra);
  font-size: clamp(var(--text-4xl), 8vw, var(--text-6xl));
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--neutro-ink);
}

/* H2 — seção */
h2, .h2 {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: clamp(var(--text-2xl), 5vw, var(--text-4xl));
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--neutro-ink);
}

/* H3 — sub-seção, card title */
h3, .h3 {
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: clamp(var(--text-xl), 3.5vw, var(--text-2xl));
  line-height: var(--leading-snug);
  color: var(--neutro-ink);
}

/* H4 — component title */
h4, .h4 {
  font-family: var(--font-body);
  font-weight: var(--fw-bold);
  font-size: var(--text-lg);
  line-height: var(--leading-snug);
  color: var(--neutro-ink);
}

/* Body / p */
p {
  color: var(--neutro-ink);
  line-height: var(--leading-normal);
}

/* Kicker — pequeno label acima do H1 */
.kicker {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
  color: var(--mhf-laranja);
  margin-bottom: var(--space-3);
}

/* Lead — texto de intro sob H1 */
.lead {
  font-size: var(--text-lg);
  color: var(--neutro-muted);
  max-width: 65ch;
  line-height: var(--leading-normal);
}

/* Small / meta text */
.small, small {
  font-size: var(--text-sm);
  color: var(--neutro-muted);
}

/* Aloha script accent */
.accent {
  font-family: var(--font-accent);
  color: var(--mhf-laranja);
  font-weight: var(--fw-bold);
}

/* ============ CONTAINER / LAYOUT ============ */

.container {
  width: 100%;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

@media (min-width: 768px) {
  .container {
    padding-left: var(--space-6);
    padding-right: var(--space-6);
  }
}

@media (min-width: 1024px) {
  .container {
    padding-left: var(--space-8);
    padding-right: var(--space-8);
  }
}

.container-sm { max-width: var(--container-sm); }
.container-md { max-width: var(--container-md); }
.container-lg { max-width: var(--container-lg); }

/* Section — espaço vertical entre seções */
.section {
  padding-top: var(--space-12);
  padding-bottom: var(--space-12);
}
@media (min-width: 768px) {
  .section {
    padding-top: var(--space-16);
    padding-bottom: var(--space-16);
  }
}
@media (min-width: 1024px) {
  .section {
    padding-top: var(--space-20);
    padding-bottom: var(--space-20);
  }
}

.section--tight {
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
}

.section--alt { background: var(--neutro-off-white); }
.section--dark { background: var(--neutro-ink); color: var(--neutro-off-white); }
.section--dark h1, .section--dark h2, .section--dark h3, .section--dark h4 { color: var(--neutro-branco); }

/* ============ UTILIDADES ============ */

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

.text-laranja  { color: var(--mhf-laranja); }
.text-azul     { color: var(--mhf-azul); }
.text-muted    { color: var(--neutro-muted); }
.text-white    { color: var(--neutro-branco); }

.bg-laranja      { background: var(--mhf-laranja); }
.bg-azul         { background: var(--mhf-azul); }
.bg-off-white    { background: var(--neutro-off-white); }
.bg-white        { background: var(--neutro-branco); }
.bg-ink          { background: var(--neutro-ink); }

.uppercase   { text-transform: uppercase; letter-spacing: var(--tracking-wide); }
.tracked     { letter-spacing: var(--tracking-widest); }

.hidden { display: none !important; }
.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;
}

/* Mostra apenas em mobile */
.mobile-only { display: block; }
@media (min-width: 768px) { .mobile-only { display: none; } }

/* Mostra apenas em desktop */
.desktop-only { display: none; }
@media (min-width: 768px) { .desktop-only { display: block; } }

/* Grid rápido */
.grid { display: grid; gap: var(--space-4); }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: repeat(2, 1fr); }

@media (min-width: 768px) {
  .grid { gap: var(--space-6); }
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Flex helpers */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

/* Espaçamento vertical */
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

/* Bordas arredondadas */
.rounded    { border-radius: var(--radius); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }
