/* 
 * Template Composer - Typography System
 * Bootstrap 5 Compatible Extensions - No Overrides
 * Based on tokens from /lib/root/tokens/typography.json
 */

/* ===== FONT FAMILY UTILITIES ===== */
.tc_font_primary {
  font-family: var(--tc-font-primary);
}

.tc_font_secondary {
  font-family: var(--tc-font-secondary);
}

.tc_font_mono {
  font-family: var(--tc-font-mono);
}

/* ===== SEMANTIC TYPOGRAPHY CLASSES ===== */

/* Display Styles - For major headings and hero text */
.tc_display_1 {
  font-family: var(--tc-font-secondary);
  font-size: var(--tc-text-6xl);
  font-weight: var(--tc-font-extrabold);
  line-height: var(--tc-leading-none);
  letter-spacing: var(--tc-tracking-tighter);
}

.tc_display_2 {
  font-family: var(--tc-font-secondary);
  font-size: var(--tc-text-5xl);
  font-weight: var(--tc-font-bold);
  line-height: var(--tc-leading-tight);
  letter-spacing: var(--tc-tracking-tight);
}

.tc_display_3 {
  font-family: var(--tc-font-secondary);
  font-size: var(--tc-text-4xl);
  font-weight: var(--tc-font-bold);
  line-height: var(--tc-leading-tight);
  letter-spacing: var(--tc-tracking-tight);
}

/* Heading Styles - For section titles and content hierarchy */
.tc_heading_1 {
  font-family: var(--tc-font-secondary);
  font-size: var(--tc-text-4xl);
  font-weight: var(--tc-font-bold);
  line-height: var(--tc-leading-tight);
  letter-spacing: var(--tc-tracking-tight);
}

.tc_heading_2 {
  font-family: var(--tc-font-secondary);
  font-size: var(--tc-text-3xl);
  font-weight: var(--tc-font-bold);
  line-height: var(--tc-leading-tight);
  letter-spacing: var(--tc-tracking-tight);
}

.tc_heading_3 {
  font-family: var(--tc-font-secondary);
  font-size: var(--tc-text-2xl);
  font-weight: var(--tc-font-semibold);
  line-height: var(--tc-leading-snug);
  letter-spacing: var(--tc-tracking-normal);
}

.tc_heading_4 {
  font-family: var(--tc-font-primary);
  font-size: var(--tc-text-xl);
  font-weight: var(--tc-font-semibold);
  line-height: var(--tc-leading-snug);
  letter-spacing: var(--tc-tracking-normal);
}

.tc_heading_5 {
  font-family: var(--tc-font-primary);
  font-size: var(--tc-text-lg);
  font-weight: var(--tc-font-semibold);
  line-height: var(--tc-leading-normal);
  letter-spacing: var(--tc-tracking-normal);
}

.tc_heading_6 {
  font-family: var(--tc-font-primary);
  font-size: var(--tc-text-base);
  font-weight: var(--tc-font-medium);
  line-height: var(--tc-leading-normal);
  letter-spacing: var(--tc-tracking-normal);
}

/* Body Text Styles */
.tc_body_large {
  font-family: var(--tc-font-primary);
  font-size: var(--tc-text-lg);
  font-weight: var(--tc-font-normal);
  line-height: var(--tc-leading-relaxed);
  letter-spacing: var(--tc-tracking-normal);
}

.tc_body_base {
  font-family: var(--tc-font-primary);
  font-size: var(--tc-text-base);
  font-weight: var(--tc-font-normal);
  line-height: var(--tc-leading-relaxed);
  letter-spacing: var(--tc-tracking-normal);
}

.tc_body_small {
  font-family: var(--tc-font-primary);
  font-size: var(--tc-text-sm);
  font-weight: var(--tc-font-normal);
  line-height: var(--tc-leading-normal);
  letter-spacing: var(--tc-tracking-normal);
}

/* Utility Text Styles */
.tc_caption {
  font-family: var(--tc-font-primary);
  font-size: var(--tc-text-xs);
  font-weight: var(--tc-font-medium);
  line-height: var(--tc-leading-normal);
  letter-spacing: var(--tc-tracking-wide);
  color: var(--tc-text-muted);
}

.tc_overline {
  font-family: var(--tc-font-primary);
  font-size: var(--tc-text-xs);
  font-weight: var(--tc-font-semibold);
  line-height: var(--tc-leading-normal);
  letter-spacing: var(--tc-tracking-wider);
  text-transform: uppercase;
  color: var(--tc-text-muted);
}

/* Code Styles */
.tc_code_inline {
  font-family: var(--tc-font-mono);
  font-size: 0.875em;
  font-weight: var(--tc-font-medium);
  line-height: var(--tc-leading-normal);
  background-color: var(--tc-bg-muted);
  color: var(--tc-text-primary);
  padding: 0.125rem 0.25rem;
  border-radius: var(--tc-radius-sm);
}

.tc_code_block {
  font-family: var(--tc-font-mono);
  font-size: var(--tc-text-sm);
  font-weight: var(--tc-font-normal);
  line-height: var(--tc-leading-relaxed);
  background-color: var(--tc-bg-muted);
  color: var(--tc-text-primary);
  padding: var(--tc-space-4);
  border-radius: var(--tc-radius-md);
  overflow-x: auto;
}

/* ===== SECTION-SPECIFIC TYPOGRAPHY ===== */

/* Hero Section Typography */
.tc_hero_title {
  font-family: var(--tc-font-secondary);
  font-size: var(--tc-text-6xl);
  font-weight: var(--tc-font-extrabold);
  line-height: var(--tc-leading-tight);
  letter-spacing: var(--tc-tracking-tighter);
  color: var(--tc-text-primary);
  margin-bottom: var(--tc-space-6);
}

.tc_hero_subtitle {
  font-family: var(--tc-font-primary);
  font-size: var(--tc-text-xl);
  font-weight: var(--tc-font-medium);
  line-height: var(--tc-leading-normal);
  letter-spacing: var(--tc-tracking-normal);
  color: var(--tc-text-secondary);
  margin-bottom: var(--tc-space-8);
}

/* Section Typography */
.tc_section_title {
  font-family: var(--tc-font-secondary);
  font-size: var(--tc-text-4xl);
  font-weight: var(--tc-font-bold);
  line-height: var(--tc-leading-tight);
  letter-spacing: var(--tc-tracking-tight);
  color: var(--tc-text-primary);
  margin-bottom: var(--tc-space-4);
}

.tc_section_subtitle {
  font-family: var(--tc-font-primary);
  font-size: var(--tc-text-lg);
  font-weight: var(--tc-font-medium);
  line-height: var(--tc-leading-normal);
  letter-spacing: var(--tc-tracking-normal);
  color: var(--tc-text-secondary);
  margin-bottom: var(--tc-space-3);
}

.tc_section_description {
  font-family: var(--tc-font-primary);
  font-size: var(--tc-text-base);
  font-weight: var(--tc-font-normal);
  line-height: var(--tc-leading-relaxed);
  letter-spacing: var(--tc-tracking-normal);
  color: var(--tc-text-primary);
  margin-bottom: var(--tc-space-8);
  max-width: 65ch; /* Optimal reading width */
}

/* Card Typography */
.tc_card_title {
  font-family: var(--tc-font-primary);
  font-size: var(--tc-text-xl);
  font-weight: var(--tc-font-semibold);
  line-height: var(--tc-leading-snug);
  letter-spacing: var(--tc-tracking-normal);
  color: var(--tc-text-primary);
  margin-bottom: var(--tc-space-3);
}

.tc_card_text {
  font-family: var(--tc-font-primary);
  font-size: var(--tc-text-base);
  font-weight: var(--tc-font-normal);
  line-height: var(--tc-leading-normal);
  letter-spacing: var(--tc-tracking-normal);
  color: var(--tc-text-primary);
}

/* Navigation Typography */
.tc_nav_link {
  font-family: var(--tc-font-primary);
  font-size: var(--tc-text-base);
  font-weight: var(--tc-font-medium);
  line-height: var(--tc-leading-normal);
  letter-spacing: var(--tc-tracking-normal);
  color: var(--tc-text-primary);
  text-decoration: none;
  transition: color var(--tc-transition-fast);
}

.tc_nav_link:hover,
.tc_nav_link:focus {
  color: var(--tc-text-link);
  text-decoration: none;
}

/* Button Typography */
.tc_button_text {
  font-family: var(--tc-font-primary);
  font-size: var(--tc-text-base);
  font-weight: var(--tc-font-medium);
  line-height: var(--tc-leading-normal);
  letter-spacing: var(--tc-tracking-normal);
}

/* Footer Typography */
.tc_footer_text {
  font-family: var(--tc-font-primary);
  font-size: var(--tc-text-sm);
  font-weight: var(--tc-font-normal);
  line-height: var(--tc-leading-normal);
  letter-spacing: var(--tc-tracking-normal);
  color: var(--tc-text-muted);
}

/* ===== RESPONSIVE TYPOGRAPHY ===== */
@media (max-width: 768px) {
  .tc_hero_title {
    font-size: var(--tc-text-4xl);
  }
  
  .tc_section_title {
    font-size: var(--tc-text-3xl);
  }
  
  .tc_display_1 {
    font-size: var(--tc-text-5xl);
  }
  
  .tc_display_2 {
    font-size: var(--tc-text-4xl);
  }
}

@media (max-width: 480px) {
  .tc_hero_title {
    font-size: var(--tc-text-3xl);
  }
  
  .tc_section_title {
    font-size: var(--tc-text-2xl);
  }
  
  .tc_display_1 {
    font-size: var(--tc-text-4xl);
  }
}

/* ===== LINK STYLES - ADDITIVE TO BOOTSTRAP ===== */
a:not([class]) {
  color: var(--tc-text-link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: all var(--tc-transition-fast);
}

a:not([class]):hover,
a:not([class]):focus {
  color: var(--tc-text-link-hover);
  text-decoration-thickness: 2px;
}

a:not([class]):visited {
  color: var(--tc-text-link);
}

/* ===== TEXT UTILITIES ===== */
.tc_text_gradient {
  background: var(--tc-gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}

.tc_text_shadow_sm {
  text-shadow: var(--tc-shadow-xs);
}

.tc_text_shadow_md {
  text-shadow: var(--tc-shadow-sm);
}

.tc_text_balance {
  text-wrap: balance;
}

.tc_text_pretty {
  text-wrap: pretty;
}

/* ===== ACCESSIBILITY ENHANCEMENTS ===== */
@media (prefers-reduced-motion: reduce) {
  .tc_nav_link,
  a:not([class]) {
    transition: none;
  }
}

@media (prefers-contrast: high) {
  .tc_caption,
  .tc_overline,
  .tc_footer_text {
    color: var(--tc-text-secondary);
  }
  
  .tc_hero_subtitle,
  .tc_section_subtitle {
    color: var(--tc-text-primary);
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  .tc_hero_title,
  .tc_section_title,
  .tc_heading_1,
  .tc_heading_2 {
    break-after: avoid;
    page-break-after: avoid;
  }
  
  .tc_text_gradient {
    color: var(--tc-text-primary);
    -webkit-text-fill-color: var(--tc-text-primary);
  }
}