/* Guides (guides/*.html): the searchable list and the article layout. Uses the tokens and shared classes in styles.css
   (surfaces, ink, muted, brand, pills, buttons, demo badge). Light and dark follow the page; no motion of its own apart
   from colour changes on hover, and those only with prefers-reduced-motion: no-preference. */

.g-main { padding: 24px 0 8px; }
.g-wrap { width: 100%; max-width: calc(var(--wrap) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }

/* Breadcrumb */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; color: var(--muted); font-size: .875rem; }
.crumbs li { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.crumbs li + li::before { content: ""; width: 6px; height: 6px; border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor; transform: rotate(45deg); opacity: .6; margin-right: 2px; }
.crumbs a { color: var(--muted); text-decoration: none; padding: 10px 2px; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs [aria-current] { color: var(--ink); font-weight: 600; }

/* ---------- Guides index ---------- */

.g-hero { padding: 40px 0 32px; text-align: center; }
.g-hero h1 { margin-top: 20px; font-size: clamp(2.25rem, 1.4rem + 3.6vw, 4rem); line-height: 1.04; letter-spacing: -0.04em; font-weight: 750; }
.g-hero .lead { margin-top: 18px; }

.g-search { position: relative; max-width: 560px; margin: 32px auto 0; text-align: left; }
.g-search label { display: block; margin-bottom: 8px; font-weight: 600; font-size: .9375rem; }
.g-search-box { position: relative; }
.g-search-box svg { position: absolute; left: 18px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.g-search input {
  -webkit-appearance: none; appearance: none;
  display: block; width: 100%; min-height: 56px; padding: 12px 56px 12px 50px;
  border-radius: 999px; border: 1px solid var(--hairline-strong);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm);
  font: inherit; font-size: 1rem;
}
.g-search input::placeholder { color: var(--muted); opacity: 1; }
.g-search input::-webkit-search-cancel-button, .g-search input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
.g-search input:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.g-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; display: grid; place-items: center;
  border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer;
}
.g-clear:hover { background: var(--surface-2); color: var(--ink); }
.g-clear svg { width: 18px; height: 18px; }
.g-count { margin-top: 12px; color: var(--muted); font-size: .9375rem; text-align: center; }

.g-groups { display: grid; gap: 12px; margin-top: 24px; }
.g-group { padding: 32px 20px; border-radius: var(--radius-panel); background: var(--surface); border: 1px solid var(--hairline); scroll-margin-top: 96px; }
.g-group h2 { font-size: 1.375rem; letter-spacing: -0.025em; }
.g-group > p { margin-top: 6px; color: var(--muted); }
.g-cards { list-style: none; display: grid; gap: 12px; margin-top: 20px; }
.g-card {
  position: relative; display: flex; flex-direction: column; gap: 6px; height: 100%;
  padding: 20px 56px 20px 20px; border-radius: var(--radius); background: var(--inset); border: 1px solid var(--hairline);
  color: var(--ink); text-decoration: none;
}
.g-card:hover { border-color: var(--hairline-strong); background: var(--surface-2); }
.g-card-n { color: var(--muted); font-size: .8125rem; font-weight: 600; }
.g-card-t { font-size: 1.0625rem; font-weight: 700; letter-spacing: -0.015em; line-height: 1.3; }
.g-card-s { color: var(--muted); font-size: .9375rem; line-height: 1.5; }
.g-card-m { margin-top: auto; padding-top: 6px; color: var(--muted); font-size: .8125rem; font-weight: 600; }
.g-card .i { position: absolute; right: 16px; top: 20px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); border: 1px solid var(--hairline); color: var(--ink); }
.g-card .i svg { width: 13px; height: 13px; }
.g-card.is-first { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 28%, transparent); }
.g-card.is-first .g-card-n { color: var(--brand); }

.g-empty { margin-top: 24px; padding: 40px 20px; border-radius: var(--radius-panel); background: var(--surface); border: 1px dashed var(--hairline-strong); text-align: center; }
.g-empty h2 { font-size: 1.25rem; }
.g-empty p { margin-top: 8px; color: var(--muted); }
.g-empty .btn { margin-top: 20px; }

@media (prefers-reduced-motion: no-preference) {
  .g-card, .g-card .i { transition: background-color .2s ease, border-color .2s ease; }
}

/* ---------- Article ---------- */

.g-layout { display: grid; gap: 24px; margin-top: 12px; }
.g-article { min-width: 0; padding: 32px 20px 40px; border-radius: var(--radius-panel); background: var(--surface); border: 1px solid var(--hairline); }
.g-head .pill-eyebrow { background: var(--inset); box-shadow: none; }
.g-head h1 { margin-top: 18px; font-size: clamp(2rem, 1.35rem + 2.6vw, 3.25rem); line-height: 1.06; letter-spacing: -0.04em; font-weight: 750; }
.g-meta { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.g-meta li { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 3px 12px; border-radius: 999px; background: var(--inset); border: 1px solid var(--hairline); color: var(--muted); font-size: .8125rem; font-weight: 600; }
.g-meta svg { width: 14px; height: 14px; flex: none; }
.g-intro { margin-top: 22px; color: var(--muted); font-size: 1.125rem; line-height: 1.65; }

.g-article h2 { margin-top: 44px; font-size: 1.5rem; letter-spacing: -0.025em; scroll-margin-top: 96px; }
.g-article h2 + p, .g-article p + p { margin-top: 12px; }
.g-article p, .g-article li { color: var(--muted); }
.g-article strong { color: var(--ink); }
.g-article p:not([class]) { margin-top: 12px; }
.g-article ul.g-list { margin-top: 12px; padding-left: 22px; }
.g-article ul.g-list li + li { margin-top: 6px; }
.g-article a { font-weight: 600; }

/* Numbered steps */
.g-steps { list-style: none; counter-reset: g-step; margin-top: 20px; display: grid; gap: 4px; }
.g-step { position: relative; counter-increment: g-step; padding: 0 0 22px 52px; scroll-margin-top: 96px; }
.g-step::before {
  content: counter(g-step); position: absolute; left: 0; top: -2px;
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%;
  background: var(--brand); color: var(--on-brand); font-weight: 700; font-size: .9375rem; font-variant-numeric: tabular-nums;
}
.g-step:not(:last-child)::after { content: ""; position: absolute; left: 16.5px; top: 40px; bottom: 6px; width: 1px; background: var(--hairline-strong); }
.g-step h3 { font-size: 1.125rem; letter-spacing: -0.015em; line-height: 1.35; padding-top: 3px; }
.g-step p { margin-top: 8px; }
.g-step .g-list { margin-top: 8px; }

/* Screenshots: labelled Demo data, numbered markers explained in the caption */
.shot { margin: 16px 0 6px; padding: 12px; border-radius: 20px; background: var(--inset); border: 1px solid var(--hairline); }
/* the frame takes the picture's own size (set inline from the file), so the space is kept before a lazy picture loads */
.shot-frame { position: relative; width: min(100%, var(--w, 100%)); margin: 0 auto; }
.shot-frame img { display: block; width: 100%; height: auto; aspect-ratio: var(--r); border-radius: 12px; border: 1px solid var(--hairline); background: #F7F8FA; }
.shot .demo-badge { margin-right: 6px; vertical-align: 1px; }
.shot figcaption { margin-top: 12px; padding: 0 4px; color: var(--muted); font-size: .9375rem; line-height: 1.5; }
.shot-title { color: var(--ink); font-weight: 600; }
.shot-marks { list-style: none; display: grid; gap: 6px; margin-top: 8px; }
.shot-marks li { display: flex; gap: 10px; align-items: flex-start; color: var(--muted); }
.mark-n { flex: none; width: 22px; height: 22px; margin-top: 1px; display: grid; place-items: center; border-radius: 50%; background: #B45309; color: #FFFFFF; font-size: .75rem; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (prefers-color-scheme: dark) {
  :root:not([data-mode="light"]) .shot-frame img { filter: brightness(.93); }
}
:root[data-mode="dark"] .shot-frame img { filter: brightness(.93); }

/* Callouts: tip, careful, and "when your account is switched on" */
.callout { display: flex; gap: 12px; align-items: flex-start; margin-top: 18px; padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--hairline); background: var(--inset); }
.callout svg { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.callout p { margin: 0; color: var(--ink); }
.callout p + p { margin-top: 6px; }
.callout-label { display: block; font-weight: 700; color: var(--ink); }
.callout-tip { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 22%, transparent); }
.callout-tip svg, .callout-tip .callout-label { color: var(--brand); }
.callout-careful { background: #FEF3C7; border-color: #F5C04A; }
.callout-careful p, .callout-careful .callout-label, .callout-careful svg, .callout-careful a { color: #78350F; }
.callout-soon svg { color: var(--muted); }
@media (prefers-color-scheme: dark) {
  :root:not([data-mode="light"]) .callout-careful { background: rgba(245, 158, 11, .12); border-color: rgba(245, 158, 11, .35); }
  :root:not([data-mode="light"]) .callout-careful p, :root:not([data-mode="light"]) .callout-careful .callout-label,
  :root:not([data-mode="light"]) .callout-careful svg, :root:not([data-mode="light"]) .callout-careful a { color: #FCD34D; }
}
:root[data-mode="dark"] .callout-careful { background: rgba(245, 158, 11, .12); border-color: rgba(245, 158, 11, .35); }
:root[data-mode="dark"] .callout-careful p, :root[data-mode="dark"] .callout-careful .callout-label,
:root[data-mode="dark"] .callout-careful svg, :root[data-mode="dark"] .callout-careful a { color: #FCD34D; }

/* Still stuck, and the previous / next links */
.g-stuck { margin-top: 44px; padding: 22px; border-radius: var(--radius-lg); background: var(--inset); border: 1px solid var(--hairline); }
.g-stuck h2 { margin: 0; font-size: 1.125rem; }
.g-stuck p { margin-top: 6px; }
.g-pager { display: grid; gap: 12px; margin-top: 16px; }
.g-pager a {
  display: flex; flex-direction: column; gap: 4px; min-height: 76px; padding: 16px 18px;
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--hairline); color: var(--ink); text-decoration: none;
}
.g-pager a:hover { border-color: var(--hairline-strong); }
.g-pager .dir { color: var(--muted); font-size: .8125rem; font-weight: 600; }
.g-pager .t { font-weight: 700; line-height: 1.3; }
.g-pager .next { text-align: right; }
.g-pager .all { text-align: center; justify-content: center; }

/* Table of contents: desktop only */
.g-toc { display: none; }
@media (min-width: 1100px) {
  .g-layout { grid-template-columns: minmax(0, 1fr) 256px; gap: 32px; align-items: start; }
  .g-toc { display: block; position: sticky; top: 100px; padding: 20px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--hairline); }
  .g-toc h2 { font-size: .8125rem; font-weight: 700; color: var(--muted); letter-spacing: .02em; text-transform: uppercase; }
  .g-toc ol { list-style: none; margin-top: 10px; display: grid; gap: 2px; }
  .g-toc a { display: block; padding: 8px 10px; border-radius: 10px; color: var(--muted); font-size: .9375rem; line-height: 1.35; text-decoration: none; }
  .g-toc a:hover { color: var(--ink); background: var(--surface-2); }
  .g-toc a[aria-current="true"] { color: var(--ink); background: var(--inset); font-weight: 600; box-shadow: inset 2px 0 0 var(--brand); }
  .g-toc .g-toc-all { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--hairline); }
}

@media (min-width: 600px) {
  .g-group { padding: 40px 32px; }
  .g-article { padding: 48px 40px 48px; }
  .g-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-pager { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-pager .all { grid-column: 1 / -1; }
  .shot { padding: 14px; }
}
@media (min-width: 768px) {
  .g-hero { padding: 64px 0 40px; }
  /* tall, narrow screenshots sit beside their caption */
  .shot.is-tall { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: start; }
  .shot.is-tall figcaption { margin-top: 0; padding-top: 4px; }
  .shot.is-tall .shot-frame { width: min(100%, var(--w), calc(720px * var(--r))); }
}
@media (min-width: 900px) {
  .g-article { padding: 56px 64px 56px; }
  .g-group { padding: 48px 48px; }
}
@media (min-width: 1100px) {
  .g-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 600px) {
  .g-cards > li:has(.g-card.is-first) { grid-column: span 2; }
}
.g-step h3 { color: var(--ink); }
/* phones: the breadcrumb stops at Guides (the page title is right under it) */
@media (max-width: 599px) {
  .g-article-crumbs li:last-child { display: none; }
}
.shot-full { display: inline-flex; align-items: center; min-height: 44px; margin-top: 4px; font-size: .875rem; }
