/* Knowledgebase (help center) UI — Tailwind/tw- compatible helpers
   Loaded ONLY on knowledgebase pages via templates/croster/includes/head.tpl */

/* KB pages: full width (override cp-tailwind .tw-content max-width) */
.tw-content {
  max-width: none;
}

/* De Croster layout wrapped content in a Bootstrap `.container`.
   Make KB pages truly full-width by removing the container max-width only there. */
body.tpl-knowledgebase #main-body > .container,
body.tpl-knowledgebasecat #main-body > .container,
body.tpl-knowledgebasearticle #main-body > .container {
  max-width: none !important;
  width: 100%;
}

.tw-kb-hero {
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  background: linear-gradient(135deg, rgba(2, 115, 212, 0.10), rgba(2, 115, 212, 0.02));
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.tw-kb-hero h1 {
  margin: 0;
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 700;
  color: #003366;
}

.tw-kb-hero p {
  margin: 0.5rem 0 0;
  color: #475569;
}

.tw-kb-searchbar {
  margin-top: 1rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.tw-kb-searchbar .tw-input {
  border-radius: 9999px;
  padding: 0.85rem 1.05rem;
  font-size: 1rem;
}

.tw-kb-searchbar .tw-btn {
  border-radius: 9999px;
  padding: 0.85rem 1.25rem;
  font-size: 0.95rem;
}

.tw-kb-section-title {
  margin: 1.25rem 0 0.75rem;
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 700;
  color: #0f172a;
}

.tw-kb-cardlink {
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.tw-kb-cardlink__main {
  display: block;
  text-decoration: none;
  color: inherit;
}

.tw-kb-cardlink:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.10);
}

.tw-kb-cardmeta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.tw-kb-count {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 9999px;
  background: rgba(2, 115, 212, 0.10);
  color: #0273d4;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.tw-kb-desc {
  margin: 0.5rem 0 0;
  color: #475569;
  font-size: 0.875rem;
}

.tw-kb-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tw-kb-list > li + li {
  border-top: 1px solid #e2e8f0;
}

.tw-kb-list > li > a {
  display: block;
  padding: 0.9rem 1rem;
  text-decoration: none;
  color: inherit;
}

.tw-kb-list > li > a:hover {
  background: #f8fafc;
}

.tw-kb-list-title {
  font-weight: 700;
  color: #0f172a;
}

.tw-kb-list-snippet {
  margin-top: 0.25rem;
  color: #64748b;
  font-size: 0.875rem;
}

.tw-kb-layout-2 {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.tw-kb-layout-3 {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 260px;
  gap: 1.5rem;
  align-items: start;
}

/* Sticky category sidebar (desktop) */
@media (min-width: 1024px) {
  .tw-kb-sidebar {
    position: sticky;
    top: 110px;
  }
}

@media (max-width: 1023px) {
  .tw-kb-layout-2,
  .tw-kb-layout-3 {
    grid-template-columns: 1fr;
  }

  .tw-kb-toc-col {
    display: none;
  }
}

.tw-kb-breadcrumbs {
  font-size: 0.875rem;
  color: #64748b;
  margin-bottom: 0.75rem;
}

.tw-kb-breadcrumbs a {
  color: #0273d4;
  text-decoration: none;
}

.tw-kb-breadcrumbs a:hover {
  text-decoration: underline;
}

.tw-kb-article-title {
  margin: 0;
  font-size: 1.75rem;
  line-height: 2.25rem;
  font-weight: 800;
  color: #003366;
}

.tw-kb-meta {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  color: #64748b;
  font-size: 0.875rem;
}

.tw-kb-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* Article content ("prose" equivalent) */
.tw-kb-prose {
  margin-top: 1.25rem;
  font-size: 1rem;
  line-height: 1.75;
  color: #0f172a;
}

.tw-kb-prose h2,
.tw-kb-prose h3 {
  scroll-margin-top: 110px;
}

.tw-kb-prose h2 {
  margin: 2rem 0 0.75rem;
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 800;
  color: #003366;
}

.tw-kb-prose h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.125rem;
  line-height: 1.5rem;
  font-weight: 800;
  color: #0f172a;
}

.tw-kb-prose p {
  margin: 0.9rem 0 0;
}

.tw-kb-prose ul,
.tw-kb-prose ol {
  margin: 0.9rem 0 0;
  padding-left: 1.25rem;
}

.tw-kb-prose li {
  margin: 0.45rem 0 0;
}

.tw-kb-prose a {
  color: #0273d4;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tw-kb-prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background: #f1f5f9;
  border-radius: 0.375rem;
  padding: 0.12rem 0.35rem;
  font-size: 0.95em;
}

.tw-kb-prose pre {
  margin-top: 1rem;
  background: #0b1220;
  color: #e2e8f0;
  border-radius: 0.75rem;
  padding: 1rem;
  overflow: auto;
}

.tw-kb-prose pre code {
  background: transparent;
  padding: 0;
}

.tw-kb-prose img {
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
}

.tw-kb-prose table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.tw-kb-prose th,
.tw-kb-prose td {
  border: 1px solid #e2e8f0;
  padding: 0.75rem;
  text-align: left;
}

.tw-kb-prose blockquote {
  margin-top: 1rem;
  border-left: 4px solid rgba(2, 115, 212, 0.35);
  padding-left: 1rem;
  color: #334155;
}

/* ToC */
.tw-kb-toc {
  position: sticky;
  top: 110px;
}

.tw-kb-toc-title {
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.75rem;
}

.tw-kb-toc-nav a {
  display: block;
  padding: 0.25rem 0;
  color: #334155;
  text-decoration: none;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.tw-kb-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tw-kb-toc-nav a:hover {
  color: #0f172a;
}

.tw-kb-toc-nav a.is-active {
  color: #0273d4;
  font-weight: 800;
}

.tw-kb-toc-nav .toc-h3 {
  padding-left: 1rem;
  font-size: 0.8125rem;
  color: #475569;
}

.tw-kb-toc-mobile {
  margin-top: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  background: #fff;
}

@media (min-width: 1024px) {
  .tw-kb-toc-mobile {
    display: none;
  }
}

.tw-kb-toc-mobile summary {
  cursor: pointer;
  font-weight: 800;
  color: #0f172a;
}

/* Tags (chips) */
.tw-kb-tags {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.tw-kb-tag {
  display: inline-flex;
}

.tw-kb-tag.is-hidden {
  display: none;
}

.tw-kb-tag a,
.tw-kb-taglink {
  display: inline-flex;
  align-items: center;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 9999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #334155;
  text-decoration: none;
}

.tw-kb-tag a:hover,
.tw-kb-taglink:hover {
  background: #f8fafc;
  color: #0f172a;
}

.tw-kb-tags-toggle {
  border: 0;
  background: transparent;
  color: #0273d4;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  padding: 0.25rem 0.25rem;
}
