/* ==========================================================================
   BAMBU Design | base.css
   Fontes da marca, reset mínimo, tipografia e utilitários de acessibilidade.
   Depende de tokens.css. Seletores de baixa especificidade, para que as classes
   utilitárias do Tailwind e o CSS de cada app consigam sobrescrever.
   ========================================================================== */

/* ---------- Fontes da marca ----------
   Os caminhos são relativos a este arquivo (css/ -> ../fonts/). Bundlers como o Vite
   resolvem e copiam os arquivos sozinhos. font-display: swap evita texto invisível. */
@font-face {
  font-family: 'Acumin';
  src: url('../fonts/acumin-var.woff2') format('woff2-variations'), url('../fonts/acumin-var.woff2') format('woff2');
  font-weight: 300 800;
  font-stretch: 50% 105%;
  font-style: normal;
  font-display: swap;
}
/* Títulos: Manrope (OFL, uso livre). A Acherus Militant fica restrita ao manual de marca (decisão do dono, 25/10/2026). */
@font-face {
  font-family: 'Manrope';
  src: url('../fonts/manrope-var.woff2') format('woff2-variations'), url('../fonts/manrope-var.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

/* ---------- Reset mínimo ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  color-scheme: light dark; /* sobrescrito por tokens.css conforme o tema */
}
body {
  margin: 0;
  background: var(--bd-bg);
  color: var(--bd-text);
  font-family: var(--bd-font-text);
  font-size: var(--bd-fs-body);
  line-height: var(--bd-lh-body);
  font-weight: var(--bd-weight-regular);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
table { border-collapse: collapse; }
a { color: var(--bd-link); text-underline-offset: 3px; }
a:hover { color: var(--bd-link-hover); }
hr { border: 0; border-top: 1px solid var(--bd-border); margin: 0; }
::selection { background: var(--bd-primary-soft); color: var(--bd-primary-soft-fg); }
[hidden] { display: none !important; }

/* ---------- Foco visível (global) ----------
   Um único anel para todo o sistema. Nunca remova o outline sem repor um equivalente. */
:focus-visible {
  outline: var(--bd-ring-width) solid var(--bd-focus);
  outline-offset: var(--bd-ring-offset);
}

/* ---------- Acessibilidade ---------- */
.bd-sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.bd-skip:not(:focus) {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.bd-skip:focus {
  position: fixed; left: 12px; top: 12px; z-index: var(--bd-z-skip);
  background: var(--bd-primary); color: var(--bd-primary-fg);
  padding: 10px 16px; border-radius: var(--bd-radius-md); text-decoration: none;
}

/* ---------- Tipografia ----------
   Display (Manrope) só em título, valor de KPI e horário. Todo o resto é Acumin. */
.bd-display, .bd-title-1, .bd-title-2, .bd-title-3 {
  font-family: var(--bd-font-display);
  font-weight: var(--bd-weight-bold);
  letter-spacing: var(--bd-tracking-display);
  color: var(--bd-heading);
  text-wrap: balance;
}
.bd-title-1 { font-size: var(--bd-fs-4xl); line-height: var(--bd-lh-4xl); }
.bd-title-2 { font-size: var(--bd-fs-3xl); line-height: var(--bd-lh-3xl); }
.bd-title-3 { font-size: var(--bd-fs-2xl); line-height: var(--bd-lh-2xl); }
.bd-subtitle { font-size: var(--bd-fs-xl); line-height: var(--bd-lh-xl); font-weight: var(--bd-weight-semibold); }
.bd-lead { font-size: var(--bd-fs-lg); line-height: var(--bd-lh-lg); color: var(--bd-text-2); max-width: 64ch; text-wrap: pretty; }
.bd-body { font-size: var(--bd-fs-body); line-height: var(--bd-lh-body); }
.bd-small { font-size: var(--bd-fs-sm); line-height: var(--bd-lh-sm); }
.bd-xs { font-size: var(--bd-fs-xs); line-height: var(--bd-lh-xs); }
.bd-caption { font-size: var(--bd-fs-caption); line-height: var(--bd-lh-caption); color: var(--bd-text-3); }
.bd-overline {
  font-size: var(--bd-fs-xs); line-height: var(--bd-lh-xs); font-weight: var(--bd-weight-semibold);
  letter-spacing: var(--bd-tracking-overline); text-transform: uppercase; color: var(--bd-text-2);
}
.bd-muted { color: var(--bd-text-2); }
.bd-subtle { color: var(--bd-text-3); }
.bd-strong { font-weight: var(--bd-weight-semibold); }
.bd-mono { font-family: var(--bd-font-mono); font-size: 0.9em; white-space: nowrap; }
/* Números: sempre tabulares em tabela, KPI, valores e horários; alinhados à direita nas colunas. */
.bd-num { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }
.bd-num-right { text-align: right; font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }
.bd-nowrap { white-space: nowrap; }
.bd-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-prose > * + * { margin-top: var(--bd-space-3); }
.bd-prose { max-width: 68ch; text-wrap: pretty; }

/* ---------- Layout utilitário ---------- */
.bd-stack { display: flex; flex-direction: column; gap: var(--bd-stack-gap, var(--bd-space-4)); }
.bd-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--bd-cluster-gap, var(--bd-space-3)); }
.bd-spread { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--bd-space-3); }
.bd-grid { display: grid; gap: var(--bd-gap); }
.bd-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bd-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bd-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bd-grid--auto { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.bd-grid--7-5 { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.bd-container { width: 100%; max-width: var(--bd-layout-content-max); margin-inline: auto; padding-inline: var(--bd-layout-gutter); }
@media (max-width: 1080px) { .bd-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .bd-grid--7-5 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 780px) { .bd-grid--3 { grid-template-columns: minmax(0, 1fr); } .bd-grid--2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) { .bd-grid--4 { grid-template-columns: minmax(0, 1fr); } .bd-container { padding-inline: 16px; } }

/* ---------- Barra de rolagem discreta ---------- */
* { scrollbar-width: thin; scrollbar-color: var(--bd-border-strong) transparent; }

/* ---------- Movimento reduzido ----------
   Os tokens de duração já zeram; isto cobre animações em keyframes e rolagem suave. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
}

/* ---------- Impressão ---------- */
@media print {
  body { background: #fff; color: #000; }
  .bd-no-print { display: none !important; }
}
