/*
 * spoonhouse.app/help: the help centre. Sits on top of site.css (fonts, colours, header and
 * footer), so it follows light and dark the same way. Nothing here moves.
 * The pages are built from firebase/hosting/help-src (see docs/help-centre.md).
 */

.help { max-width: 760px; padding-top: 40px; }
.help h1 { font-size: clamp(32px, 5vw, 44px); line-height: 1.15; margin-bottom: 12px; }
.help > h2, .help section > h2 { font-size: 24px; line-height: 32px; margin: 48px 0 16px; }
.help .lede { font-size: 20px; line-height: 30px; color: var(--ink-soft); max-width: 34em; }

/* Breadcrumb: Help centre / Topic / Article */
.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  font-size: 16px;
  line-height: 24px;
  color: var(--ink-soft);
}
.crumbs li { display: flex; align-items: center; gap: 8px; }
.crumbs li + li::before { content: "/"; color: var(--outline); }
.crumbs a { display: inline-block; padding: 10px 0; }

/* Home */
.help-hero { padding-bottom: 8px; }
.help-search { display: block; margin-top: 28px; }
.help-search label { display: block; font-weight: 600; margin-bottom: 8px; }
.search-row { display: flex; flex-wrap: wrap; gap: 12px; }
.help-search .field { flex: 1 1 240px; }
.help-search .field::-webkit-search-cancel-button { cursor: pointer; }
.search-status { margin-top: 12px; color: var(--ink-soft); font-size: 16px; line-height: 24px; }
.search-status:empty { display: none; }
.results { list-style: none; padding: 0; margin: 12px 0 0; overflow: hidden; }
.results li + li { border-top: 1px solid var(--hairline); }
.results a { display: block; padding: 14px 20px; text-decoration: none; color: var(--ink); }
.results a:hover .result-title { text-decoration: underline; }
.results a:focus-visible { outline-offset: -4px; border-radius: var(--radius-lg); }
.result-title { display: block; color: var(--rose); font-weight: 600; }
.result-where { display: block; font-size: 15px; line-height: 22px; color: var(--ink-soft); }

.quick { padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }
.quick a { display: inline-block; padding: 8px 0; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
  gap: 12px;
  list-style: none;
  padding: 0;
}
.tile-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  padding: 18px 20px;
  color: var(--ink);
  text-decoration: none;
}
.tile-link:hover { border-color: var(--outline); color: var(--ink); }
.tile-link:hover .tile-title { text-decoration: underline; }
.tile-title { color: var(--rose); font-weight: 600; font-size: 19px; line-height: 26px; }
.tile-link .soft { font-size: 16px; line-height: 24px; }
.tile-count { margin-top: auto; padding-top: 6px; font-size: 14px; line-height: 20px; color: var(--ink-soft); }

/* Topic: its articles */
.article-list { list-style: none; padding: 0; margin: 32px 0 0; overflow: hidden; }
.article-list li + li { border-top: 1px solid var(--hairline); }
.row-link { display: flex; flex-direction: column; gap: 2px; padding: 16px 20px; color: var(--ink); text-decoration: none; }
.row-link:hover .row-title { text-decoration: underline; }
.row-link:focus-visible { outline-offset: -4px; border-radius: var(--radius-lg); }
.row-title { color: var(--rose); font-weight: 600; }
.row-link .soft { font-size: 16px; line-height: 24px; }

/* An article */
.article .updated { margin-top: 12px; color: var(--ink-soft); font-size: 16px; line-height: 24px; }
.article h2 { font-size: 24px; line-height: 32px; margin: 40px 0 12px; }
.article h3 { font-size: 20px; line-height: 28px; margin: 28px 0 8px; }
.article p, .article ul, .article ol { margin: 0 0 16px; }
.article ul, .article ol { padding-left: 26px; }
.article li + li { margin-top: 8px; }
.article code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.92em;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--tag);
  overflow-wrap: anywhere;
}
.article pre {
  margin: 0 0 16px;
  padding: 16px 20px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--hairline);
  overflow-x: auto;
  font-size: 16px;
  line-height: 24px;
}
.article pre code { padding: 0; background: none; font-size: inherit; overflow-wrap: normal; }
.article .steps li::marker { color: var(--rose); font-weight: 600; }
.article .note {
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--lavender);
  color: var(--lavender-ink);
}
.article .note a { color: inherit; }

/* Screenshots. The calm slot that holds a picture's place is in site.css. */
.help .shot, .help .shot-slot { margin: 24px 0; }
.shot img {
  width: auto;
  max-width: min(100%, 320px);
  height: auto;
  border-radius: 20px;
  border: 1px solid var(--hairline);
}

/* Clips (docs/screencasts.md): a short silent loop with Pause and Play, or, for less motion, its
   steps as pictures with their words. clips.js plays it only while it is on screen. */
.help .clip { margin: 24px 0; }
.clip-stage { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; max-width: min(100%, 320px); }
.clip.wide .clip-stage { max-width: min(100%, 640px); }
.clip-video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 20px;
  border: 1px solid var(--hairline);
  background: var(--card);
}
.clip-toggle { min-height: 48px; }
.clip-steps {
  display: none;
  list-style: none;
  padding: 0;
  margin: 0;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}
.clip.wide .clip-steps { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.clip-steps img { display: block; width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--hairline); }
.clip-steps span { display: block; margin-top: 6px; font-size: 15px; line-height: 22px; color: var(--ink-soft); }
.clip figcaption { margin-top: 8px; max-width: 30em; font-size: 15px; line-height: 23px; color: var(--ink-soft); }
@media (prefers-reduced-motion: reduce) {
  .clip-stage { display: none; }
  .clip-steps { display: grid; }
}

/* Related, and Still stuck? */
.related ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.related li { display: flex; flex-direction: column; }
.related a { display: inline-block; padding: 8px 0 0; font-weight: 600; }
.related .soft { font-size: 16px; line-height: 24px; }
.stuck { margin-top: 48px; padding: 24px 28px; }
.help .stuck h2 { margin: 0 0 8px; font-size: 22px; line-height: 30px; }

@media (max-width: 640px) {
  .help { padding-top: 24px; }
  .help .lede { font-size: 19px; line-height: 28px; }
  .stuck { padding: 20px; }
}

/* Printing an article: just the words. */
@media print {
  .site-header, .site-footer, .crumbs, .stuck { display: none; }
}
