/* Portal público — layout "Central de Ajuda" sobre Bootstrap 5.
   Ajuste as variáveis abaixo para aplicar a identidade visual da empresa. */
:root {
  /* Paleta derivada do logo (esfera vermelha + "A" prateado). */
  --kb-brand: #8e1f0f;
  --kb-brand-dark: #4a0b04;
  --kb-brand-deep: #2b0703;
  --kb-accent: #c0341d;
  --kb-accent-hover: #9e2a16;
  --kb-accent-glow: #fb6846;
  --kb-silver: #c9ced3;
  --kb-text: #212529;
  --kb-muted: #6c757d;
  --kb-border: #e3e6ea;
  --kb-surface: #f6f8fa;
  --kb-radius: 0.5rem;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  color: var(--kb-text);
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  color: var(--kb-accent);
}

a:hover {
  color: var(--kb-accent-hover);
}

.btn:focus, .btn:active:focus, .form-control:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem rgba(192, 52, 29, 0.55);
}

.form-control:focus {
  border-color: #e08a7a;
}

/* ---------- Header ---------- */
.kb-header {
  background: linear-gradient(90deg, var(--kb-brand-dark) 0%, var(--kb-brand) 100%);
  border-bottom: 3px solid var(--kb-accent);
}

.kb-header .navbar {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.kb-header .navbar-dark .nav-link {
  color: rgba(255, 255, 255, 0.82);
}

.kb-header .navbar-dark .nav-link:hover,
.kb-header .navbar-dark .nav-link:focus {
  color: #fff;
}

.kb-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.kb-brand-logo {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15), 0 2px 8px rgba(0, 0, 0, 0.35);
}

.kb-header-search {
  flex: 1 1 auto;
  max-width: 420px;
}

.kb-header-search .form-control {
  border: 0;
  border-radius: 2rem;
  padding-left: 1rem;
}

/* ---------- Hero (home) ---------- */
.kb-hero {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(251, 104, 70, 0.22) 0%, transparent 60%),
    linear-gradient(180deg, var(--kb-brand) 0%, var(--kb-brand-deep) 100%);
  color: #fff;
  padding: 3.5rem 0 4rem;
  text-align: center;
}

.kb-hero-title {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.kb-hero-search {
  display: flex;
  gap: 0.5rem;
  max-width: 640px;
  margin: 0 auto;
}

.kb-hero-search .form-control {
  border: 0;
}

.kb-btn-accent {
  background: var(--kb-accent);
  color: #fff;
  white-space: nowrap;
}

.kb-btn-accent:hover {
  background: var(--kb-accent-hover);
  color: #fff;
}

@media (max-width: 575.98px) {
  .kb-hero-search {
    flex-direction: column;
  }
}

/* ---------- Conteúdo geral ---------- */
.kb-main {
  flex: 1 0 auto;
  padding-top: 1.5rem;
  padding-bottom: 3rem;
}

.kb-breadcrumb {
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.kb-breadcrumb a {
  text-decoration: none;
}

.kb-page-title {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.kb-section-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0.5rem 0 1rem;
}

.kb-subsection-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.kb-subsection-title a {
  color: var(--kb-text);
  text-decoration: none;
}

.kb-subsection-title a:hover {
  color: var(--kb-accent);
}

.kb-see-all {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  text-decoration: none;
}

/* Cards de categoria (home) */
.kb-category-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.25rem;
  height: 100%;
  min-height: 6rem;
  padding: 1.25rem;
  border: 1px solid var(--kb-border);
  border-radius: var(--kb-radius);
  color: var(--kb-text);
  text-align: center;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.kb-category-card:hover {
  border-color: var(--kb-accent);
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.06);
  color: var(--kb-accent);
}

.kb-category-name {
  font-weight: 600;
  font-size: 1.05rem;
}

.kb-category-meta {
  color: var(--kb-muted);
  font-size: 0.85rem;
}

/* Listas de artigos */
.kb-article-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.kb-article-list li {
  padding: 0.4rem 0;
}

.kb-article-list a {
  text-decoration: none;
}

.kb-article-list a:hover {
  text-decoration: underline;
}

@media (min-width: 768px) {
  .kb-article-list-columns {
    columns: 2;
    column-gap: 2rem;
  }
}

/* Resultados de busca */
.kb-search-results {
  list-style: none;
  padding: 0;
}

.kb-search-results li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--kb-border);
}

.kb-search-result-title {
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
}

.kb-search-result-path {
  color: var(--kb-muted);
  font-size: 0.85rem;
  margin-top: 0.15rem;
}

.kb-search-result-summary {
  margin: 0.35rem 0 0;
  color: var(--kb-text);
}

/* ---------- Página do artigo ---------- */
.kb-sidenav {
  position: sticky;
  top: 1rem;
}

.kb-sidenav-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.kb-sidenav-toggle {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--kb-border);
  border-radius: var(--kb-radius);
  background: var(--kb-surface);
  font-weight: 600;
  text-align: left;
}

.kb-sidenav-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
  border-left: 2px solid var(--kb-border);
}

.kb-sidenav-list li a,
.kb-sidenav-current {
  display: block;
  padding: 0.35rem 0 0.35rem 0.85rem;
  margin-left: -2px;
  border-left: 2px solid transparent;
  font-size: 0.9rem;
  text-decoration: none;
}

.kb-sidenav-list li a {
  color: var(--kb-text);
}

.kb-sidenav-list li a:hover {
  color: var(--kb-accent);
}

.kb-sidenav-current {
  border-left-color: var(--kb-accent);
  color: var(--kb-accent);
  font-weight: 600;
}

.kb-article-header {
  margin-bottom: 1.5rem;
}

.kb-article-title {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.kb-article-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.kb-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--kb-brand);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  flex-shrink: 0;
}

.kb-article-author {
  font-weight: 600;
  font-size: 0.95rem;
}

.kb-toc {
  background: var(--kb-surface);
  border: 1px solid var(--kb-border);
  border-radius: var(--kb-radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.kb-toc-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

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

.kb-toc-list li {
  padding: 0.15rem 0;
}

.kb-toc-list .kb-toc-sub {
  padding-left: 1rem;
  font-size: 0.925rem;
}

.kb-toc-list a {
  text-decoration: none;
}

.kb-article-content {
  line-height: 1.7;
  overflow-wrap: break-word;
}

.kb-article-content h2,
.kb-article-content h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  scroll-margin-top: 1rem;
}

.kb-article-content h2 {
  font-size: 1.5rem;
}

.kb-article-content h3 {
  font-size: 1.2rem;
}

.kb-article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin: 0.5rem 0;
}

/* Componentes gerados pelo SunEditor. O alinhamento de imagem/vídeo é salvo como classe
   no contêiner (__se__float-*), não como estilo inline — sem estas regras a página pública
   ignoraria o alinhamento escolhido no editor (equivalem às de .sun-editor-editable). */
.kb-article-content .se-component {
  display: flex;
  margin: 1rem 0;
  max-width: 100%;
}

.kb-article-content .se-component figure {
  display: block;
  position: relative;
  margin: 0;
  padding: 0;
  min-width: 0;
  max-width: 100%;
}

.kb-article-content .se-component figure img {
  margin: 0;
}

.kb-article-content .__se__float-center figure {
  margin: 0 auto !important;
}

.kb-article-content .__se__float-left {
  float: left;
  margin: 0.25rem 1rem 0.5rem 0;
}

.kb-article-content .__se__float-right {
  float: right;
  margin: 0.25rem 0 0.5rem 1rem;
}

.kb-article-content .__se__float-none,
.kb-article-content .__se__float-center {
  float: none;
}

.kb-article-content figure figcaption {
  display: block;
  padding: 0.5rem;
  background: var(--kb-surface);
  color: var(--kb-muted);
  font-size: 0.9rem;
  text-align: center;
}

.kb-article-content figure figcaption p {
  margin: 0;
}

.kb-article-content .se-video-container figure {
  width: 100%;
}

.kb-article-content .se-video-container iframe,
.kb-article-content .se-video-container video {
  max-width: 100%;
}

/* Imagens flutuando à esquerda/direita não podem invadir o bloco de voto/tags. */
.kb-article-content::after {
  content: "";
  display: table;
  clear: both;
}

@media (max-width: 575.98px) {
  .kb-article-content .__se__float-left,
  .kb-article-content .__se__float-right {
    float: none;
    margin: 1rem 0;
  }
}

.kb-article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  display: block;
  overflow-x: auto;
}

.kb-article-content table td,
.kb-article-content table th {
  border: 1px solid #dee2e6;
  padding: 0.5rem;
}

.kb-article-content pre {
  background: var(--kb-surface);
  border: 1px solid var(--kb-border);
  border-radius: var(--kb-radius);
  padding: 1rem;
  overflow-x: auto;
}

.kb-article-content blockquote {
  border-left: 4px solid var(--kb-accent);
  background: var(--kb-surface);
  padding: 0.75rem 1rem;
  margin: 1rem 0;
}

.kb-article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2rem;
}

.kb-tag {
  padding: 0.2rem 0.65rem;
  border: 1px solid var(--kb-border);
  border-radius: 2rem;
  color: var(--kb-muted);
  font-size: 0.85rem;
  text-decoration: none;
}

.kb-tag:hover {
  border-color: var(--kb-accent);
}

.kb-vote {
  margin-top: 2.5rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--kb-border);
  border-bottom: 1px solid var(--kb-border);
  text-align: center;
}

.kb-vote-question {
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.kb-vote-buttons form {
  display: inline-flex;
  gap: 0.5rem;
}

.kb-vote-buttons .btn {
  min-width: 5rem;
}

.kb-vote-thanks {
  font-weight: 600;
  color: var(--kb-accent);
}

.kb-vote-count {
  margin-top: 0.5rem;
}

.kb-article-extras {
  margin-top: 1.5rem;
}

/* ---------- Rodapé e "voltar ao topo" ---------- */
.kb-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--kb-border);
  background: var(--kb-surface);
  color: var(--kb-muted);
  padding: 1.25rem 0;
  font-size: 0.9rem;
}

.kb-footer a {
  color: var(--kb-muted);
  text-decoration: none;
}

.kb-footer a:hover {
  color: var(--kb-accent);
}

.kb-back-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 50%;
  background: var(--kb-brand);
  color: #fff;
  font-size: 1.2rem;
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.kb-back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
}
