/* Global site CSS overrides for article spacing */
/* Scoped to #post-body so only article content is affected */
#post-body :is(h1,h2,h3,h4,h5,h6) {
  /* give headings a modest bottom gap */
  margin-bottom: 0.75rem; /* 12px */
}

/* Prevent paragraphs from adding extra top margin when they follow a heading */
#post-body :is(h1,h2,h3,h4,h5,h6) + p {
  margin-top: 0; 
}

/* Slightly larger spacing after h1/h2 for hierarchy */
#post-body h1 { margin-bottom: 1rem; margin-top: 1rem; }
#post-body h2 { margin-bottom: 0.85rem; margin-top: 0.85rem;}
#post-body h3 { margin-bottom: 0.75rem; margin-top: 0.75rem;}

/* Optional: ensure lists and blockquotes following headings also look good */
#post-body :is(h1,h2,h3,h4,h5,h6) + ul,
#post-body :is(h1,h2,h3,h4,h5,h6) + ol,
#post-body :is(h1,h2,h3,h4,h5,h6) + blockquote {
  margin-top: 0.5rem;
}

/* Keep this file small and specific to article layout spacing */

/* Ensure lists inside article content render with markers and readable spacing.
   Tailwind's preflight (or missing typography plugin) can remove default
   list styling; explicitly restore sensible defaults scoped to #post-body. */
#post-body ul,
#post-body ol {
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  padding-left: 1.25rem; /* show marker indentation */
}

#post-body ul {
  list-style-type: disc;
}

#post-body ol {
  list-style-type: decimal;
}

#post-body li {
  margin-top: 0.35rem;
}

/* Make inline links in article content clearly visible and blue to match other pages */
#post-body a {
  color: #2563eb; /* Tailwind blue-600 */
  text-decoration: underline;
  text-underline-offset: 2px;
}

#post-body a:hover {
  color: #1d4ed8; /* blue-700 */
}

#post-body a:visited {
  color: #4c51bf; /* a muted visited color */
}

/* Make markdown hard line breaks visible: treat <br> as a block with vertical spacing
   so single hard-breaks add a small gap and two in a row produce a larger (double) gap. */
#post-body br {
  display: block;
  content: "";
  margin-top: 0.5rem; /* space after a manual line break */
  margin-bottom: 0.0rem;
}

/* Fenced code block styling inside articles */
#post-body pre {
  background: #f3f4f6; /* gray-100 */
  border-radius: 12px;
  padding: 1rem 1rem;
  overflow: auto;
  position: relative;
  box-shadow: 0 1px 0 rgba(15,23,42,0.02) inset;
  margin: 1rem 0;
}

#post-body pre code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, 'Roboto Mono', 'Courier New', monospace;
  font-size: 0.95rem;
  color: #0f172a; /* slate-900 */
  background: transparent;
  padding: 0; /* avoid double padding inside pre */
}

/* Left accent bar for visual highlighting */
#post-body pre::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 6px;
  border-radius: 6px 0 0 6px;
  background: linear-gradient(180deg, #a78bfa, #60a5fa); /* purple to blue gradient */
}

/* Prevent horizontal overflow on small screens caused by long words, unbroken URLs,
   wide images, tables, or code blocks. Scoped to article content to avoid
   interfering with other layouts. */
#post-body {
  /* allow long words and URLs to break and wrap */
  overflow-wrap: anywhere;
  word-break: break-word;
  -webkit-hyphens: auto;
  hyphens: auto;
  -ms-word-break: break-word;
}

/* Ensure images, iframes, and videos do not exceed the article container */
#post-body img,
#post-body video,
#post-body iframe {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Tables: allow horizontal scrolling within the article instead of overflowing the page */
#post-body table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  display: block;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

/* Keep code blocks scrollable but not wider than container */
#post-body pre {
  max-width: 100%;
  box-sizing: border-box;
}

/* Small-screen tweak: slightly reduce prose max-width if using a typography container */
@media (max-width: 640px) {
  #post-body {
    font-size: 1rem;
    line-height: 1.5;
  }
}


