/* ==========================================================================
   Trad Market — HelpScout Docs Custom Stylesheet
   Brand alignment for help.tradmarket.com
   ========================================================================== */

/* ---- Design Tokens ---- */
:root {
  --tm-green: #157146;
  --tm-green-light: #44be71;
  --tm-green-dark: #1f211f;
  --tm-success: #157147;
  --tm-green-bg: #dcf4e1;
  --tm-text: #121212;
  --tm-border: #e7e7e7;
  --tm-grey-bg: #eaeaea;
  --tm-grey50: hsl(240, 3%, 98%);
  --tm-white: #ffffff;
  --tm-font-heading: 'Space Grotesk', sans-serif;
  --tm-font-body: 'Inter', sans-serif;
  --tm-radius-btn: 8px;
  --tm-radius-card: 8px;
  --tm-radius-input: 6px;
  --tm-shadow: 0px 8px 16px rgba(0, 0, 0, 0.04);
  --tm-shadow-hover: 0px 8px 24px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   1. Global / Body
   ========================================================================== */

body {
  font-family: var(--tm-font-body);
  color: var(--tm-text);
  background-color: var(--tm-grey50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--tm-green);
  color: var(--tm-white);
}

a {
  color: var(--tm-green);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--tm-green-dark);
  text-decoration: underline;
}

/* ==========================================================================
   2. CTA Banner (injected via head-code.html script)
   ========================================================================== */

#tm-cta-bar {
  background-color: var(--tm-green);
  text-align: center;
  padding: 10px 16px;
  font-family: var(--tm-font-body);
  font-size: 14px;
  font-weight: 500;
}

#tm-cta-bar a {
  color: var(--tm-white);
  text-decoration: none;
}

#tm-cta-bar a:hover {
  text-decoration: underline;
  color: var(--tm-white);
}

/* ==========================================================================
   3. Navigation Bar
   ========================================================================== */

#mainNav,
.navbar {
  background-color: var(--tm-white) !important;
  border-bottom: 1px solid var(--tm-border);
  box-shadow: none;
}

.navbar .navbar-inner,
.navbar-inner {
  min-height: 68px !important;
  padding: 0 24px !important;
  background: var(--tm-white) !important;
  box-shadow: none !important;
  border: none !important;
}

#tm-back-link {
  font-family: var(--tm-font-body);
  font-weight: 400;
  font-size: 13px;
  color: #666 !important;
  text-decoration: none;
  margin-left: 16px;
  float: left;
  line-height: 68px;
}

#tm-back-link:hover {
  color: var(--tm-green) !important;
  text-decoration: underline;
}

.navbar .nav li a {
  font-family: var(--tm-font-heading);
  font-weight: 500;
  font-size: 16px;
  color: var(--tm-text) !important;
  transition: color 0.15s ease;
  line-height: 68px !important;
  padding: 0 !important;
  border: none !important;
  background: none !important;
  box-shadow: none !important;
}

.navbar .nav li a:hover,
.navbar .nav li a:focus {
  color: var(--tm-green) !important;
  text-decoration: none;
  background: none !important;
  box-shadow: none !important;
}

.navbar .nav li.active a {
  color: var(--tm-green) !important;
  font-weight: 500;
  border: none !important;
  background: none !important;
  box-shadow: none !important;
}

.navbar .brand {
  padding: 17px 0 !important;
  float: left !important;
  text-align: left !important;
  line-height: 0;
}

.navbar .brand img {
  height: 33px !important;
  width: 216px !important;
}

/* ==========================================================================
   4. Search Banner
   ========================================================================== */

#docsSearch {
  background-image: url('https://tradmarket.com/static/images/helpdesk/help-banner-mandolin-desktop.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-bottom: 1px solid var(--tm-border);
  padding: 48px 24px;
  position: relative;
}

#docsSearch::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(30, 76, 47, 0.75);
}

#docsSearch h1,
#docsSearch form,
#docsSearch .search-form,
#docsSearch #searchBar {
  position: relative;
  z-index: 1;
}

#docsSearch h1 {
  font-family: var(--tm-font-heading);
  font-weight: 700;
  color: var(--tm-white);
  font-size: 28px;
  line-height: 1.2;
  margin-bottom: 24px;
}

#searchBar .search-query,
#serp-dd .search-query,
#docsSearch input[type="text"] {
  font-family: var(--tm-font-body);
  font-size: 16px;
  border: 1px solid var(--tm-border);
  border-radius: var(--tm-radius-input);
  min-height: 50px;
  padding: 12px 16px;
  color: var(--tm-text);
  background-color: var(--tm-white);
  box-shadow: none;
  transition: border-color 0.15s ease;
}

#searchBar .search-query:focus,
#serp-dd .search-query:focus,
#docsSearch input[type="text"]:focus {
  border-color: var(--tm-green);
  outline: none;
  box-shadow: 0 0 0 3px rgba(30, 76, 47, 0.1);
}

#searchBar button,
#docsSearch button[type="submit"],
#docsSearch .search-btn {
  background-color: var(--tm-green);
  color: var(--tm-white);
  font-family: var(--tm-font-body);
  font-weight: 600;
  font-size: 16px;
  border: none;
  border-radius: var(--tm-radius-btn);
  min-height: 50px;
  padding: 12px 24px;
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

#searchBar button:hover,
#docsSearch button[type="submit"]:hover,
#docsSearch .search-btn:hover {
  background-color: var(--tm-green-dark);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   4. Category Cards
   ========================================================================== */

.category-list .category {
  border: 1px solid var(--tm-border);
  border-radius: var(--tm-radius-card);
  background-color: var(--tm-white);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  overflow: hidden;
}

.category-list .category:hover {
  box-shadow: var(--tm-shadow-hover);
  transform: translateY(-1px);
}

.category-list .category h2,
.category-list .category .category-name {
  font-family: var(--tm-font-heading);
  font-weight: 600;
  color: var(--tm-text);
}

.category-list .category .article-count {
  font-family: var(--tm-font-body);
  color: var(--tm-success);
  font-weight: 500;
  font-size: 14px;
}

.category-list .category p,
.category-list .category .category-description {
  font-family: var(--tm-font-body);
  color: #666;
  font-size: 14px;
  line-height: 1.5;
}

/* ==========================================================================
   5. Article List
   ========================================================================== */

.articleList,
.article-list {
  list-style: none;
  padding: 0;
}

.articleList a,
.article-list a {
  font-family: var(--tm-font-body);
  font-weight: 400;
  color: var(--tm-green);
  font-size: 16px;
  line-height: 1.6;
  display: block;
  padding: 10px 0;
  border-bottom: 1px solid var(--tm-border);
  transition: color 0.15s ease;
}

.articleList a:hover,
.article-list a:hover {
  color: var(--tm-green-dark);
  text-decoration: underline;
}

.articleList .icon-article,
.article-list .icon-article {
  color: var(--tm-success);
}

/* ==========================================================================
   6. Popular Articles
   ========================================================================== */

.most-pop-articles h3,
.most-pop-articles .title {
  font-family: var(--tm-font-heading);
  font-weight: 700;
  color: var(--tm-text);
}

.most-pop-articles a {
  font-family: var(--tm-font-body);
  color: var(--tm-green);
}

.most-pop-articles a:hover {
  color: var(--tm-green-dark);
  text-decoration: underline;
}

/* ==========================================================================
   7. Article Content
   ========================================================================== */

#fullArticle h1.title,
#fullArticle h1 {
  font-family: var(--tm-font-heading);
  font-weight: 700;
  color: var(--tm-text);
  font-size: 32px;
  line-height: 1.2;
  margin-bottom: 24px;
}

#fullArticle h2 {
  font-family: var(--tm-font-heading);
  font-weight: 600;
  color: var(--tm-text);
  font-size: 24px;
  line-height: 1.3;
  margin-top: 32px;
  margin-bottom: 16px;
}

#fullArticle h3 {
  font-family: var(--tm-font-heading);
  font-weight: 600;
  color: var(--tm-text);
  font-size: 20px;
  line-height: 1.3;
  margin-top: 24px;
  margin-bottom: 12px;
}

#fullArticle p,
#fullArticle li,
#fullArticle div {
  font-family: var(--tm-font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--tm-text);
}

#fullArticle a {
  color: var(--tm-green);
}

#fullArticle a:hover {
  text-decoration: underline;
}

#fullArticle blockquote {
  border-left: 3px solid var(--tm-green);
  background-color: var(--tm-green-bg);
  padding: 16px 20px;
  margin: 20px 0;
  border-radius: 0 var(--tm-radius-card) var(--tm-radius-card) 0;
  font-family: var(--tm-font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--tm-text);
}

#fullArticle code,
#fullArticle kbd {
  background-color: var(--tm-grey-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 14px;
}

#fullArticle pre {
  background-color: #f5f5f5;
  border: 1px solid var(--tm-border);
  border-radius: var(--tm-radius-card);
  padding: 16px;
  overflow-x: auto;
}

#fullArticle pre code {
  background: none;
  padding: 0;
  border-radius: 0;
}

#fullArticle img {
  max-width: 100%;
  height: auto;
  border-radius: var(--tm-radius-card);
}

#fullArticle .callout,
#fullArticle .callout-green {
  background-color: var(--tm-green-bg);
  border-left: 3px solid var(--tm-success);
  border-radius: 0 var(--tm-radius-card) var(--tm-radius-card) 0;
  padding: 16px 20px;
  margin: 20px 0;
}

/* ==========================================================================
   8. Sidebar
   ========================================================================== */

#sidebar a,
.sidebar a {
  font-family: var(--tm-font-body);
  color: var(--tm-green);
  font-size: 15px;
  transition: color 0.15s ease;
}

#sidebar a:hover,
.sidebar a:hover {
  color: var(--tm-green-dark);
  text-decoration: underline;
}

#sidebar .active a,
.sidebar .active a {
  font-weight: 700;
  color: var(--tm-text);
}

#sidebar ul,
.sidebar ul {
  border-bottom: 1px solid var(--tm-border);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

/* ==========================================================================
   9. Footer
   ========================================================================== */

/* Hide default HelpScout footers — replaced by injected #tm-footer */
.articleFoot,
.contentFooter,
footer {
  display: none !important;
}

/* "Still need help?" block moved into article body via JS */
.article-footer-help {
  background-color: var(--tm-grey50);
  border: 1px solid var(--tm-border);
  border-radius: var(--tm-radius-card);
  padding: 24px;
  margin-top: 32px;
  text-align: center;
  font-family: var(--tm-font-body);
  font-size: 15px;
  color: var(--tm-text);
}

.article-footer-help a {
  color: var(--tm-green) !important;
  font-weight: 600;
}

.article-footer-help a:hover {
  text-decoration: underline;
}

/* Custom injected footer */
#tm-footer {
  background-color: var(--tm-green);
  padding: 40px 24px;
  text-align: center;
  font-family: var(--tm-font-body);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

#tm-footer a {
  color: var(--tm-white) !important;
  opacity: 0.85;
}

#tm-footer a:hover {
  opacity: 1;
  text-decoration: underline;
}


/* ==========================================================================
   10. Breadcrumbs
   ========================================================================== */

.breadcrumbs,
.breadcrumb {
  font-family: var(--tm-font-body);
  font-size: 13px;
  color: #999;
  margin-bottom: 16px;
}

.breadcrumbs a,
.breadcrumb a {
  color: #999;
  font-weight: 400;
}

.breadcrumbs a:hover,
.breadcrumb a:hover {
  color: var(--tm-green);
  text-decoration: underline;
}

.breadcrumbs .current,
.breadcrumb .active,
.breadcrumbs > span:last-child {
  color: var(--tm-text);
  font-weight: 600;
}

.breadcrumbs .divider,
.breadcrumb .divider {
  margin: 0 6px;
  color: #ccc;
}

/* ==========================================================================
   11. Search Results
   ========================================================================== */

#serp-dd .result,
.search-results .result {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--tm-border);
}

#serp-dd .result h3,
#serp-dd .result .title,
.search-results .result h3,
.search-results .result .title {
  font-family: var(--tm-font-heading);
  font-weight: 600;
  color: var(--tm-green);
  font-size: 18px;
  margin-bottom: 4px;
}

#serp-dd .result p,
#serp-dd .result .description,
.search-results .result p,
.search-results .result .description {
  font-family: var(--tm-font-body);
  color: #666;
  font-size: 14px;
  line-height: 1.5;
}

/* Contact form button overrides */
.contact-btn,
a.contact-btn,
.btn-primary {
  background-color: var(--tm-green) !important;
  border-color: var(--tm-green) !important;
  color: var(--tm-white) !important;
  font-family: var(--tm-font-body);
  font-weight: 600;
  border-radius: var(--tm-radius-btn);
  transition: background-color 0.15s ease;
}

.contact-btn:hover,
a.contact-btn:hover,
.btn-primary:hover {
  background-color: var(--tm-green-dark) !important;
  border-color: var(--tm-green-dark) !important;
}

/* ==========================================================================
   12. Responsive Adjustments
   ========================================================================== */

@media (max-width: 768px) {
  #docsSearch {
    padding: 32px 16px;
  }

  #docsSearch h1 {
    font-size: 24px;
  }

  #searchBar .search-query,
  #docsSearch input[type="text"] {
    width: 100%;
    margin-bottom: 12px;
  }

  #searchBar button,
  #docsSearch button[type="submit"],
  #docsSearch .search-btn {
    width: 100%;
  }

  .category-list .category {
    margin-bottom: 12px;
  }

  #fullArticle h1.title,
  #fullArticle h1 {
    font-size: 26px;
  }

  #fullArticle h2 {
    font-size: 20px;
  }

  #fullArticle h3 {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  #docsSearch h1 {
    font-size: 20px;
  }

  #fullArticle h1.title,
  #fullArticle h1 {
    font-size: 22px;
  }
}
