/* ============================================================
   Help center (/help/) — additive styling on top of /styles/refresh.css.
   Reuses refresh.css tokens (--text, --muted, --accent, --panel,
   --panel-border, --radius-card, --shadow, --ui-font, ...) and the shared
   .sbb-legal shell/typography classes, same convention as blog.css and
   versus.css. Own namespaced classes (.sbb-help-*) rather than reusing
   .sbb-blog-* — each content section gets its own stylesheet, per the
   "reproduce, don't cross-import" convention documented in
   VersusLayout.astro's header. Only loaded on /help/, /help/topic/*, and
   /help/[slug]/. See KNOWLEDGE-BASE-SPEC.md section 3.3.
   ============================================================ */

/* ---- Index / topic hub ---- */
.sbb-help-index__intro { max-width: 66ch; }

/* ---- Index shell ----
   Capped at the same 1080px as .sbb-site-header__shell / the footer shell
   so the page lines up with the header. Without this the shell had no
   width at all (.sbb-legal__shell is only defined by contact/privacy/404,
   never by blog/vs/help), and a 15-article page grouped 1-3 per category
   left the right 60% of every section empty on wide viewports. */
.sbb-help-index__shell { max-width: 1080px; margin-inline: auto; }

/* ---- "Jump to a topic" chip row (same recipe as blog.css's "Browse by
   topic"; reproduced here under help-* names per the reproduce-don't-
   cross-import convention). Chips are anchors to the section ids. ---- */
.sbb-help-index__topics-label {
  margin: 22px 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.sbb-help-index__topics { margin-top: 0; }
.sbb-help-index__chip {
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}
/* .sbb-legal prefix (0,2,0) beats refresh.css's `.sbb-legal a` (0,1,1),
   which would otherwise paint every chip accent-blue. */
.sbb-legal .sbb-help-index__chip { color: var(--text); text-decoration: none; }
.sbb-legal .sbb-help-index__chip:hover {
  color: var(--accent);
  border-color: var(--accent-strong);
  text-decoration: none;
}
.sbb-help-index__chip-count { margin-left: 6px; opacity: 0.6; font-weight: 600; }

/* ---- "Start here" strip: three articles' own hero screenshots ---- */
.sbb-help-index__start { margin-top: 36px; }
.sbb-help-index__start-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin-bottom: 14px;
}
.sbb-help-index__start-head h2 {
  margin: 0;
  font-family: var(--ui-font);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.sbb-help-index__start-head p { margin: 0; color: var(--muted); font-size: 14.5px; }
.sbb-help-index__start-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.sbb-help-feature {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-card);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 180ms ease;
}
.sbb-help-feature:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--accent-strong);
}
.sbb-help-feature__media {
  display: block;
  aspect-ratio: 5 / 2;
  overflow: hidden;
  background: var(--bg);
  border-bottom: 1px solid var(--panel-border);
}
.sbb-help-feature__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover; /* object-position set inline per image */
}
.sbb-help-feature__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px 18px;
}
.sbb-help-feature h3 {
  margin: 0;
  font-family: var(--ui-font);
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--text);
}
.sbb-help-feature p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}

/* ---- Category sections: left rail + one list panel ----
   Two columns so the heading uses the left of the page and the articles
   fill the right, whatever the count. Rows (not cards) so a category with
   one article looks intended rather than like a grid with holes. ---- */
.sbb-help-index__section {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 20px 40px;
  margin-top: 44px;
  padding-top: 36px;
  border-top: 1px solid var(--panel-border);
  scroll-margin-top: 84px; /* clears the sticky site header (site-nav.css) */
}
.sbb-help-index__rail h2 {
  margin: 0;
  font-family: var(--ui-font);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--text);
}
.sbb-help-index__section-intro {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.6;
}
.sbb-help-index__all-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--accent);
  font-weight: 700;
  font-size: 13.5px;
  text-decoration: none;
}
.sbb-help-index__all-link:hover { text-decoration: underline; }

.sbb-help-index__list {
  display: grid;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-card);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  overflow: hidden;
}
.sbb-help-index__row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  text-decoration: none;
  color: inherit;
  transition: background 140ms ease;
}
.sbb-help-index__row + .sbb-help-index__row { border-top: 1px solid var(--panel-border); }
.sbb-help-index__row:hover { background: var(--accent-soft); }
.sbb-help-index__row-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
}
.sbb-help-index__row h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: var(--ui-font);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--text);
}
.sbb-help-index__row p {
  margin: 0;
  max-width: 70ch;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}
.sbb-help-index__row-arrow {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 16px;
  transition: transform 140ms ease, color 140ms ease;
}
.sbb-help-index__row:hover .sbb-help-index__row-arrow {
  color: var(--accent);
  transform: translateX(2px);
}

/* refresh.css's `.sbb-legal a:hover { text-decoration: underline }` (0,2,1)
   otherwise underlines a whole card/row's title AND description on hover.
   Two classes + :hover (0,3,0) wins regardless of load order. Also applied
   to .sbb-help-card, which the topic hubs and "Related help" still use. */
.sbb-legal .sbb-help-feature:hover,
.sbb-legal .sbb-help-index__row:hover,
.sbb-legal .sbb-help-card:hover { text-decoration: none; }

.sbb-help-index__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.sbb-help-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-card);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  text-decoration: none;
  color: inherit;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 180ms ease;
}
.sbb-help-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--accent-strong);
}
.sbb-help-card h2,
.sbb-help-card h3 {
  margin: 0;
  font-family: var(--ui-font);
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--text);
}
.sbb-help-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}
.sbb-help-card--compact { padding: 16px; }

/* ---- Tier chip (reuses the accent-soft "chip" look from refresh.css) ---- */
.sbb-help-tier {
  display: inline-flex;
  align-items: center;
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 700;
}

/* ---- Post shell / breadcrumb / meta ---- */
.sbb-help-post__shell { max-width: 760px; margin-inline: auto; }

.sbb-legal.sbb-help-post h1 {
  font-size: clamp(28px, 4.2vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.sbb-help-post__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13.5px;
}
.sbb-help-post__meta-sep { opacity: 0.6; }

/* ---- Hero + inline figures ---- */
.sbb-help-figure {
  margin: 24px 0 0;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}
.sbb-help-figure img {
  display: block;
  width: 100%;
  height: auto;
}
.sbb-help-figure figcaption {
  padding: 10px 14px;
  border-top: 1px solid var(--panel-border);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.sbb-help-figure--hero { margin-top: 22px; }
/* One image per row. `repeat(auto-fit, minmax(220px, 1fr))` put the two
 * 1100x34 bar strips side by side at ~320px each — a 29% downscale that
 * made every bookmark label in them unreadable. Stacked full-width they
 * render close to 1:1 and read as the before/after pair they are. */
.sbb-help-figure--stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  border: 0;
  box-shadow: none;
  background: none;
  overflow: visible;
}
.sbb-help-figure--stack .sbb-help-figure {
  margin: 0;
}

/* ---- Article body typography (same recipe as blog.css) ---- */
.sbb-help-post__body {
  margin-top: 28px;
  max-width: 66ch;
  color: var(--text);
  font-size: 17px;
  line-height: 1.75;
}
.sbb-help-post__body > * + * { margin-top: 1.1em; }
.sbb-help-post__body p,
.sbb-help-post__body li { text-wrap: pretty; color: var(--text); }
.sbb-legal .sbb-help-post__body p { margin-top: 1.1em; line-height: 1.75; }

.sbb-help-post__body h2 {
  margin-top: 1.8em;
  scroll-margin-top: 76px;
  font-family: var(--ui-font);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--text);
  text-wrap: balance;
}
.sbb-help-post__body h3 {
  margin-top: 1.5em;
  scroll-margin-top: 76px;
  font-family: var(--ui-font);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.35;
  color: var(--text);
}
.sbb-help-post__body strong { color: var(--text); font-weight: 700; }
.sbb-help-post__body ul,
.sbb-help-post__body ol {
  padding-left: 1.3em;
  display: grid;
  gap: 0.5em;
}
.sbb-help-post__body ul { list-style: disc; }
.sbb-help-post__body ol { list-style: decimal; }
.sbb-help-post__body a { color: var(--accent); font-weight: 600; text-decoration: none; }
.sbb-help-post__body a:hover { text-decoration: underline; }
.sbb-help-post__body code {
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  font-size: 0.9em;
  padding: 2px 7px;
  border-radius: 8px;
  background: rgba(29, 29, 31, 0.05);
  border: 1px solid rgba(29, 29, 31, 0.06);
  color: var(--text);
}
.sbb-help-post__body table {
  width: 100%;
  min-width: 420px;
  border-collapse: collapse;
  font-size: 14.5px;
}
.sbb-help-post__body th,
.sbb-help-post__body td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--panel-border);
  text-align: left;
  vertical-align: top;
}
.sbb-help-post__body thead th {
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}
.sbb-help-post__body tbody tr:last-child th,
.sbb-help-post__body tbody tr:last-child td { border-bottom: 0; }

/* ---- "Good to know" callout ---- */
.sbb-help-note {
  margin-top: 1.1em;
  padding: 14px 16px;
  border-radius: var(--radius-control);
  background: var(--accent-soft);
  border-left: 3px solid var(--accent-strong);
  color: var(--text);
  font-size: 15.5px;
  line-height: 1.65;
}
.sbb-help-note p:first-child { margin-top: 0 !important; }
.sbb-help-note p:last-child { margin-bottom: 0; }

/* ---- CTA card (identical recipe to blog.css's, kept independent) ---- */
.sbb-blog-cta {
  margin-top: 32px;
  padding: 24px;
  border: 1px solid var(--accent-strong);
  border-radius: var(--radius-card);
  background: var(--accent-soft);
  box-shadow: var(--shadow);
}
.sbb-blog-cta h2 {
  margin: 0 0 8px;
  font-family: var(--ui-font);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.sbb-blog-cta p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  max-width: 60ch;
}
.sbb-blog-cta__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border-radius: var(--radius-control);
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26), 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: transform 140ms ease, box-shadow 140ms ease;
}
.sbb-legal .sbb-blog-cta__button,
.sbb-legal .sbb-blog-cta__button:hover { color: #fff; }
.sbb-blog-cta__button:hover {
  transform: translateY(-0.5px);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.06);
}

/* ---- Related help / from the blog ---- */
.sbb-help-related {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--panel-border);
}
.sbb-help-related h2 {
  margin: 0 0 16px;
  font-family: var(--ui-font);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.sbb-help-related__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.sbb-help-card--compact h3 {
  font-size: 16px;
}
.sbb-help-card__pillar {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 0 10px;
  min-height: 22px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---- Breadcrumb (same recipe as blog.css's .sbb-blog-breadcrumb) ---- */
.sbb-help-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}
.sbb-help-breadcrumb a { color: var(--muted); text-decoration: none; }
.sbb-help-breadcrumb a:hover { color: var(--accent); text-decoration: underline; }
.sbb-help-breadcrumb__sep { opacity: 0.5; }
.sbb-help-breadcrumb [aria-current="page"] { color: var(--text); font-weight: 600; }

.sbb-help-post__blog-links { margin-top: 32px; }
.sbb-help-post__blog-links h2 {
  margin: 0 0 10px;
  font-family: var(--ui-font);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.sbb-help-post__blog-links ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.sbb-help-post__blog-links a { color: var(--accent); font-weight: 600; text-decoration: none; }
.sbb-help-post__blog-links a:hover { text-decoration: underline; }

.sbb-help-post__contact {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--panel-border);
  color: var(--muted);
  font-size: 14px;
}
.sbb-help-post__contact a { color: var(--accent); font-weight: 600; text-decoration: none; }
.sbb-help-post__contact a:hover { text-decoration: underline; }

@media (max-width: 720px) {
  .sbb-help-index__grid { grid-template-columns: 1fr; }
  .sbb-help-index__start-grid { grid-template-columns: 1fr; }
  .sbb-help-index__section {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 34px;
    padding-top: 28px;
  }
  .sbb-help-index__row { padding: 14px 16px; }
  .sbb-help-index__row-arrow { display: none; }
}
