/* Help centre and FAQ. Loaded after site.css; uses its variables only. */

/* ---------- Search ---------- */

.help-search { margin-top: 32px; max-width: 640px; }
.help-search[hidden], .help-results[hidden] { display: none; }
.help-search-label { display: block; font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.help-search input {
  width: 100%;
  height: 52px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: 17px var(--font);
  color: var(--ink);
  background: #fff;
  -webkit-appearance: none;
  appearance: none;
}
.help-search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.help-results { max-width: 640px; margin-top: 16px; }
.help-results ul { list-style: none; margin: 0; padding: 0; }
.help-results li { padding: 14px 0; border-top: 1px solid var(--line); }
.help-results li:last-child { border-bottom: 1px solid var(--line); }
.help-results a { font-weight: 600; }
.help-results .meta { display: block; font-size: 13px; color: var(--muted); }
.help-results p { margin-top: 4px; font-size: 15px; }
.help-results .empty { color: var(--muted); font-size: 15px; }
.help-quick { margin-top: 24px; }

/* ---------- Categories (help home) ---------- */

.help-cats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px 48px; padding-bottom: 72px; }
.help-cat { border-top: 1px solid var(--ink); padding-top: 20px; min-width: 0; }
.help-cat h2 { font-size: 19px; letter-spacing: -0.012em; }
.help-cat .small { margin-top: 6px; }
.help-cat ul { list-style: none; margin: 14px 0 0; padding: 0; }
.help-cat li { padding: 7px 0; font-size: 16px; line-height: 1.45; }
.help-cats.is-searching { display: none; }

/* ---------- Articles ---------- */

.help-title { max-width: 18em; overflow-wrap: break-word; }
.help-article code { font: 0.9em var(--mono); background: var(--soft); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
.help-article table { table-layout: auto; }
.help-article td:first-child { white-space: nowrap; padding-right: 20px; }
.help-article .tag { margin-right: 0; }
.help-side-list { list-style: none; margin: 10px 0 0; padding: 0; font-size: 15px; }
.help-side-list li { padding: 5px 0; line-height: 1.4; }
.help-side-list a { color: var(--text); }
.help-side-list a[aria-current="page"] { color: var(--ink); font-weight: 600; }

.help-feedback { margin-top: 56px !important; padding: 28px; background: var(--soft); border-radius: var(--radius); }
.help-feedback h2 { margin-top: 0; font-size: 21px; }
.help-feedback p { margin-top: 8px; font-size: 16px; }
.help-feedback-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px !important; }

/* ---------- "Still stuck?" ---------- */

.help-contact { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 16px; padding: 32px; margin-bottom: 112px; }
.help-contact h2 { font-size: 24px; letter-spacing: -0.02em; }
.help-contact p { margin-top: 6px; }

/* ---------- FAQ page ---------- */

.faq-page { max-width: 760px; padding-bottom: 72px; }
.faq-group + .faq-group { margin-top: 56px; }
.faq-group h2 { font-family: var(--serif); font-size: 28px; font-weight: 500; letter-spacing: -0.012em; margin-bottom: 12px; }
.faq-page details { border-top: 1px solid var(--line); }
.faq-page details:last-child { border-bottom: 1px solid var(--line); }
.faq-page summary {
  list-style: none;
  cursor: pointer;
  position: relative;
  padding: 18px 36px 18px 0;
  color: var(--ink);
  font-weight: 600;
  font-size: 17px;
  line-height: 1.4;
}
.faq-page summary::-webkit-details-marker { display: none; }
.faq-page summary::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 24px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}
.faq-page details[open] summary::after { transform: rotate(-135deg); top: 28px; }
.faq-page summary:hover { color: var(--accent-ink); }
.faq-answer { padding: 0 0 20px; font-size: 16px; line-height: 1.65; }
.faq-answer p + p { margin-top: 10px; }

/* ---------- Mac and Windows sections (help home) ---------- */

.help-platforms { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.help-platform { border: 1px solid var(--line); border-radius: 16px; padding: 28px; min-width: 0; display: flex; flex-direction: column; }
.help-platform h2 { display: flex; align-items: center; gap: 10px; font-size: 22px; letter-spacing: -0.015em; }
.help-platform h2 .os-icon { width: 22px; height: 22px; color: var(--ink); }
.help-platform .small { margin-top: 6px; }
.help-platform ul { list-style: none; margin: 14px 0 0; padding: 0; flex: 1; }
.help-platform li { padding: 7px 0; font-size: 16px; line-height: 1.45; }
.help-platform-download { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-weight: 600; }

/* "On Windows, see …" pointer at the top of a Mac-only article, and the reverse. */
.help-other-os { font-size: 15px; background: var(--soft); padding: 12px 16px; border-radius: 8px; }

/* ---------- Small screens ---------- */

@media (max-width: 900px) {
  .help-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 32px; }
}

@media (max-width: 640px) {
  .help-cats { grid-template-columns: 1fr; gap: 32px; padding-bottom: 56px; }
  .help-platforms { grid-template-columns: 1fr; gap: 16px; }
  .help-platform { padding: 22px 18px; }
  .help-contact { padding: 24px 20px; margin-bottom: 72px; }
  .help-contact .btn, .help-feedback-actions .btn { width: 100%; }
  .help-feedback { padding: 22px 18px; }
  .help-article td:first-child { white-space: normal; }
  /* Two-column fact tables stack; the comparison table keeps its columns. */
  .help-article table:not(.compare), .help-article table:not(.compare) tbody, .help-article table:not(.compare) tr, .help-article table:not(.compare) td { display: block; width: 100%; }
  .help-article table:not(.compare) td { border-top: 0; padding: 0 0 12px; }
  .help-article table:not(.compare) tr { border-top: 1px solid var(--line); padding-top: 14px; }
  .help-article table:not(.compare) tr:last-child { border-bottom: 1px solid var(--line); }
  .help-article table:not(.compare) tr:last-child td { border-bottom: 0; }
  .help-article .compare { font-size: 14px; }
  .help-article .compare th, .help-article .compare td { padding-right: 10px; overflow-wrap: anywhere; }
}

@media (prefers-reduced-motion: reduce) {
  .faq-page summary::after { transition: none; }
}

/* site.css spaces prose list items; the related grid uses its own gap. */
.help-article .related li + li { margin-top: 0; }
