/* ====================================================================
   AXO Email — Documentation site styles
   Loaded after styles.css; relies on existing .doc-* base.
   ==================================================================== */

.docs-search-wrap {
  max-width: 560px;
  margin: 28px auto 0;
}
.docs-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 4px 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.docs-search:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(91, 154, 255, 0.15);
}
.docs-search > i {
  color: var(--text-muted);
  font-size: 1.1rem;
}
.docs-search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  padding: 12px 4px;
}
.docs-search input::placeholder { color: var(--text-muted); }
.docs-search-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 10px 0 0;
}

/* Wider layout for docs */
.docs-grid { grid-template-columns: 260px 1fr; gap: 40px; }
.docs-toc { max-height: calc(100vh - 120px); overflow-y: auto; padding-right: 8px; }
.docs-toc::-webkit-scrollbar { width: 6px; }
.docs-toc::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

.toc-group {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.toc-group:first-of-type { border-top: none; margin-top: 6px; padding-top: 6px; }
.toc-group-head {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 4px 10px 2px;
}
.docs-toc a.toc-active {
  background: rgba(91, 154, 255, 0.14);
  color: var(--blue);
}

/* Content: headings spacing */
.docs-content h2 {
  scroll-margin-top: 80px;
  padding-top: 8px;
  margin-top: 48px;
  margin-bottom: 14px;
}
.docs-content h2:first-child {
  margin-top: 0;
}
.docs-content h2::before {
  content: "";
  display: block;
  width: 40px;
  height: 3px;
  background: var(--grad);
  border-radius: 3px;
  margin-bottom: 14px;
}

/* Search highlight — filter mode hides non-matching sections */
.docs-content.filtering h2,
.docs-content.filtering h2 ~ * {
  display: none;
}
.docs-content.filtering h2.match,
.docs-content.filtering h2.match ~ * {
  display: revert;
}
.docs-content.filtering h2.match + *:not(h2),
.docs-content.filtering h2.match ~ *:not(h2):not(h2.match ~ *) {
  display: revert;
}
.docs-content.filtering h2.next-match,
.docs-content.filtering h2.next-match ~ * {
  display: none;
}
.docs-search-empty {
  display: none;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.docs-search-empty i { font-size: 2.6rem; color: rgba(91,154,255,0.4); margin-bottom: 10px; display: block; }
.docs-content.filtering ~ .docs-search-empty { display: block; }
mark {
  background: rgba(245, 158, 11, 0.3);
  color: var(--text);
  padding: 0 2px;
  border-radius: 3px;
}

/* Callouts */
.callout {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  border-radius: 12px;
  margin: 18px 0;
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.callout > i {
  font-size: 1.3rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.callout strong { color: var(--text); }
.callout p { margin: 4px 0 0; }
.callout-tip {
  background: rgba(94, 234, 212, 0.08);
  border-color: rgba(94, 234, 212, 0.25);
}
.callout-tip > i { color: #5eead4; }
.callout-warn {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.25);
}
.callout-warn > i { color: #fbbf24; }
.callout-note {
  background: rgba(91, 154, 255, 0.08);
  border-color: rgba(91, 154, 255, 0.25);
}
.callout-note > i { color: var(--blue); }

/* kbd styled consistently */
.docs-content kbd,
.docs-hero kbd,
.docs-search kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-dim);
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.78rem;
  font-weight: 600;
}

@media (max-width: 900px) {
  .docs-grid { grid-template-columns: 1fr; }
  .docs-toc {
    position: static;
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
    margin-bottom: 20px;
  }
  .docs-content h2 { scroll-margin-top: 20px; }
}
