/* MAARTORI — Central de Ajuda v1
   Extensão do sistema visual do Glossário para navegação lateral por assunto. */

.aj-hero h1 { max-width: 15ch; }
.aj-hero .lead { max-width: 62ch; }
.aj-search { position: relative; }
.aj-search input[type="search"]::-webkit-search-cancel-button { display: none; }
.aj-search-clear {
  display: none;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  flex: 0 0 30px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.10);
  color: var(--white);
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.aj-search-clear.is-visible { display: inline-flex; }
.aj-search-clear:hover { background: rgba(255,255,255,0.18); transform: scale(1.05); }
.aj-counter #ajudaCounter {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--white);
  margin-right: 4px;
}

.aj-content { padding-top: var(--space-6); }
.aj-layout {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  gap: clamp(42px, 6vw, 84px);
  align-items: start;
  max-width: 1180px;
  margin: 0 auto;
}
.aj-sidebar {
  position: sticky;
  top: 112px;
  min-width: 0;
}
.aj-sidebar-head { margin-bottom: 24px; }
.aj-sidebar-head .label {
  color: var(--sage-d);
  margin-bottom: 9px;
}
.aj-sidebar-head > p:last-child {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  margin: 0;
}
.aj-tabs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.aj-tab {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0,1fr) 18px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 70px;
  padding: 12px 14px;
  border: 1px solid var(--gray-100);
  border-radius: 14px;
  background: var(--white);
  color: var(--deep);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(15,17,20,.035);
  transition: transform .25s cubic-bezier(.4,0,.2,1), border-color .25s ease, background .25s ease, box-shadow .25s ease;
}
.aj-tab::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: transparent;
  transition: background .25s ease;
}
.aj-tab:hover {
  transform: translateX(4px);
  border-color: var(--sage-30);
  box-shadow: 0 10px 28px rgba(74,85,50,.10);
}
.aj-tab.is-active {
  background: var(--sage-d);
  border-color: var(--sage-d);
  color: var(--white);
  box-shadow: 0 14px 34px rgba(74,85,50,.20);
}
.aj-tab.is-active::before { background: var(--sage-l); }
.aj-tab.has-no-match { opacity: .35; cursor: default; }
.aj-tab.has-no-match:hover { transform: none; box-shadow: 0 4px 18px rgba(15,17,20,.035); }
.aj-tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--sage-15);
  color: var(--sage-d);
  font-size: 20px;
  transition: background .25s ease, color .25s ease;
}
.aj-tab.is-active .aj-tab-icon { background: rgba(255,255,255,.14); color: var(--sage-l); }
.aj-tab-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.aj-tab-copy strong { font-size: 14px; font-weight: 600; line-height: 1.25; }
.aj-tab-copy small {
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: .04em;
  color: var(--muted);
}
.aj-tab.is-active .aj-tab-copy small { color: rgba(255,255,255,.68); }
.aj-tab-arrow { color: var(--gray-300); transition: transform .25s ease, color .25s ease; }
.aj-tab.is-active .aj-tab-arrow { color: var(--sage-l); transform: translateX(2px); }

.aj-faq { display: block; max-width: none; min-width: 0; margin: 0; }
.aj-panel-head {
  padding-bottom: 24px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--gray-100);
}
.aj-panel-head .label { color: var(--sage-d); margin-bottom: 10px; }
.aj-panel-head h2 {
  font-family: var(--font-display);
  font-size: clamp(34px, 4vw, 52px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -.025em;
  color: var(--deep);
  margin: 0 0 12px;
  text-wrap: balance;
}
.aj-panel-head > p:last-child {
  color: var(--muted);
  max-width: 650px;
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
}
.aj-panel-head[hidden] { display: none; }
.aj-faq .faq-cat[hidden] { display: none !important; }
.aj-faq .faq-cat > h2 { display: none !important; }
.aj-faq .faq-cat { display: flex; flex-direction: column; gap: 14px; }
.aj-faq .faq-item[hidden] { display: none !important; }
.aj-faq .faq-item {
  border-radius: 14px;
  border-color: var(--gray-100);
  background: var(--white);
  box-shadow: 0 4px 18px rgba(15,17,20,.035);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.aj-faq .faq-item:hover {
  transform: translateY(-2px);
  border-color: var(--sage-30);
  box-shadow: 0 12px 30px rgba(74,85,50,.09);
}
.aj-faq .faq-item.is-open {
  border-color: var(--sage-d);
  box-shadow: 0 16px 38px rgba(74,85,50,.12);
}
.aj-faq .faq-q {
  padding: 22px 24px;
  gap: 20px;
  font-size: 15px;
  line-height: 1.35;
}
.aj-faq .faq-q i { flex: 0 0 auto; color: var(--sage-d); }
.aj-faq .faq-q[aria-expanded="true"] i { color: var(--white); }
.aj-faq .faq-a {
  display: block;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  color: var(--muted);
  line-height: 1.7;
  transition: max-height .4s cubic-bezier(.4,0,.2,1), opacity .25s ease, padding .35s ease;
}
.aj-faq .faq-a.is-open { max-height: 520px; opacity: 1; padding: 0 24px 22px; }
.aj-faq .faq-a .link-inline { color: var(--sage-d); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.aj-empty {
  text-align: center;
  padding: 72px 24px;
  border: 1px dashed var(--sage-30);
  border-radius: 18px;
  background: rgba(255,255,255,.55);
}
.aj-empty[hidden] { display: none; }
.aj-empty > i { font-size: 42px; color: var(--sage); }
.aj-empty h3 {
  margin: 14px 0 8px;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  color: var(--deep);
}
.aj-empty p { color: var(--muted); margin: 0; }

.aj-cta-section .cta-band .label { justify-content: center; }

@media (max-width: 900px) {
  .aj-content { padding-top: var(--space-5); }
  .aj-layout { grid-template-columns: 1fr; gap: 36px; }
  .aj-sidebar { position: static; }
  .aj-sidebar-head { text-align: center; max-width: 560px; margin: 0 auto 20px; }
  .aj-sidebar-head .label { justify-content: center; }
  .aj-tabs {
    flex-direction: row;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    padding: 2px 2px 12px;
    margin: 0 calc(var(--gutter) * -1);
    padding-left: var(--gutter);
    padding-right: var(--gutter);
    scrollbar-width: none;
  }
  .aj-tabs::-webkit-scrollbar { display: none; }
  .aj-tab {
    flex: 0 0 220px;
    scroll-snap-align: start;
    grid-template-columns: 38px minmax(0,1fr);
    min-height: 64px;
  }
  .aj-tab-arrow { display: none; }
  .aj-tab:hover { transform: translateY(-2px); }
  .aj-tab-icon { width: 38px; height: 38px; font-size: 18px; }
}

@media (max-width: 640px) {
  .aj-hero h1 { max-width: 9ch; }
  .aj-hero .lead { font-size: 16px; }
  .aj-search { padding: 13px 16px; }
  .aj-search input { min-width: 0; font-size: 14px; }
  .aj-content { padding-bottom: var(--space-5); }
  .aj-layout { gap: 26px; }
  .aj-sidebar-head { text-align: left; margin-bottom: 16px; }
  .aj-sidebar-head .label { justify-content: flex-start; }
  .aj-tab { flex-basis: 205px; }
  .aj-panel-head { padding-bottom: 18px; }
  .aj-panel-head h2 { font-size: 34px; }
  .aj-panel-head > p:last-child { font-size: 14px; }
  .aj-faq .faq-q { padding: 18px; font-size: 14px; }
  .aj-faq .faq-a.is-open { padding: 0 18px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .aj-tab, .aj-search-clear, .aj-faq .faq-item { transition: none; }
  .aj-tab:hover, .aj-search-clear:hover, .aj-faq .faq-item:hover { transform: none; }
}
