/* Fix excessive spacing between markdown sections */
.content h1:not(:first-child),
.content h2:not(:first-child),
.content h3:not(:first-child),
.content h4:not(:first-child),
.content h5:not(:first-child),
.content h6:not(:first-child) {
  margin-top: 1.5em !important; /* Further reduced from 2em to 1.5em */
}

/* Ensure reasonable spacing for consecutive headings */
.content h1+h2:not(:first-child),
.content h2+h3:not(:first-child),
.content h3+h4:not(:first-child),
.content h4+h5:not(:first-child),
.content h5+h6:not(:first-child) {
  margin-top: 1em !important; /* Further reduced from 1.5em to 1em */
}

/* Fix code block wrapping - targeted fix for ```text``` blocks */
.content pre code {
  white-space: pre-wrap; /* Allow wrapping in code blocks while preserving formatting */
  word-break: break-word; /* Break long words if necessary */
  overflow-wrap: break-word; /* Modern word wrapping */
}

/* Reduce paragraph spacing */
.content p:not(:last-child) {
  margin-bottom: 0.75em !important; /* Reduced from 1em/1.5em to 0.75em */
}

/* Reduce list spacing */
.content ul:not(:last-child),
.content ol:not(:last-child) {
  margin-bottom: 0.75em !important; /* Reduced from 1em/1.5em to 0.75em */
}

/* Reduce spacing between list items */
.content li+li {
  margin-top: 0.1em !important; /* Reduced from 0.25em to 0.1em */
}

/* Reduce nested list spacing */
.content ul ul,
.content ol ol,
.content ul ol,
.content ol ul {
  margin-top: 0.25em !important; /* Add some small spacing for nested lists */
  margin-bottom: 0.25em !important;
}

/* Fix indentation - align body content with title */
.content {
  padding-left: 0 !important; /* Remove any default left padding */
  margin-left: 0 !important; /* Remove any default left margin */
}

/* Ensure headers also align properly */
.content h1,
.content h2,
.content h3,
.content h4,
.content h5,
.content h6 {
  margin-left: 0 !important;
  padding-left: 0 !important;
}

/* Make sure paragraphs and lists also align */
.content p,
.content ul,
.content ol,
.content blockquote,
.content pre,
.content table {
  margin-left: 0 !important;
  padding-left: 0 !important;
}

/* But preserve list item indentation */
.content ul,
.content ol {
  padding-left: 1.5em !important; /* Standard list indentation */
}

/* Nested lists should have additional indentation */
.content ul ul,
.content ol ol,
.content ul ol,
.content ol ul {
  padding-left: 1.5em !important; /* Additional indentation for nested lists */
}

/* Reduce spacing between index page entries */
.section article:not(:last-child) {
  margin-bottom: 1.5rem !important; /* Reduced from default spacing */
}

/* Match scratchpad timestamp spacing exactly */
.section article .subtitle.date {
  margin-bottom: 20px !important; /* Match scratchpad's .subtitle:not(:last-child) spacing */
  line-height: 1.5em !important; /* Match scratchpad's .subtitle.date line-height */
}

.section article .title {
  margin-bottom: 0.5rem !important; /* Reduce space between title and content */
}

.section article .content {
  margin-bottom: 0.5rem !important; /* Reduce space after content preview */
}

/* Reduce spacing around tags */
.section article .subtitle.tags {
  margin-bottom: 0.25rem !important;
}

/* Tighter spacing for article containers only, preserve header spacing */
.section:not(:first-child) .container {
  padding-top: 1rem !important;
  padding-bottom: 1rem !important;
}

/* Fix disclaimer blockquote spacing */
.content blockquote {
  margin-left: 1.5rem !important; /* Add proper left margin for disclaimers */
  margin-right: 1.5rem !important; /* Add proper right margin for disclaimers */
  padding-left: 1rem !important; /* Add padding inside the blockquote */
  padding-right: 1rem !important; /* Add padding inside the blockquote */
  margin-top: 1rem !important; /* Add top margin */
  margin-bottom: 1rem !important; /* Add bottom margin */
}