/* Shared write-up styles for project article pages (GitHub-flavoured, light
   only, to match the always-light site). Scope everything under .md-article so
   it can't leak into the Bootstrap-based site chrome (nav, home grid).
   Used by multiple project detail templates so their prose looks consistent. */

.md-article {
  --fg: #24292f;
  --muted: #57606a;
  --border: #d0d7de;
  --code-bg: #f6f8fa;
  --accent: #0969da;
  --callout: #0969da;

  max-width: 820px;
  margin: 0 auto;
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.6;
  font-size: 17px;
}

.md-article h1 {
  font-size: 2.1rem;
  line-height: 1.2;
  margin: 0 0 1.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--border);
}
.md-article h2 {
  font-size: 1.5rem;
  margin: 2.4rem 0 0.9rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
}
.md-article h3 {
  font-size: 1.2rem;
  margin: 1.8rem 0 0.7rem;
}
.md-article p { margin: 0.9rem 0; color: var(--fg); }
.md-article a { color: var(--accent); text-decoration: none; }
.md-article a:hover { color: var(--accent); text-decoration: underline; }
.md-article ul, .md-article ol { margin: 0.9rem 0; padding-left: 1.6rem; }
.md-article li { margin: 0.3rem 0; }
.md-article li ul, .md-article li ol { margin: 0.3rem 0; }

.md-article code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.88em;
  color: inherit;                 /* neutralise Bootstrap reboot's pink <code> */
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 5px;
}
.md-article pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  line-height: 1.45;
  color: var(--fg);
}
.md-article pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
}

.md-article table {
  border-collapse: collapse;
  margin: 0.5rem auto;
  font-size: 0.92rem;
  color: var(--fg);
}
.md-article th, .md-article td {
  border: 1px solid var(--border);
  padding: 0.4rem 0.75rem;
  text-align: left;
}
.md-article thead th { background: var(--code-bg); }
/* Bootstrap's .row adds negative side margins meant for a grid container;
   neutralise them so a centred table never overflows. */
.md-article .row { margin-left: 0; margin-right: 0; }

/* Bootstrap docs-style callout (not a Bootstrap component — keep our own) */
.md-article .bd-callout {
  padding: 1rem 1.1rem;
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 6px;
  background: var(--code-bg);
}
.md-article .bd-callout-primary { border-left-color: var(--callout); }
.md-article .bd-callout p:first-child { margin-top: 0; font-weight: 600; }

/* Primary call-to-action button (e.g. "try the live demo"). Distinct from
   Bootstrap's default .btn-primary so it uses the article's own accent
   rather than Bootstrap's blue, and gets a hover lift consistent with the
   home page's card hover treatment. */
.md-article .cta-wrap { text-align: center; margin: 1.75rem 0; }
.md-article .cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.85rem;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 1.08rem;
  border-radius: 8px;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(9, 105, 218, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.md-article .cta:hover {
  background: #0757ba;
  color: #fff;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(9, 105, 218, 0.38);
}
.md-article .cta svg {
  width: 18px;
  height: 18px;
  transition: transform 0.15s ease;
}
.md-article .cta:hover svg { transform: translateX(3px); }
.md-article .cta-note {
  display: block;
  margin-top: 0.65rem;
  color: var(--muted);
}

.md-article figure { margin: 1.5rem 0; text-align: center; }
.md-article img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}
.md-article figure img { border: 1px solid var(--border); border-radius: 6px; }
.md-article figure figcaption {
  display: block;
  margin: 0.5rem auto 0;
  max-width: 90%;
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
}
