/* Blog Article Typography and Styling */

/* Base article container */
article {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.75;
  color: #374151;
  max-width: 65ch;
  margin: 0 auto;
}

/* Headings */
article h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: #111827;
  line-height: 1.2;
  margin-top: 0;
  margin-bottom: 2rem;
  letter-spacing: -0.025em;
}

article h2 {
  font-size: 2rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.3;
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid #f97316;
  letter-spacing: -0.025em;
}

article h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #ea580c;
  line-height: 1.4;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

article h4 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #374151;
  line-height: 1.4;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

article h5 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #374151;
  line-height: 1.4;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

article h6 {
  font-size: 1rem;
  font-weight: 600;
  color: #6b7280;
  line-height: 1.4;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Paragraphs */
article p {
  font-size: 1.125rem;
  line-height: 1.75;
  margin-bottom: 1.5rem;
  color: #374151;
  text-align: justify;
  hyphens: auto;
}

/* First paragraph after heading */
article h1 + p,
article h2 + p,
article h3 + p {
  margin-top: 0.5rem;
}

/* Lead paragraph (first paragraph) */
article > p:first-of-type {
  font-size: 1.25rem;
  font-weight: 400;
  color: #111827;
  line-height: 1.6;
}

/* Strong and bold text */
article strong,
article b {
  font-weight: 700;
  color: #111827;
}

/* Emphasis and italic text */
article em,
article i {
  font-style: italic;
  color: #374151;
}

/* Combined strong and emphasis */
article strong em,
article em strong {
  font-weight: 700;
  font-style: italic;
  color: #111827;
}

/* Links */
article a {
  color: #f97316;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: #fed7aa;
  text-underline-offset: 0.125em;
  transition: all 0.2s ease;
}

article a:hover {
  color: #ea580c;
  text-decoration-color: #f97316;
}

/* Lists */
article ul,
article ol {
  margin: 1.5rem 0;
  padding-left: 2rem;
}

article ul li,
article ol li {
  margin-bottom: 0.75rem;
  line-height: 1.75;
}

article ul {
  list-style-type: none;
}

article ul li::before {
  content: "•";
  color: #f97316;
  font-weight: bold;
  font-size: 1.2em;
  position: absolute;
  margin-left: -1.5rem;
}

article ol {
  counter-reset: list-counter;
}

article ol li {
  counter-increment: list-counter;
  position: relative;
}

article ol li::before {
  content: counter(list-counter) ".";
  color: #f97316;
  font-weight: bold;
  position: absolute;
  margin-left: -2rem;
  width: 1.5rem;
  text-align: right;
}

/* Nested lists */
article ul ul,
article ol ol,
article ul ol,
article ol ul {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Blockquotes */
article blockquote {
  position: relative;
  margin: 2rem 0;
  padding: 1.5rem 2rem;
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border-left: 4px solid #f97316;
  border-radius: 0 0.75rem 0.75rem 0;
  font-style: italic;
  color: #6b7280;
  font-size: 1.125rem;
  line-height: 1.6;
}

article blockquote::before {
  content: """;
  position: absolute;
  top: -0.5rem;
  left: 0.5rem;
  font-size: 4rem;
  color: #f97316;
  opacity: 0.3;
  font-family: Georgia, serif;
}

article blockquote p {
  margin: 0;
  text-align: left;
}

article blockquote cite {
  display: block;
  margin-top: 1rem;
  font-style: normal;
  font-weight: 600;
  color: #374151;
  text-align: right;
}

/* Code */
article code {
  background: #f3f4f6;
  color: #db2777;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Consolas', monospace;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid #e5e7eb;
}

article pre {
  background: #1f2937;
  color: #f9fafb;
  padding: 1.5rem;
  border-radius: 0.75rem;
  overflow-x: auto;
  margin: 2rem 0;
  border: 1px solid #374151;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

article pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border: none;
  font-size: 0.875rem;
}

/* Images */
article img {
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
  margin: 2rem auto;
  display: block;
  box-shadow:0 0px 15px 0px rgba(0, 0, 0, 0.1);
  padding: 2rem;
}

/* Figure and figcaption */
article figure {
  margin: 2rem 0;
  text-align: center;
}

article figcaption {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: #6b7280;
  font-style: italic;
  text-align: center;
}

/* Tables */
article table {
  max-width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  background: white;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

article th,
article td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

article th {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: white;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.875rem;
}

article tbody tr:hover {
  background: #f9fafb;
}

/* Horizontal rule */
article hr {
  border: none;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, #f97316 50%, transparent 100%);
  margin: 3rem 0;
  border-radius: 1.5px;
}

/* Mark/highlight */
article mark {
  background: #fef3c7;
  color: #92400e;
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
}

/* Small text */
article small {
  font-size: 0.875rem;
  color: #6b7280;
}

/* Subscript and superscript */
article sub,
article sup {
  font-size: 0.75rem;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

article sup {
  top: -0.5em;
}

article sub {
  bottom: -0.25em;
}

/* Responsive design */
@media (max-width: 768px) {
  article {
    font-size: 1rem;
    line-height: 1.6;
  }
  
  article h1 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
  }
  
  article h2 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
  }
  
  article h3 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
  }
  
  article p {
    font-size: 1rem;
    text-align: left;
    margin-bottom: 1.25rem;
  }
  
  article > p:first-of-type {
    font-size: 1.125rem;
  }
  
  article blockquote {
    margin: 1.5rem -1rem;
    padding: 1rem 1.5rem;
  }
  
  article pre {
    margin: 1.5rem -1rem;
    border-radius: 0;
    padding: 1rem;
  }
  
  article ul,
  article ol {
    padding-left: 1.5rem;
  }
}

/* Print styles */
@media print {
  article {
    color: black;
    background: white;
  }
  
  article a {
    color: black;
    text-decoration: underline;
  }
  
  article blockquote {
    background: white;
    border: 1px solid black;
  }
  
  article pre {
    background: #f5f5f5;
    color: black;
    border: 1px solid black;
  }
}
