// Typography improvements for better readability
// Maintains brand consistency while enhancing legibility for documentation

// Base typography adjustments - optimized for documentation
:root {
  // Increase base font size for comfortable documentation reading
  --docs-font-size: 16px;
  --docs-small-font: 14px;
  --docs-large-font: 18px;
  
  // Improve line height for documentation
  --docs-line-height: 1.7;
  --docs-heading-line-height: 1.3;
  
  // Enhanced spacing
  --docs-paragraph-margin: 1.35rem;
  --docs-list-spacing: 0.45rem;
}

// Body text improvements - more subtle
body {
  // Improve font rendering only
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

// Main content area adjustments
.docs-content,
.content {
  // Better paragraph spacing - removed max-width constraint
  p {
    margin-bottom: var(--docs-paragraph-margin);
    font-size: var(--docs-font-size);
    line-height: var(--docs-line-height);
  
  }
  
  // List improvements
  ul, ol {
    margin-bottom: var(--docs-paragraph-margin);
    
    li {
      margin-bottom: var(--docs-list-spacing);
      line-height: var(--docs-line-height);
      font-size: var(--docs-font-size);
      
      // Nested lists
      ul, ol {
        margin-top: var(--docs-list-spacing);
        margin-bottom: var(--docs-list-spacing);
      }
    }
  }
  
  // Code blocks readability
  pre {
    font-size: var(--docs-small-font);
    line-height: 1.5;
    border-radius: 8px;
    
    code {
      font-size: inherit;
      font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    }
  }
  
  // Inline code
  code:not(pre code) {
    font-size: 0.9em;
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-weight: 500;
    background: var(--gray-200);
    color: var(--text-danger);
  }
}

// Heading improvements
h1, h2, h3, h4, h5, h6 {
  line-height: var(--docs-heading-line-height);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-top: 2rem;
  margin-bottom: 1rem;
  
  // Better heading hierarchy
  + p {
    margin-top: 0.75rem;
  }
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-top: 0;
  
  @media (max-width: 768px) {
    font-size: 1.875rem;
  }
}

h2 {
  font-size: 1.625rem;
  margin-top: 2.5rem;
  padding-top: 0.5rem;
  
  @media (max-width: 768px) {
    font-size: 1.5rem;
  }
}

h3 {
  font-size: 1.5rem;
  margin-top: 2rem;
  
  @media (max-width: 768px) {
    font-size: 1.25rem;
  }
}

h4 {
  font-size: 1.25rem;
  
  @media (max-width: 768px) {
    font-size: 1.125rem;
  }
}

// Navigation and sidebar text - keeping original spacing
.docs-sidebar,
.leftnav,
#sidebar-default {
  // Remove font size override to keep original
  
  .nav-link,
  a {
    // Keep original padding and line-height
    font-weight: 450;
    
    &:hover {
      font-weight: 500;
    }
    
    &.active {
      font-weight: 600;
    }
  }
}

// Table improvements
table {
  font-size: var(--docs-small-font);
  line-height: 1.6;
  
  th {
    font-weight: 600;
    padding: 0.75rem 1rem;
  }
  
  td {
    padding: 0.75rem 1rem;
  }
}

// Blockquote styling
blockquote {
  font-size: var(--docs-font-size);
  line-height: var(--docs-line-height);
  font-style: italic;
  border-left: 4px solid var(--primary);
  padding-left: 1.5rem;
  margin: 1.5rem 0;
  color: var(--muted-text-color);
  
  p {
    margin-bottom: 0.75rem;
    
    &:last-child {
      margin-bottom: 0;
    }
  }
}

// Alert and notice improvements
.alert,
.notice {
  font-size: var(--docs-font-size);
  line-height: var(--docs-line-height);
  padding: 1.25rem;
  
  p {
    margin-bottom: 0.75rem;
    
    &:last-child {
      margin-bottom: 0;
    }
  }
}

// Better link styling for readability
a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
  transition: all 0.2s ease;
  
  &:hover {
    text-decoration-thickness: 2px;
  }
  
  // Exception for navigation links
  &.nav-link,
  &.btn {
    text-decoration: none;
  }
}

// Improve contrast for muted text
.text-muted,
.muted {
  opacity: 0.85;
  
  @media (prefers-color-scheme: dark) {
    opacity: 0.75;
  }
}

// Better focus styles for accessibility
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 2px;
}

// Enhanced print styles
@media print {
  body {
    font-size: 12pt;
    line-height: 1.5;
  }
  
  h1 { font-size: 20pt; }
  h2 { font-size: 18pt; }
  h3 { font-size: 16pt; }
  h4 { font-size: 14pt; }
  
  p, li {
    font-size: 12pt;
    line-height: 1.5;
  }
}