/* Search page only. Loaded after site.css. */

/* ---------------------------------------------------------------- hero */

/* Search reads as one narrow column rather than the 1240px page grid, so the
 * shared page hero is retightened here instead of in site.css. */
.search-hero .page-hero__inner {
  max-width: 920px; /* not-a-measure: the search page's narrow layout column */
}

.search-hero__form {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 620px;
}

/* Not .field: that is the 38px control. This is the same idea at 46px.
 * It was a translucent white box on navy; the hero's words sit on the light
 * panel now, so it is a normal light-surface field again. */
.search-hero__field {
  flex: 1 1 auto;
  min-width: 0;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text-body);
  font-size: 16px;
}

.search-hero__field::placeholder {
  color: var(--text-muted);
}

.search-hero__submit {
  flex: 0 0 auto;
  height: 46px;
  padding: 0 22px;
}

@media (max-width: 640px) {
  .search-hero__form {
    flex-wrap: wrap;
  }

  .search-hero__submit {
    width: 100%;
  }
}

/* ------------------------------------------------------------- results */

.search-wrap {
  display: grid;
  gap: 24px;
  max-width: 920px; /* not-a-measure: matches the hero column above it */
  margin: 0 auto;
  padding-left: 32px;
  padding-right: 32px;
}

.search-results__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.search-count {
  font-size: 15px;
  color: var(--text-secondary);
}

/* -------------------------------------------------------- type filters */

.search-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Toggle buttons: the pressed state is carried by aria-pressed, so the
 * styling keys off it rather than a class. */
.search-filter {
  min-height: 32px;
  padding: 6px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: #fff;
  color: var(--navy-800);
  font-size: 13px;
  line-height: 1.4;
  cursor: pointer;
  transition:
    background var(--dur-micro) ease,
    border-color var(--dur-micro) ease,
    color var(--dur-micro) ease;
}

.search-filter:hover {
  background: var(--grey-100);
}

.search-filter[aria-pressed='true'] {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.search-filter[aria-pressed='true']:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

/* ---------------------------------------------------------- result rows */

.search-list {
  list-style: none;
  display: grid;
  gap: 2px;
}

.search-result {
  display: grid;
  gap: 8px;
  padding: 22px 16px;
  border-radius: var(--radius);
  color: var(--text-body);
  transition: background var(--dur-micro) ease;
}

/* The row underline would drag the whole three-line block; underline the
 * title instead. */
.search-result:hover {
  background: var(--grey-100);
  text-decoration: none;
}

.search-result__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.search-result__icon {
  font-size: 15px;
  color: var(--primary);
}

/* The breadcrumb is a path, not a label: no tracking, no caps. */
.search-result__crumb {
  letter-spacing: 0;
  text-transform: none;
}

.search-result__title {
  font-size: 19px;
  line-height: 1.4;
  color: var(--primary);
  text-wrap: pretty;
}

.search-result:hover .search-result__title {
  text-decoration: underline;
}

.search-result__snippet {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-secondary);
  text-wrap: pretty;
}

/* ------------------------------------- empty state and the no-JS notice */

.search-note {
  display: grid;
  justify-items: start;
  gap: 16px;
  padding: 44px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
}

.search-note__icon {
  font-size: 34px;
  color: var(--text-muted);
}

.search-note__title {
  font-size: 19px;
  font-weight: 600;
  color: var(--navy-800);
}

.search-note__body {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* `hidden` must beat the display values set above. */
.search-results__head[hidden],
.search-list[hidden],
.search-note[hidden] {
  display: none;
}

@media (max-width: 640px) {
  .search-wrap {
    padding-left: 20px;
    padding-right: 20px;
  }

  /* 44px hit targets on touch. */
  .search-filter {
    min-height: 44px;
  }

  .search-note {
    padding: 28px 20px;
  }
}
