/* Table of Contents Styling */
.index-nav {
  margin-top: 30px;
  width: 100%;
}

.index-nav h3 {
  font-family: "Open Sans", sans-serif;
  font-size: 1.3em;
  color: #2c3e50;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #d0e8f0;
}

.index-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.index-nav li {
  margin-bottom: 8px;
}

.index-nav a {
  color: #007bff;
  text-decoration: none;
  font-size: 0.95em;
  line-height: 1.4;
  display: block;
  padding: 2px 0;
}

.index-nav a:hover {
  text-decoration: underline;
  color: #0056b3;
}

/* Nested list styling */
.index-nav ul ul {
  margin-left: 20px;
  margin-top: 5px;
}

.index-nav ul ul a {
  font-size: 0.9em;
  color: #555;
}

.index-nav ul ul a:hover {
  color: #007bff;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
  .ebook-container {
    flex-direction: column; /* Stack columns on smaller screens */
    margin: 0; /* Remove margin to take full width */
    border-radius: 0; /* Remove border-radius on full-width mobile */
    box-shadow: none; /* Remove shadow on mobile */
  }

  .ebook-sidebar {
    flex: none; /* Remove flex sizing */
    width: 100%; /* Take full width */
    padding: 30px 20px;
    border-right: none; /* Remove right border */
    border-bottom: 1px solid #d0e8f0; /* Add bottom border */
    align-items: center; /* Center align title on smaller screens */
    text-align: center; /* Center align text on smaller screens */
  }

  .index-nav {
    text-align: left; /* Reset text alignment for TOC */
    margin-top: 25px;
  }

  .index-nav h3 {
    text-align: center;
    font-size: 1.2em;
  }
}
/* General Body and Base Styles */
body {
  font-family: "Merriweather", serif; /* Serif for main body text, good for readability */
  line-height: 1.7; /* Standard line height for comfortable reading */
  color: #333; /* Dark gray for text for good contrast */
  background-color: #f9f9f9; /* Off-white background for reduced eye strain */
  margin: 0;
  padding: 0; /* Remove body padding as container will handle it */
  display: flex;
  justify-content: center;
  min-height: 100vh; /* Ensure body takes full viewport height */
  overflow-x: hidden; /* Prevent horizontal scroll on small screens */
}

/* Ebook Container for Two-Column Layout */
.ebook-container {
  display: flex; /* Enable flexbox for side-by-side layout */
  width: 100%;
  max-width: 1200px; /* Max width for the entire ebook container */
  margin: 20px auto; /* Center the container with some margin */
  background-color: #ffffff; /* White background for the entire ebook area */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); /* Subtle shadow for depth */
  border-radius: 8px; /* Slightly rounded corners */
  overflow: hidden; /* Ensure content stays within bounds */
}

/* Left Sidebar Styling */
.ebook-sidebar {
  flex: 0 0 300px; /* Fixed width for sidebar, won't grow/shrink by default */
  background-color: #e0f2f7; /* Light blue background for the sidebar */
  padding: 40px 30px;
  display: flex; /* Use flex to align header content */
  flex-direction: column; /* Stack header elements vertically */
  align-items: flex-start; /* Align header content to the start (left) */
  justify-content: flex-start; /* Align content to the top */
  border-right: 1px solid #d0e8f0; /* Separator line */
}

.ebook-header {
  text-align: left; /* Align header text to the left */
  margin-bottom: 0; /* Remove bottom margin as it's a sidebar */
  padding-bottom: 0; /* Remove padding as it's a sidebar */
  border-bottom: none; /* Remove border */
  width: 100%; /* Take full width of sidebar */
}

.ebook-title {
  font-family: "Open Sans", sans-serif;
  font-size: 2.2em; /* Adjusted size for sidebar */
  color: #2c3e50;
  margin-bottom: 15px; /* More space below title */
  line-height: 1.3;
}

.ebook-author {
  font-size: 1em; /* Slightly smaller for sidebar */
  color: #555;
}

.ebook-author a {
  color: #007bff;
  text-decoration: none;
}

.ebook-author a:hover {
  text-decoration: underline;
}

/* Main Content Area Styling */
.ebook-main-content {
  flex: 1; /* Allows main content to take remaining space */
  padding: 40px 30px;
  overflow-y: auto; /* Enable scrolling for main content if it overflows */
}

/* Section and Term Styling (mostly retained from previous version) */
.intro-section,
.chapter,
.conclusion-section {
  margin-bottom: 40px;
}

.chapter h2,
.intro-section h2,
.conclusion-section h2 {
  font-family: "Open Sans", sans-serif;
  font-size: 2.2em;
  color: #34495e;
  margin-top: 50px;
  margin-bottom: 25px;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 10px;
}

.chapter-intro {
  font-style: italic;
  color: #666;
  margin-bottom: 30px;
}

.term-definition {
  margin-bottom: 30px;
  padding-left: 15px;
  border-left: 4px solid #a7d9f7;
}

.term-definition h3 {
  font-family: "Open Sans", sans-serif;
  font-size: 1.6em;
  color: #2c3e50;
  margin-top: 0;
  margin-bottom: 15px;
}

.term-definition p {
  margin-bottom: 10px;
}

.term-definition strong {
  color: #000;
}

/* Lists */
ul,
ol {
  margin-left: 25px;
  margin-bottom: 15px;
  list-style-type: disc;
}

ol {
  list-style-type: decimal;
}

ul li,
ol li {
  margin-bottom: 8px;
}

/* Specific notes/highlights */
.note {
  font-style: italic;
  color: #777;
  text-align: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px dashed #eee;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
  .ebook-container {
    flex-direction: column; /* Stack columns on smaller screens */
    margin: 0; /* Remove margin to take full width */
    border-radius: 0; /* Remove border-radius on full-width mobile */
    box-shadow: none; /* Remove shadow on mobile */
  }

  .ebook-sidebar {
    flex: none; /* Remove flex sizing */
    width: 100%; /* Take full width */
    padding: 30px 20px;
    border-right: none; /* Remove right border */
    border-bottom: 1px solid #d0e8f0; /* Add bottom border */
    align-items: center; /* Center align title on smaller screens */
    text-align: center; /* Center align text on smaller screens */
  }

  .ebook-title {
    font-size: 2.5em; /* Make title larger when it's the main focus */
  }

  .ebook-author {
    font-size: 1.1em;
  }

  .ebook-main-content {
    padding: 30px 20px;
  }

  .chapter h2,
  .intro-section h2,
  .conclusion-section h2 {
    font-size: 2em;
    margin-top: 30px;
    margin-bottom: 20px;
  }

  .term-definition h3 {
    font-size: 1.5em;
  }
}

@media (max-width: 768px) {
  body {
    padding: 0;
  }

  .ebook-sidebar {
    padding: 25px 15px;
  }

  .ebook-title {
    font-size: 2em;
  }

  .ebook-main-content {
    padding: 25px 15px;
  }

  .chapter h2,
  .intro-section h2,
  .conclusion-section h2 {
    font-size: 1.8em;
  }

  .term-definition h3 {
    font-size: 1.3em;
  }
}

@media (max-width: 480px) {
  .ebook-title {
    font-size: 1.6em;
  }

  .chapter h2,
  .intro-section h2,
  .conclusion-section h2 {
    font-size: 1.5em;
  }

  .term-definition h3 {
    font-size: 1.1em;
  }

  body,
  p,
  li {
    font-size: 0.95em; /* Slightly smaller base font for very small screens */
  }
}
