/* ==========================================================================
   help.css — the help centre (help/ and fr/aide/)

   Loaded after pages.css, on the help pages only. The pages reuse the blog's
   title band (.blog-head), its listing ground (.blog-list) and its article
   frame (.article, .prose, .article__related); this file adds what a guide
   needs on top: a breadcrumb, a table of contents, code samples, parameter
   tables, and the guide cards of the index.
   ========================================================================== */

/* Guide ------------------------------------------------------------------- */
.help-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  padding: 1.625rem 0 0.6rem;
  border-bottom: 1px solid var(--c-line);
  color: var(--c-muted);
  font-size: 0.875rem;
}

.help-crumbs a {
  color: var(--c-accent-text);
}

.help-crumbs a:hover,
.help-crumbs a:focus-visible {
  color: var(--c-brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Anchored headings land below the fixed header, not under it. */
.help-article [id] {
  scroll-margin-top: calc(var(--header-h) + 1.25rem);
}

.help-toc {
  padding: 1.25rem 1.5rem;
  border-radius: 8px;
  background: var(--c-surface-alt);
  font-size: 0.9375rem;
}

.help-toc__title {
  margin-bottom: 0.625rem;
  color: var(--c-heading);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.125em;
  text-transform: uppercase;
}

.prose .help-toc ol {
  margin: 0;
  padding-left: 1.375rem;
}

.prose .help-toc li + li {
  margin-top: 0.3rem;
}

.prose .help-toc a {
  text-decoration: none;
}

.prose .help-toc a:hover,
.prose .help-toc a:focus-visible {
  text-decoration: underline;
}

.help-note {
  padding: 0.875rem 1.125rem;
  border-left: 3px solid var(--c-accent);
  background: var(--c-surface-alt);
  font-size: 0.9375rem;
}

/* Code -------------------------------------------------------------------- */
.prose code {
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--c-surface-alt);
  color: var(--c-brand);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  font-size: 0.875em;
  overflow-wrap: anywhere;
}

.prose pre {
  overflow-x: auto;
  padding: 1.125rem 1.25rem;
  border-radius: 8px;
  background: var(--c-brand);
  color: #e8e9f5;
  font-size: 0.875rem;
  line-height: 1.6;
  tab-size: 2;
}

.prose pre code {
  padding: 0;
  background: none;
  color: inherit;
  font-size: inherit;
  overflow-wrap: normal;
  white-space: pre;
}

/* Parameter tables -------------------------------------------------------- */
/* The wrapper scrolls sideways on a phone rather than squeezing the table. */
.help-table {
  overflow-x: auto;
  border: 1px solid var(--c-line);
  border-radius: 8px;
}

.help-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.help-table th,
.help-table td {
  padding: 0.625rem 0.875rem;
  text-align: left;
  vertical-align: top;
}

.help-table th {
  background: var(--c-surface-alt);
  color: var(--c-heading);
  font-weight: 700;
  white-space: nowrap;
}

.help-table tbody tr + tr td {
  border-top: 1px solid var(--c-line);
}

.help-table td:first-child {
  white-space: nowrap;
}

/* Index ------------------------------------------------------------------- */
.help-index {
  max-width: 60rem;
  margin-inline: auto;
}

.help-group + .help-group {
  margin-top: clamp(2.5rem, 4vw, 3.5rem);
}

.help-group__title {
  margin-bottom: 0.75rem;
  color: var(--c-heading);
  font-size: clamp(1.375rem, 1.15rem + 0.7vw, 1.5625rem);
  font-weight: 400;
  line-height: 1.3;
}

.help-group__title::after {
  content: '';
  display: block;
  width: 3rem;
  height: 3px;
  margin-top: 0.625rem;
  background: var(--c-accent);
}

.help-group__lead {
  max-width: var(--measure);
  margin-bottom: 1.25rem;
  color: var(--c-ink-soft);
}

.help-grid {
  display: grid;
  gap: clamp(1rem, 0.75rem + 1vw, 1.5rem);
  grid-template-columns: 1fr;
}

@media (min-width: 48rem) {
  .help-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.help-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  height: 100%;
  padding: 1.375rem 1.5rem 1.5rem;
  border-top: 3px solid var(--c-accent);
  border-radius: 8px;
  background: var(--c-surface);
  box-shadow: 0 4px 16px rgba(20, 16, 86, 0.08);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.help-card:hover,
.help-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 10px 26px rgba(20, 16, 86, 0.16);
}

.help-card__title {
  color: var(--c-heading);
  font-size: 1.25rem;
  line-height: 1.3;
}

.help-card:hover .help-card__title,
.help-card:focus-visible .help-card__title {
  color: var(--c-accent-text);
}

.help-card__text {
  color: var(--c-muted);
  font-size: var(--fs-small);
  line-height: 1.55;
}

.help-panel {
  padding: 1.375rem 1.5rem;
  border-radius: 8px;
  background: var(--c-surface);
  color: var(--c-ink-soft);
  box-shadow: 0 4px 16px rgba(20, 16, 86, 0.08);
}

.help-panel ul {
  margin-top: 0.75rem;
  padding-left: 1.375rem;
  list-style: disc;
}

.help-panel li + li {
  margin-top: 0.4rem;
}

.help-panel strong {
  color: var(--c-heading);
}

.help-panel a,
.help-index__contact a {
  color: var(--c-accent-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.help-index__contact {
  margin-top: clamp(2.5rem, 4vw, 3.5rem);
  padding-top: 1.375rem;
  border-top: 1px solid var(--c-line);
  color: var(--c-muted);
}
