/**
 * @file
 * The site search: its suggestion list and rows, and the large field.
 *
 * The rows are the menu link rows (biopama_libraries/row-card,
 * .biopama-link-row); this file adds only what they lack. Durations and
 * easings are the motion tokens; the list's layer is from the stacking scale.
 */

/* The list under its field: exactly the field's width (position-absolute
   top-100 start-0 w-100 on the field's own wrapper), no gap, square corners.
   Below the navbar on the home page. */
.akp-search-list {
  z-index: var(--biopama-z-tool-overlay, 90);
  background-color: rgba(var(--bs-dark-rgb, 60, 60, 60), 0.87);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
}

/* In the header the list lives in the field's wrapper, whose transform
   (translate-middle-y) makes it a stacking context of its own: the wrapper is
   what must rise. It takes the header band's dropdown layer, above the band's
   own blue strip (the navbar layer); the band itself is that layer too
   (site-header.css), as the stacking scale allows for the band's dropdowns. */
.akp-header-search-field:has(> .akp-search-list) {
  z-index: var(--biopama-z-header, 101);
}

/* The keyboard's selection looks like the pointer's hover. Two classes and an
   attribute outrank row-card's own hover rule whatever the order. */
.akp-search-list [aria-selected="true"] > .card.biopama-link-row {
  --bs-card-bg: rgba(var(--bs-dark-rgb, 60, 60, 60), 0.6);
  color: var(--bs-warning, #ffc107);
}

.akp-search-list [aria-selected="true"] .biopama-row-title {
  color: var(--bs-warning, #ffc107);
}

/* No rule between rows, and no gap: one band. */
.akp-search-list .card.biopama-row-card,
.akp-search-results .card.biopama-row-card {
  box-shadow: none;
}

/* A row's text column may shrink, so a long title truncates. */
.akp-search-row-text {
  min-width: 0;
}

/* In the row's text column (a vertical flex box) the title takes its own
   height. row-card's zero flex basis, meant for its horizontal rows, made it
   0 tall there: with text-truncate's overflow it had no minimum height, so
   every title vanished. Three classes outrank row-card's two. */
.akp-search-row .akp-search-row-text .biopama-row-title {
  flex: 0 0 auto;
}

/* The typed words, in the accent colour, without the highlighter box. */
.akp-search-row mark {
  padding: 0;
  background-color: transparent;
  color: var(--bs-warning, #ffc107);
}

/* The row's fields on one muted line, separated by a dot. */
.akp-search-row-meta {
  color: rgba(var(--bs-body-color-rgb, 255, 255, 255), 0.6);
}

.akp-search-row-meta div,
.akp-search-row-meta span {
  display: inline;
}

.akp-search-row-meta .field + .field::before {
  content: " · ";
}

.akp-search-row-meta img {
  width: auto;
  height: 1em;
  vertical-align: -0.125em;
}

/* "No results" and "not available": one muted line. */
.akp-search-empty {
  color: rgba(var(--bs-body-color-rgb, 255, 255, 255), 0.6);
}

/* The large field: the label centred in it, floating above the text once the
   field has focus or text, from its centre (Bootstrap floats from the left).
   The field grows to hold both at once; height cannot be animated (motion
   rules), so the growth is instant. The label's own movement is Bootstrap's,
   retimed by akp/motion. */
.akp-search-form .form-floating > .form-control {
  background-color: rgba(203, 203, 203, 0.33);
}

.akp-search-form .form-floating > label {
  transform-origin: 50% 0;
}

.akp-search-form .form-floating > .form-control:focus,
.akp-search-form .form-floating > .form-control:not(:placeholder-shown) {
  height: calc(4.5rem + 2px);
  padding-top: 2.25rem;
}
