/* Help article typography.
 *
 * This is a GLOBAL stylesheet on purpose. Article bodies are injected as a
 * MarkupString, and the Razor compiler only stamps CSS-isolation scope
 * attributes onto elements it compiles itself — never onto markup that arrives
 * at runtime. Scoped CSS (HelpArticle.razor.css) would therefore style the
 * wrapper and nothing inside it. Don't "tidy" this into an isolated file.
 *
 * Colors come from the MudBlazor palette variables so the articles follow the
 * portal's light/dark theme without a second set of rules.
 */

.help-article {
    color: var(--mud-palette-text-primary);
    font-size: 0.95rem;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

/* ---- Headings ------------------------------------------------------- */

.help-article h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 0.75rem;
}

.help-article h2 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 1.75rem 0 0.6rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--mud-palette-divider);
}

.help-article h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 1.3rem 0 0.4rem;
    color: var(--mud-palette-text-primary);
}

.help-article h2:first-child,
.help-article h3:first-child {
    margin-top: 0;
}

/* ---- Body ----------------------------------------------------------- */

.help-article p {
    margin: 0.6rem 0;
}

.help-article ul,
.help-article ol {
    margin: 0.5rem 0 0.9rem;
    padding-left: 1.5rem;
}

.help-article li {
    margin: 0.35rem 0;
}

/* Numbered steps are the backbone of most articles — give them a bit more
   room to breathe than a plain bullet list. */
.help-article ol > li {
    margin: 0.5rem 0;
    padding-left: 0.15rem;
}

.help-article strong {
    font-weight: 600;
    color: var(--mud-palette-text-primary);
}

.help-article a {
    color: var(--mud-palette-primary);
    text-decoration: none;
}

.help-article a:hover {
    text-decoration: underline;
}

/* ---- Callouts ------------------------------------------------------- */

/* Blockquotes are used for tips and warnings. The leading bar plus a tinted
   panel makes them read as an aside rather than body copy. */
.help-article blockquote {
    margin: 1rem 0;
    padding: 0.65rem 1rem;
    border-left: 4px solid var(--mud-palette-primary);
    background: var(--mud-palette-background-grey);
    border-radius: 0 6px 6px 0;
}

.help-article blockquote p {
    margin: 0.25rem 0;
}

/* ---- Code and keys -------------------------------------------------- */

/* Inline code carries button labels and field values, so keep it legible
   rather than shrinking it the way a developer doc would. */
.help-article code {
    background: var(--mud-palette-background-grey);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-size: 0.875em;
}

.help-article pre {
    background: var(--mud-palette-background-grey);
    padding: 0.8rem 1rem;
    border-radius: 8px;
    overflow-x: auto;
}

.help-article pre code {
    background: none;
    padding: 0;
}

/* ---- Tables --------------------------------------------------------- */

/* Tables can be wider than a dialog. Scroll them inside their own box so the
   article body never scrolls sideways. */
.help-article .table-wrap,
.help-article table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
}

.help-article table {
    border-collapse: collapse;
    margin: 0.9rem 0;
}

.help-article th,
.help-article td {
    border: 1px solid var(--mud-palette-divider);
    padding: 0.45rem 0.65rem;
    text-align: left;
    vertical-align: top;
}

.help-article th {
    background: var(--mud-palette-background-grey);
    font-weight: 600;
    white-space: nowrap;
}

.help-article hr {
    border: none;
    border-top: 1px solid var(--mud-palette-divider);
    margin: 1.5rem 0;
}

.help-article img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

/* ---- First/last spacing --------------------------------------------- */

.help-article > *:first-child {
    margin-top: 0;
}

.help-article > *:last-child {
    margin-bottom: 0;
}
