/* The user guide, which rides on crucible.css for the palette, the masthead and the type. Only what the
   guide adds is here.
 *
 * Crucible itself is a fixed, pinned layout that never scrolls as a page. A guide is the opposite, so the
 * page scroll that the app suppresses is turned back on. */

html,
body.help-body {
    height: auto;
    min-height: 100%;
    overflow: auto;
}

.help {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 32px;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 28px 24px 64px;
}

/* Follows the reader down the page, which is what makes the section list worth having at all. */
.help-nav {
    position: sticky;
    top: 24px;
    align-self: start;
}

.help-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-left: 1px solid var(--line-soft);
}

.help-nav-list a {
    display: block;
    padding: 5px 12px;
    margin-left: -1px;
    border-left: 1px solid transparent;
    color: var(--text-faint);
    font-size: 12px;
    text-decoration: none;
}

.help-nav-list a:hover {
    color: var(--text);
    border-left-color: var(--ember);
}

.help-content {
    min-width: 0;
    line-height: 1.65;
    color: var(--text-dim);
}

.help-section {
    padding-bottom: 28px;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--line-soft);

    /* Leaves the heading clear of the top edge when a section is jumped to from the list. */
    scroll-margin-top: 24px;
}

.help-section:last-child {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: none;
}

.help-content h2 {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text);
}

.help-content h3 {
    margin: 22px 0 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.help-content h4 {
    margin: 18px 0 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
}

.help-content p { margin: 0 0 12px; }
.help-content ul, .help-content ol { margin: 0 0 12px; padding-left: 20px; }
.help-content li { margin-bottom: 4px; }
.help-content strong { color: var(--text); font-weight: 600; }

.help-content code {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text);
    background: var(--bg-sunken);
    border: 1px solid var(--line-soft);
    border-radius: 3px;
    padding: 1px 4px;
}

.help-content pre {
    margin: 0 0 12px;
    padding: 11px 13px;
    background: var(--bg-sunken);
    border: 1px solid var(--line);
    border-radius: 5px;
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.55;
    color: var(--text-dim);
    overflow-x: auto;
}

.help-content pre code {
    padding: 0;
    border: none;
    background: none;
    color: inherit;
}

/* Screenshots sit flush to the text column and keep the window border they were cropped with, so a shot
   of one window reads as a window rather than as a floating rectangle. */
.help-figure {
    margin: 0 0 16px;
}

/* Never past its own size: a crop narrower than the column would otherwise be stretched and softened. */
.help-figure img {
    display: block;
    max-width: 100%;
    height: auto;
    background: var(--bg-sunken);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.help-figure figcaption {
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-faint);
}

.help-table {
    width: 100%;
    margin: 0 0 12px;
    border-collapse: collapse;
    font-size: 12px;
}

.help-table th,
.help-table td {
    padding: 6px 12px 6px 0;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--line-soft);
}

.help-table th {
    color: var(--text-dim);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* The key itself, which is the column the eye goes to first. */
.help-table td:first-child { white-space: nowrap; }

/* Marks a section that has yet to be written, so an empty guide reads as unfinished rather than broken. */
.help-pending {
    color: var(--text-faint);
    font-style: italic;
}

@media (max-width: 860px) {
    .help { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    .help-nav { position: static; }
    .help-nav-list { flex-direction: row; flex-wrap: wrap; border-left: none; }
}
