/* ==========================================================================
   Typography — AlleProfit
   Inter from Google Fonts + heading/body scales
   ========================================================================== */

/* ---- Font Import ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ---- Heading Scale ---- */

h1, .h1 {
  font-size: var(--text-4xl);
  font-weight: var(--weight-extrabold);
  line-height: var(--leading-tight);
  letter-spacing: -0.025em;
  color: var(--color-text);
}

h2, .h2 {
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
  color: var(--color-text);
}

h3, .h3 {
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  letter-spacing: -0.015em;
  color: var(--color-text);
}

h4, .h4 {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  color: var(--color-text);
}

h5, .h5 {
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  line-height: var(--leading-tight);
  color: var(--color-text);
}

/* ---- Responsive Heading Scale ---- */

@media (max-width: 640px) {
  h1, .h1 {
    font-size: var(--text-2xl);
  }

  h2, .h2 {
    font-size: var(--text-xl);
  }

  h3, .h3 {
    font-size: var(--text-lg);
  }
}

/* ---- Body Text ---- */

p {
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
}

p + p {
  margin-top: var(--space-md);
}

.text-body {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
}

.text-body-lg {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
}

/* ---- Small Text & Labels ---- */

small, .text-sm {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.text-xs {
  font-size: var(--text-xs);
  line-height: var(--leading-normal);
}

.text-muted {
  color: var(--color-text-muted);
}

.text-secondary {
  color: var(--color-text-secondary);
}

.label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* ---- Links ---- */

.link {
  color: var(--color-primary);
  font-weight: var(--weight-medium);
  transition: color var(--transition);
  cursor: pointer;
}

.link:hover {
  color: var(--color-primary-hover);
}

.link-underline {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--color-primary);
  text-decoration-thickness: 1px;
}

.link-underline:hover {
  text-decoration-thickness: 2px;
}

/* ---- Text Utilities ---- */

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

.text-primary { color: var(--color-primary); }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }

.font-normal { font-weight: var(--weight-normal); }
.font-medium { font-weight: var(--weight-medium); }
.font-semibold { font-weight: var(--weight-semibold); }
.font-bold { font-weight: var(--weight-bold); }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- Monospace / Code ---- */

code, .code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--color-surface-hover);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
  color: var(--color-primary);
}

/* ---- Number Display (for KPIs) ---- */

.number-display {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
  letter-spacing: -0.02em;
}

.number-xl {
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.number-lg {
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

/* ---- Divider ---- */

.divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-xl) 0;
}
