/* Responsive Typography - Mobile First Approach */

/* Base Typography (Mobile: 320px - 767px) */
html {
  font-size: 14px;
  font-family: 'Montserrat', sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Fluid Typography using clamp() for smooth scaling */
h1 {
  font-size: clamp(1.75rem, 5vw, 3rem);
  line-height: 1.2;
  margin: 1rem 0;
  font-weight: 700;
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  line-height: 1.3;
  margin: 0.875rem 0;
  font-weight: 600;
}

h3 {
  font-size: clamp(1.125rem, 3vw, 1.5rem);
  line-height: 1.4;
  margin: 0.75rem 0;
  font-weight: 600;
}

h4 {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  line-height: 1.4;
  margin: 0.625rem 0;
  font-weight: 600;
}

h5 {
  font-size: clamp(0.875rem, 2vw, 1.125rem);
  line-height: 1.5;
  margin: 0.5rem 0;
  font-weight: 600;
}

h6 {
  font-size: clamp(0.75rem, 1.5vw, 1rem);
  line-height: 1.5;
  margin: 0.5rem 0;
  font-weight: 600;
}

/* Paragraph text */
p {
  font-size: clamp(1rem, 2vw, 1.125rem);
  line-height: 1.7;
  margin: 1rem 0;
}

/* List items */
li {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  line-height: 1.6;
  margin: 0.5rem 0;
}

/* Small text */
small {
  font-size: clamp(0.75rem, 1.5vw, 0.875rem);
  line-height: 1.5;
}

/* Blockquotes */
blockquote {
  font-size: clamp(1rem, 2vw, 1.125rem);
  line-height: 1.7;
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  border-left: 4px solid #0066cc;
  background: #f8f9fa;
  font-style: italic;
}

/* Code blocks */
code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9em;
  background: #f4f4f4;
  padding: 0.2em 0.4em;
  border-radius: 3px;
}

pre {
  font-family: 'Courier New', Courier, monospace;
  font-size: clamp(0.75rem, 1.5vw, 0.875rem);
  line-height: 1.5;
  background: #282c34;
  color: #abb2bf;
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  margin: 1rem 0;
}

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

/* Links */
a {
  color: black;
  text-decoration: none;
  transition: all 0.2s ease-in-out;
}

a:hover,
a:focus {
  color: DarkOrange;
  outline: 2px solid transparent;
}

a:focus-visible {
  outline: 2px solid DarkOrange;
  outline-offset: 2px;
}

/* Strong and emphasis */
strong, b {
  font-weight: 700;
}

em, i {
  font-style: italic;
}

/* Horizontal rule */
hr {
  border: none;
  border-top: 2px solid #ddd;
  margin: 2rem 0;
}

/* Small Mobile (320px - 479px) */
@media only screen and (max-width: 479px) {
  html {
    font-size: 13px;
  }
  
  p {
    font-size: 1rem;
  }
  
  li {
    font-size: 0.95rem;
  }
}

/* Mobile (480px - 767px) */
@media only screen and (min-width: 480px) and (max-width: 767px) {
  html {
    font-size: 14px;
  }
}

/* Tablet (768px - 1023px) */
@media only screen and (min-width: 768px) and (max-width: 1023px) {
  html {
    font-size: 15px;
  }
}

/* Desktop (1024px - 1439px) */
@media only screen and (min-width: 1024px) and (max-width: 1439px) {
  html {
    font-size: 16px;
  }
}

/* Large Desktop (1440px+) */
@media only screen and (min-width: 1440px) {
  html {
    font-size: 16px;
  }
  
  /* Prevent text from getting too large on very wide screens */
  .container {
    max-width: 1400px;
    margin: 0 auto;
  }
}

/* Print styles */
@media print {
  html {
    font-size: 12pt;
  }
  
  h1 {
    font-size: 24pt;
  }
  
  h2 {
    font-size: 18pt;
  }
  
  h3 {
    font-size: 14pt;
  }
  
  p, li {
    font-size: 12pt;
  }
  
  a {
    color: black;
    text-decoration: underline;
  }
  
  a[href]:after {
    content: " (" attr(href) ")";
    font-size: 10pt;
  }
}

/* Accessibility - Respect user preferences */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  a {
    text-decoration: underline;
  }
  
  a:hover,
  a:focus {
    text-decoration: none;
    background: yellow;
    color: black;
  }
}
