/*
 * FilUpGo help pages: the customer guide (help.php) and the management
 * guide (admin?view=help). Colours come from the theme tokens in style.css
 * so both pages follow light and dark mode.
 */

.help-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
  padding-bottom: 3rem;
}

.help-layout-admin {
  gap: 1rem;
  padding-bottom: 1rem;
}

.help-toc {
  position: sticky;
  top: 105px;
  display: grid;
  gap: 0.15rem;
  padding: 0.5rem 0;
  font-size: 0.82rem;
}

.help-toc strong {
  margin-bottom: 0.35rem;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.help-toc a {
  padding: 0.35rem 0.6rem;
  color: var(--text-primary);
  text-decoration: none;
  border-left: 2px solid var(--border-color);
}

.help-toc a:hover,
.help-toc a:focus-visible {
  color: var(--brand-blue);
  border-left-color: var(--brand-blue);
}

.help-body {
  max-width: 760px;
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.65;
}

.help-layout-admin .help-body {
  max-width: none;
  padding: 0.5rem 1.6rem 1.6rem;
  font-size: 0.85rem;
}

.help-body section {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-color);
  scroll-margin-top: 100px;
}

.help-body section:last-child {
  border-bottom: 0;
}

.help-body h2 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
  font-weight: 650;
}

.help-layout-admin .help-body h2 {
  font-size: 1rem;
}

.help-body p,
.help-body ul,
.help-body ol {
  margin: 0 0 0.75rem;
}

.help-body ul {
  padding-left: 1.2rem;
}

.help-body li + li {
  margin-top: 0.35rem;
}

.help-steps {
  padding-left: 0;
  list-style: none;
  counter-reset: help-step;
}

.help-steps > li {
  position: relative;
  padding-left: 2.25rem;
  counter-increment: help-step;
}

.help-steps > li + li {
  margin-top: 0.7rem;
}

.help-steps > li::before {
  position: absolute;
  top: 0.1rem;
  left: 0;
  display: grid;
  width: 1.5rem;
  height: 1.5rem;
  place-items: center;
  color: var(--brand-blue);
  font-size: 0.72rem;
  font-weight: 700;
  content: counter(help-step);
  background: var(--brand-blue-soft);
  border-radius: 50%;
}

.help-note {
  display: flex;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  margin-top: 1rem;
  background: var(--brand-blue-soft);
  border-radius: 0.6rem;
}

.help-note i {
  color: var(--brand-blue);
  font-size: 1.1rem;
}

.help-note p {
  margin: 0;
}

.help-defs {
  display: grid;
  grid-template-columns: minmax(150px, max-content) minmax(0, 1fr);
  gap: 0.45rem 1.25rem;
  margin: 0.5rem 0 0.75rem;
}

.help-defs dt {
  font-weight: 600;
}

.help-defs dd {
  margin: 0;
  color: var(--text-muted);
}

.help-body details {
  padding: 0.75rem 0;
  border-top: 1px solid var(--border-color);
}

.help-body details:last-of-type {
  border-bottom: 1px solid var(--border-color);
}

.help-body summary {
  font-weight: 600;
  cursor: pointer;
}

.help-body details p {
  margin: 0.5rem 0 0;
  color: var(--text-muted);
}

@media (max-width: 860px) {
  .help-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.5rem;
  }

  .help-toc {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .help-toc strong {
    flex-basis: 100%;
  }

  .help-toc a {
    border: 1px solid var(--border-color);
    border-radius: 999px;
  }

  .help-defs {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.1rem;
  }

  .help-defs dd {
    margin-bottom: 0.5rem;
  }

  .help-layout-admin .help-body {
    padding: 0.25rem 1rem 1rem;
  }
}

@media print {
  .help-toc {
    display: none;
  }

  .help-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}
