/* ChartRequest Knowledge Base - home refresh (Help Scout Docs "Upload stylesheet")
   Brand blue #4062E5. Neutrals reuse the site's existing greys.
   Scoped with `body` / ids to out-rank Help Scout's inline Customize <style>. */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap");

:root {
  --cr-blue: #4062E5;
  --cr-blue-soft: rgba(64, 98, 229, 0.06);
  --cr-blue-ring: rgba(64, 98, 229, 0.18);
  --cr-text: #131414;   /* titles and semibold text */
  --cr-body: #333333;   /* article paragraphs */
  --cr-text-2: #545454; /* secondary text: counts, footer, inactive sidebar items */
  --cr-border: #e0e0e0;
  --cr-radius: 10px;
}

body {
  font-family: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Links: one blue everywhere ---------- */
body .collection a,
body .contentWrapper a,
body #fullArticle strong a,
body #fullArticle a strong,
body .most-pop-articles .popArticles a,
body .most-pop-articles .popArticles a:hover span,
body #serp-dd .result a:hover,
body #serp-dd .result > li.active {
  color: var(--cr-blue);
}

/* ---------- Header / nav ---------- */
body #mainNav {
  position: sticky;
  top: 0;
  z-index: 50;
}
body #mainNav .navbar-inner {
  background: #fff;
  background-image: none;
  border-bottom: 1px solid var(--cr-border);
  box-shadow: none;
}
body .navbar .brand img { width: 170px !important; height: auto; display: block; }
body .navbar .nav li a .caret { display: none; }

@media (min-width: 980px) {
  body #mainNav .container-fluid {
    max-width: 1120px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
  }
  body #mainNav .brand { padding: 14px 0; margin: 0; flex: none; }
  body #mainNav .nav-collapse { flex: 1; height: auto !important; overflow: visible; margin: 0; padding: 0; align-self: center; }
  body #mainNav nav { margin: 0; padding: 0; }
  body #mainNav .nav {
    position: static; /* Help Scout sets absolute, which pulls it out of the flex row */
    float: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 2px;
    margin: 0;
  }
  body #mainNav .nav > li { float: none; }
  body #mainNav .nav > li > a {
    padding: 8px 10px;
    border-radius: 8px;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 500;
    line-height: 18px;
    color: var(--cr-text);
    text-shadow: none;
    transition: background .15s, color .15s;
  }
  body #mainNav .nav > li > a:hover,
  body #mainNav .nav > li > a:focus {
    background: var(--cr-blue-soft);
    color: var(--cr-blue);
  }
}

/* ---------- Hero + search ---------- */
body #docsSearch {
  background: var(--cr-blue-soft);
  border-bottom: 1px solid var(--cr-border);
  margin: 0 0 8px;
  padding: 56px 20px 52px;
}
body #docsSearch h1 {
  font-size: 34px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--cr-text);
  margin: 0;
  padding: 0;
}
body #searchBar {
  position: relative;
  width: min(680px, 100%);
  margin: 28px auto 0;
  padding: 0;
}
body #searchBar .search-query {
  height: 56px;
  margin: 0;
  padding: 0 130px 0 20px;
  font-size: 16px;
  line-height: 22px;
  border: 1px solid var(--cr-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color .15s, box-shadow .15s;
}
body #searchBar .search-query:focus {
  outline: none;
  border-color: var(--cr-blue);
  box-shadow: 0 0 0 4px var(--cr-blue-ring);
}
body #serp-dd { top: 62px; border-radius: 12px; overflow: hidden; }

@media (min-width: 769px) {
  body #searchBar button {
    top: 6px;
    right: 6px;
    height: 44px;
    padding: 0 22px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    text-shadow: none;
    background: var(--cr-blue);
    border: 0;
    border-radius: 8px;
    transition: filter .15s;
  }
  body #searchBar button:hover { background: var(--cr-blue); filter: brightness(0.92); }
}
@media (max-width: 768px) {
  body #docsSearch h1 { font-size: 26px; }
  body #searchBar .search-query { padding-right: 56px; }
  body #searchBar button { top: 6px; right: 4px; height: 44px; }
  body #searchBar button .icon-search { color: var(--cr-blue); }
}

/* ---------- Collection rows ---------- */
body #contentArea { max-width: 1120px; margin: 0 auto; }

body .collection-category {
  padding: 28px 0 32px;
  border-top: 1px solid var(--cr-border);
}
body .collection-category:first-of-type { border-top: 0; }

body .collection-category h2 {
  margin: 0 0 16px;
  padding: 0;
  text-align: left;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.005em;
}
body .collection-category h2 a { color: var(--cr-text); border: 0; }
body .collection-category h2 a:hover { color: var(--cr-blue); border: 0; }

@media (min-width: 900px) {
  body .collection-category {
    display: grid;
    grid-template-columns: 220px 1fr;
    column-gap: 32px;
    align-items: start;
  }
  body .collection-category h2 { margin: 4px 0 0; }
}

/* Collections with no categories on the home page: compact link row */
body .collection-category:not(:has(.category)) { padding: 18px 0; }
body .collection-category:not(:has(.category)) h2 { margin: 0; }
body .collection-category:not(:has(.category)) h2 a::after {
  content: " \2192";
  color: var(--cr-blue);
}

/* ---------- Category cards ---------- */
body .collection-category .category-list,
body .category-list.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
  margin: 0;
  text-align: left;
}
body .category-list .category,
body .category-list.two-col .category {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
  width: auto !important;
  height: auto !important; /* beats the legacy Headers rule (height:125px !important) */
  min-height: 80px;
  margin: 0 !important;
  padding: 16px 44px 16px 18px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--cr-border);
  border-radius: var(--cr-radius);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
body .category-list .category:hover,
body .category-list .category:focus-visible {
  background: #fff;
  border-color: var(--cr-blue);
  box-shadow: 0 2px 10px var(--cr-blue-ring);
  outline: none;
}
body .category-list .category::after {
  content: "\2192";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translate(-4px, -50%);
  color: var(--cr-blue);
  font-size: 16px;
  opacity: 0;
  transition: opacity .15s, transform .15s;
}
body .category-list .category:hover::after,
body .category-list .category:focus-visible::after {
  opacity: 1;
  transform: translate(0, -50%);
}
body .category-list h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--cr-text);
}
body .category-list .category p:empty { display: none; }
body .category-list .category p { margin: 4px 0 0; font-size: 13px; color: var(--cr-text-2); }
body .category-list .category .article-count {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 18px;
  color: var(--cr-text-2);
}
body .category-list .category:hover .article-count { color: var(--cr-blue); }

/* ---------- Footer ---------- */
body footer.center { padding: 24px 0 8px; }
body footer.center p { font-size: 12px; color: var(--cr-text-2); }
body footer.center a { color: var(--cr-text-2); text-decoration: underline; }

/* Narrow desktop / small laptop: keep all nav links on one row */
@media (min-width: 980px) and (max-width: 1199px) {
  body #mainNav .nav > li > a { padding: 8px 6px; font-size: 12px; }
  body #mainNav .container-fluid { gap: 8px; }
  body .navbar .brand img { width: 150px !important; }
}

/* ---------- Sidebar search (article / category / search pages) ---------- */
body #searchBar.sm {
  width: 100%;
  margin: 0 0 30px;
}
body #searchBar.sm .search-query {
  height: 44px;
  padding: 0 52px 0 14px;
  font-size: 14px;
  border-radius: 10px;
  margin: 0;
}
body #searchBar.sm button {
  top: 4px;
  right: 4px;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 8px;
  background: var(--cr-blue);
  border: 0;
  filter: none;
}
body #searchBar.sm button:hover { background: var(--cr-blue); filter: brightness(0.92); }
body #searchBar.sm button .icon-search { display: block; color: #fff; line-height: 36px; }
body #searchBar.sm button span { display: none; }
body #serp-dd.sb { top: 48px; }

/* ---------- Search dropdown rows ---------- */
body #serp-dd .result { padding: 6px; margin: 0; }
body #serp-dd .result > li,
body #serp-dd .result > li:first-child,
body #serp-dd .result > li:last-child {
  margin: 0;
  border-radius: 8px;
  background: transparent;
}
body #serp-dd .result > li a {
  padding: 9px 12px;
  color: var(--cr-text);
  background: transparent;
  border-radius: 8px;
}
/* Help Scout paints li.active grey; replace it with a clean brand tint */
body #serp-dd .result > li:hover,
body #serp-dd .result > li.active {
  background: var(--cr-blue-soft);
}
body #serp-dd .result > li:hover a,
body #serp-dd .result > li.active a {
  color: var(--cr-blue);
  background: transparent;
}

/* ---------- Page titles (category, article, search results) ---------- */
body .contentWrapper h1,
body #fullArticle h1.title,
body #categoryHead h1 {
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--cr-text);
}

/* ---------- Article body text: darker for readability (7.1:1 -> 12.6:1) ---------- */
body #fullArticle,
body #fullArticle p,
body #fullArticle ul,
body #fullArticle ol,
body #fullArticle li,
body #fullArticle div,
body #fullArticle blockquote,
body #fullArticle dd,
body #fullArticle table {
  color: var(--cr-text);
}

/* ---------- Article readability: 16px text, ~70 chars per line ----------
   Only text blocks are capped; images, tables and embedded widgets keep full width. */
body #fullArticle p,
body #fullArticle li {
  font-size: 16px;
  line-height: 1.65;
}
body #fullArticle p,
body #fullArticle ul,
body #fullArticle ol,
body #fullArticle blockquote,
body #fullArticle h2,
body #fullArticle h3,
body #fullArticle h4 {
  max-width: 680px;
}
body #fullArticle li { margin-bottom: 6px; }


/* =====================================================================
   v5 visual polish (CSS only - no content, structure or script changes)
   v3 base + soft hero, hover lift, sticky headings, sidebar pill,
   article surface/tables/quotes, focus rings. Cards keep v3 layout (no icons).
   ===================================================================== */
html { scroll-behavior: smooth; }

/* Hero: soft brand glow + lifted search */
body #docsSearch {
  background:
    radial-gradient(900px 280px at 50% 0%, rgba(64, 98, 229, 0.12), transparent 70%),
    linear-gradient(180deg, rgba(64, 98, 229, 0.06), rgba(64, 98, 229, 0.02));
}
body #searchBar .search-query {
  box-shadow: 0 8px 28px rgba(64, 98, 229, 0.10), 0 1px 2px rgba(0, 0, 0, 0.04);
}
body #searchBar.sm .search-query { box-shadow: none; }

/* Cards: gentle lift on hover (layout unchanged from v3) */
body .category-list .category {
  transition: border-color .15s, box-shadow .15s, background .15s, transform .15s;
}
body .category-list .category:hover { transform: translateY(-1px); }

/* Audience headings stay in view while their cards scroll past */
@media (min-width: 900px) {
  body .collection-category h2 { position: sticky; top: 84px; align-self: start; }
}

/* Sidebar category list (article / category pages) */
body #sidebar .nav-list > li > a {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--cr-text-2);
  transition: background .15s, color .15s;
}
body #sidebar .nav-list > li > a:hover { background: var(--cr-blue-soft); color: var(--cr-blue); text-decoration: none; }
body #sidebar .nav-list > li.active > a { background: var(--cr-blue-soft); color: var(--cr-blue); font-weight: 600; }

/* Article surface and content */
body #main-content .contentWrapper { border-radius: 12px; }
body #fullArticle a { text-underline-offset: 3px; }
body #fullArticle a:hover { text-decoration: underline; }
body #fullArticle img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--cr-border);
}
body #fullArticle table { border-collapse: collapse; width: 100%; }
body #fullArticle th,
body #fullArticle td { border: 1px solid var(--cr-border); padding: 10px 12px; text-align: left; }
body #fullArticle th { background: var(--cr-blue-soft); font-weight: 600; }
body #fullArticle blockquote {
  margin: 16px 0;
  padding: 12px 18px;
  border: 0;
  border-left: 3px solid var(--cr-blue);
  background: var(--cr-blue-soft);
  border-radius: 0 8px 8px 0;
}

/* Keyboard focus + reduced motion */
body a:focus-visible,
body button:focus-visible { outline: 2px solid var(--cr-blue); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}


/* Hero spans edge to edge only where Help Scout adds 20px body padding (<=768px).
   Wider screens: no negative margin, so there is no sideways overflow. */
@media (max-width: 768px) {
  body #docsSearch { margin: 0 -20px 8px; }
}

/* ---------- Colors: titles / semibold = #131414, article paragraphs = #333333 ---------- */
body #fullArticle,
body #fullArticle p,
body #fullArticle ul,
body #fullArticle ol,
body #fullArticle li,
body #fullArticle div,
body #fullArticle blockquote,
body #fullArticle dd,
body #fullArticle table {
  color: var(--cr-body);
}
body #fullArticle h1,
body #fullArticle h2,
body #fullArticle h3,
body #fullArticle h4,
body #fullArticle strong,
body #fullArticle b,
body #fullArticle th {
  color: var(--cr-text);
}
body #sidebar h3 { color: var(--cr-text); }

/* ---------- Mobile / tablet header: logo and menu button share one centered row ---------- */
@media (max-width: 979px) {
  body #mainNav .navbar-inner { padding: 0 20px; }
  body #mainNav .container-fluid {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    padding: 0;
  }
  body #mainNav .brand {
    float: none;
    display: flex;
    align-items: center;
    height: 64px;
    margin: 0;
    padding: 0;
  }
  body .navbar .brand img { width: 150px !important; height: auto; display: block; }
  body #mainNav .btn-navbar {
    position: static !important;
    float: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    margin: 0 -10px 0 0; /* optical: bars line up with the 20px page gutter */
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    border-radius: 8px;
  }
  body #mainNav .btn-navbar .icon-bar {
    display: block;
    width: 22px;
    height: 2px;
    margin: 0;
    background: var(--cr-text);
    border-radius: 2px;
    box-shadow: none;
  }
  body #mainNav .nav-collapse { flex-basis: 100%; order: 3; margin: 0; }
}

/* The header container has clearfix ::before/::after. In a flex row they become
   invisible items and push the logo/menu inward, so switch them off. */
body #mainNav .container-fluid::before,
body #mainNav .container-fluid::after { display: none; content: none; }
