/* Post-migration additions (not transplanted WP CSS). Keep small. */

/* ===== Accessibility (WCAG AA contrast; Lighthouse color-contrast + link-in-text-block) =====
   Minimal colour shifts on top of the transplanted theme CSS — no underlines added. */
/* Theme gray #7b839a is 3.1–3.8:1 on the light backgrounds (#fff, #f3f3f3, #e6ebed) -> the theme's
   body-text gray #61687c (4.6–5.6:1). */
/* (text-* utility classes keep their colour, e.g. the footer's p.h4.text-lightgray on blue) */
h4:not([class*="text-"]), .h4:not([class*="text-"]), .text-darkgray, .has-darkgray-color, #page-nav-mobile { color: #61687c; }
/* ...on the dark-blue (#14234c) homepage hero it must get lighter instead: 4.0:1 -> 5.9:1. */
#home-main-content h4, #home-main-table .text-darkgray { color: #9aa1b5; }
/* Solid red buttons: white on #FF473F is 3.4:1 -> #e0302a 4.5:1. */
.button, .wp-block-button__link, #menu .menu-download > a.button,
.button.has-red-background-color, .wp-block-button__link.has-red-background-color { background-color: #e0302a; }
/* "NEW" badges (inline style, white on #4ec9b0 = 2.0:1): navy text on the same teal = 7.5:1. */
label[style*="#4EC9B0" i] { color: #14234c !important; }
/* Links inside running text must differ from the #61687c text by 3:1 without relying on an
   underline: #274492 is 1.6:1 -> dark navy #0b1430 (3.3:1; 18:1 on white). */
.block li > a, #footer-sub small a { color: #0b1430; }
/* Rouge code samples (feature pages): token colours were 1.2–3.8:1 on the #f7f7f7 code background ->
   same hues darkened to >= 4.6:1. */
.highlight .c, .highlight .cm, .highlight .c1 { color: #6e6e6e; }
.highlight .k, .highlight .kc, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kt,
.highlight .nt, .highlight .ow { color: #3474a0; }
.highlight .cs { color: #e00808; }
.highlight .m, .highlight .mf, .highlight .mh, .highlight .mi, .highlight .mo, .highlight .il { color: #3473a4; }
.highlight .s { color: #966400; }
.highlight .nb, .highlight .bp { color: #1f7a85; }
.highlight .nc, .highlight .nf { color: #007f65; }
.highlight .no, .highlight .nv, .highlight .vc, .highlight .vg, .highlight .vi { color: #1f7a7a; }
.highlight .nd, .highlight .sx { color: #996300; }
.highlight .nn { color: #3c70b6; }
.highlight .sb, .highlight .sc, .highlight .sd, .highlight .s2, .highlight .se, .highlight .sh, .highlight .si,
.highlight .sr, .highlight .s1, .highlight .ss { color: #98640c; }
/* Visually hidden text (link descriptions for screen readers / Lighthouse link-text). */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* Training promo on feature pages: stands in for the empty <h2></h2> of the dropped CF7 form
   (only its h2 margin-bottom contributed to the layout). */
.feature-cta-spacer { margin-bottom: 1rem; }

/* Former GIFs as <video> (scripts/convert-media.mjs). Same box as the old img.tat-contain / inline CTA
   img: the column width (max. intrinsic), height from the width/height attributes' aspect ratio. */
video.tat-contain { display: block; width: 100%; max-width: 1000px; height: auto; }
.feature-icon video { max-width: 100%; height: auto; vertical-align: middle; } /* = theme img rule */

/* YouTube click-to-load facade (replaces embedded iframes; see scripts/extract-home.mjs) */
.yt-facade {
  position: relative;
  max-width: 100%;
  background-color: #000;
  background-position: center;
  background-size: cover;
  cursor: pointer;
}
.yt-facade-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 68px;
  height: 48px;
  transform: translate(-50%, -50%);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 68 48'%3E%3Cpath d='M66.52 7.74c-.78-2.93-2.49-5.41-5.42-6.19C55.79.13 34 0 34 0S12.21.13 6.9 1.55c-2.93.78-4.63 3.26-5.42 6.19C.06 13.05 0 24 0 24s.06 10.95 1.48 16.26c.78 2.93 2.49 5.41 5.42 6.19C12.21 47.87 34 48 34 48s21.79-.13 27.1-1.55c2.93-.78 4.64-3.26 5.42-6.19C67.94 34.95 68 24 68 24s-.06-10.95-1.48-16.26z' fill='%23f00'/%3E%3Cpath d='M45 24 27 14v20' fill='%23fff'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: 0.9;
  transition: opacity 0.2s;
}
.yt-facade:hover .yt-facade-play,
.yt-facade:focus-visible .yt-facade-play { opacity: 1; }

/* The theme sets display on .button etc., which would override the hidden attribute. */
[hidden] { display: none !important; }

/* ===== Site search (/search/, header menu, 404) — Pagefind; theme tokens: navy #14234c, blue #274492,
   gray #61687c, light blue #DEF1F7, teal #4ec9b0, Nunito ===== */
.search-form { display: flex; gap: 0.75rem; align-items: center; }
.search-form input[type="search"] {
  flex: 1; min-width: 0; height: 3rem; margin: 0; padding: 0 1rem;
  border: 1px solid #c8c8c8; border-radius: 0.25rem; background: #fff;
  color: #14234c; font-family: Nunito, sans-serif; font-size: 1.125rem;
}
.search-form input[type="search"]::placeholder { color: #61687c; opacity: 1; }
.search-form .button { flex: none; height: 3rem; }
.search-box { background: #fff; padding: 1.5rem; margin-top: 1.5rem; }
.search-page :focus-visible, .page-404 :focus-visible, .menu-search :focus-visible { outline: 3px solid #274492; outline-offset: 2px; }

.search-filters { margin-bottom: 1rem; }
.search-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.5rem; }
.search-chip {
  border: 1px solid #274492; border-radius: 1.25rem; background: #fff; color: #274492;
  padding: 0.35rem 1rem; font: 600 0.9375rem/1.4 Nunito, sans-serif; cursor: pointer;
}
.search-chip[aria-pressed="true"] { background: #274492; color: #fff; }
.search-chip-count { opacity: 0.8; font-weight: 400; }
.search-status { color: #61687c; margin: 0.5rem 0 1rem; }
.search-status.is-loading { display: flex; align-items: center; gap: 0.75rem; }
.search-spinner {
  width: 1.25rem; height: 1.25rem; flex: none; border-radius: 50%;
  border: 3px solid #DEF1F7; border-top-color: #274492; animation: search-spin 0.7s linear infinite;
}
@keyframes search-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .search-spinner { animation: none; } }
.search-results { list-style: none; padding: 0; margin: 0; }
.search-results.is-pending { min-height: 100vh; } /* reserved while Pagefind loads (no CLS) */
.search-filters.is-pending { min-height: 34px; }
.search-result { border-bottom: 1px solid #e6ebed; padding: 1.25rem 0; }
.search-result-badges { margin: 0 0 0.25rem; display: flex; gap: 0.5rem; }
.search-badge {
  display: inline-block; padding: 0.1rem 0.5rem; border-radius: 0.2rem; background: #DEF1F7;
  color: #14234c; font-size: 0.8125rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em;
}
.search-badge-platform { background: #4ec9b0; }
.search-result-title { font-size: 1.375rem; line-height: 1.75rem; margin: 0 0 0.25rem; letter-spacing: -0.5px; }
.search-result-title a { color: #274492; }
.search-result-title a:hover { color: #14234c; }
.search-result-section { margin: 0 0 0.25rem; color: #14234c; font-weight: 600; }
.search-result-excerpt { margin: 0 0 0.25rem; color: #61687c; }
.search-result-excerpt mark { background: #fff3b0; color: #14234c; padding: 0 0.1em; }
.search-result-url { margin: 0; color: #61687c; font-size: 0.875rem; word-break: break-all; }
.search-more-wrap { margin-top: 1.5rem; }
.search-popular ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.search-popular a { color: #274492; font-weight: 600; }

/* header menu: compact GET search form in place of the old "Search" link */
#menu .menu-search-form { display: flex; align-items: center; gap: 0.25rem; padding: 0.25rem 0.5rem; }
#menu .menu-search-form input {
  width: 11rem; margin: 0; padding: 0.25rem 0; border: 0; border-bottom: 2px solid #61687c; border-radius: 0;
  background: transparent; color: #14234c; font-family: Nunito, sans-serif; font-size: 1.125rem; line-height: 1.5rem;
}
#menu .menu-search-form input::placeholder { color: #274492; opacity: 1; }
#menu .menu-search-form button {
  display: flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; padding: 0;
  border: 0; background: none; color: #274492; cursor: pointer;
}

/* 404: search + popular links on the dark band */
.page-404 .search-form { max-width: 36rem; margin: 0 auto 1.5rem; }
.page-404 .search-popular h2 { color: #fff; }
.page-404 .search-popular ul { justify-content: center; }
.page-404 .search-popular a { color: #fff; }

/* Column blocks keep WP's per-page `.wp-container-N { flex-wrap: nowrap }` (layout support, inline on live). */
.guten-content .wp-block-columns { flex-wrap: nowrap; }

/* FAQ accordion (/features/) — native details/summary */
.faq .faq-item { border-bottom: 1px solid #d9dee8; padding: 0 15px; }
.faq .faq-item summary { cursor: pointer; list-style: none; font-weight: 600; font-size: 1.125rem; line-height: 1.4; padding: 1rem 2rem 1rem 0; position: relative; color: #14234C; }
.faq .faq-item summary::-webkit-details-marker { display: none; }
.faq .faq-item summary::after { content: '+'; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 1.5rem; line-height: 1; }
.faq .faq-item[open] summary::after { content: '\2212'; }
.faq .faq-item summary:focus-visible { outline: 3px solid #1a5fd0; outline-offset: 2px; }
.faq .faq-answer { padding: 0 0 1rem; }
.faq .faq-answer p { margin: 0 0 .5rem; }
.faq .faq-link a { text-decoration: underline; }

/* A11y: archive index hero subtitle (grey on grey-blue, contrast 1.46) */
.post-type-archive #page-subtitle { color: #0d1633; }

/* ===== Download dropdowns (BELLATRIX-07): header li.menu-download + hero .collapsible =====
   The theme's <label> became a <button class="button js-dropdown"> (interactive.js initDropdowns).
   Same specificity as the theme's `.collapsible label` (0,1,1) so `.collapsible .button` still wins,
   i.e. the button renders exactly like the label did. */
.collapsible button {
  -webkit-appearance: none; appearance: none; border: 0; margin: 0;
  position: relative; font-weight: 600; background: #fff;
  box-shadow: rgba(0, 0, 0, 0.1) 0px 5px 11px 0px, rgba(0, 0, 0, 0.08) 0px 4px 11px 0px;
  color: #1c1c6b; display: block; margin-bottom: 10px; cursor: pointer;
  padding: 15px 40px 15px 20px; border-radius: 4px;
}
/* Chevron = the theme's dropdown asset; centred on the right like the header menu arrows; points up when open. */
.collapsible button.js-dropdown::after {
  content: ""; position: absolute; right: 1.25rem; top: 50%;
  width: 1.25rem; height: 1.25rem; margin-top: -0.625rem;
  background: url("/assets/site/images/theme/dropdown_arrow_white.svg") no-repeat center / contain;
}
.collapsible button.js-dropdown[aria-expanded="true"]::after { transform: rotate(180deg); }
@media (prefers-reduced-motion: no-preference) {
  .collapsible button.js-dropdown::after { transition: transform 0.3s ease; }
}
.collapsible button.js-dropdown:focus-visible { outline: 2px solid #14234c; outline-offset: 2px; }
/* hero: .is-open replaces the old `input:checked ~ .collapsible-text`; closed links are not focusable */
.collapsible .collapsible-text { visibility: hidden; }
.collapsible.is-open .collapsible-text {
  visibility: visible; max-height: 400px; background: #fff;
  box-shadow: rgba(0, 0, 0, 0.1) 0px 5px 11px 0px; opacity: 1; top: 0;
}
/* header: in the slide-in menu (< 90em since new-page-designs) the list was always shown -> now collapsed until opened;
   on wide desktop it keeps the theme's hover behaviour and also opens on click / keyboard. */
@media not all and (min-width: 90em) {
  #menu .menu-download:not(.is-open) > .sub-menu { display: none; }
}
@media screen and (min-width: 90em) {
  #menu .menu-download.is-open > .sub-menu { height: auto; opacity: 1; }
}

/* ===== A11y: /agent/ docs (BELLATRIX-07; Lighthouse color-contrast + link-in-text-block) =====
   Same fixes as the feature archive / running-text links above; no underlines. */
.agent-docs #page-subtitle { color: #0d1633; }
.agent-docs .feature-content a:not(.button) { color: #0b1430; }

/* ===== Header: one-line desktop menu from 90em (1440px) (new-page-designs, owner decision) =====
   The theme only switches to the horizontal menu at 102em (1632px). The rules below are the theme's
   102em header rules (bellatrix-combined.css, unchanged) applied from 90em. Between 90em and 102em the
   menu is made to fit a 1440px window with a classic scrollbar (layout width ~1423px, >= 16px spare):
   top-level link side padding 0.75rem -> 0.6rem, and the search field collapses to a toggle button
   (interactive.js initSearchToggle) that expands the GET form over the menu items. >= 102em: unchanged. */
#menu .menu-search-toggle { display: none; } /* shown only between 90em and 102em, below */
@media screen and (min-width: 90em) {
  #header { padding: 0 2rem; }
  #menu-open { display: none; }
  #menu { overflow-y: initial; flex-direction: row; justify-content: flex-end; align-items: center; position: initial; padding: 0; width: auto; height: 5rem; background-color: transparent; }
  #menu .menu-item > a:not(.button):before { content: ""; position: absolute; height: 2px; bottom: 0.25rem; left: 0.75rem; right: 0.75rem; background-color: #61687c; visibility: hidden; transform: scaleX(0); transition: all 0.3s ease-in-out 0s; }
  #menu a { position: relative; padding: 0 0.75rem; font-size: 1.15rem; line-height: 3rem; color: #61687c; }
  #menu-main { padding: 0; width: auto; flex-direction: row; align-items: center; }
  #menu-main > .menu-item { height: auto; }
  #menu #menu-main > .menu-item.current-menu-item > a:not(.button):before, #menu #menu-main > .menu-item:hover > a:not(.button):before { visibility: visible; transform: scaleX(1); }
  #menu .menu-item-has-children > a { padding-right: 1.5rem; background-image: url("/assets/site/images/theme-parent/arrow_drop_down.svg"); background-repeat: no-repeat; background-position: right center; background-size: 1rem auto; margin-right: 0.5rem; }
  #menu .menu-item .sub-menu { display: block; position: absolute; top: calc( 100% - 0.25rem ); left: 0.75rem; right: auto; width: 200px; height: 0; z-index: -1; overflow-y: hidden; padding: 0.5rem 0; background-color: #ffffff; opacity: 0; box-shadow: 0 0 5px rgba(0, 0, 0, 0.3); transition: opacity 0.5s linear; }
  #menu .menu-item:hover .sub-menu { height: auto; opacity: 1; }
  #menu .sub-menu .menu-item { width: 100%; min-height: 2rem; }
  #menu .menu-item .sub-menu a { line-height: 1.25rem; padding: 0.5rem 0.75rem; border-bottom: 1px solid white; }
  #menu .menu-item .sub-menu .menu-item:hover a { background-color: #eeeeee; }
  /* keyboard: a focused submenu link opens its dropdown like hover does (theme was hover-only) */
  #menu #menu-main > .menu-item:not(.menu-download):focus-within > .sub-menu { height: auto; opacity: 1; z-index: 5; }
}
@media screen and (min-width: 90em) and (max-width: 101.99em) {
  #menu #menu-main > .menu-item:not(.menu-download) > a:not(.button) { padding-left: 0.6rem; padding-right: 0.6rem; }
  #menu #menu-main > .menu-item-has-children:not(.menu-download) > a:not(.button) { padding-right: 1.5rem; }
  #menu #menu-main > .menu-item > a:not(.button):before { left: 0.6rem; right: 0.6rem; }
  #menu #menu-main > .menu-item-has-children > a:not(.button):before { right: 1.5rem; }
  /* collapsed search: only the toggle (2rem x 2rem hit area), no side padding (owner: needed for >= 16px spare at a
     1423px layout width); the expanded form keeps its own 0.25rem 0.5rem padding */
  #menu .menu-search { position: relative; padding: 0.25rem 0; }
  #menu .menu-search-toggle {
    display: flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; padding: 0;
    border: 0; background: none; color: #274492; cursor: pointer;
  }
  #menu .menu-search-toggle:focus-visible { outline: 3px solid #274492; outline-offset: 2px; }
  #menu .menu-search:not(.is-open) .menu-search-form { display: none; }
  /* expanded: the original form (original padding) over the menu items, right-aligned on the toggle; no reflow */
  #menu .menu-search.is-open .menu-search-toggle { visibility: hidden; }
  #menu .menu-search.is-open .menu-search-form {
    position: absolute; right: 0; top: 50%; transform: translateY(-50%); z-index: 10;
    background: #fff; box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
  }
}

/* ===== Sticky side navs on the new-page-designs pages (/features/ai-agent/, /agent/*) =====
   The theme sets overflow-x: hidden on BOTH html and body. html's value goes to the viewport, so body becomes a
   scroll container of its own (overflow hidden/auto) that never scrolls — position: sticky inside it never engages
   (the theme's own #page-nav avoids this with JS position: fixed, .js-moving-nav). overflow-x: clip clips the same
   way without creating a scroll container. html.no-scroll body (modal open) is more specific and still wins. */
@supports (overflow-x: clip) {
  body.bx2-page { overflow-x: clip; }
}
