/* Help Center theme — used only by sites whose settings.template == "help".
 * Builds on tokens.css (so light/dark still work via [data-theme]), but:
 *   - the top bar is ALWAYS black in both themes (hardcoded, ignores tokens)
 *   - articles are full-width (no narrow doc column, no right TOC)
 *   - adds Category / Sub-category landing grids + a search hero homepage.
 */

/* ---- shell: full width, no sidebar/toc columns ---- */
.help-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
}

.help-main {
  flex: 1;
  width: 100%;
  max-width: 1080px;     /* readable article measure, but wide */
  margin: 0 auto;
  padding: 40px 24px 80px;
}
.help-main.help-main--wide {
  max-width: 1280px;     /* landing pages use the wider measure */
}

/* ---- top bar: ALWAYS black, both themes ---- */
.help-topbar {
  background: #000;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  position: sticky;
  top: 0;
  z-index: 50;
}
.help-topbar-inner {
  /* Full-bleed bar: logo near the left edge, theme toggle near the right.
     No max-width; a small edge gap so they don't kiss the viewport border. */
  width: 100%;
  padding: 0 10px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.help-topbar a { color: #fff; text-decoration: none; }
.help-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.help-brand img { height: 22px; width: auto; display: block; }
.help-topbar-spacer { flex: 1; }
.help-topbar-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.help-topbar-link {
  font-size: 14px;
  opacity: 0.85;
}
.help-topbar-link:hover { opacity: 1; }
.help-topbar .help-store-admin-cta {
  height: 36px;
  max-width: 220px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 6px;
  color: #000;
  background: #fff;
  border: 1px solid #fff;
  font-size: 14px;
  line-height: 1;
  font-weight: 700;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}
.help-topbar .help-store-admin-cta:hover {
  color: #000;
  background: #f3f4f6;
  border-color: #f3f4f6;
}
.help-topbar .help-store-admin-cta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.help-account-menu { position: relative; }
.help-account-trigger {
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  padding: 0 8px 0 5px;
  color: #fff;
  background: transparent;
  font: inherit;
  cursor: pointer;
}
.help-account-trigger:hover,
.is-account-open .help-account-trigger {
  background: rgba(255, 255, 255, 0.1);
}
.help-account-avatar {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.help-account-label {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.help-account-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 240px;
  padding: 6px;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  border: 1px solid rgba(17, 24, 39, 0.12);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.2);
}
.help-account-summary {
  padding: 8px 10px 10px;
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
  margin-bottom: 4px;
}
.help-account-summary strong,
.help-account-summary span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.help-account-summary strong {
  font-size: 13px;
  line-height: 18px;
}
.help-account-summary span {
  font-size: 12px;
  color: #6b7280;
}
.help-account-dropdown a {
  display: flex;
  align-items: center;
  min-height: 32px;
  padding: 0 9px;
  border-radius: 6px;
  color: #111827;
  font-size: 13px;
}
.help-account-dropdown a:hover {
  background: #f3f4f6;
}
@media (max-width: 640px) {
  .help-topbar-inner { gap: 10px; }
  .help-brand span { display: none; }
  .help-topbar .help-store-admin-cta {
    max-width: 46vw;
    padding: 0 12px;
    font-size: 13px;
  }
  .help-account-label { display: none; }
  .help-account-trigger { padding-right: 5px; }
}
/* theme toggle sits in the black bar — keep it light-on-black always */
.help-topbar .theme-toggle { color: #fff; border-color: rgba(255,255,255,0.25); }

/* ---- breadcrumb ---- */
.help-breadcrumb {
  font-size: 13px;
  color: hsl(var(--muted-foreground));
  margin-bottom: 20px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.help-breadcrumb a { color: hsl(var(--muted-foreground)); text-decoration: none; }
.help-breadcrumb a:hover { color: hsl(var(--foreground)); }
.help-breadcrumb .sep { opacity: 0.5; }

/* ---- homepage hero + search ---- */
.help-hero {
  position: relative;
  color: hsl(var(--foreground));
  padding: 64px 24px 32px;
  text-align: center;
  background: #fff;
}

/* ---- banner section: a centered image (NOT edge-to-edge) sitting between
   the search hero and the content, with a gap on both sides. ---- */
.help-banner {
  background: #fff;
  padding: 8px 24px 48px;
}
.help-banner img {
  display: block;
  width: 100%;
  max-width: 880px;     /* centered, not full-bleed */
  height: auto;
  margin: 0 auto;
  border-radius: 16px;
}
.help-hero h1 {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}
/* Typewriter caret — solid bar while typing, blinking once typed. Reserve a
   line of height so the heading doesn't reflow as characters appear. */
.help-typewriter { min-height: 1.2em; }
.help-typewriter.is-typing::after,
.help-typewriter.is-typed::after {
  content: "";
  display: inline-block;
  width: 3px;
  height: 0.95em;
  margin-left: 4px;
  vertical-align: -0.08em;
  background: currentColor;
  border-radius: 1px;
}
.help-typewriter.is-typed::after { animation: help-caret-blink 1s step-end infinite; }
@keyframes help-caret-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.help-hero p { font-size: 16px; opacity: 0.8; margin: 0 0 28px; }
.help-search {
  max-width: 640px;
  margin: 0 auto;
  position: relative;
}

/* Live results dropdown under the search bar — light card, left-aligned
   rows (title + snippet), keyboard-active + hover highlight. */
.help-search-results {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  z-index: 60;
  text-align: left;
  background: #fff;
  border: 1px solid hsl(var(--border));
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  max-height: 60vh;
  overflow-y: auto;
}
.help-search-result {
  display: block;
  padding: 12px 18px;
  text-decoration: none;
  color: hsl(var(--foreground));
  border-bottom: 1px solid hsl(var(--border));
}
.help-search-result:last-child { border-bottom: none; }
.help-search-result.is-active,
.help-search-result:hover {
  background: hsl(var(--muted));
}
.help-search-result-title {
  display: block;
  font-weight: 600;
  font-size: 15px;
}
.help-search-result-snippet {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  color: hsl(var(--muted-foreground));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* highlighted match term inside a snippet */
.help-search-result-snippet mark {
  background: transparent;
  color: hsl(var(--foreground));
  font-weight: 700;
}
.help-search-empty {
  padding: 16px 18px;
  font-size: 14px;
  color: hsl(var(--muted-foreground));
  text-align: left;
}

/* Embossed glossy-glass search field. Sits on the black hero, so it reads as a
   raised pane of frosted glass: translucent fill + backdrop blur, a bright
   top-inner highlight and dark bottom-inner shadow (the emboss), a glossy
   sheen layered over the top half, and a soft outer drop shadow for lift. */
.help-search-field {
  position: relative;
  display: flex;
  align-items: center;
  height: 56px;
  border-radius: 14px;
  padding: 0 18px 0 50px;
  background: #fff;
  border: 1px solid hsl(var(--border));
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

/* Glossy sheen across the top half — a clipped pseudo-element so the gloss sits
   above the fill but below the text/icon. */
.help-search-icon {
  position: absolute;
  left: 18px;
  display: inline-flex;
  align-items: center;
  color: hsl(var(--muted-foreground));
  pointer-events: none;
}
.help-search-icon svg { width: 18px; height: 18px; }

.help-search-field input {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  outline: none;
  font-size: 16px;
  color: hsl(var(--foreground));
}
.help-search-field input::placeholder { color: hsl(var(--muted-foreground)); }

/* Focus: a normal light focus ring. */
.help-search-field:focus-within {
  border-color: hsl(var(--foreground) / 0.5);
  box-shadow: 0 0 0 3px hsl(var(--foreground) / 0.08);
}
.help-search-field:focus-within .help-search-icon { color: hsl(var(--foreground)); }

/* ---- category landing: sub-category panels listing their articles ---- */
.help-cat-header { margin-bottom: 28px; }
.help-subcats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
  text-align: left;
}
.help-subcat {
  display: flex;
  flex-direction: column;
  border: 1px solid hsl(var(--border));
  border-radius: 14px;
  padding: 22px 22px 14px;
  background: hsl(var(--card));
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.help-subcat:hover {
  border-color: hsl(var(--foreground) / 0.22);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.06);
}
.help-subcat-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.help-subcat-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}
.help-subcat-title a { color: hsl(var(--foreground)); text-decoration: none; }
.help-subcat-title a:hover { text-decoration: underline; }
.help-subcat-count {
  flex-shrink: 0;
  font-size: 12px;
  color: hsl(var(--muted-foreground));
}
.help-subcat-desc {
  font-size: 14px;
  color: hsl(var(--muted-foreground));
  margin: 0 0 12px;
}
.help-subcat-articles {
  list-style: none;
  margin: 8px 0 6px;
  padding: 0;
  flex: 1;
}
.help-subcat-articles li {
  border-top: 1px solid hsl(var(--border) / 0.6);
}
.help-subcat-articles a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  font-size: 14px;
  color: hsl(var(--foreground) / 0.85);
  text-decoration: none;
  border-radius: 6px;
}
.help-subcat-articles a:hover {
  color: hsl(var(--foreground));
  padding-left: 8px;
}
.help-article-icon { flex-shrink: 0; color: hsl(var(--muted-foreground)); }
.help-subcat-empty {
  font-size: 13px;
  color: hsl(var(--muted-foreground));
  margin: 8px 0;
}
.help-subcat-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid hsl(var(--border));
  font-size: 13px;
  font-weight: 600;
  color: hsl(var(--foreground));
  text-decoration: none;
}
.help-subcat-all:hover { gap: 9px; }

/* ---- homepage categories: plain heading + topics under it (no cards) ---- */
.help-cats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 40px 48px;
  margin-top: 8px;
  text-align: left;
}
.help-cat-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid hsl(var(--border));
}
.help-cat-title a { color: hsl(var(--foreground)); text-decoration: none; }
.help-cat-title a:hover { text-decoration: underline; }
.help-cat-topics {
  list-style: none;
  margin: 0;
  padding: 0;
}
.help-cat-topics li { margin: 0 0 8px; }
.help-cat-topics a {
  font-size: 15px;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
}
.help-cat-topics a:hover { color: hsl(var(--foreground)); text-decoration: underline; }

/* ---- category / sub-category card grid ---- */
.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 8px;
}
.help-card {
  display: block;
  border: 1px solid hsl(var(--border));
  border-radius: 12px;
  padding: 22px;
  text-decoration: none;
  color: hsl(var(--foreground));
  background: hsl(var(--card));
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.help-card:hover {
  border-color: hsl(var(--foreground) / 0.4);
  transform: translateY(-2px);
}

/* Glass category card — frosted pane echoing the search bar: translucent
   fill + backdrop blur, embossed top-highlight, soft lift. Holds a clickable
   head (category) + an inline list of its sub-categories. */
.help-card--glass {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.10) 0%,
    rgba(255, 255, 255, 0.04) 60%,
    rgba(255, 255, 255, 0.02) 100%
  );
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 10px 28px rgba(0, 0, 0, 0.4);
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.help-card--glass:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 16px 40px rgba(0, 0, 0, 0.5);
}
.help-card-head {
  display: block;
  padding: 22px 22px 16px;
  text-decoration: none;
  color: hsl(var(--foreground));
}
.help-card-subs {
  list-style: none;
  margin: 0;
  padding: 4px 12px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.help-card-subs li { margin: 0; }
.help-card-subs a {
  display: block;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 14px;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
}
.help-card-subs a:hover {
  background: rgba(255, 255, 255, 0.07);
  color: hsl(var(--foreground));
}

.help-card-title { font-weight: 700; font-size: 17px; margin: 0 0 6px; }
.help-card-desc { font-size: 14px; color: hsl(var(--muted-foreground)); margin: 0; }
.help-card-count {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  margin: 0;
  padding: 0 22px 18px;
}

/* ---- article list (sub-category page) ---- */
.help-article-list { list-style: none; margin: 8px 0 0; padding: 0; }
.help-article-list li { border-bottom: 1px solid hsl(var(--border)); }
.help-article-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 4px;
  text-decoration: none;
  color: hsl(var(--foreground));
  font-size: 15px;
}
.help-article-list a:hover { color: hsl(var(--foreground)); padding-left: 8px; }
.help-article-list .chev { color: hsl(var(--muted-foreground)); }

/* ---- collapsible H2 sections (help-article) ---- */
.help-section-toggle {
  border-top: 1px solid hsl(var(--border));
}
.help-section-toggle:last-of-type {
  border-bottom: 1px solid hsl(var(--border));
}
.help-section-toggle > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  list-style: none;
  cursor: pointer;
  padding: 18px 2px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: hsl(var(--foreground));
}
.help-section-toggle > summary::-webkit-details-marker { display: none; }
.help-section-chevron {
  flex-shrink: 0;
  color: hsl(var(--muted-foreground));
  transition: transform 0.18s ease;
}
.help-section-toggle[open] > summary .help-section-chevron {
  transform: rotate(90deg);
}
.help-section-body {
  padding: 0 2px 22px 28px;
}

/* ---- page headings ---- */
.help-page-title { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 8px; }
.help-page-summary { font-size: 16px; color: hsl(var(--muted-foreground)); margin: 0 0 28px; }

/* ---- footer ---- */
.help-footer {
  position: relative;
  overflow: hidden;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 32px 24px;
  text-align: center;
  font-size: 13px;
  background: #000;
  color: rgba(255, 255, 255, 0.55);
}
.help-footer a { color: rgba(255, 255, 255, 0.8); }
.help-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}
.help-footer > * { position: relative; z-index: 1; }

/* ---- Locale switcher (help topbar) ---- */
/* Language picker. Five languages, so the menu shows all of them at once —
   no search field, no scroll, no mobile takeover. The trigger names the
   current language; the open menu marks it with a check, so selection never
   rests on background colour alone. */
.help-locale-switcher {
  position: relative;
}
.help-locale-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #9ca3af;
  font-size: 12px;
  line-height: 18px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease;
}
.help-locale-trigger:hover,
.help-locale-switcher[open] > .help-locale-trigger {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
}
.help-locale-trigger:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}
.help-locale-trigger::-webkit-details-marker {
  display: none;
}
.help-locale-caret {
  color: #6b7280;
  transition: transform 150ms ease;
}
.help-locale-switcher[open] .help-locale-caret {
  transform: rotate(180deg);
}

.help-locale-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 60;
  min-width: 220px;
  padding: 4px;
  background: #09090b;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
}

.help-topbar .help-locale-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #d1d5db;
  font: inherit;
  text-align: start;
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease;
}
.help-topbar .help-locale-option:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}
.help-topbar .help-locale-option:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: -2px;
}
.help-topbar .help-locale-option.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.help-locale-names {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.help-locale-native {
  font-size: 14px;
  line-height: 19px;
}
.help-locale-english {
  color: #6b7280;
  font-size: 12px;
  line-height: 16px;
}
.help-locale-option.is-active .help-locale-english {
  color: #9ca3af;
}

/* The check only renders for the selected language — identity is never
   carried by colour alone. */
.help-locale-check {
  flex: none;
  color: #6366f1;
  opacity: 0;
}
.help-locale-option.is-active .help-locale-check {
  opacity: 1;
}

@media (max-width: 767px) {
  .help-locale-trigger {
    padding: 6px 8px;
  }
  .help-locale-trigger > span {
    display: none;
  }
  /* Still an anchored dropdown, not a full-screen sheet: five rows fit. */
  .help-locale-menu {
    min-width: 200px;
  }
}
