/* Chief Typography System */
/* Font imports and type scale from brand guidelines */

/* @font-face for Inter is defined inline in layouts/_stylesheets.html.erb
   so we can use asset_path for the digested font URL */

/* Headings */
h1, .h1 {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-tight);
  line-height: var(--line-height-tight);
}

h2, .h2 {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-snug);
  line-height: var(--line-height-tight);
}

h3, .h3 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-normal);
  line-height: var(--line-height-snug);
}

h4, .h4 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-normal);
  line-height: var(--line-height-snug);
}

h5, .h5 {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-normal);
  line-height: var(--line-height-normal);
}

h6, .h6 {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-normal);
  line-height: var(--line-height-normal);
}

/* Display heading for hero sections */
.display {
  font-size: var(--font-size-display);
  font-weight: var(--font-weight-heavy);
  letter-spacing: var(--letter-spacing-display);
  line-height: var(--line-height-tight);
}

/* Body text */
p {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--spacing-lg);
}

p:last-child {
  margin-bottom: 0;
}

/* Lead paragraph */
.lead {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-relaxed);
  color: var(--theme-text-secondary);
}

/* Small text */
small, .small {
  font-size: var(--font-size-sm);
  color: var(--theme-text-muted);
}

/* Labels */
.label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  color: var(--theme-text-muted);
}

/* Chief logo text style */
.logo-text {
  font-family: var(--font-family-sans);
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.04em;
  position: relative;
  display: inline-block;
}

.logo-text::after {
  content: '';
  position: absolute;
  bottom: -0.15em;
  left: 0;
  width: 40%;
  height: 0.1em;
  background: var(--color-primary);
  border-radius: 0.05em;
}

/* Links */
a {
  color: var(--color-primary);
  transition: var(--transition-fast);
}

a:hover {
  color: var(--color-primary-light);
}

/* Code and monospace */
code, kbd, pre, samp {
  font-family: var(--font-family-mono);
  font-size: 0.875em;
}

code {
  padding: 0.125em 0.25em;
  background: var(--theme-bg-input);
  border-radius: var(--border-radius-sm);
  color: var(--color-primary-light);
}

pre {
  display: block;
  padding: var(--spacing-lg);
  background: var(--theme-bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-md);
  overflow-x: auto;
  line-height: var(--line-height-relaxed);
}

pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

/* Blockquotes */
blockquote {
  padding-left: var(--spacing-xl);
  border-left: 4px solid var(--color-primary);
  font-style: italic;
  color: var(--theme-text-secondary);
  margin: var(--spacing-xl) 0;
}

/* Lists */
ul, ol {
  margin: var(--spacing-md) 0;
  padding-left: var(--spacing-2xl);
}

ul {
  list-style-type: disc;
}

ol {
  list-style-type: decimal;
}

li {
  margin-bottom: var(--spacing-sm);
  line-height: var(--line-height-relaxed);
}

/* Definition lists */
dl {
  margin: var(--spacing-md) 0;
}

dt {
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--spacing-xs);
}

dd {
  margin-left: var(--spacing-xl);
  margin-bottom: var(--spacing-md);
  color: var(--theme-text-secondary);
}

/* Text utilities */
.text-primary { color: var(--color-primary) !important; }
.text-success { color: var(--color-success) !important; }
.text-warning { color: var(--color-warning) !important; }
.text-danger { color: var(--color-danger) !important; }
.text-muted { color: var(--theme-text-muted) !important; }
.text-faint { color: var(--theme-text-faint) !important; }

.text-left { text-align: left !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.text-justify { text-align: justify !important; }

.text-lowercase { text-transform: lowercase !important; }
.text-uppercase { text-transform: uppercase !important; }
.text-capitalize { text-transform: capitalize !important; }

.font-weight-light { font-weight: var(--font-weight-light) !important; }
.font-weight-regular { font-weight: var(--font-weight-regular) !important; }
.font-weight-medium { font-weight: var(--font-weight-medium) !important; }
.font-weight-semibold { font-weight: var(--font-weight-semibold) !important; }
.font-weight-bold { font-weight: var(--font-weight-bold) !important; }

.font-mono { font-family: var(--font-family-mono) !important; }

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

/* Line clamp */
.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;
}

/* Light theme overrides */
.light-bg .lead,
.light-bg blockquote,
.light-bg dd {
  color: var(--theme-text-secondary);
}

.light-bg small,
.light-bg .small,
.light-bg .label,
.light-bg .text-muted,
.light-bg .text-faint {
  color: var(--theme-text-muted);
}