/**
 * Turf Pro Logic — Help Scout Docs custom stylesheet
 *
 * Help Scout: Manage → Docs → Custom Code → Custom Stylesheet URL
 * https://app.turfprologic.com/helpscout-docs.css
 *
 * Customize: header #1A1A1A, page bg #F9FAFB, links #16A34A, article #111827.
 */

:root {
  --tpl-header: #1a1a1a;
  --tpl-header-accent: #16a34a;
  --tpl-primary: #1f2937;
  --tpl-link: #16a34a;
  --tpl-link-hover: #15803d;
  --tpl-link-soft: #dcfce7;
  --tpl-text: #111827;
  --tpl-muted: #6b7280;
  --tpl-page-bg: #ffffff;
  --tpl-surface: #f9fafb;
  --tpl-border: #e5e7eb;
  --tpl-radius: 12px;
  --tpl-radius-sm: 8px;
  --tpl-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  --tpl-shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --tpl-shadow-hover: 0 12px 28px rgba(0, 0, 0, 0.1);
  --tpl-max: 1120px;
}

/* Overrides Help Scout inline body background when set to white in Customize */
body {
  background: var(--tpl-surface) !important;
  color: var(--tpl-text);
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ──────────────────────────────────────────────────────── */

.navbar .navbar-inner {
  background: var(--tpl-header) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  min-height: 56px;
}

.navbar .container-fluid {
  align-items: center;
  display: flex;
  max-width: var(--tpl-max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

a.brand {
  align-items: center;
  display: flex;
  padding: 0.5rem 0 !important;
}

a.brand > img {
  border-radius: var(--tpl-radius-sm);
  height: 40px !important;
  margin-left: 0 !important;
  width: 40px !important;
}

.navbar .nav li a {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 0.5rem 0.75rem;
}

.navbar .caret {
  display: none;
}

.navbar .btn-navbar {
  margin-top: 0;
}

/* ── Search hero ─────────────────────────────────────────────────── */

#docsSearch {
  background: linear-gradient(180deg, var(--tpl-header) 0%, #141414 100%);
  border-bottom: 3px solid var(--tpl-header-accent);
  margin-bottom: 0;
  padding: 2.5rem 1.25rem 2.75rem;
  text-align: center;
}

#docsSearch h1 {
  color: #ffffff;
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.35;
  margin: 0 auto 0.5rem;
  max-width: 32rem;
  padding: 0;
}

#docsSearch h1::after {
  color: rgba(255, 255, 255, 0.72);
  content: "Search articles or browse topics below.";
  display: block;
  font-size: 0.9375rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.5;
  margin-top: 0.5rem;
}

#searchBar {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
  display: flex;
  margin: 1.5rem auto 0;
  max-width: 520px;
  overflow: hidden;
  position: relative;
  border-radius: var(--tpl-radius);
}

#searchBar .search-query {
  background: var(--tpl-page-bg);
  border: none;
  border-radius: 0;
  box-shadow: none;
  color: var(--tpl-text);
  flex: 1;
  font-size: 1rem;
  height: 52px;
  margin: 0;
  min-width: 0;
  padding: 0 1rem;
}

#searchBar .search-query::placeholder {
  color: #9ca3af;
}

#searchBar .search-query:focus {
  outline: none;
}

#searchBar button {
  background: var(--tpl-link);
  border: none;
  border-radius: 0;
  color: #ffffff;
  flex-shrink: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  height: 52px;
  letter-spacing: 0.02em;
  min-width: 7rem;
  padding: 0 1.25rem;
  text-shadow: none;
}

#searchBar button:hover,
#searchBar button:focus {
  background: var(--tpl-link-hover);
  color: #ffffff;
}

#searchBar button .icon-search {
  display: none;
}

#searchBar button span {
  display: inline;
}

/* ── Main content area ───────────────────────────────────────────── */

#contentArea.container-fluid {
  max-width: var(--tpl-max);
  padding: 0 1.25rem 3rem;
}

.contentWrapper,
#main-content {
  background: transparent;
}

/* 4×2 grid balances 8 categories (no orphan slot) */
section.category-list {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(4, 1fr);
  margin: 2rem 0 2.5rem;
  max-width: none;
  padding: 0;
  text-align: left;
}

section.category-list::before {
  color: var(--tpl-muted);
  content: "Browse by topic";
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  grid-column: 1 / -1;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
}

.category-list .category {
  background: var(--tpl-page-bg);
  border: 1px solid var(--tpl-border);
  border-radius: var(--tpl-radius);
  box-shadow: var(--tpl-shadow-card);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  height: 100%;
  margin: 0 !important;
  min-height: 7.5rem;
  padding: 1.25rem 1.25rem 1rem;
  text-decoration: none;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
  vertical-align: initial;
  width: auto !important;
}

.category-list .category:hover {
  border-color: rgba(22, 163, 74, 0.35);
  box-shadow: var(--tpl-shadow-hover);
  text-decoration: none;
  transform: translateY(-3px);
}

/* Help Scout emits empty <p></p> between title and count */
.category-list .category > p:not(.article-count) {
  display: none !important;
  margin: 0;
  padding: 0;
}

.category-list .category h3 {
  color: var(--tpl-text);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
}

.category-list .category .article-count {
  align-items: center;
  background: var(--tpl-link-soft);
  border-radius: 999px;
  color: var(--tpl-link-hover);
  display: inline-flex;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-top: auto;
  padding: 0.25rem 0.625rem;
  width: fit-content;
}

.category-list .category:hover .article-count {
  background: var(--tpl-link);
  color: #ffffff;
}

.category-list .category:hover h3 {
  color: var(--tpl-text);
}

/* Highlight Getting Started (most articles) */
#category-5 {
  border-left: 3px solid var(--tpl-header-accent);
}

/* ── Category & article inner pages ──────────────────────────────── */

.collection-category h2 {
  color: var(--tpl-text);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
  text-align: left;
}

.collection-category h2 a {
  color: var(--tpl-text);
}

.collection-category h2 a:hover {
  color: var(--tpl-link);
}

#categoryHead {
  border-bottom: 1px solid var(--tpl-border);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
}

#fullArticle .title,
.contentWrapper h1 {
  color: var(--tpl-text);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

#fullArticle h2 {
  color: var(--tpl-primary);
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 2rem;
}

#fullArticle,
#fullArticle p,
#fullArticle li {
  font-size: 1rem;
  line-height: 1.65;
}

#articleBody a {
  color: var(--tpl-link);
  font-weight: 500;
  text-underline-offset: 2px;
}

#articleBody a:hover {
  color: var(--tpl-link-hover);
}

#sidebar {
  border-right: 1px solid var(--tpl-border);
}

#sidebar h3 {
  color: var(--tpl-muted);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#sidebar .nav-list a {
  color: var(--tpl-text);
  font-size: 0.875rem;
}

#sidebar .nav-list .active a,
#sidebar .nav-list .active a:hover {
  color: var(--tpl-link);
  font-weight: 600;
}

/* ── Footer ──────────────────────────────────────────────────────── */

footer.center {
  border-top: 1px solid var(--tpl-border);
  margin-top: 1rem;
  padding-top: 1.75rem;
}

footer p,
footer p a {
  color: var(--tpl-muted);
  font-size: 0.8125rem;
  line-height: 1.6;
}

footer p a:hover {
  color: var(--tpl-link);
}

.articleFoot time.lu {
  display: none;
}

/* ── Responsive ──────────────────────────────────────────────────── */

@media (max-width: 1024px) {
  section.category-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  #docsSearch {
    padding: 2rem 1rem 2.25rem;
  }

  #docsSearch h1::after {
    font-size: 0.875rem;
  }

  #searchBar {
    flex-direction: column;
    box-shadow: var(--tpl-shadow-card);
  }

  #searchBar .search-query,
  #searchBar button {
    border-radius: 0;
    height: 48px;
    width: 100%;
  }

  #searchBar button {
    min-width: 0;
  }

  section.category-list {
    grid-template-columns: 1fr;
  }

  section.category-list {
    margin-top: 1.5rem;
  }
}
