/* Base Styles */
body {
    margin: 1.5% 5%;  /* Reduced vertical margin */
    text-align: justify;
    font-size: 1em;
    line-height: 1.6;  /* Better readability */
    max-width: 90%;  /* Prevent overly long lines */
    font-family: "Georgia", serif;  /* More book-like font */
  }
  
  /* Headings Hierarchy */
  h1 {
    font-size: 2.2em;
    text-align: center;
    margin: 2em 0 1em;
    line-height: 1.2;
    font-weight: bold;
    border-bottom: 1px solid #ccc;  /* Decorative element */
    padding-bottom: 0.5em;
  }
  
  h2 {
    font-size: 1.8em;
    margin: 2em 0 1em;
    padding-bottom: 0.3em;
    border-bottom: 1px solid #eee;
  }
  
  h3 { font-size: 1.5em; margin: 1.8em 0 0.8em; }
  h4 { font-size: 1.3em; margin: 1.5em 0 0.6em; }
  h5 { font-size: 1.1em; margin: 1.2em 0 0.4em; }
  h6 { font-size: 1em; margin: 1em 0 0.2em; }
  
  /* Code Blocks */
  code, pre {
    font-family: "Fira Code", "Courier New", monospace;
    background: #f8f8f8;
    border-radius: 3px;
    padding: 0.5em !important;  /* Reduced padding */
    overflow-x: auto;  /* Horizontal scroll for long code */
  }
  
  pre {
    margin: 1.5em 0;
    border-left: 4px solid #6ce26c;
  }
  
  /* Special Text Elements */
  blockquote {
    margin: 1.5em 0;
    padding: 0.5em 1.5em;
    background: #f8f8f8;
    border-left: 4px solid #ccc;
  }
  
  a {
    color: #2a6496;
    text-decoration: none;
  }
  
  a:hover {
    text-decoration: underline;
  }
  
  /* Table of Contents */
  nav#toc ol {
    padding: 0;
    margin: 2em 0;
  }
  
  nav#toc li {
    list-style-type: none;
    margin: 0.8em 0;
    padding: 0.3em 1em;
    border-left: 3px solid #eee;
    transition: all 0.2s ease;
  }
  
  nav#toc li:hover {
    border-left-color: #6ce26c;
    background: #f8f8f8;
  }
  
  /* Paragraph and Spacing */
  p {
    margin-bottom: 1.2em;
    hyphens: auto;  /* Better text justification */
  }
  
  /* Responsive Images */
  img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1em auto;
  }
  
  /* Title Page */
  h1.title {
    font-size: 2.8em;
    margin: 3em 0 0.5em;
    border: none;
  }
  
  h2.author {
    font-size: 1.4em;
    text-align: center;
    margin: 0 0 2em;
    color: #666;
    font-weight: normal;
  }
  
  h3.date {
    text-align: center;
    color: #999;
    margin-bottom: 4em;
  }
  
  /* Footnotes */
  .footnotes {
    font-size: 0.9em;
    color: #666;
    margin-top: 4em;
    border-top: 1px solid #eee;
    padding-top: 1em;
  }
  
  /* Mobile Optimization */
  @media (max-width: 600px) {
    body {
      margin: 3%;
      max-width: 94%;
      font-size: 0.95em;
    }
    
    h1 { font-size: 1.8em; }
    pre, code { font-size: 0.9em; }
  }