/* ── Skill Markdown Body ──────────────────────────────────────────────────────
   Custom markdown rendering styles for SkillFullDetailPage.
   Uses CSS custom properties from the app theme (no Tailwind required).
   ─────────────────────────────────────────────────────────────────────────── */

.skill-markdown-body {
  font-size: 13px;
  line-height: 1.7;
  color: hsl(var(--foreground) / 0.9);
  word-break: break-word;
  text-align: left;
}

/* ── Headings ── */
.skill-markdown-body h1,
.skill-markdown-body h2,
.skill-markdown-body h3,
.skill-markdown-body h4,
.skill-markdown-body h5,
.skill-markdown-body h6 {
  color: hsl(var(--foreground));
  font-weight: 600;
  line-height: 1.3;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  text-align: left;
}

.skill-markdown-body h1 {
  font-size: 1.15em;
  border-bottom: 1px solid hsl(var(--border));
  padding-bottom: 0.3em;
}
.skill-markdown-body h2 {
  font-size: 1.05em;
  border-bottom: 1px solid hsl(var(--border) / 0.5);
  padding-bottom: 0.2em;
}
.skill-markdown-body h3 {
  font-size: 0.95em;
}
.skill-markdown-body h4 {
  font-size: 0.875em;
}
.skill-markdown-body h5 {
  font-size: 0.825em;
}
.skill-markdown-body h6 {
  font-size: 0.8em;
  color: hsl(var(--muted-foreground));
}

/* Remove top margin for first heading */
.skill-markdown-body > :first-child {
  margin-top: 0;
}
.skill-markdown-body > :last-child {
  margin-bottom: 0;
}

/* ── Paragraphs ── */
.skill-markdown-body p {
  margin-top: 0;
  margin-bottom: 0.85em;
  text-align: left;
}

.skill-markdown-body p:last-child {
  margin-bottom: 0;
}

/* ── Horizontal rules ── */
.skill-markdown-body hr {
  border: none;
  border-top: 1px solid hsl(var(--border));
  margin: 1.25em 0;
}

/* ── Lists ── */
.skill-markdown-body ul,
.skill-markdown-body ol {
  margin-top: 0;
  margin-bottom: 0.85em;
  padding-left: 1.5em;
  text-align: left;
}

.skill-markdown-body li {
  margin-bottom: 0.25em;
  line-height: 1.6;
}

.skill-markdown-body li > p {
  margin-bottom: 0.25em;
}

.skill-markdown-body ul {
  list-style-type: disc;
}
.skill-markdown-body ol {
  list-style-type: decimal;
}

.skill-markdown-body ul ul {
  list-style-type: circle;
}
.skill-markdown-body ul ul ul {
  list-style-type: square;
}

/* ── Blockquotes ── */
.skill-markdown-body blockquote {
  margin: 0.75em 0;
  padding: 0.5em 1em;
  border-left: 3px solid hsl(var(--primary) / 0.5);
  background: hsl(var(--muted) / 0.4);
  border-radius: 0 0.375rem 0.375rem 0;
  color: hsl(var(--muted-foreground));
  font-style: italic;
}

.skill-markdown-body blockquote p {
  margin-bottom: 0;
}

/* ── Inline code ── */
.skill-markdown-body code {
  font-family:
    ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  border-radius: 0.25em;
  padding: 0.1em 0.35em;
  color: hsl(var(--foreground));
}

/* ── Code blocks (pre) ── */
.skill-markdown-body pre {
  font-family:
    ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  border-radius: 0.5rem;
  padding: 0.875em 1em;
  overflow-x: auto;
  margin: 0.75em 0;
  white-space: pre;
}

/* Reset inline code inside a pre block */
.skill-markdown-body pre code {
  background: transparent;
  border: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
  border-radius: 0;
}

/* ── Tables ── */
.skill-markdown-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin: 0.75em 0;
  text-align: left;
}

.skill-markdown-body th,
.skill-markdown-body td {
  padding: 0.4em 0.75em;
  border: 1px solid hsl(var(--border));
  text-align: left;
  vertical-align: top;
}

.skill-markdown-body th {
  background: hsl(var(--muted) / 0.7);
  font-weight: 600;
}

.skill-markdown-body tr:nth-child(even) td {
  background: hsl(var(--muted) / 0.25);
}

/* ── Links ── */
.skill-markdown-body a {
  color: hsl(var(--primary));
  text-decoration: none;
}

.skill-markdown-body a:hover {
  text-decoration: underline;
}

/* ── Images ── */
.skill-markdown-body img {
  max-width: 100%;
  border-radius: 0.375rem;
}

/* ── Strong / Em ── */
.skill-markdown-body strong {
  font-weight: 600;
  color: hsl(var(--foreground));
}

.skill-markdown-body em {
  font-style: italic;
}

/* ── Task list (GFM) ── */
.skill-markdown-body input[type="checkbox"] {
  margin-right: 0.35em;
  vertical-align: middle;
}
