/* 
  ========================================================================
  PEACE WORLD - MARKDOWN-RENDERED CONTENT (markdown.css)
  ========================================================================
  Styles for HTML produced by util/markdown.js and shown to visitors.
  Everything is scoped under the .md-content class, which is added to every
  container that receives rendered Markdown (article/peace reading pages,
  card previews, poem + news modals).

  WHY THIS FILE EXISTS
  Tailwind's Preflight (the CDN reset loaded in includes/head.ejs) sets
  `ul, ol { list-style: none; margin: 0; padding: 0 }`. That silently hid
  the bullet/number markers of every Markdown list — items appeared as
  plain lines. The list rules below restore the markers (and the indent)
  that Preflight strips.

  Colours use the existing --color-* tokens, so dark mode
  (dark-mode.css redefines those tokens under html.dark) is handled for
  free. Logical properties (padding-inline-start, border-inline-start)
  keep indentation/borders correct in both LTR (English) and RTL (Pashto).
  ========================================================================
*/

/* --- Lists: restore the markers Tailwind's preflight removes -------- */
.md-content ul,
.md-content ol {
  margin: 0.75em 0;
  padding-inline-start: 1.6rem;   /* side-aware indent (LTR + RTL) */
}
.md-content ul { list-style: disc outside; }
.md-content ol { list-style: decimal outside; }
.md-content ul ul { list-style: circle outside; }
.md-content ul ul ul { list-style: square outside; }
.md-content ol ol { list-style: lower-alpha outside; }
.md-content li { margin: 0.25em 0; }
.md-content li > ul,
.md-content li > ol { margin: 0.25em 0; }

/* --- Paragraph / block spacing ------------------------------------- */
.md-content p { margin: 0.7em 0; }
.md-content > :first-child { margin-top: 0; }
.md-content > :last-child { margin-bottom: 0; }

/* --- Headings (em-based, so they also scale down in card previews) -- */
.md-content h1,
.md-content h2,
.md-content h3,
.md-content h4,
.md-content h5,
.md-content h6 {
  font-weight: 700;
  line-height: 1.3;
  margin: 1.1em 0 0.5em;
}
.md-content h1 { font-size: 1.45em; }
.md-content h2 { font-size: 1.3em; }
.md-content h3 { font-size: 1.15em; }
.md-content h4,
.md-content h5,
.md-content h6 { font-size: 1em; }

/* --- Blockquote ----------------------------------------------------- */
.md-content blockquote {
  margin: 0.85em 0;
  padding: 0.15em 0 0.15em 1rem;
  border-inline-start: 4px solid var(--color-teal);
  color: var(--color-slate);
  opacity: 0.9;
  font-style: italic;
}

/* --- Links ---------------------------------------------------------- */
.md-content a {
  color: var(--color-teal-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* --- Inline code ---------------------------------------------------- */
.md-content code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875em;
  background-color: var(--color-teal-light);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* --- Fenced code blocks --------------------------------------------- */
.md-content pre {
  margin: 0.9em 0;
  padding: 0.85rem 1rem;
  background-color: #0f172a;   /* dark block reads well in both themes */
  color: #e2e8f0;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.85em;
}
.md-content pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* --- Horizontal rule ------------------------------------------------ */
.md-content hr {
  margin: 1.3em 0;
  border: 0;
  border-top: 1px solid var(--color-sand-dark);
}

/* --- Tables (only if the author ever writes one) -------------------- */
.md-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
}
.md-content th,
.md-content td {
  border: 1px solid var(--color-sand-dark);
  padding: 0.5rem 0.75rem;
  text-align: start;
}
.md-content thead th {
  background-color: var(--color-teal-light);
}
