/* Import Poppins font for body text */
@import '@fontsource/poppins/400.css';
@import '@fontsource/poppins/500.css';
@import '@fontsource/poppins/600.css';
@import '@fontsource/poppins/700.css';

/* Override Starlight default fonts with higher specificity */
:root,
:root:where(:root),
::backdrop {
  /* Main font for body text - Poppins for modern, geometric design */
  --sl-font: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
  --__sl-font: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
  
  /* Monospace font for code - Monaco for classic readability */
  --sl-font-mono: 'Monaco', 'Menlo', 'Consolas', 'Courier New', monospace !important;
  --__sl-font-mono: 'Monaco', 'Menlo', 'Consolas', 'Courier New', monospace !important;
  
  /* Font smoothing for better rendering */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  
  /* Optimize text rendering */
  text-rendering: optimizeLegibility;
}

/* Enhanced typography for better readability */
body {
  /* Force Poppins font on body */
  font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
  
  /* Base font size - reduced for better readability */
  font-size: 0.9375rem; /* 15px */
  
  /* Slightly increase line height for better reading comfort */
  line-height: 1.65;
  
  /* Optimize font weight for screens */
  font-weight: 400;
  
  /* Better letter spacing for Poppins */
  letter-spacing: -0.01em;
}

/* Headings with proper font weights */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
  letter-spacing: -0.015em;
  line-height: 1.35;
}

/* Different weights for heading hierarchy - proper cascading */
h1 {
  font-weight: 700;
}

h2 {
  font-weight: 600;
}

h3 {
  font-weight: 600;
}

h4 {
  font-weight: 500;
}

h5 {
  font-weight: 500;
}

h6 {
  font-weight: 400;
}

/* Code blocks with Monaco */
pre, code, kbd, samp {
  font-family: 'Monaco', 'Menlo', 'Consolas', 'Courier New', monospace !important;
  font-weight: 400;
}

/* Inline code styling */
:not(pre) > code {
  font-size: 0.85rem;
  font-weight: 500;
}

/* Optimize Chinese text rendering if needed */
:lang(zh-CN) {
  font-family: 'Poppins', 'PingFang SC', 'Microsoft YaHei', '微软雅黑', sans-serif;
  letter-spacing: -0.01em;
}

/* Improve sidebar font rendering */
.sidebar {
  font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
  font-weight: 400;
}

/* Better font rendering for navigation */
nav {
  font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
  font-weight: 500;
}

/* Optimize table text */
table {
  font-variant-numeric: tabular-nums;
}

/* Better rendering for documentation content */
.content {
  font-size: 0.9375rem; /* 15px */
  font-weight: 400;
}

/* Strong text should be more prominent */
strong, b {
  font-weight: 600;
}

/* 简洁专业的 LangCrew logo 样式 - 适合开源项目 */
.site-title,
header a[href="/"],
header .sl-flex,
.sl-nav-title {
  font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #1a1a1a !important;
}

/* Optimize font size for different screen sizes */
@media (max-width: 49.9rem) {
  body {
    font-size: 0.875rem; /* 14px on small screens */
  }
}

@media (min-width: 50rem) {
  body {
    font-size: 1rem; /* 16px on medium screens */
  }
}

@media (min-width: 72rem) {
  body {
    font-size: 1.0625rem; /* 17px on large screens */
  }
}