/* Main container */
main {
  margin: 70px auto;
  max-width: 800px;
  padding: 40px 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui,
    sans-serif;
  font-size: 18px;
  line-height: 1.7;
  color: var(--light);
  background-color: var(--background);
}

/* Post meta */
.post-meta {
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(75, 85, 99, 0.3);
}

.post-date {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui,
    sans-serif;
  font-size: 0.9rem;
  color: #9ca3af;
  font-weight: 500;
}

/* Headings */
main h1,
main h2,
main h3,
main h4,
main h5,
main h6 {
  color: var(--light);
  margin-bottom: 24px;
  margin-top: 40px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui,
    sans-serif;
  font-weight: 600;
  letter-spacing: -0.025em;
}

main h1:first-child,
main h2:first-child,
main h3:first-child {
  margin-top: 0;
}

main h1 {
  font-size: 2.5rem;
  line-height: 1.2;
  margin-bottom: 32px;
}
main h2 {
  font-size: 2rem;
  line-height: 1.3;
}
main h3 {
  font-size: 1.6rem;
  line-height: 1.4;
}
main h4 {
  font-size: 1.3rem;
  line-height: 1.4;
}
main h5 {
  font-size: 1.1rem;
  line-height: 1.5;
}
main h6 {
  font-size: 1rem;
  line-height: 1.5;
}
main a {
  color: #60a5fa;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}
main a:visited {
  color: #a78bfa;
}
main a:hover {
  color: #93c5fd;
  text-decoration-thickness: 2px;
}
main a:focus,
main a:active {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Paragraphs and Text */
main p,
main ul li,
main ol li {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui,
    sans-serif;
  font-weight: 400;
  font-size: 1rem;
  color: #e5e7eb;
  line-height: 1.7;
  margin-bottom: 20px;
}
main p {
  text-align: left;
  max-width: 100%;
}

/* Improved list styling */
main ul,
main ol {
  margin: 0 0 24px 0;
  padding-left: 24px;
}
main ul li,
main ol li {
  margin-bottom: 8px;
  padding-left: 8px;
}
main ul li::marker {
  color: #9ca3af;
  font-size: 1rem;
}
main ol li::marker {
  color: #9ca3af;
  font-size: 1rem;
  font-weight: 500;
}

/* Blockquotes */
main blockquote {
  margin: 32px 0;
  padding: 20px 24px;
  background-color: rgba(55, 65, 81, 0.3);
  border-left: 4px solid #60a5fa;
  border-radius: 0 8px 8px 0;
  color: #d1d5db;
  font-style: italic;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui,
    sans-serif;
  font-size: 1.1rem;
  line-height: 1.6;
}

/* Code */
main code {
  background-color: rgba(31, 41, 55, 0.8);
  color: #fbbf24;
  padding: 3px 6px;
  border-radius: 4px;
  font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas,
    "Courier New", monospace;
  font-size: 0.9rem;
  border: 1px solid rgba(75, 85, 99, 0.5);
}
main pre {
  background-color: rgba(17, 24, 39, 0.8);
  color: var(--light);
  padding: 20px;
  border-radius: 8px;
  overflow-x: auto;
  font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas,
    "Courier New", monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  border: 1px solid rgba(75, 85, 99, 0.3);
  margin: 24px 0;
}
main pre code {
  background: none;
  padding: 0;
  border: none;
  color: inherit;
}

/* Tables */
main table {
  width: 100%;
  border-collapse: collapse;
  margin: 32px 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui,
    sans-serif;
  font-size: 0.95rem;
  background-color: rgba(31, 41, 55, 0.3);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
main th,
main td {
  border: 1px solid rgba(75, 85, 99, 0.5);
  padding: 12px 16px;
  text-align: left;
}
main th {
  background-color: rgba(55, 65, 81, 0.6);
  color: var(--light);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}
main td {
  color: #e5e7eb;
  border-bottom: 1px solid rgba(75, 85, 99, 0.3);
}
main tr:last-child td {
  border-bottom: none;
}
main tr:hover td {
  background-color: rgba(55, 65, 81, 0.2);
}

/* Images */
main img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 32px auto;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  max-height: 600px;
  object-fit: cover;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
main img:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
}

/* Image captions support */
main img + em,
main img + i {
  display: block;
  text-align: center;
  font-size: 0.9rem;
  color: #9ca3af;
  margin-top: 8px;
  margin-bottom: 24px;
}

/* Horizontal Rule */
main hr {
  border: none;
  height: 2px;
  background: linear-gradient(to right, transparent, #60a5fa, transparent);
  margin: 48px 0;
  border-radius: 1px;
}

/* Inline Styles for Highlighted Elements */
main strong {
  font-weight: 600;
  color: var(--light);
  text-shadow: 0 0 1px rgba(255, 255, 255, 0.3);
}
main em {
  font-style: italic;
  color: #fbbf24;
}

/* Selection styling */
main *::selection {
  background-color: rgba(96, 165, 250, 0.3);
  color: var(--light);
}

/* Responsive Design */

/* Mobile screens */
@media (max-width: 768px) {
  main {
    font-size: 16px;
    padding: 20px 16px;
    max-width: 100%;
    margin: 50px auto;
  }
  main h1 {
    font-size: 2rem;
    line-height: 1.2;
    margin-top: 0;
    margin-bottom: 24px;
  }
  main h2 {
    font-size: 1.6rem;
    line-height: 1.3;
    margin-top: 32px;
  }
  main h3 {
    font-size: 1.4rem;
    line-height: 1.4;
    margin-top: 28px;
  }
  main h4 {
    font-size: 1.2rem;
    line-height: 1.4;
    margin-top: 24px;
  }
  main h5 {
    font-size: 1.1rem;
    line-height: 1.5;
    margin-top: 20px;
  }
  main h6 {
    font-size: 1rem;
    line-height: 1.5;
    margin-top: 20px;
  }
  main p,
  main ul li,
  main ol li {
    font-size: 16px;
    line-height: 1.6;
  }
  main blockquote {
    padding: 16px 20px;
    margin: 24px 0;
    font-size: 1rem;
  }
  main code {
    font-size: 0.85rem;
  }
  main pre {
    font-size: 0.85rem;
    padding: 16px;
    margin: 20px 0;
  }
  main img {
    margin: 24px auto;
    max-height: 300px;
    border-radius: 8px;
  }
  main table {
    font-size: 0.85rem;
    margin: 24px 0;
  }
  main th,
  main td {
    padding: 8px 12px;
  }
}

/* Tablet screens */
@media (min-width: 769px) and (max-width: 1024px) {
  main {
    font-size: 17px;
    padding: 30px 20px;
    max-width: 700px;
  }
  main h1 {
    font-size: 2.2rem;
  }
  main h2 {
    font-size: 1.8rem;
  }
  main h3 {
    font-size: 1.5rem;
  }
  main img {
    max-height: 400px;
  }
}

/* Large screens */
@media (min-width: 1025px) {
  main {
    font-size: 18px;
    padding: 40px 20px;
    max-width: 800px;
  }
  main h1 {
    font-size: 2.5rem;
  }
  main h2 {
    font-size: 2rem;
  }
  main h3 {
    font-size: 1.6rem;
  }
  main img {
    max-height: 600px;
  }
}
