/* Typography for in-app help articles (PathIQ.Web/Help/*.md rendered by Markdig), shared by the
   layout's help panel and the full /help/{slug} page. Colours come from the MudBlazor palette
   variables so articles track the app theme. */

.mpx-help-article {
    line-height: 1.6;
    color: var(--mud-palette-text-primary);
}

.mpx-help-article h1,
.mpx-help-article h2,
.mpx-help-article h3 {
    font-weight: 500;
    line-height: 1.3;
    margin: 1.4em 0 0.5em;
}

.mpx-help-article h1 { font-size: 1.5rem; }
.mpx-help-article h2 { font-size: 1.25rem; }
.mpx-help-article h3 { font-size: 1.05rem; }

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

.mpx-help-article p,
.mpx-help-article ul,
.mpx-help-article ol,
.mpx-help-article table,
.mpx-help-article blockquote {
    margin: 0 0 0.9em;
}

.mpx-help-article ul,
.mpx-help-article ol { padding-left: 1.5em; }

.mpx-help-article li { margin-bottom: 0.35em; }

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

.mpx-help-article code {
    font-size: 0.9em;
    padding: 0.1em 0.35em;
    border-radius: 3px;
    background-color: var(--mud-palette-background-gray);
}

/* "> **Tip:** ..." in an article renders as a callout. */
.mpx-help-article blockquote {
    padding: 0.6em 1em;
    border-left: 4px solid var(--mud-palette-info);
    background-color: var(--mud-palette-background-gray);
    border-radius: 0 4px 4px 0;
}

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

.mpx-help-article table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.92em;
}

.mpx-help-article th,
.mpx-help-article td {
    border: 1px solid var(--mud-palette-lines-default);
    padding: 6px 10px;
    text-align: left;
    vertical-align: top;
}

.mpx-help-article th { background-color: var(--mud-palette-background-gray); font-weight: 500; }

.mpx-help-article img {
    max-width: 100%;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 4px;
}

/* The panel is ~420px wide; wide tables scroll inside it rather than stretching it. */
.mpx-help-panel .mpx-help-article table {
    display: block;
    overflow-x: auto;
}

/* "Where to do this" bar above an article: the menu path(s) and a link to the page. */
.mpx-help-where {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 8px 12px;
    margin-bottom: 16px;
    border-radius: 6px;
    background: var(--mud-palette-background-gray);
    border-left: 3px solid var(--mud-palette-primary);
}

/* Pinned help panel: below the app bar (so its ?, chat and bell stay reachable) and beside the
   page rather than over it — the page is padded by the panel's width while it's open. */
/* !important: MudBlazor's own fixed-drawer rules pin top:0 with higher specificity. */
.mpx-help-panel--pinned.mud-drawer {
    top: var(--mud-appbar-height, 64px) !important;
    height: calc(100% - var(--mud-appbar-height, 64px)) !important;
}

.mud-layout:has(.mpx-help-panel--pinned.mud-drawer--open) .mud-main-content {
    padding-right: 440px;
}

@media (max-width: 960px) {
    /* Too narrow to work beside it; the panel simply covers the page as it does unpinned. */
    .mud-layout:has(.mpx-help-panel--pinned.mud-drawer--open) .mud-main-content {
        padding-right: 0;
    }
}
