/* ============================================================
   1stUnit Help — side-nav layout
   Scoped overrides on top of /css/style.css.
   ============================================================ */

.help-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 2.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.6rem var(--pad-x) 5rem;
}

.help-nav {
  position: sticky;
  top: 5rem;
  align-self: start;
  font-family: var(--font-body);
  font-size: 0.9rem;
  line-height: 1.5;
  border-right: 1px solid var(--color-border);
  padding-right: 1.25rem;
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
}

.help-nav h2 {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--color-text-muted);
  margin: 1.25rem 0 0.5rem;
}

.help-nav h2:first-child { margin-top: 0; }

.help-nav ol {
  list-style: none;
  padding: 0;
  margin: 0;
}

.help-nav li {
  margin: 0;
}

.help-nav a {
  display: block;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  color: var(--color-black);
  text-decoration: none;
}

.help-nav a:hover {
  background: rgba(102, 53, 244, 0.06);
  color: var(--color-purple);
}

.help-nav a[aria-current="page"] {
  background: rgba(102, 53, 244, 0.1);
  color: var(--color-purple);
  font-weight: 500;
}

/* Override the default .help-page padding so the layout grid controls spacing. */
.help-layout .help-page {
  max-width: none;
  margin: 0;
  padding: 0;
}

.help-layout .help-content {
  max-width: 760px;
}

/* Topic page typographic helpers */
.help-content h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin: 2rem 0 0.75rem;
}

.help-content h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 500;
  margin: 1.5rem 0 0.5rem;
}

.help-content ul,
.help-content ol {
  margin: 0 0 1rem 1.25rem;
}

.help-content li { margin-bottom: 0.4rem; }

.help-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: rgba(0, 0, 0, 0.05);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
}

.help-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0 1.25rem;
  font-size: 0.9rem;
}

.help-content th,
.help-content td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

.help-content th {
  font-family: var(--font-heading);
  font-weight: 500;
  background: rgba(0, 0, 0, 0.03);
}

.help-content .callout {
  background: rgba(102, 53, 244, 0.06);
  border-left: 3px solid var(--color-purple);
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  border-radius: 3px;
}

.help-content .callout.note {
  background: rgba(0, 0, 0, 0.04);
  border-left-color: var(--color-text-muted);
}

.help-content .img-placeholder {
  display: block;
  background: repeating-linear-gradient(
    45deg,
    rgba(0,0,0,0.04),
    rgba(0,0,0,0.04) 10px,
    rgba(0,0,0,0.07) 10px,
    rgba(0,0,0,0.07) 20px
  );
  border: 1px dashed rgba(0,0,0,0.25);
  color: var(--color-text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  padding: 1.25rem;
  margin: 1rem 0;
  border-radius: 4px;
  white-space: pre-wrap;
}

.page-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
  font-family: var(--font-heading);
  font-size: 0.95rem;
}

.page-nav a {
  text-decoration: none;
  color: var(--color-purple);
}

.page-nav a:hover { text-decoration: underline; }
.page-nav .spacer { flex: 1; }

/* Responsive: collapse side nav above content on narrow screens. */
@media (max-width: 860px) {
  .help-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .help-nav {
    position: static;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    padding-right: 0;
    padding-bottom: 1rem;
  }
}
