/* The public manual.
 *
 * Loaded AFTER landing.css and depends on its tokens (--lp-ink, --lp-line, --lp-soft…) and on its
 * header and footer classes, so a reader moving between the sales page and the manual stays in the
 * same product rather than arriving somewhere that merely links back.
 *
 * This file is only the READING surface: a column of prose at a measured width, a contents list
 * beside it, and the callout boxes the chapters are written with. Everything here is shared by
 * every chapter, because 21 pages each carrying their own styles is 21 pages that drift apart.
 *
 * 🔑 THE MEASURE IS THE WHOLE DESIGN. 68 characters a line, 1.75 line height, 1.05rem type. A
 * manual is read, not scanned, and prose set to the full width of a 27-inch monitor is prose
 * nobody finishes. Everything else here serves that column.
 */

/* ------------------------------------------------------------------ shell */

.gd-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.25rem 5rem;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 3.25rem;
  align-items: start;
}

/* The header is fixed, so both columns have to clear it. */
.gd-top-space { height: 5.5rem; }

/* ------------------------------------------------------------- breadcrumb */

.gd-crumb {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem .25rem;
  font-size: .84rem;
  color: var(--lp-muted);
}

.gd-crumb a { color: var(--lp-muted); text-decoration: none; }
.gd-crumb a:hover { color: var(--lp-accent); text-decoration: underline; }
.gd-crumb i { font-size: .7rem; margin: 0 .35rem; opacity: .55; }

/* --------------------------------------------------------------- contents */

.gd-side {
  position: sticky;
  top: 6.5rem;
  max-height: calc(100vh - 8rem);
  overflow-y: auto;
  font-size: .9rem;
  padding-right: .5rem;
}

.gd-side h2 {
  font-family: 'Sora', 'Poppins', sans-serif;
  font-size: .74rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--lp-muted);
  margin: 1.6rem 0 .6rem;
}

.gd-side h2:first-child { margin-top: 0; }

.gd-side ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: gd;
}

.gd-side li {
  counter-increment: gd;
  margin: 0;
  line-height: 1.4;
}

.gd-side a,
.gd-side span {
  display: block;
  padding: .4rem .6rem .4rem 2rem;
  border-radius: 9px;
  text-decoration: none;
  color: var(--lp-ink-2);
  position: relative;
}

.gd-side a::before,
.gd-side span::before {
  content: counter(gd);
  position: absolute;
  left: .55rem;
  width: 1.1rem;
  text-align: right;
  font-size: .78rem;
  color: var(--lp-muted);
  opacity: .8;
}

.gd-side a:hover { background: var(--lp-soft); color: var(--lp-ink); }

.gd-side a.gd-here {
  background: var(--lp-ink);
  color: #fff;
  font-weight: 600;
}

.gd-side a.gd-here::before { color: rgba(255, 255, 255, .7); }

/* A chapter that is written but not yet published reads as plain text, not a dead link. Nothing
 * here promises a page that would 404. */
.gd-side span { color: var(--lp-muted); opacity: .62; cursor: default; }

/* ------------------------------------------------------------------ prose */

.gd-body { max-width: 44rem; }          /* ~68 characters at this type size */

.gd-kicker {
  font-family: 'Sora', 'Poppins', sans-serif;
  font-size: .76rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--lp-accent);
  font-weight: 700;
  margin-bottom: .5rem;
}

.gd-body h1 {
  font-family: 'Sora', 'Poppins', sans-serif;
  font-size: clamp(1.9rem, 4.2vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -.02em;
  color: var(--lp-ink);
  margin: 0 0 1rem;
}

/* The one paragraph written for somebody who arrived from a search engine and has never heard of
 * the product. Every chapter needs one; the Markdown originals do not have them, because they were
 * written for a customer who had already bought. */
.gd-lede {
  font-size: 1.16rem;
  line-height: 1.6;
  color: var(--lp-ink-2);
  margin: 0 0 2.25rem;
  padding-bottom: 2.25rem;
  border-bottom: 1px solid var(--lp-line);
}

.gd-body h2 {
  font-family: 'Sora', 'Poppins', sans-serif;
  font-size: 1.46rem;
  line-height: 1.25;
  color: var(--lp-ink);
  margin: 3rem 0 .9rem;
  scroll-margin-top: 6.5rem;
}

.gd-body h3 {
  font-family: 'Sora', 'Poppins', sans-serif;
  font-size: 1.1rem;
  color: var(--lp-ink-2);
  margin: 2.1rem 0 .7rem;
  scroll-margin-top: 6.5rem;
}

.gd-body p,
.gd-body li {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--lp-text);
}

.gd-body p { margin: 0 0 1.15rem; }
.gd-body ul { margin: 0 0 1.35rem; padding-left: 1.3rem; }
.gd-body li { margin-bottom: .55rem; }
.gd-body li::marker { color: var(--lp-accent); }
.gd-body strong { color: var(--lp-ink); font-weight: 600; }
.gd-body em { color: var(--lp-ink-2); }

.gd-body a { color: var(--lp-blue); text-underline-offset: .18em; }
.gd-body a:hover { color: var(--lp-accent); }

/* A screen path: Reports -> Visits. Set apart so an instruction is never mistaken for prose.
 *
 * Deliberately NOT white-space: nowrap. "Settings -> Attendance setup -> Punch Rules -> Field staff
 * may not punch from home" is a real path in chapter 5, and on a 375px screen an unbreakable one
 * pushes the whole page sideways. */
.gd-nav-path {
  font-weight: 600;
  color: var(--lp-ink);
}

/* ----------------------------------------------------------- callout box */

/* The chapters are written with GitHub's > [!IMPORTANT] blocks. They carry the things a reader
 * must not skim past, so they keep that weight here instead of flattening into a paragraph. */
.gd-note {
  margin: 2rem 0;
  padding: 1.15rem 1.35rem;
  border-left: 3px solid var(--lp-accent);
  border-radius: 0 14px 14px 0;
  background: var(--lp-soft);
}

.gd-note > :last-child { margin-bottom: 0; }

.gd-note-head {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-family: 'Sora', 'Poppins', sans-serif;
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--lp-accent-dark);
  margin-bottom: .6rem;
}

.gd-note p { font-size: 1rem; }
.gd-note ul, .gd-note ol { margin-bottom: 1rem; }
.gd-note li { font-size: 1rem; }

/* The five kinds the chapters are written with, in the weight each one earns. NOTE and TIP are
 * asides; WARNING and DANGER are the two that cost somebody their morning if skimmed past, so they
 * are the only ones that get a coloured ground as well as a coloured rule. */
.gd-note-tip       { border-left-color: var(--lp-good); }
.gd-note-tip       .gd-note-head { color: var(--lp-good); }
.gd-note-note      { border-left-color: var(--lp-blue); }
.gd-note-note      .gd-note-head { color: var(--lp-blue); }
.gd-note-important { border-left-color: var(--lp-violet); }
.gd-note-important .gd-note-head { color: var(--lp-violet); }

.gd-note-warning {
  border-left-color: var(--lp-amber);
  background: #fdf7e8;
}

.gd-note-warning .gd-note-head { color: #8a5d05; }

.gd-note-danger {
  border-left-color: var(--lp-accent);
  background: #fdeeee;
}

.gd-note-danger .gd-note-head { color: var(--lp-accent-dark); }

/* ----------------------------------------------------------------- tables */

/* 112 lines of table across the 21 chapters, so this is not a trimming. The wrapper scrolls rather
 * than the page: a four-column table of punch rules cannot be made to fit 375px, and squeezing it
 * until each cell holds one word per line is not fitting it either. */
.gd-table-wrap {
  margin: 1.75rem 0;
  overflow-x: auto;
  border: 1px solid var(--lp-line);
  border-radius: 14px;
}

.gd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .97rem;
}

.gd-table th,
.gd-table td {
  padding: .7rem .9rem;
  text-align: left;
  vertical-align: top;
  line-height: 1.55;
  border-bottom: 1px solid var(--lp-line);
}

.gd-table thead th {
  background: var(--lp-soft);
  font-family: 'Sora', 'Poppins', sans-serif;
  font-size: .82rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--lp-ink-2);
  white-space: nowrap;
}

.gd-table tbody tr:last-child td { border-bottom: 0; }
.gd-table tbody tr:hover { background: #fafbfe; }

/* The first column of these tables is almost always the thing being named - a report, a setting,
 * a key - and reads as a row heading. */
.gd-table td:first-child { color: var(--lp-ink); }

.gd-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .9em;
  padding: .12em .4em;
  border-radius: 6px;
  background: var(--lp-soft);
  border: 1px solid var(--lp-line);
  color: var(--lp-ink-2);
}

/* ---------------------------------------------------------------- figures */

/* Phone screenshots, so they are shown at a phone's width rather than stretched across the column.
 * A 390px-wide screenshot blown up to 700px is a blurry screenshot. */
.gd-fig {
  margin: 2rem 0;
  max-width: 310px;
}

.gd-fig img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--lp-line);
  border-radius: 16px;
  box-shadow: 0 .5rem 1.4rem rgba(16, 27, 46, .09);
}

.gd-fig figcaption {
  margin-top: .7rem;
  font-size: .88rem;
  line-height: 1.5;
  color: var(--lp-muted);
}

/* ------------------------------------------------------- quote and rule */

.gd-quote {
  margin: 1.75rem 0;
  padding: .9rem 1.2rem;
  border-left: 3px solid var(--lp-line);
  background: var(--lp-soft);
  border-radius: 0 12px 12px 0;
  font-size: 1.04rem;
  line-height: 1.7;
  color: var(--lp-ink-2);
}

.gd-rule {
  margin: 2.75rem 0;
  border: 0;
  border-top: 1px solid var(--lp-line);
}

/* ---------------------------------------------------- the contents page */

.gd-wrap {
  max-width: 940px;
  margin: 0 auto;
  padding: 0 1.25rem 5rem;
}

.gd-hero { padding: 1rem 0 2.5rem; }

.gd-hero h1 {
  font-family: 'Sora', 'Poppins', sans-serif;
  font-size: clamp(2.1rem, 5vw, 3rem);
  line-height: 1.1;
  letter-spacing: -.025em;
  color: var(--lp-ink);
  margin: 0 0 1rem;
}

.gd-hero .gd-lede { max-width: 42rem; }

.gd-book { margin-bottom: 3.5rem; }

.gd-book h2 {
  font-family: 'Sora', 'Poppins', sans-serif;
  font-size: 1.5rem;
  color: var(--lp-ink);
  margin: 0 0 .4rem;
}

.gd-book-blurb {
  margin: 0 0 1.5rem;
  color: var(--lp-muted);
  font-size: 1rem;
  max-width: 40rem;
}

.gd-toc {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .4rem;
}

.gd-toc > li {
  border: 1px solid var(--lp-line);
  border-radius: 14px;
  padding: 1rem 1.15rem;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}

.gd-toc > li:hover {
  border-color: #c9d3e6;
  box-shadow: 0 .4rem 1.1rem rgba(16, 27, 46, .07);
}

.gd-toc a {
  display: flex;
  align-items: baseline;
  gap: .7rem;
  text-decoration: none;
}

.gd-toc-no {
  flex: 0 0 1.9rem;
  font-family: 'Sora', 'Poppins', sans-serif;
  font-size: .82rem;
  font-weight: 700;
  color: var(--lp-accent);
}

.gd-toc-name {
  font-family: 'Sora', 'Poppins', sans-serif;
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--lp-ink);
}

.gd-toc a:hover .gd-toc-name { color: var(--lp-accent); }

.gd-toc p {
  margin: .35rem 0 0 2.6rem;
  font-size: .95rem;
  line-height: 1.6;
  color: var(--lp-muted);
}

@media (max-width: 560px) {
  .gd-toc p { margin-left: 0; }
}

/* ------------------------------------------------------------- page foot */

.gd-next {
  margin-top: 3.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--lp-line);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.gd-next p { margin: 0; font-size: .97rem; color: var(--lp-muted); }

.gd-updated {
  margin-top: 2.5rem;
  font-size: .85rem;
  color: var(--lp-muted);
}

/* ------------------------------------------------------------- the phone */

@media (max-width: 900px) {
  .gd-shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding-bottom: 3.5rem;
  }

  /* On a phone the contents go BELOW the chapter, not above it. A reader who followed a search
   * result wants the answer, not a list of the twenty other chapters they did not ask for. */
  .gd-side {
    position: static;
    max-height: none;
    order: 2;
    margin-top: 3.5rem;
    padding: 1.75rem 0 0;
    border-top: 1px solid var(--lp-line);
  }

  .gd-body { order: 1; max-width: none; }
  .gd-body p, .gd-body li { font-size: 1.02rem; }
}

@media print {
  .lp-nav, .lp-foot, .gd-side, .gd-crumb, .gd-next, .gd-top-space { display: none !important; }
  .gd-shell { display: block; padding: 0; }
  .gd-body { max-width: none; }
  .gd-body p, .gd-body li { font-size: 11pt; line-height: 1.55; }
  .gd-note { background: #f4f4f4; border-left: 2pt solid #555; }
}
