/*
 * BELLATRIX docs: additions to the production layout of docs.bellatrix.solutions. The layout itself (green
 * heading band, #page-nav on the right starting inside the band, content column, typography) comes from the
 * site theme in assets/site/css/bellatrix-combined.css, exactly as in production. This file only adds:
 *  - the current page in the nav: highlighted (link colour, semibold, arrow), never greyed
 *  - the stuck nav keeps a 24px gap to the viewport top and scrolls inside if it is taller (docs.js eases the
 *    top from the production 56px to 24px while scrolling, so it does not jump)
 *  - the AI Agent callout, the skip link and the header search results dropdown (docs-search.js)
 * Code blocks: the shared codeblock.css / codeblock.js. Shared by the C#, Java and JavaScript docs.
 */

/* ===== heading band: production green (#3d917d, 3.79:1 with white) darkened in the same hue to 4.52:1 (AA) ===== */
.single-features #page-heading { background-color: #378371; }

/* ===== nav: current page highlighted, not greyed ===== */
#page-nav .current-menu-item:not(.sub-anchor) > a,
#page-nav .current-menu-item:not(.sub-anchor) > a:hover { color: #274492; font-weight: 600; position: relative; }
#page-nav .current-menu-parent > a { color: #274492; }
#page-nav .current-menu-item:not(.sub-anchor) > a::before {
  content: ""; position: absolute; top: 50%; transform: translateY(-50%); width: 1.5rem; height: 1.25rem;
  background: url('/assets/site/images/theme-parent/nav-anchor-n.svg') left center / contain no-repeat;
}
/* top-level items have no indent: the arrow sits in the nav's left padding */
#menu-pagenav > .current-menu-item > a::before { left: -1.75rem; }
/* pages: in the 2rem indent; their anchors keep the theme's in-view arrow (.sub-anchor.current-menu-item) */
#page-nav .sub-menu > .current-menu-item:not(.sub-anchor) > a::before { left: 0.25rem; }
#page-nav .sub-anchor.current-menu-item > a { color: #274492; }
#page-nav a:focus-visible { outline: 3px solid #274492; outline-offset: 2px; }

/* ===== nav stuck: 24px from the top, scrolls inside when taller than the viewport (top set by docs.js) ===== */
@media screen and (min-width: 80em) {
  #page-nav.scrolled { max-height: calc(100vh - var(--docs-nav-top, 56px) - 24px); overscroll-behavior: contain; }
}

/* ===== AI Agent callout (overview pages) ===== */
#documentation-content .docs-callout {
  margin: 0 0 1.5rem; padding: 20px 24px; background: #f5f8ff; border: 1px solid #dbe1f0; border-left: 4px solid #4ec9b0; border-radius: 8px;
}
#documentation-content .docs-callout p { margin: 0; color: #14234c; }
#documentation-content .docs-callout p + p { margin-top: 8px; }
#documentation-content .docs-callout .docs-callout-label {
  display: inline-block; margin-right: 8px; background: #4ec9b0; color: #14234c; font-size: 13px; line-height: 19.5px;
  font-weight: 700; letter-spacing: 0.06em; padding: 1px 8px; text-transform: uppercase; vertical-align: 2px;
}
#documentation-content .docs-callout a { color: #274492; text-decoration: underline; }
#documentation-content .docs-callout-pending { border-left-color: #ed9d13; }
#documentation-content .docs-callout-pending .docs-callout-label { background: #fbe3b5; }

/* skip link */
.docs-skip:focus { position: fixed !important; left: 1rem; top: 1rem; width: auto; height: auto; clip: auto; z-index: 1000; padding: 0.5rem 1rem; background: #fff; color: #14234c; }

/* ===== header search: results dropdown (docs-search.js) ===== */
#menu .docs-search { position: relative; }
.docs-search-results {
  position: absolute; top: calc(100% + 0.25rem); right: 0; z-index: 50; width: min(36rem, 90vw); max-height: 70vh; overflow-y: auto;
  background: #fff; border-radius: 8px; box-shadow: 0 8px 24px rgba(20, 35, 76, 0.18); text-align: left;
}
.docs-search-results[hidden] { display: none; }
.docs-search-list { list-style: none; margin: 0; padding: 0.25rem 0; }
.docs-search-list li { margin: 0; padding: 0; list-style: none; width: 100%; min-height: 0; height: auto; }
#menu .docs-search-results a.docs-search-result {
  display: block; padding: 0.6rem 1rem; line-height: 1.4; color: #14234c; text-decoration: none; border-bottom: 1px solid #eef1f6;
  font-size: 1rem; white-space: normal;
}
#menu .docs-search-results a.docs-search-result::before { display: none; }
#menu .docs-search-results a.docs-search-result:hover, #menu .docs-search-results a.docs-search-result.active { background: #def1f7; }
.docs-search-crumb { display: block; color: #61687c; font-size: 0.8125rem; letter-spacing: 0.02em; }
.docs-search-title { display: block; color: #14234c; font-size: 1.0625rem; font-weight: 600; }
.docs-search-snippet { display: block; color: #61687c; font-size: 0.875rem; line-height: 1.5; margin-top: 0.15rem; }
.docs-search-hit { background: none; color: #14234c; font-weight: 700; padding: 0; }
.docs-search-empty, .docs-search-more { margin: 0; padding: 0.75rem 1rem; color: #61687c; font-size: 0.9375rem; line-height: 1.4; }
/* mobile menu panel (< 90em): search is a normal block, results flow below it */
@media screen and (max-width: 89.99em) {
  #menu .docs-search { width: 100%; }
  .docs-search-results { position: static; width: auto; max-height: 55vh; margin: 0.25rem 0.5rem 0.75rem; box-shadow: 0 2px 10px rgba(20, 35, 76, 0.15); }
}
