/* ddir.co.uk help centre and terms: what only those pages need, on top of
 * /site/site.css. Linked after it; the build stamps ?v=<hash> on both.
 *
 * The help centre's job is finding an answer fast and then reading it
 * comfortably: a plain search field over a grouped list (like the home
 * page's modules list), and the article set for reading on a paper panel.
 * The terms use the same reading panel with a contents list. */

.nav a[aria-current='page'] { color: var(--paper); }

/* ── The opening, on ink ──────────────────────────────────────────────── */
.help-top { padding: 36px 0 32px; }
.help-top .wrap { display: grid; gap: 16px; justify-items: start; }
.help-top h1 { max-width: 13em; }
.help-top--article h1 { font-size: clamp(32px, 4.6vw, 54px); line-height: 1.06; max-width: 20em; }
@media (min-width: 760px) { .help-top { padding: 80px 0 48px; } .help-top--article { padding: 64px 0 40px; } }

.help-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 15px; color: var(--fg-3); }
.help-crumbs a { color: var(--fg-2); text-decoration: none; padding: 6px 0; }
.help-crumbs a:hover { color: var(--fg); text-decoration: underline; text-underline-offset: 4px; }

/* Search: one large field. It only hides rows, so without it nothing is lost. */
.help-search { width: 100%; max-width: 640px; margin-top: 12px; position: relative; }
.help-search::before { content: ''; position: absolute; left: 22px; top: 50%; width: 15px; height: 15px; border: 2px solid var(--fg-3); border-radius: 50%; transform: translateY(-60%); pointer-events: none; }
.help-search::after { content: ''; position: absolute; left: 36px; top: 50%; width: 7px; height: 2px; background: var(--fg-3); transform: translateY(5px) rotate(45deg); pointer-events: none; }
.help-search input {
  width: 100%; min-height: 62px; padding: 0 22px 0 54px; border-radius: 99px;
  border: 1px solid var(--rule-strong); background: var(--ink-1); color: var(--paper);
  font-size: 18px; -webkit-appearance: none; appearance: none;
  transition: border-color var(--dur) ease, box-shadow var(--dur) ease, background-color var(--dur) ease;
}
.help-search input::placeholder { color: var(--paper-3); }
.help-search input::-webkit-search-cancel-button {
  -webkit-appearance: none; width: 18px; height: 18px; margin-right: 4px; cursor: pointer; opacity: 0.7;
  background: linear-gradient(45deg, transparent 45%, var(--paper-2) 45%, var(--paper-2) 55%, transparent 55%),
              linear-gradient(-45deg, transparent 45%, var(--paper-2) 45%, var(--paper-2) 55%, transparent 55%);
}
.help-search input::-webkit-search-cancel-button:hover { opacity: 1; }
.help-search input:focus { outline: none; border-color: var(--accent); background: var(--ink-2); box-shadow: 0 0 0 3px rgba(60, 179, 113, 0.25); }
.no-js .help-search, .no-js .help-count { display: none; }
.help-count { min-height: 1.4em; font-size: 15px; color: var(--fg-3); }

/* ── The index: categories as groups, each article a row ──────────────── */
.help-index-wrap { padding: 8px 0 72px; }
.help-index { display: grid; gap: 40px; }
.help-col { display: grid; gap: 40px; align-content: start; }
.help-group { scroll-margin-top: calc(var(--header-h) + 16px); }
.help-group h2 {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--rule-strong);
  font-size: 22px; letter-spacing: -0.02em; line-height: 1.2;
}
.help-n { flex: none; font-family: var(--mono); font-weight: 500; font-size: 13px; letter-spacing: 0; color: var(--fg-3); }
.help-group li a {
  display: flex; align-items: baseline; gap: 12px; padding: 15px 0;
  border-bottom: 1px solid var(--rule); text-decoration: none;
  font-size: 16.5px; font-weight: 500; line-height: 1.4; color: var(--fg);
  transition: color var(--dur) ease;
}
.help-group li a span { flex: 1; min-width: 0; text-wrap: pretty; }
.help-group li a::after { content: '→'; flex: none; color: var(--fg-3); transition: transform 160ms var(--ease-out), color var(--dur) ease; }
@media (hover: hover) and (pointer: fine) {
  .help-group li a:hover { color: var(--accent); }
  .help-group li a:hover::after { color: var(--accent); transform: translateX(3px); }
}
.help-has-video { flex: none; font-family: var(--mono); font-weight: 500; font-size: 12px; color: var(--fg-3); }
.help-group[hidden], .help-group li[hidden] { display: none; }
.help-none { padding: 24px 0; font-size: 17px; color: var(--fg-2); }
.help-none a { color: var(--fg); font-weight: 600; text-underline-offset: 4px; }
.help-empty { padding: 48px 0; color: var(--fg-3); }
@media (min-width: 760px) {
  .help-index { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 64px; align-items: start; }
  .help-col { gap: 52px; }
}

/* Andre, and the way in, under the index. */
.help-andre { padding: 0 0 88px; }
.help-andre .wrap { display: grid; gap: 14px; justify-items: start; padding-top: 40px; border-top: 1px solid var(--rule); }
.help-andre h2 { font-size: clamp(28px, 3.4vw, 40px); }
.help-andre p { max-width: 38em; font-size: 17px; color: var(--fg-2); text-wrap: pretty; }
.help-andre .acts { width: 100%; margin-top: 8px; gap: 12px 24px; }
.help-andre .more { justify-self: start; }

/* ── Reading: an article, or the terms, on a paper panel ─────────────── */
.help-read { padding: 28px 0 40px; }
.help-read-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; }
main > .help-read:last-child { margin-bottom: 56px; }
.help-read-main { min-width: 0; }
@media (min-width: 760px) { .help-read { padding: 56px 0 72px; } }
@media (min-width: 1000px) { .help-read-grid { grid-template-columns: minmax(0, 1fr) 300px; gap: 72px; align-items: start; } }

.help-video-embed { position: relative; aspect-ratio: 16 / 9; margin: 0 0 32px; border-radius: 16px; overflow: hidden; background: #000; }
.help-video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.help-prose { max-width: 40em; font-size: 18px; line-height: 1.7; color: var(--sheet-ink-2); overflow-wrap: anywhere; }
.help-prose > * + * { margin-top: 18px; }
.help-prose h2, .help-prose h3, .help-prose h4 { color: var(--sheet-ink); text-wrap: balance; }
.help-prose h2 { margin-top: 44px; font-size: 27px; line-height: 1.2; letter-spacing: -0.025em; }
.help-prose h3 { margin-top: 32px; font-size: 21px; letter-spacing: -0.015em; }
.help-prose h4 { margin-top: 24px; font-size: 18px; font-weight: 700; }
.help-prose > :first-child { margin-top: 0; }
.help-prose h2 + *, .help-prose h3 + *, .help-prose h4 + * { margin-top: 10px; }
.help-prose ul, .help-prose ol { padding-left: 1.35em; }
.help-prose ul { list-style: disc; }
.help-prose ol { list-style: decimal; }
.help-prose li + li { margin-top: 8px; }
.help-prose li > ul, .help-prose li > ol { margin-top: 8px; }
.help-prose li::marker { color: #1f7a45; font-weight: 600; }
.help-prose strong, .help-prose b { color: var(--sheet-ink); font-weight: 600; }
.help-prose a { color: var(--sheet-ink); font-weight: 600; text-decoration: underline; text-decoration-color: rgba(12, 15, 20, 0.3); text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.help-prose a:hover { text-decoration-color: currentColor; }
.help-prose img { border-radius: 14px; }
.help-prose code { font-family: var(--mono); font-size: 0.88em; padding: 1px 6px; border-radius: 6px; background: var(--sheet-tile); }
.help-prose blockquote { padding-left: 18px; border-left: 2px solid rgba(12, 15, 20, 0.2); }
.help-prose hr { border: 0; border-top: 1px solid rgba(12, 15, 20, 0.14); margin: 40px 0; }
.help-prose table { display: block; width: 100%; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 15.5px; line-height: 1.5; }
.help-prose th, .help-prose td { padding: 10px 14px 10px 0; text-align: left; vertical-align: top; border-bottom: 1px solid rgba(12, 15, 20, 0.12); min-width: 8em; }
.help-prose th { color: var(--sheet-ink); font-weight: 700; border-bottom-color: rgba(12, 15, 20, 0.3); }
.help-prose small { font-size: 14px; color: var(--sheet-ink-3); }
@media (max-width: 599px) { .help-prose { font-size: 17px; } .help-prose h2 { font-size: 24px; } }

.help-andre-note { max-width: 40em; margin-top: 40px; padding: 18px 20px; border-radius: 16px; background: var(--sheet-tile); font-size: 15.5px; line-height: 1.55; color: var(--sheet-ink-2); text-wrap: pretty; }
.help-andre-note b { display: block; margin-bottom: 4px; color: var(--sheet-ink); font-weight: 600; }

.help-cta { max-width: 40em; margin-top: 40px; padding-top: 32px; border-top: 1px solid rgba(12, 15, 20, 0.14); display: grid; gap: 10px; }
.help-cta h2 { font-size: 28px; }
.help-cta p { font-size: 16.5px; color: var(--sheet-ink-2); }
.help-cta .acts { margin-top: 8px; }

/* Beside the article: the capability guide it belongs to, then its neighbours. */
.help-aside { display: grid; gap: 32px; align-content: start; min-width: 0; }
@media (min-width: 1000px) { .help-aside { position: sticky; top: calc(var(--header-h) + 24px); } }
.help-guide {
  display: grid; gap: 6px; padding: 20px; border-radius: 18px; background: #ffffff;
  box-shadow: 0 0 0 1px rgba(12, 15, 20, 0.08); color: var(--sheet-ink); text-decoration: none;
  transition: box-shadow var(--dur) ease;
}
.help-guide small { font-size: 13.5px; color: var(--sheet-ink-3); }
.help-guide b { font-size: 18px; letter-spacing: -0.015em; line-height: 1.3; }
.help-guide b::after { content: ' →'; font-weight: 500; }
.help-guide span { font-size: 15px; line-height: 1.5; color: var(--sheet-ink-2); text-wrap: pretty; }
.help-guide:hover { box-shadow: 0 0 0 1px rgba(12, 15, 20, 0.22); }
.help-related h2 { padding-bottom: 10px; border-bottom: 1px solid rgba(12, 15, 20, 0.2); font-size: 17px; letter-spacing: -0.01em; }
.help-related li a { display: block; padding: 12px 0; border-bottom: 1px solid rgba(12, 15, 20, 0.1); color: var(--sheet-ink); text-decoration: none; font-size: 15.5px; font-weight: 500; line-height: 1.4; }
.help-related li a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ── Terms: contents beside the text on desktop, folded on a phone ────── */
.help-legal-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.help-legal-grid > * { min-width: 0; }
.help-legal { max-width: 46em; }
.help-legal h2 { scroll-margin-top: calc(var(--header-h) + 20px); }
.help-legal h2 + p > em:only-child { color: var(--sheet-ink-3); }
.help-toc ol { counter-reset: none; }
.help-toc li a { display: block; padding: 7px 0; color: var(--sheet-ink-2); text-decoration: none; font-size: 15px; line-height: 1.35; }
.help-toc li a:hover { color: var(--sheet-ink); text-decoration: underline; text-underline-offset: 4px; }
.help-toc-fold { border: 1px solid rgba(12, 15, 20, 0.14); border-radius: 16px; padding: 0 18px; }
.help-toc-fold summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; min-height: 52px; font-weight: 700; }
.help-toc-fold summary::-webkit-details-marker { display: none; }
.help-toc-fold summary::after { content: ''; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-3px) rotate(45deg); transition: transform 200ms var(--ease-out); }
.help-toc-fold[open] summary::after { transform: translateY(2px) rotate(225deg); }
.help-toc-fold ol { padding-bottom: 12px; }
.help-toc-side { display: none; }
@media (min-width: 1000px) {
  .help-legal-grid { grid-template-columns: 240px minmax(0, 1fr); gap: 64px; align-items: start; }
  .help-toc { position: sticky; top: calc(var(--header-h) + 24px); max-height: calc(100vh - var(--header-h) - 48px); overflow-y: auto; }
  .help-toc-fold { display: none; }
  .help-toc-side { display: block; }
  .help-toc-side p { margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--sheet-ink-3); }
}

@media (prefers-reduced-motion: reduce) {
  .help-group li a::after, .help-toc-fold summary::after, .help-search input { transition: none; }
}
