/*
  The user guide (/help/): read in OptiCRM's help window, about 560 pixels wide beside the application, and in a browser.
  Written for people who use a computer little: large text, short lines, numbered steps, and the section the application
  opened (the #section of the address) marked so the eye finds it.
*/

.guide-brand span { font-size: 18px; }

.guide { max-width: 760px; padding-top: 20px; padding-bottom: 72px; font-size: 18px; line-height: 1.65; }
.guide h1 { font-size: clamp(28px, 4vw, 38px); font-weight: 700; }
.guide-lead { margin-top: 14px; color: var(--ink-2); font-size: 19px; }

.guide-crumbs { margin-bottom: 10px; font-size: 15px; color: var(--ink-3); }

.guide-toc {
  margin-top: 24px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
}
.guide-toc p { font-weight: 600; margin-bottom: 6px; }
.guide-toc ul { margin: 0; padding-left: 22px; }
.guide-toc li + li { margin-top: 4px; }

.guide-section { margin-top: 40px; scroll-margin-top: 80px; }
.guide-section h2 { font-size: 24px; font-weight: 700; margin-bottom: 12px; }
.guide-section h3 { font-size: 19px; font-weight: 700; margin: 24px 0 8px; }
.guide-section p + p, .guide-section p + ul, .guide-section ul + p, .guide-section ol + p, .guide-section dl + p { margin-top: 12px; }

/* The section the application opened, or a link went to: a soft background around it. */
.guide-section:target {
  margin-left: -14px; margin-right: -14px; padding: 14px; border-radius: 14px;
  background: var(--blue-soft); box-shadow: inset 4px 0 0 var(--brand);
}

.guide-list { margin: 8px 0 0; padding-left: 24px; }
.guide-list li + li { margin-top: 8px; }

/* Numbered steps: one thing to do in each, the number in a circle. */
.guide-steps { counter-reset: step; list-style: none; margin: 14px 0 0; padding: 0; }
.guide-steps > li { counter-increment: step; position: relative; padding-left: 46px; min-height: 32px; }
.guide-steps > li + li { margin-top: 14px; }
.guide-steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand); color: #fff; font-weight: 700; font-size: 16px;
}
@media (prefers-color-scheme: dark) { .guide-steps > li::before { color: #08202f; } }

/* What a field is for: its name as the screen writes it, then a line about it. */
.guide-fields { margin: 12px 0 0; }
.guide-fields dt { font-weight: 600; margin-top: 12px; }
.guide-fields dd { margin: 2px 0 0 0; color: var(--ink-2); }

.guide-tip, .guide-warn, .guide-missing { margin-top: 18px; padding: 14px 16px; border-radius: 10px; border-left: 4px solid; }
.guide-tip { background: var(--green-soft); border-color: var(--green); }
.guide-warn { background: var(--sand-soft); border-color: var(--sand); }
.guide-missing { margin: 0 0 24px; background: var(--sand-soft); border-color: var(--sand); }
.guide-tip strong, .guide-warn strong { display: block; margin-bottom: 2px; }

/* A word on the screen (a button, a tab, a menu): bold, so it is easy to look for. */
.ui { font-weight: 600; }

kbd {
  display: inline-block; min-width: 1.8em; padding: 0 6px; border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 6px; background: var(--surface); font: 600 15px/1.6 var(--font); text-align: center;
}

.guide-q {
  display: inline-grid; place-items: center; width: 1.4em; height: 1.4em; border-radius: 50%;
  background: var(--brand); color: #fff; font-weight: 700; font-size: 15px; line-height: 1;
}
@media (prefers-color-scheme: dark) { .guide-q { color: #08202f; } }

/* The guide's pages, grouped, on its first page. */
.guide-pages { display: grid; gap: 22px; margin-top: 8px; }
.guide-pages h3 { font-size: 17px; font-weight: 700; color: var(--ink-2); margin: 0 0 6px; }
.guide-pages ul { margin: 0; padding-left: 22px; }
.guide-pages li + li { margin-top: 4px; }
@media (min-width: 720px) { .guide-pages { grid-template-columns: 1fr 1fr; } }

.guide-next { margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 16px; color: var(--ink-2); }

@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  .guide { padding-top: 14px; font-size: 17px; }
  .top-row { height: 56px; }
}
/* A picture of the application's screen, as it looks with a demo club; a click shows it at its full size (help.js). */
.guide-shot { margin: 18px 0 22px; }
.guide-shot img {
  display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 2px 10px rgba(8, 32, 47, .10); background: #fff; cursor: zoom-in;
}
.guide-shot figcaption { margin-top: 8px; font-size: 15px; line-height: 1.5; color: var(--ink-3); }
.guide-zoom {
  position: fixed; inset: 0; z-index: 100; overflow: auto; padding: 16px; background: rgba(8, 20, 30, .88); cursor: zoom-out;
}
.guide-zoom img { display: block; margin: 0 auto; max-width: none; border-radius: 6px; box-shadow: 0 6px 30px rgba(0, 0, 0, .45); }
.guide-zoom p { margin: 0 auto 10px; max-width: 760px; color: #fff; font-size: 15px; text-align: center; }

/* The search box at the top of every page (help.js): what the user writes, and the sections that speak of it, each with
   its sentence that says most of it and the words looked for marked. */
.guide-search { margin: 0 0 24px; scroll-margin-top: 80px; }
.guide-lead + .guide-search { margin-top: 24px; }
.guide-search label { display: block; margin-bottom: 6px; font-size: 16px; }
.guide-search-row { display: flex; gap: 8px; }
.guide-search-row input { flex: 1; min-width: 0; font-size: 17px; }
.guide-search-row .btn { flex: none; }
.guide-search-examples { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; font-size: 15px; color: var(--ink-2); }
.guide-search-examples button {
  font: inherit; font-size: 15px; padding: 3px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink); cursor: pointer;
}
.guide-search-examples button:hover { border-color: var(--brand); }
.guide-search-status { margin-top: 8px; font-size: 15px; color: var(--ink-2); }
.guide-search-status:empty { display: none; }
.guide-search-results { list-style: none; display: grid; gap: 8px; margin: 10px 0 0; padding: 0; }
.guide-search-results:empty { display: none; }
.guide-search-results a {
  display: block; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  color: var(--ink); text-decoration: none;
}
.guide-search-results a:hover, .guide-search-results a:focus-visible { border-color: var(--brand); box-shadow: inset 4px 0 0 var(--brand); }
.guide-search-where { display: block; font-weight: 600; color: var(--brand); }
.guide-search-text { display: block; margin-top: 2px; font-size: 16px; line-height: 1.5; color: var(--ink-2); }
.guide-search mark { padding: 0 1px; border-radius: 3px; background: var(--sand-soft); color: inherit; font-weight: 600; }
@media (max-width: 420px) { .guide-search-row { flex-direction: column; } }
