/* ═══════════════════════════════════════════════════════════════════
   BCX Theme, base.css
   Reset minimalista + tipografia + utilitários
   Carregado depois do style.css (que tem as CSS variables)
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Reset moderno ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 4; scroll-behavior: smooth; }
body {
  font-family: var(--bcx-font-body);
  font-size: var(--bcx-font-size-base);
  line-height: var(--bcx-line-height-base);
  color: var(--bcx-text);
  background: var(--bcx-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: var(--bcx-primary); text-decoration: none; transition: color var(--bcx-transition-fast); }
a:hover { color: var(--bcx-primary-dark); }
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }

/* ─── Tipografia BCX ───────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--bcx-font-heading);
  font-weight: 800;
  color: var(--bcx-text);
  letter-spacing: var(--bcx-letter-spacing-heading);
  line-height: 1.25;
  margin-bottom: var(--bcx-space-3);
}
h1 { font-size: var(--bcx-font-size-3xl); }
h2 { font-size: var(--bcx-font-size-2xl); }
h3 { font-size: var(--bcx-font-size-xl); }
h4 { font-size: var(--bcx-font-size-lg); font-weight: 700; }
h5 { font-size: var(--bcx-font-size-md); font-weight: 700; }
h6 { font-size: var(--bcx-font-size-sm); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }

p { margin-bottom: var(--bcx-space-4); }
small { font-size: var(--bcx-font-size-sm); }
strong, b { font-weight: 700; }

ul, ol { margin: 0 0 var(--bcx-space-4) var(--bcx-space-5); }
li { margin-bottom: var(--bcx-space-1); }
hr { border: 0; border-top: 1px solid var(--bcx-border); margin: var(--bcx-space-6) 0; }

/* ─── Container BCX ────────────────────────────────────────────────── */
.bcx-container {
  width: 100%;
  max-width: var(--bcx-container-max);
  margin-inline: auto;
  padding-inline: var(--bcx-container-padding);
}
.bcx-container-tight { max-width: 800px; }
.bcx-container-wide { max-width: 1440px; }

/* ─── Layout helpers ───────────────────────────────────────────────── */
.bcx-stack > * + * { margin-top: var(--bcx-space-4); }
.bcx-stack-sm > * + * { margin-top: var(--bcx-space-2); }
.bcx-stack-lg > * + * { margin-top: var(--bcx-space-6); }
.bcx-row { display: flex; flex-wrap: wrap; gap: var(--bcx-space-4); }
.bcx-grid { display: grid; gap: var(--bcx-space-5); }
.bcx-grid-2 { grid-template-columns: repeat(2, 1fr); }
.bcx-grid-3 { grid-template-columns: repeat(3, 1fr); }
.bcx-grid-4 { grid-template-columns: repeat(4, 1fr); }
.bcx-grid-6 { grid-template-columns: repeat(6, 1fr); }
.bcx-flex { display: flex; gap: var(--bcx-space-3); align-items: center; }
.bcx-flex-col { display: flex; flex-direction: column; gap: var(--bcx-space-3); }
.bcx-flex-between { display: flex; justify-content: space-between; align-items: center; gap: var(--bcx-space-3); }

/* ─── Skip link (a11y) ─────────────────────────────────────────────── */
.skip-link {
  position: absolute; left: -9999px;
  background: var(--bcx-text); color: #fff;
  padding: var(--bcx-space-3) var(--bcx-space-4);
  z-index: var(--bcx-z-toast);
}
.skip-link:focus { left: 0; top: 0; }

/* ─── Focus visible (a11y) ─────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--bcx-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ─── Utilitários de visibilidade ──────────────────────────────────── */
.bcx-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;
}
.bcx-hidden { display: none !important; }
.bcx-mobile-only { display: none; }
.bcx-desktop-only { display: block; }

/* ─── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .bcx-grid-6 { grid-template-columns: repeat(4, 1fr); }
  .bcx-grid-4 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  :root {
    --bcx-container-padding: 16px;
    --bcx-header-height: var(--bcx-header-height-mobile);
  }
  h1 { font-size: var(--bcx-font-size-2xl); }
  h2 { font-size: var(--bcx-font-size-xl); }
  h3 { font-size: var(--bcx-font-size-lg); }
  .bcx-grid-2, .bcx-grid-3, .bcx-grid-4, .bcx-grid-6 { grid-template-columns: repeat(2, 1fr); }
  .bcx-mobile-only { display: block; }
  .bcx-desktop-only { display: none; }
}
@media (max-width: 480px) {
  .bcx-grid-2, .bcx-grid-3 { grid-template-columns: 1fr; }
}

/* ─── Print ────────────────────────────────────────────────────────── */
@media print {
  .bcx-no-print { display: none !important; }
  body { background: #fff; color: #000; }
  a::after { content: ' (' attr(href) ')'; font-size: 0.85em; }
}

/* ─── Prefers reduced motion (a11y) ────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
