/* MissionOS content typography — the ".md-body" system.
 *
 * This is the SAME typography that renders MissionOS Doc Hub articles
 * (h1–h6, paragraphs, lists, links, blockquotes, tables, figures). It
 * used to live only in css/doc-hub.css, which is enqueued ONLY on Doc
 * Hub taxonomy pages — so a normal WordPress post or page, edited with
 * the same H1–H6 / list / link blocks, rendered with plain unstyled
 * browser defaults instead.
 *
 * This file is loaded globally (see missionos_enqueue_assets() in
 * functions.php) so ANY template can opt in to the exact same look by
 * simply wrapping its the_content() output in a "md-body" div — no
 * dependency on which page type you're on.
 *
 * doc-hub.css still exists for everything Doc-Hub-specific (sidebar,
 * TOC, tags, related topics, print layout, etc.) and continues to load
 * only on Doc Hub pages, on top of this file.
 */

.md-body, .md-body * { word-wrap: break-word; overflow-wrap: break-word; }

.md-body figcaption {
  font-size: 14px;
  color: #475569;
  font-weight: 600;
}
.dark .md-body figcaption { color: #94a3b8; }

.md-body img {
  margin-bottom: 4px;
  margin-top: 15px;
  border-radius: 10px;
}

.md-body h1 {
  font-family: var(--missionos-font-family, Inter, sans-serif);
  font-weight: 900;
  font-size: 2rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: #0b1124;
  margin: 1rem 0 1.35rem;
  scroll-margin-top: 8rem;
}
.dark .md-body h1 { color: #f8fafc; }

.md-body h2 { font-family: var(--missionos-font-family, Inter, sans-serif); font-weight: 800; font-size: 1.3125rem; margin-top: 2.25rem; margin-bottom: 0.9rem; scroll-margin-top: 8rem; color: #0b1124; }
.dark .md-body h2 { color: #f8fafc; }
.md-body h2:first-child { margin-top: 0; }

.md-body h3 { font-family: var(--missionos-font-family, Inter, sans-serif); font-weight: 700; font-size: 1.15rem; margin-top: 1.75rem; margin-bottom: 0.6rem; scroll-margin-top: 8rem; color: #0b1124; }
.dark .md-body h3 { color: #f8fafc; }

.md-body h4 {
  font-family: var(--missionos-font-family, Inter, sans-serif);
  font-weight: 700;
  font-size: 1.05rem;
  margin-top: 1.5rem;
  margin-bottom: 0.55rem;
  scroll-margin-top: 8rem;
  color: #0b1124;
}
.dark .md-body h4 { color: #f8fafc; }

.md-body h5 {
  font-family: var(--missionos-font-family, Inter, sans-serif);
  font-weight: 700;
  font-size: 0.95rem;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  scroll-margin-top: 8rem;
  color: #0b1124;
}
.dark .md-body h5 { color: #f8fafc; }

.md-body h6 {
  font-family: var(--missionos-font-family, Inter, sans-serif);
  font-weight: 700;
  font-size: 0.875rem;
  margin-top: 1rem;
  margin-bottom: 0.45rem;
  scroll-margin-top: 8rem;
  color: #0b1124;
}
.dark .md-body h6 { color: #f8fafc; }

.md-body p { color: #475569; line-height: 1.75; margin-bottom: 1rem; }
.dark .md-body p { color: #cbd5e1; }
.md-body > p:first-of-type { font-size: 1.05rem; color: #334155; }
.dark .md-body > p:first-of-type { color: #e2e8f0; }

.md-body ul, .md-body ol { margin-bottom: 1.1rem; padding-left: 1.4rem; color: #475569; }
.dark .md-body ul, .dark .md-body ol { color: #cbd5e1; }
.md-body ul { list-style: disc; }
.md-body ol { list-style: decimal; }
.md-body li { margin-bottom: 0.4rem; line-height: 1.7; }
.md-body li > ul, .md-body li > ol { margin-top: 0.4rem; margin-bottom: 0; }

.md-body strong { color: #0b1124; font-weight: 700; }
.dark .md-body strong { color: #f1f5f9; }
.md-body em { color: inherit; }

.md-body a { color: #fd5902; font-weight: 500; text-decoration: none; }
.dark .md-body a { color: #ff8a3d; }


.md-body blockquote { background: #eef2ff; border-left: 3px solid #fd5902; border-radius: 0 12px 12px 0; padding: .5rem 1.25rem; margin: 1.25rem 0; color: #3730a3; font-size: 0.94rem; line-height: 1.5; }
.dark .md-body blockquote { background: #1e293b; border-left-color: #ff8a3d; color: #c7d2fe; }
.md-body blockquote p { margin-bottom: 2px; }
.md-body blockquote p:last-child { margin-bottom: 0; }

.md-body code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85em; background: #eef2ff; color: #4338ca; padding: 0.1em 0.45em; border-radius: 6px; }
.dark .md-body code { background: #283548; color: #a5b4fc; }

/* ==========================================================================
   Tables — both the legacy .md-table-wrap wrapper (kept for any older
   content that still uses it) and Gutenberg's own <figure
   class="wp-block-table"><table>…</table></figure> markup, which is
   what the block editor actually outputs.
   ========================================================================== */
.md-table-wrap,
.md-body .wp-block-table {
  overflow-x: auto;
  margin: 1.25rem 0;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}
.dark .md-table-wrap,
.dark .md-body .wp-block-table { border-color: #334155; }
.md-body table,
.md-body .wp-block-table table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 0;
}
.md-body th,
.md-body .wp-block-table th {
  text-align: left;
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}
.dark .md-body th,
.dark .md-body .wp-block-table th { background: #283548; color: #cbd5e1; border-color: #334155; }
.md-body td,
.md-body .wp-block-table td {
  padding: 0.65rem 1rem;
  border: 1px solid #f1f5f9;
  color: #475569;
  vertical-align: top;
}
.dark .md-body td,
.dark .md-body .wp-block-table td { border-color: #1e293b; color: #cbd5e1; }
.md-body tr:last-child td,
.md-body .wp-block-table tr:last-child td { border-bottom: none; }
.md-body .wp-block-table caption {
  caption-side: bottom;
  padding: 0.6rem 1rem;
  font-size: 0.82rem;
  color: #94a3b8;
  text-align: left;
}
.md-body .wp-block-table.is-style-stripes tbody tr:nth-child(odd) { background: #f8fafc; }
.dark .md-body .wp-block-table.is-style-stripes tbody tr:nth-child(odd) { background: #162032; }
.md-body .wp-block-table.is-style-stripes th,
.md-body .wp-block-table.is-style-stripes td { border-bottom: none; }
.md-body .wp-block-table .has-text-align-left { text-align: left; }
.md-body .wp-block-table .has-text-align-center { text-align: center; }
.md-body .wp-block-table .has-text-align-right { text-align: right; }

/* Figures (image + caption block) */
.md-figure { margin: 1.5rem 0; border: 1px solid #e2e8f0; border-radius: 14px; overflow: hidden; background: #f8fafc; }
.dark .md-figure { border-color: #334155; background: #162032; }
.md-figure img { width: 100%; display: block; margin: 0; border-radius: 0; }
.md-figure figcaption { padding: 0.65rem 1rem; font-size: 0.82rem; color: #94a3b8; border-top: 1px solid #e2e8f0; }
.dark .md-figure figcaption { border-color: #334155; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
