/* =======================================================================
 *  docs.css — Markdown document styling for xfawa.wiki
 *
 *  All rules are scoped under .doc-content so they NEVER leak into the
 *  rest of the site.  The page shell imports styles.css for header/footer
 *  as usual; this file only styles the rendered Markdown body.
 * ======================================================================= */

/* ---------- Container -------------------------------------------------- */
.doc-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 30px 20px 80px;
  line-height: 1.75;
  color: #333;
}

/* ---------- Headings --------------------------------------------------- */
.doc-content h1 {
  font-size: 2rem;
  font-weight: bold;
  margin: 1.2em 0 0.5em;
  color: #333;
}
.doc-content h2 {
  font-size: 1.6rem;
  font-weight: bold;
  margin: 1.3em 0 0.5em;
  padding-bottom: 0.3em;
  border-bottom: 1px solid #eee;
}
.doc-content h3 {
  font-size: 1.3rem;
  font-weight: bold;
  margin: 1em 0 0.4em;
}
.doc-content h4 { font-size: 1.1rem; font-weight: bold; margin: 1em 0 0.3em; }

/* ---------- Paragraphs ------------------------------------------------- */
.doc-content p {
  margin: 0.8em 0;
}

/* ---------- Links ------------------------------------------------------ */
.doc-content a {
  color: #0066cc;
  text-decoration: none;
}
.doc-content a:hover {
  text-decoration: underline;
}

/* ---------- Inline code ------------------------------------------------ */
.doc-content code {
  font-family: Consolas, "Liberation Mono", Menlo, monospace;
  background: #f0f0f0;
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 0.95em;
}

/* ---------- Code blocks ------------------------------------------------ */
.doc-content pre {
  position: relative;
  background: #f6f8fa;
  border: 1px solid #e1e4e8;
  border-radius: 6px;
  padding: 16px;
  overflow-x: auto;
  margin: 1em 0;
}
.doc-content pre code {
  background: none;
  padding: 0;
  font-size: 0.95em;
  line-height: 1.5;
}

/* Language badge (data-lang set by docs-render.js) */
.doc-content pre[data-lang]::before {
  content: attr(data-lang);
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.72em;
  font-family: sans-serif;
  color: #666;
  background: rgba(0,0,0,0.06);
  padding: 2px 8px;
  border-radius: 4px;
  pointer-events: none;
}

/* ---------- Tables ----------------------------------------------------- */
.doc-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  font-size: 0.95em;
}
.doc-content th,
.doc-content td {
  padding: 8px 12px;
  border: 1px solid #ddd;
  text-align: left;
}
.doc-content th {
  background: #f6f8fa;
  font-weight: bold;
}
.doc-content tr:nth-child(even) {
  background: #fafafa;
}

/* ---------- Lists ------------------------------------------------------ */
.doc-content ul,
.doc-content ol {
  padding-left: 2em;
  margin: 0.8em 0;
}
.doc-content li {
  margin: 0.3em 0;
}

/* ---------- Blockquote ------------------------------------------------- */
.doc-content blockquote {
  border-left: 4px solid #ccc;
  padding: 0.5em 1em;
  margin: 1em 0;
  color: #555;
  background: #f9f9f9;
}
.doc-content blockquote p {
  margin: 0.4em 0;
}

/* ---------- Horizontal rule -------------------------------------------- */
.doc-content hr {
  border: none;
  border-top: 1px solid #eee;
  margin: 2em 0;
}

/* ---------- Images ----------------------------------------------------- */
.doc-content img {
  max-width: 100%;
  height: auto;
}

/* ---------- Responsive ------------------------------------------------- */
@media (max-width: 600px) {
  .doc-content {
    padding: 16px 12px 60px;
  }
  .doc-content h1 { font-size: 1.5rem; }
  .doc-content h2 { font-size: 1.3rem; }
  .doc-content table { font-size: 0.85em; }
}
