/* =============================================================
   4utils — Utilities
   Helpers tipográficos, acessibilidade, layout helpers.
   Único arquivo onde !important é tolerado (sobrescrever Bootstrap).
   ============================================================= */

/* ---------- TIPOGRAFIA (classes utilitárias) -------------- */

.t-display {
  font-family: var(--font-sans);
  font-size: var(--font-display);
  font-weight: var(--weight-bold);
  line-height: 1.05;
  letter-spacing: var(--tracking-tight);
}
.t-h1 {
  font-family: var(--font-sans);
  font-size: var(--font-h1);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-snug);
}
.t-h2 {
  font-family: var(--font-sans);
  font-size: var(--font-h2);
  font-weight: var(--weight-bold);
  line-height: 1.2;
  letter-spacing: -0.015em;
}
.t-h3 {
  font-family: var(--font-sans);
  font-size: var(--font-h3);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  letter-spacing: -0.01em;
}
.t-h4 {
  font-family: var(--font-sans);
  font-size: var(--font-h4);
  font-weight: var(--weight-semibold);
  line-height: 1.35;
}
.t-body-lg {
  font-family: var(--font-sans);
  font-size: var(--font-body-lg);
  font-weight: var(--weight-regular);
  line-height: 1.6;
}
.t-body {
  font-family: var(--font-sans);
  font-size: var(--font-body);
  font-weight: var(--weight-regular);
  line-height: var(--leading-relaxed);
}
.t-small {
  font-family: var(--font-sans);
  font-size: var(--font-small);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
}
.t-micro {
  font-family: var(--font-sans);
  font-size: var(--font-micro);
  font-weight: var(--weight-medium);
  line-height: 1.4;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.t-mono     { font-family: var(--font-mono); }
.t-tabular  { font-variant-numeric: tabular-nums; }
.t-balance  { text-wrap: balance; }
.t-pretty   { text-wrap: pretty; }

.t-primary   { color: var(--text-primary); }
.t-secondary { color: var(--text-secondary); }
.t-tertiary  { color: var(--text-tertiary); }
.t-on-brand  { color: var(--text-on-brand); }
.t-link      { color: var(--text-link); }

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

/* ---------- GRADIENT TEXT (logo, hero H1) ---------------- */

.gradient-text {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* ---------- ACESSIBILIDADE -------------------------------- */

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

.visually-hidden-focusable:not(:focus):not(:focus-within) {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.visually-hidden-focusable:focus,
.visually-hidden-focusable:focus-within {
  position: fixed;
  top: var(--space-3);
  left: var(--space-3);
  z-index: var(--z-toast);
  padding: var(--space-3) var(--space-5);
  background: var(--brand-primary);
  color: var(--text-on-brand);
  border-radius: var(--radius-md);
  box-shadow: var(--elev-3);
  text-decoration: none;
  font-weight: var(--weight-semibold);
}

/* ---------- LAYOUT HELPERS ------------------------------- */

.flow > * + * { margin-top: var(--space-4); }
.flow-tight > * + * { margin-top: var(--space-2); }
.flow-loose > * + * { margin-top: var(--space-6); }

.stack-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

.no-wrap { white-space: nowrap; }
.break-word { word-break: break-word; }
.full-width { width: 100%; }

/* ---------- READABLE WIDTH (SEO body) -------------------- */

.read-width {
  max-width: 68ch;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- REDUCED MOTION ------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
