/* ============================================================
   Be Civic — markdown content styles
   ------------------------------------------------------------
   Styles for HTML produced by markdown-render.js. Inlined
   per-app (bc-specs + bc-roadmap). Depends on brand tokens
   from style.css (--ink, --body, --mute, --bg, --bg-soft,
   --bg-card, --line, --brand-gold, --brand-red, --mono,
   --sans-body, --sans-display).
   ============================================================ */

.md-content {
  font-family: var(--sans-body);
  font-size: 14px;
  line-height: 1.62;
  color: var(--body);
}

/* Headings */
.md-content .md-h {
  font-family: var(--sans-display);
  color: var(--ink);
  margin: 1.5em 0 0.55em;
  scroll-margin-top: 80px;
  position: relative;
  line-height: 1.25;
}
.md-content .md-h-1 { font-size: 26px; font-weight: 700; }
.md-content .md-h-2 {
  font-size: 20px;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
  margin-top: 1.8em;
}
.md-content .md-h-3 { font-size: 16px; font-weight: 700; }
.md-content .md-h-4 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mute);
}
.md-content .md-h-1:first-child,
.md-content .md-h-2:first-child { margin-top: 0; }

/* Anchor link on headings (visible on hover) */
.md-content .anchor-link {
  position: absolute;
  left: -1em;
  width: 1em;
  text-align: center;
  color: var(--mute);
  font-weight: 400;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.md-content .md-h:hover .anchor-link { opacity: 0.5; }
.md-content .anchor-link:hover { opacity: 1 !important; color: var(--brand-gold); }

/* Body text */
.md-content p { margin: 0.75em 0; }
.md-content ul,
.md-content ol { margin: 0.75em 0 0.75em 1.4em; padding: 0; }
.md-content li { margin: 0.3em 0; }
.md-content li > p { margin: 0.4em 0; }

/* Inline code */
.md-content code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--bg-soft);
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid var(--line);
  white-space: nowrap;
}

/* Code blocks */
.md-content pre {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: 12px 14px;
  border-radius: 4px;
  overflow-x: auto;
  margin: 1em 0;
}
.md-content pre code {
  background: transparent;
  border: none;
  padding: 0;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre;
}

/* Blockquotes */
.md-content blockquote {
  border-left: 3px solid var(--brand-gold);
  background: var(--bg-soft);
  padding: 0.5em 1em;
  margin: 1em 0;
  color: var(--body);
}
.md-content blockquote p { margin: 0.3em 0; }

/* Tables */
.md-content table {
  border-collapse: collapse;
  margin: 1em 0;
  font-size: 13px;
  width: auto;
  max-width: 100%;
}
.md-content th,
.md-content td {
  border: 1px solid var(--line);
  padding: 6px 10px;
  text-align: left;
  vertical-align: top;
}
.md-content th {
  background: var(--bg-soft);
  font-weight: 600;
  color: var(--ink);
}

/* Links */
.md-content a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--brand-gold);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
.md-content a:hover { color: var(--brand-red); text-decoration-color: var(--brand-red); }

/* Horizontal rules */
.md-content hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 2em 0;
}

/* Inline DSL tags */
.dsl {
  display: inline-block;
  padding: 0 7px;
  margin: 0 1px;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 0.84em;
  font-weight: 500;
  vertical-align: baseline;
  line-height: 1.5;
  white-space: nowrap;
}
.dsl-skill {
  background: rgba(45, 138, 62, 0.10);
  border-color: rgba(45, 138, 62, 0.4);
  color: #1d6228;
}
.dsl-path {
  background: rgba(250, 224, 66, 0.20);
  border-color: rgba(250, 224, 66, 0.7);
  color: #806600;
}
.dsl-ref {
  background: var(--bg-soft);
  color: var(--mute);
  border-color: var(--line);
}
.dsl-risk {
  background: rgba(237, 41, 57, 0.12);
  border-color: rgba(237, 41, 57, 0.5);
  color: #b21d2c;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dsl-vv {
  background: rgba(106, 106, 101, 0.12);
  color: var(--ink);
  border-color: var(--line);
}

/* Dark mode adjustments — DSL colors lighten for contrast */
@media (prefers-color-scheme: dark) {
  .dsl-skill { color: #6dd380; background: rgba(45, 138, 62, 0.18); }
  .dsl-path { color: #f4d04a; background: rgba(250, 224, 66, 0.16); }
  .dsl-risk { color: #ff6877; background: rgba(237, 41, 57, 0.20); }
}
