/*
 * Unified typography system — utility classes.
 * Consumes tokens from typography-tokens.css. Bare heading tags (h1-h4) and
 * the sitewide button/nav component classes get font metrics automatically;
 * the explicit utility classes below exist for roles with no natural tag
 * (Card Heading, Eyebrow, Caption, CTA Heading/Description, Body Large) and
 * for opting a specific element into a content-width (ch) constraint.
 *
 * Deliberately NOT applied: max-width on bare h1/h2/p tag selectors. A
 * blanket ch cap on every heading/paragraph sitewide would clip short
 * dashboard/admin text that was never the long-form marketing copy this
 * rule is meant for — ch constraints live only on .h1/.h2/.cta-description
 * /.measure, applied where the content is actually long-form.
 */

body {
  font-family: var(--font-ui);
}

h1, .h1 {
  font-family: var(--font-ui);
  font-size: var(--h1-size);
  font-weight: var(--h1-weight);
  line-height: var(--h1-leading);
  letter-spacing: var(--h1-tracking);
  margin: 0 0 var(--space-h1-desc);
}
.h1 { max-width: var(--measure-h1); }

h2, .h2 {
  font-family: var(--font-ui);
  font-size: var(--h2-size);
  font-weight: var(--h2-weight);
  line-height: var(--h2-leading);
  letter-spacing: var(--h2-tracking);
  margin: 0 0 var(--space-h2-desc);
}
.h2 { max-width: var(--measure-h2); }

h3, .h3 {
  font-family: var(--font-ui);
  font-size: var(--h3-size);
  font-weight: var(--h3-weight);
  line-height: var(--h3-leading);
  letter-spacing: var(--h3-tracking);
  margin: 0 0 var(--space-h3-desc);
}

h4, .h4 {
  font-family: var(--font-ui);
  font-size: var(--h4-size);
  font-weight: var(--h4-weight);
  line-height: var(--h4-leading);
  letter-spacing: var(--h4-tracking);
  margin: 0;
}

.card-heading {
  font-family: var(--font-ui);
  font-size: var(--card-heading-size);
  font-weight: var(--card-heading-weight);
  line-height: var(--card-heading-leading);
  letter-spacing: var(--card-heading-tracking);
  margin: 0 0 var(--space-card-heading-desc);
}

.body-lg {
  font-family: var(--font-ui);
  font-size: var(--body-lg-size);
  font-weight: var(--body-lg-weight);
  line-height: var(--body-lg-leading);
  letter-spacing: var(--body-lg-tracking);
}

.body {
  font-family: var(--font-ui);
  font-size: var(--body-size);
  font-weight: var(--body-weight);
  line-height: var(--body-leading);
  letter-spacing: var(--body-tracking);
}

.body-sm {
  font-family: var(--font-ui);
  font-size: var(--body-sm-size);
  font-weight: var(--body-sm-weight);
  line-height: var(--body-sm-leading);
  letter-spacing: var(--body-sm-tracking);
}

.caption {
  font-family: var(--font-ui);
  font-size: var(--caption-size);
  font-weight: var(--caption-weight);
  line-height: var(--caption-leading);
  letter-spacing: var(--caption-tracking);
}

.eyebrow {
  font-family: var(--font-ui);
  font-size: var(--eyebrow-size);
  font-weight: var(--eyebrow-weight);
  line-height: var(--eyebrow-leading);
  letter-spacing: var(--eyebrow-tracking);
  text-transform: uppercase;
}

/* Applies to every existing button component class sitewide, plus the
   standalone .btn-type utility for elements without one of those classes. */
.btn, .btn-primary, .btn-secondary, .btn-type {
  font-family: var(--font-ui);
  font-size: var(--button-size);
  font-weight: var(--button-weight);
  line-height: var(--button-leading);
  letter-spacing: var(--button-tracking);
}

/* .nav-link intentionally excluded — that class name is shared by the
   admin and client sidebars, which keep their pre-existing styling. */
.navigation, .nav-links a {
  font-family: var(--font-ui);
  font-size: var(--nav-size);
  font-weight: var(--nav-weight);
  line-height: var(--nav-leading);
  letter-spacing: var(--nav-tracking);
}

.cta-heading {
  font-family: var(--font-ui);
  font-size: var(--cta-heading-size);
  font-weight: var(--cta-heading-weight);
  line-height: var(--cta-heading-leading);
  letter-spacing: var(--cta-heading-tracking);
  margin: 0 0 var(--space-cta-heading-desc);
}

.cta-description {
  font-family: var(--font-ui);
  font-size: var(--cta-desc-size);
  font-weight: var(--cta-desc-weight);
  line-height: var(--cta-desc-leading);
  letter-spacing: var(--cta-desc-tracking);
  max-width: var(--measure-cta-desc);
}

.code, code, pre, kbd, samp {
  font-family: var(--font-mono);
}

/* Brand mark only — do not apply elsewhere. */
.brand-mark {
  font-family: var(--font-brand);
}

/* Opt-in content-width helper for long-form body copy that isn't already
   covered by .body-lg/.body inside a naturally narrow container. */
.measure {
  max-width: var(--measure-body);
}

/* Paragraph -> button spacing, applied where a paragraph directly precedes
   a button/link with no other layout gap already handling it. */
.body + .btn-primary, .body + .btn-secondary,
.body-lg + .btn-primary, .body-lg + .btn-secondary {
  margin-top: var(--space-para-btn);
}
