/* Demo-only additions layered on aip.org's own stylesheet (aip.css). */

/* aip.org sets these in an inline <style> in its <head>. Its self-hosted
   Helvetica files are licensed, so the demo uses the system face. */
:root {
  --button-border-radius: 40px;
  --font-1: Helvetica, "Helvetica Neue", Arial, sans-serif;
  --font-2: "Times";
}
body {
  --font-1: Helvetica, "Helvetica Neue", Arial, sans-serif;
  --font-2: "Merriweather";
  --font-body: var(--font-1);
  --font-headline: var(--font-1);
  --font-list-title: var(--font-1);
  --font-promo-title: var(--font-1);
  --font-promo-description: var(--font-1);
  --font-rte-body: var(--font-1);
  --font-pull-quote: var(--font-2);
}

/* The snapshot wrapper must not add a layout box between <body> and the page. */
.DemoSnapshot {
  display: contents;
}

/* ---------------------------------------------------------------- navigation
   The server markup wraps each menu item in an extra <li> that aip.org's
   script unwraps; let the item fill the bar so its text centres vertically. */
.Navigation-items-item {
  display: flex;
}
.Navigation-items-item > .NavigationItem {
  flex: 1 0 auto;
}

/* ---------------------------------------------------------------- sticky header */
.Page-header-floating-container.DemoFloating_visible {
  top: 0;
}

/* ---------------------------------------------------------------- carousels
   aip.org builds these with Swiper at runtime; the demo uses a native
   scroll-snapping row with the same card sizes. */
.jsSlider {
  display: flex;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.jsSlider::-webkit-scrollbar {
  display: none;
}
.jsSlider.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  user-select: none;
}
.jsSlider > .swiper-slide {
  flex-shrink: 0;
  height: auto;
  scroll-snap-align: start;
}
.jsSlider > .swiper-slide:last-child {
  margin-right: 0;
}
.jsSlider img {
  -webkit-user-drag: none;
}
bsp-carousel-text-list .jsSlider > .swiper-slide {
  margin-right: 35px;
  width: calc((100% - 70px) / 3);
}
bsp-carousel-text-list .CarouselTextList-promo {
  height: 100%;
}
@media (max-width: 1023px) {
  bsp-carousel-text-list .jsSlider > .swiper-slide {
    margin-right: 20px;
    width: 80%;
  }
}

.DemoSliderBar {
  background: currentColor;
  color: var(--color-primary, #0b074e);
  height: 1px;
  margin-top: 40px;
  overflow: visible;
  position: relative;
}
.DemoSliderBar > span {
  background: currentColor;
  display: block;
  height: 4px;
  position: absolute;
  top: -3px;
  transition: transform 0.15s linear;
}
.CarouselTextList .DemoSliderBar,
.ScrollList .DemoSliderBar {
  color: #fff;
}

/* ---------------------------------------------------------------- newsletters */
.DemoInterest_selected .PagePromoInterest__btn {
  background: var(--color-royal-blue, #0029f4);
  color: #fff;
}

/* ---------------------------------------------------------------- disclaimer */
.DemoDisclaimer {
  background: #f2edf3;
  border-top: 1px solid #e8e1eb;
  color: #605f71;
  font-family: var(--font-1);
  font-size: 1.3rem;
  line-height: 1.5;
  margin: 0;
  padding: 12px var(--layoutPaddingX, 20px);
}

/* ---------------------------------------------------------------- unlock page */
.Page-body:has(.DemoUnlock) {
  padding-top: 0 !important;
}
.DemoUnlock {
  align-items: center;
  background: #0b074e;
  box-sizing: border-box;
  display: flex;
  font-family: var(--font-1);
  justify-content: center;
  min-height: 100vh;
  padding: 24px 16px;
}
.DemoUnlock-card {
  background: #fff;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  max-width: 420px;
  padding: 40px;
  width: 100%;
}
.DemoUnlock-logo {
  height: auto;
  margin-bottom: 28px;
  width: 120px;
}
.DemoUnlock-title {
  color: #0b074e;
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 8px;
}
.DemoUnlock-text {
  color: #605f71;
  font-size: 1.6rem;
  line-height: 1.5;
  margin: 0 0 28px;
}
.DemoUnlock-label {
  color: #0b074e;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.DemoUnlock-input {
  border: 1px solid #0b074e;
  border-radius: 0;
  font: inherit;
  font-size: 1.6rem;
  padding: 12px 14px;
}
.DemoUnlock-input:focus {
  border-color: #0029f4;
  outline: 2px solid #0029f4;
  outline-offset: 1px;
}
.DemoUnlock-error {
  color: #c4291d;
  font-size: 1.4rem;
  margin: 12px 0 0;
}
.DemoUnlock-button {
  align-self: flex-start;
  background: #f8d84a;
  border: 0;
  color: #0b074e;
  cursor: pointer;
  font: inherit;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-top: 24px;
  padding: 14px 40px;
  text-transform: uppercase;
}
.DemoUnlock-button:hover,
.DemoUnlock-button:focus-visible {
  background: #fff;
  outline: 2px solid #0b074e;
}

/* ---------------------------------------------------------------- Semantify
   The search overlay in AIP's palette and type. */
body .semantify-search-scope {
  --smtfy-search-accent: #0029f4 !important;
  --smtfy-search-backdrop: rgba(11, 7, 78, 0.6) !important;
  --smtfy-search-border: #e8e1eb !important;
  --smtfy-search-hover: #f2edf3 !important;
  --smtfy-search-muted: #605f71 !important;
  font-family: var(--font-1) !important;
}
body .semantify-search-scope,
body .semantify-search-overlay,
body .semantify-search-list {
  z-index: 10000 !important;
}

/* Activity dots: one transparent 6px box whose three box-shadows are the dots,
   so the same animation works on elements and on pseudo-elements the bundle
   can't overwrite. aip-behavior.tsx sets body[data-search-busy] while a
   typeahead request runs, and marks the results status while it reads
   "Searching". */
@keyframes DemoDotsBounce {
  0%, 60%, 100% {
    box-shadow: 10px 0 0 #0029f4, 20px 0 0 #0029f4, 30px 0 0 #0029f4;
  }
  15% {
    box-shadow: 10px -5px 0 #0029f4, 20px 0 0 #0029f4, 30px 0 0 #0029f4;
  }
  30% {
    box-shadow: 10px 0 0 #0029f4, 20px -5px 0 #0029f4, 30px 0 0 #0029f4;
  }
  45% {
    box-shadow: 10px 0 0 #0029f4, 20px 0 0 #0029f4, 30px -5px 0 #0029f4;
  }
}
@keyframes DemoDotsPulse {
  0%, 100% {
    box-shadow: 10px 0 0 rgba(0, 41, 244, 1), 20px 0 0 rgba(0, 41, 244, 0.35), 30px 0 0 rgba(0, 41, 244, 0.35);
  }
  33% {
    box-shadow: 10px 0 0 rgba(0, 41, 244, 0.35), 20px 0 0 rgba(0, 41, 244, 1), 30px 0 0 rgba(0, 41, 244, 0.35);
  }
  66% {
    box-shadow: 10px 0 0 rgba(0, 41, 244, 0.35), 20px 0 0 rgba(0, 41, 244, 0.35), 30px 0 0 rgba(0, 41, 244, 1);
  }
}
.DemoDots,
body[data-search-busy] .SearchOverlay.is-active .SearchOverlay__form:has(#aip-search)::after,
.semantify-search-status[data-demo-searching]::after {
  animation: DemoDotsBounce 1s ease-in-out infinite;
  border-radius: 50%;
  content: "";
  display: inline-block;
  height: 6px;
  margin-right: 30px;
  vertical-align: middle;
  width: 6px;
}
@media (prefers-reduced-motion: reduce) {
  .DemoDots,
  body[data-search-busy] .SearchOverlay.is-active .SearchOverlay__form:has(#aip-search)::after,
  .semantify-search-status[data-demo-searching]::after {
    animation: DemoDotsPulse 1.2s steps(1) infinite;
  }
}

/* In the header field: just left of the magnifying glass, with room kept
   clear in the input so a long query doesn't run underneath. */
#aip-search {
  padding-right: 72px;
}
body[data-search-busy] .SearchOverlay.is-active .SearchOverlay__form:has(#aip-search)::after {
  margin: -3px 0 0;
  position: absolute;
  right: 56px;
  top: 50%;
}
.semantify-search-status[data-demo-searching]::after {
  margin-left: 2px;
}

/* Stands in for the AI answer card until its first words stream in. */
.DemoAnswerPending {
  border: 1px solid var(--smtfy-search-border, #e8e1eb);
  border-inline-start: 3px solid #0029f4;
  border-radius: 8px;
  margin: 0 0 16px;
  padding: 10px 14px;
}
.DemoAnswerPending[hidden] {
  display: none;
}
.DemoAnswerPending-label {
  color: #0029f4;
  display: inline-block;
  font-size: 0.72em;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin: 0 0 6px;
  text-transform: uppercase;
}
.DemoAnswerPending-text {
  color: var(--smtfy-search-muted, #605f71);
  font-size: 0.95em;
  line-height: 1.5;
  margin: 0;
}
.DemoAnswerPending-text .DemoDots {
  margin-left: 2px;
}

/* The header field clips its contents so it can slide open; once open, the
   suggestions drop out of it, widening leftwards under the menu. */
.SearchOverlay.is-active:has(.semantify-search-list) {
  overflow: visible;
}
/* Keep aip.org's underlined field; the bundle's green ring becomes a thicker
   AIP-blue underline so focus stays visible. */
.Page-header .SearchOverlay__input:focus,
.Page-header .SearchOverlay__input:focus-visible {
  box-shadow: 0 2px 0 #0029f4 !important;
  outline: none !important;
}
.Page-header .semantify-search-list {
  box-shadow: 0 12px 32px rgba(11, 7, 78, 0.18) !important;
  left: auto !important;
  right: 0 !important;
  width: min(480px, calc(100vw - 32px)) !important;
}
