/*
 * The search page (M2-SEARCH, route search): the head, the form (the kit's filter bar, its keyword field spanning the
 * row), the invitation and the results grouped by type. Values come from tokens.css; the form, the notices and the
 * buttons are the design system's.
 */

.search-head .lead {
  max-width: var(--size-40rem);
  margin-bottom: var(--spacing-32);
}

.search-form {
  margin-bottom: var(--spacing-32);
}

/* The error summary takes the whole bar; the keyword field, the type filter and 'Caută' are the filter bar's row (components.css) */
.search-form .error-summary {
  margin: 0;
}

.search-start {
  text-align: center;
  padding-block: var(--spacing-40);
}

.search-start .notice-title {
  font-size: var(--font-size-20);
  line-height: var(--line-height-28);
  color: var(--color-text);
}

.search-results .result-count {
  margin: 0 0 var(--spacing-24);
}

.search-group {
  margin-bottom: var(--spacing-32);
}

.search-group__title {
  margin-bottom: var(--spacing-12);
  padding-bottom: var(--spacing-8);
  border-bottom: var(--border-width-1) solid var(--color-border-band);
  font-size: var(--font-size-20);
  line-height: var(--line-height-28);
  letter-spacing: var(--letter-spacing-h4);
}

.search-list {
  display: grid;
  gap: var(--spacing-16);
  margin: 0;
  padding: 0;
  list-style: none;
}

.search-hit {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* The title and the type's tag share a line, the tag after the link, wrapping under it on a narrow screen */
.search-hit__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--spacing-4) var(--spacing-12);
  margin: 0;
}

/* CC-7: the title 16/24 500 */
.search-hit__title {
  font-size: var(--font-size-16);
  line-height: var(--line-height-24);
  font-weight: var(--font-weight-medium);
}

/* CC-7: one line of the text, 14/20 #383838, ending in an ellipsis where it is longer than the column; the query's word marked */
.search-hit__excerpt {
  margin: var(--spacing-4) 0 0;
  overflow: hidden;
  color: var(--color-text-secondary);
  font-size: var(--font-size-14);
  line-height: var(--line-height-20);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-hit__excerpt mark {
  padding: 0 var(--spacing-2);
  border-radius: var(--border-radius-4);
  background: var(--color-background-action-hover);
  color: inherit;
}

/* CC-7: the path 12/16 #757575 */
.search-hit__meta {
  margin: var(--spacing-4) 0 0;
  color: var(--color-text-muted);
  font-size: var(--font-size-12);
  line-height: var(--line-height-16);
}

/* CC-7: 'Caută' sits beside the query field, not beside the type filter. From 1024 px the filter bar's flex row holds the query field, the
   button and then the type filter (the markup's order); from 768 to 1023 px the query field and the button share the first row and the
   type filter has the second */
@media (min-width: 768px) and (max-width: 1023.98px) {
  .search-form .filter-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: var(--spacing-16);
  }

  .search-form .filter-row > .field.wide {
    grid-column: 1;
    grid-row: 1;
  }

  .search-form .filter-row > .filter-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .search-form .filter-row > .field:not(.wide) {
    grid-column: 1;
    grid-row: 2;
    max-width: var(--size-20rem);
  }
}

.search-empty ul {
  margin-top: var(--spacing-8);
}
