/* ==========================================================================
   ScoopHub Rich-Text — Wiki & Asset content rendering
   ========================================================================== */

.rich-text,
.scoop-richtext {
  color: var(--scoop-slate-900);
  line-height: 1.7;
  font-size: 1rem;
}

.rich-text > :first-child { margin-top: 0; }
.rich-text > :last-child  { margin-bottom: 0; }

.rich-text h1,
.rich-text h2,
.rich-text h3,
.rich-text h4,
.rich-text h5,
.rich-text h6 {
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--scoop-slate-900);
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
  line-height: 1.25;
}
.rich-text h1 { font-size: 1.875rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--scoop-slate-100); }
.rich-text h2 { font-size: 1.5rem; }
.rich-text h3 { font-size: 1.25rem; }
.rich-text h4 { font-size: 1.125rem; }
.rich-text h5 { font-size: 1rem; }
.rich-text h6 { font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--scoop-slate-400); }

.rich-text p { margin-bottom: 1rem; }

.rich-text ul,
.rich-text ol {
  margin: 0 0 1rem 1.5rem;
  padding: 0;
}
.rich-text ul { list-style: disc; }
.rich-text ol { list-style: decimal; }
.rich-text li { margin-bottom: 0.4rem; }
.rich-text li > ul,
.rich-text li > ol { margin-top: 0.25rem; margin-bottom: 0.25rem; }

.rich-text a {
  color: var(--scoop-primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.rich-text a:hover { color: var(--scoop-primary-dark); }

.rich-text code {
  background-color: var(--scoop-slate-50);
  border: 1px solid var(--scoop-slate-100);
  border-radius: 0.375rem;
  padding: 0.1rem 0.4rem;
  font-family: var(--bulma-family-code);
  font-size: 0.88em;
  color: var(--scoop-slate-900);
}

.rich-text pre {
  background-color: var(--scoop-slate-900);
  color: #f6f7fa;
  border-radius: var(--scoop-radius-lg);
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  margin: 1.25rem 0 1.5rem;
  font-size: 0.875rem;
  line-height: 1.6;
}
.rich-text pre code {
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.rich-text blockquote {
  border-left: 4px solid var(--scoop-primary);
  background: var(--scoop-slate-50);
  padding: 0.75rem 1rem;
  border-radius: 0 var(--scoop-radius) var(--scoop-radius) 0;
  margin: 1rem 0 1.5rem;
  color: var(--scoop-slate-700);
}
.rich-text blockquote p:last-child { margin-bottom: 0; }

.rich-text hr {
  border: 0;
  border-top: 1px solid var(--scoop-slate-100);
  margin: 1.5rem 0;
}

.rich-text img {
  max-width: 100%;
  height: auto;
  border-radius: var(--scoop-radius-lg);
  margin: 1rem 0;
  box-shadow: var(--scoop-shadow-sm);
}

.rich-text table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.95rem;
}
.rich-text table th,
.rich-text table td {
  border: 1px solid var(--scoop-slate-100);
  padding: 0.6rem 0.85rem;
  text-align: left;
  vertical-align: top;
}
.rich-text table th {
  background-color: var(--scoop-slate-50);
  font-weight: 600;
  color: var(--scoop-slate-900);
}
.rich-text table tr:nth-child(even) td { background: rgba(240, 242, 244, 0.4); }

.rich-text strong { font-weight: 700; color: var(--scoop-slate-900); }
.rich-text em { font-style: italic; }

.rich-text mark {
  background: rgba(255, 193, 7, 0.32);
  padding: 0 0.15rem;
  border-radius: 3px;
}

.rich-text kbd {
  font-family: var(--bulma-family-code);
  font-size: 0.78em;
  background: var(--scoop-white);
  border: 1px solid var(--scoop-slate-200);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0.05rem 0.4rem;
  color: var(--scoop-slate-900);
}
