/**
 * MEMES BOVINOS — Base
 * Reset leve + fundações tipográficas e estruturais
 * Não estilizar componentes aqui.
 */

/* ── Reset Leve ────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: var(--mb-font-body);
  font-size: var(--mb-text-body);
  font-weight: var(--mb-weight-regular);
  line-height: var(--mb-leading-relaxed);
  color: var(--mb-text-primary);
  background-color: var(--mb-offwhite);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100%;
}

/* ── Cabeçalhos ────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--mb-font-headline);
  font-weight: var(--mb-weight-bold);
  line-height: var(--mb-leading-tight);
  letter-spacing: var(--mb-tracking-tight);
  color: var(--mb-text-primary);
}

h1 { font-size: var(--mb-text-h1); }
h2 { font-size: var(--mb-text-h2); }
h3 { font-size: var(--mb-text-h3); }
h4 { font-size: var(--mb-text-card-md); font-weight: var(--mb-weight-bold); }
h5 { font-size: var(--mb-text-card-sm); font-weight: var(--mb-weight-semibold); }
h6 { font-size: var(--mb-text-body);    font-weight: var(--mb-weight-semibold); }

/* ── Links ─────────────────────────────────────────────────── */
a {
  color: var(--mb-accent);
  text-decoration: none;
  transition: color var(--mb-transition-fast);
}

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

/* Links dentro de texto editorial */
.mb-content a,
.mb-article-body a {
  color: var(--mb-accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.mb-content a:hover,
.mb-article-body a:hover {
  color: var(--mb-accent-dark);
  text-decoration-thickness: 2px;
}

/* ── Parágrafos ────────────────────────────────────────────── */
p {
  margin-bottom: var(--mb-space-4);
  line-height: var(--mb-leading-relaxed);
}

strong, b  { font-weight: var(--mb-weight-semibold); }
em, i      { font-style: italic; }
small      { font-size: var(--mb-text-caption); }

/* ── Imagens ───────────────────────────────────────────────── */
img, video, iframe {
  max-width: 100%;
  display: block;
}

img {
  height: auto;
}

figure { margin: 0; }

figcaption {
  font-size: var(--mb-text-caption);
  color: var(--mb-text-muted);
  margin-top: var(--mb-space-2);
  line-height: var(--mb-leading-normal);
}

/* ── Containers ────────────────────────────────────────────── */
.mb-container {
  width: 100%;
  max-width: var(--mb-container);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--mb-gutter);
  padding-right: var(--mb-gutter);
}

.mb-container--narrow { max-width: var(--mb-content-width); }
.mb-container--wide   { max-width: 1440px; }
.mb-container--full   { max-width: 100%; }

/* ── Proporções de Imagem ──────────────────────────────────── */
.mb-ratio {
  position: relative;
  overflow: hidden;
}

.mb-ratio img,
.mb-ratio video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mb-ratio--16-9  { aspect-ratio: 16 / 9; }
.mb-ratio--4-3   { aspect-ratio: 4 / 3; }
.mb-ratio--1-1   { aspect-ratio: 1 / 1; }
.mb-ratio--3-4   { aspect-ratio: 3 / 4; }
.mb-ratio--21-9  { aspect-ratio: 21 / 9; }

/* ── Grid ──────────────────────────────────────────────────── */
.mb-grid {
  display: grid;
  gap: var(--mb-grid-gap);
}

/* Colunas utilitárias */
.mb-col-2 { grid-template-columns: repeat(2, 1fr); }
.mb-col-3 { grid-template-columns: repeat(3, 1fr); }
.mb-col-4 { grid-template-columns: repeat(4, 1fr); }

/* ── Divisores ─────────────────────────────────────────────── */
.mb-divider {
  border: none;
  border-top: var(--mb-border-width) solid var(--mb-border);
  margin: var(--mb-space-6) 0;
}

.mb-divider--accent {
  border-top-color: var(--mb-accent);
  border-top-width: var(--mb-border-width-accent);
}

/* ── Acessibilidade ────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--mb-green-500);
  outline-offset: 3px;
  border-radius: var(--mb-radius-xs);
}

.mb-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;
}

.mb-skip-link {
  position: absolute;
  top: -100%;
  left: var(--mb-space-4);
  z-index: var(--mb-z-top);
  padding: var(--mb-space-3) var(--mb-space-5);
  background: var(--mb-green-900);
  color: var(--mb-white);
  font-weight: var(--mb-weight-semibold);
  font-size: var(--mb-text-interface);
  border-radius: var(--mb-radius-sm);
  letter-spacing: var(--mb-tracking-wide);
  transition: top var(--mb-transition-fast);
}

.mb-skip-link:focus {
  top: var(--mb-space-4);
  color: var(--mb-white);
}

/* Touch targets mínimos */
button, [role="button"], a {
  min-height: 44px;
}

button, [role="button"] {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

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

/* ── Utilitários de Texto ──────────────────────────────────── */
.mb-text-center  { text-align: center; }
.mb-text-left    { text-align: left; }
.mb-text-right   { text-align: right; }
.mb-text-muted   { color: var(--mb-text-muted); }
.mb-text-inverse { color: var(--mb-text-inverse); }
.mb-text-accent  { color: var(--mb-accent); }
.mb-text-gold    { color: var(--mb-gold-500); }

/* ── Utilitários de Display ────────────────────────────────── */
.mb-hidden        { display: none !important; }
.mb-show-mobile   { display: none; }
.mb-flex          { display: flex; }
.mb-flex-center   { display: flex; align-items: center; }
.mb-flex-between  { display: flex; align-items: center; justify-content: space-between; }
.mb-flex-gap-2    { gap: var(--mb-space-2); }
.mb-flex-gap-3    { gap: var(--mb-space-3); }
.mb-flex-gap-4    { gap: var(--mb-space-4); }

/* ── Seleção de Texto ──────────────────────────────────────── */
::selection {
  background-color: rgba(58, 143, 98, 0.2);
  color: var(--mb-green-900);
}

/* ── Scrollbar (Webkit) ────────────────────────────────────── */
::-webkit-scrollbar       { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--mb-gray-100); }
::-webkit-scrollbar-thumb {
  background: var(--mb-gray-400);
  border-radius: var(--mb-radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--mb-gray-500); }

/* ── Responsive Base ───────────────────────────────────────── */
@media (max-width: 767px) {
  .mb-show-mobile { display: block; }
  .mb-hide-mobile { display: none !important; }

  .mb-col-2,
  .mb-col-3,
  .mb-col-4 { grid-template-columns: 1fr; }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .mb-col-3,
  .mb-col-4 { grid-template-columns: repeat(2, 1fr); }
}
