/* The user guide (website/guide/*.html). Loaded after styles.css, site.css and landing.css, so the nav,
   footer, buttons, keys (`kbd` in sentences, `.combo kbd` as standalone chips) and colours are the
   site's own. A calm docs layout, like Apple's and Raycast's manual pages: the guide's pages in a
   sidebar on the left (a fold-out list on phones), one readable column of text on the right. */

.guide {
  padding: 0 0 112px;
  text-align: left;
}
.g-wrap {
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  gap: 64px;
  max-width: calc(1000px + 2 * var(--gutter));
  margin: 0 auto;
  padding: 48px var(--gutter) 0;
}

/* Sidebar: every guide page, grouped, the current one on a light gray pill. */
.g-side {
  position: sticky;
  top: 76px;
  align-self: start;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  padding-bottom: 24px;
}
.g-pages p {
  margin: 22px 0 6px 10px;
  font-size: 12px;
  line-height: 1.33;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-tertiary);
}
.g-pages p:first-child {
  margin-top: 0;
}
.g-pages-m .g-pages p:first-child {
  margin-top: 4px;
}
.g-pages a {
  display: block;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.43;
  letter-spacing: -0.016em;
  color: var(--text);
  opacity: 0.8;
}
.g-pages a:hover {
  opacity: 1;
  text-decoration: none;
  background: var(--bg-alt);
}
.g-pages a[aria-current="page"] {
  opacity: 1;
  font-weight: 600;
  background: var(--bg-alt);
}

/* Phones: the same list folds into one row at the top. */
.g-pages-m {
  display: none;
  margin: 0 0 32px;
  border-radius: 14px;
  background: var(--bg-alt);
}
.g-pages-m summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.g-pages-m summary::-webkit-details-marker {
  display: none;
}
.g-pages-m summary::after {
  content: "";
  width: 7px;
  height: 7px;
  margin: -4px 4px 0 0;
  border-right: 1.5px solid var(--text-secondary);
  border-bottom: 1.5px solid var(--text-secondary);
  rotate: 45deg;
  transition: rotate 0.2s ease;
}
.g-pages-m[open] summary::after {
  margin-top: 4px;
  rotate: -135deg;
}
.g-pages-m .g-pages {
  padding: 0 6px 12px;
}
.g-pages-m .g-pages a[aria-current="page"] {
  background: var(--bg);
}

/* The page. */
.g-body {
  max-width: 680px;
  min-width: 0;
}
.g-body .g-crumbs {
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.43;
  font-weight: 600;
  color: var(--text-tertiary);
}
.g-crumbs a {
  color: var(--link);
}
.g-body h1 {
  font-size: 48px;
  line-height: 1.0835;
  font-weight: 600;
  letter-spacing: -0.003em;
  text-wrap: balance;
}
.g-body .g-lede {
  margin-top: 16px;
  font-size: 21px;
  line-height: 1.43;
  letter-spacing: 0.011em;
  color: var(--text-secondary);
  text-wrap: pretty;
}
.g-body h2 {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 32px;
  line-height: 1.125;
  font-weight: 600;
  letter-spacing: 0.004em;
  text-wrap: balance;
}
.g-body h3 {
  margin-top: 36px;
  font-size: 21px;
  line-height: 1.24;
  font-weight: 600;
  letter-spacing: 0.011em;
  text-wrap: balance;
}
.g-body h2 + h3 {
  margin-top: 24px;
}
.g-body h2,
.g-body h3 {
  position: relative;
  scroll-margin-top: 24px;
}
.g-body p,
.g-body ul,
.g-body ol {
  margin-top: 12px;
  font-size: 17px;
  line-height: 1.53;
  color: var(--text);
  text-wrap: pretty;
}
.g-body h2 + p {
  margin-top: 16px;
}
.g-body ul {
  padding-left: 22px;
  list-style: disc;
}
.g-body ul li + li,
.g-body ol li + li {
  margin-top: 6px;
}
.g-body ul li::marker {
  color: var(--text-tertiary);
}
.g-body code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--bg-alt);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.88em;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}
.g-body pre {
  margin-top: 12px;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--bg-alt);
  overflow-x: auto;
  font-size: 15px;
  line-height: 1.5;
}
.g-body pre code {
  padding: 0;
  background: none;
  font-size: inherit;
  overflow-wrap: normal;
}

/* Numbered steps: small blue numbers, as the site's .lp-steps but sized for running text. */
.g-body ol {
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.g-body ol li {
  position: relative;
  padding-left: 38px;
  counter-increment: step;
}
.g-body ol li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--button);
  color: #fff;
  font-size: 13px;
  line-height: 24px;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0;
}

/* "On this page": the page's sections, under the lede. */
.g-toc {
  margin-top: 32px;
  padding: 18px 22px;
  border-radius: 18px;
  background: var(--bg-alt);
}
.g-toc p {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}
.g-body .g-toc ul {
  margin-top: 8px;
  padding: 0;
  list-style: none;
  columns: 2;
  column-gap: 32px;
  font-size: 15px;
  line-height: 1.47;
}
.g-body .g-toc li {
  margin: 0 0 4px;
  break-inside: avoid;
}

/* Keys and clicks as a list of rows on a light gray card, like a grouped Settings form. */
.g-keys {
  width: 100%;
  margin-top: 16px;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 18px;
  background: var(--bg-alt);
  font-size: 16px;
  line-height: 1.43;
}
.g-keys td,
.g-keys th {
  padding: 12px 20px;
  vertical-align: middle;
  text-align: left;
  font-weight: 400;
}
.g-keys tr + tr td,
.g-keys tr + tr th {
  border-top: 1px solid rgba(0, 0, 0, 0.07);
}
.g-keys td:last-child {
  text-align: right;
  color: var(--text-secondary);
}
.g-keys a {
  color: var(--text);
}
.g-keys a:hover {
  color: var(--link);
}
/* A key, a click, or both, standing alone under a heading. */
.g-how {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.g-body p.g-how {
  margin-top: 10px;
  font-size: 15px;
  color: var(--text-secondary);
}
.combo {
  display: inline-flex;
  gap: 4px;
  vertical-align: middle;
  white-space: nowrap;
}
.combo kbd {
  color: var(--text);
}
.g-or {
  margin: 0 2px;
  color: var(--text-tertiary);
}

/* A side note. */
.g-note {
  margin-top: 20px;
  padding: 16px 20px;
  border-radius: 18px;
  background: var(--bg-alt);
}
.g-body .g-note p {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
}
.g-body .g-note p + p {
  margin-top: 8px;
}

/* The contents list on the guide's home page. */
.g-index {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}
.g-index a {
  display: block;
  padding: 18px 20px;
  border-radius: 18px;
  background: var(--bg-alt);
  color: var(--text);
}
.g-index a:hover {
  text-decoration: none;
  background: #ebebf0;
}
.g-index strong {
  display: block;
  font-size: 17px;
  font-weight: 600;
}
.g-index span {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  line-height: 1.43;
  color: var(--text-secondary);
}

/* Copy-a-link "#" beside each heading (guide.js), shown on hover. */
.g-anchor {
  margin-left: 8px;
  font-weight: 400;
  color: var(--text-tertiary);
  opacity: 0;
  transition: opacity 0.15s ease;
}
.g-anchor:hover {
  color: var(--link);
  text-decoration: none;
}
h2:hover > .g-anchor,
h3:hover > .g-anchor,
.g-anchor:focus-visible {
  opacity: 1;
}
/* Arriving from a link to a section: the heading lights up for a moment. */
.g-body h3:target,
.g-body h2:target {
  animation: g-arrive 2.4s ease-out;
}
@keyframes g-arrive {
  0%,
  30% {
    background: rgba(0, 113, 227, 0.1);
    box-shadow: 0 0 0 8px rgba(0, 113, 227, 0.1);
    border-radius: 4px;
  }
  100% {
    background: transparent;
    box-shadow: 0 0 0 8px transparent;
  }
}

@media (max-width: 1068px) {
  .g-wrap {
    grid-template-columns: 184px minmax(0, 1fr);
    gap: 40px;
  }
  .g-body h1 {
    font-size: 40px;
    line-height: 1.1;
  }
}
@media (max-width: 834px) {
  .g-wrap {
    display: block;
    padding-top: 28px;
  }
  .g-side {
    display: none;
  }
  .g-pages-m {
    display: block;
  }
  .g-body {
    max-width: none;
  }
}
@media (max-width: 734px) {
  :root {
    --gutter: 16px;
  }
  .guide {
    padding-bottom: 80px;
  }
  .g-body h1 {
    font-size: 32px;
    line-height: 1.125;
  }
  .g-body .g-lede {
    font-size: 19px;
  }
  .g-body h2 {
    margin-top: 48px;
    padding-top: 28px;
    font-size: 26px;
  }
  .g-body h3 {
    font-size: 19px;
  }
  .g-body .g-toc ul {
    columns: 1;
  }
  .g-index {
    grid-template-columns: 1fr;
  }
  .g-keys td,
  .g-keys th {
    padding: 11px 14px;
  }
  .g-keys {
    font-size: 15px;
  }
  /* Long values (links) go under their label instead of squeezing beside it. */
  .g-keys.g-stack tr {
    display: block;
    padding: 11px 14px;
  }
  .g-keys.g-stack tr + tr {
    border-top: 1px solid rgba(0, 0, 0, 0.07);
  }
  .g-keys.g-stack td {
    display: block;
    padding: 0;
    border-top: 0;
    text-align: left;
  }
  .g-keys.g-stack td:last-child {
    margin-top: 2px;
    overflow-wrap: anywhere;
  }
}
@media (prefers-reduced-motion: reduce) {
  .g-body h3:target,
  .g-body h2:target {
    animation: none;
  }
}
