/* Grassfarmer search and shared search widget presentation. */
.site-search-widget {
  display: flex;
  width: 100%;
  max-width: none;
  min-width: 0;
  gap: 0;
}

.site-search-widget input[type="search"],
.search-input {
  min-width: 0;
  flex: 1 1 auto;
  border: 1px solid var(--border, #d9dfd2);
  border-radius: 8px 0 0 8px;
  background: #fffefa;
  color: var(--text, #263329);
  box-shadow: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.site-search-widget input[type="search"] {
  padding: 0.7rem 0.8rem;
}

.site-search-widget input[type="search"]:focus,
.search-input:focus,
.site-search-widget select:focus,
.search-bar-row select:focus {
  position: relative;
  z-index: 1;
  border-color: #527b50;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(82, 123, 80, 0.16);
}

.site-search-widget button {
  display: grid;
  min-width: 2.9rem;
  place-items: center;
  border: 1px solid var(--menu, #1d432d);
  border-radius: 0 8px 8px 0;
  background: var(--menu, #1d432d);
  color: var(--on-accent, #fffdf6);
}

.site-search-widget button:hover {
  border-color: #315c3c;
  background: #315c3c;
}

.site-search-widget select,
.search-bar-row select {
  min-width: 0;
  max-width: 42%;
  border: 1px solid var(--border, #d9dfd2);
  border-right: 0;
  border-radius: 8px 0 0 8px;
  background: #f5f6ef;
  color: var(--text, #263329);
  font: inherit;
}

.site-search-widget select + input[type="search"],
.search-bar-row select + .search-input {
  border-radius: 0;
}

.main-menu > .menu-level-0 {
  width: auto;
  flex: 1 1 auto;
  margin: 0;
}

.main-menu > .main-menu-elements {
  flex: 0 0 auto;
  margin-left: auto;
}

.menu-search {
  width: 15rem;
  max-width: calc(100vw - 2 * var(--page-gutter));
}

.search-wrap {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: clamp(1.25rem, 3vw, 2.25rem);
  border: 1px solid var(--subtle-border, #e8e9df);
  border-radius: 18px;
  background: #fffefa;
  box-shadow: 0 12px 34px rgba(34, 55, 37, 0.06);
}

.search-bar-row {
  order: 2;
  position: static;
  display: flex;
  gap: 0;
  margin: 1.25rem 0 1.5rem;
  padding: 0;
  background: transparent;
  contain: none;
  will-change: auto;
}

.search-input {
  width: 100%;
  min-height: 3.25rem;
  padding: 0.75rem 1rem;
  font: inherit;
  font-size: 1.05rem;
}

.search-results {
  order: 3;
  display: grid;
  gap: 0.75rem;
  margin: 0;
}

.search-item {
  display: block;
  min-width: 0;
  padding: 1rem 1.1rem;
  border: 1px solid var(--subtle-border, #e8e9df);
  border-radius: 12px;
  background: #fffefa;
  color: var(--text, #263329);
  text-decoration: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.search-item:hover,
.search-item:focus-visible {
  border-color: #a8bea0;
  box-shadow: 0 7px 20px rgba(34, 55, 37, 0.08);
  text-decoration: none;
  transform: translateY(-1px);
}

.search-title-row {
  align-items: center;
  gap: 0.75rem;
}

.search-title {
  color: var(--heading, #183a29);
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.35;
}

.search-content-type {
  flex: 0 0 auto;
  padding: 0.25rem 0.55rem;
  border: 1px solid #dce6d6;
  border-radius: 999px;
  background: #f0f4eb;
  color: #426544;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.search-date {
  margin: 0.35rem 0 0.45rem;
  color: var(--muted, #677365);
  font-size: 0.82rem;
}

.search-excerpt {
  color: #586455;
  font-size: 0.94rem;
  line-height: 1.6;
}

.search-excerpt mark {
  border-radius: 2px;
  background: #e5efc9;
  color: inherit;
}

.search-empty {
  padding: 1rem 1.1rem;
  border: 1px dashed #cbd5c4;
  border-radius: 12px;
  background: #f7f8f1;
  color: var(--muted, #677365);
}

.search-skeleton {
  border-color: var(--subtle-border, #e8e9df);
}

.skeleton-line {
  background: #e8ecdf;
}

html.search-view .content-wrap.has-widgets {
  display: block;
}

html.search-view .widgets-section {
  display: none;
}

@media (max-width: 700px) {
  .main-menu > .menu-level-0 {
    width: 100%;
    flex: 1 1 auto;
    margin: 0;
  }

  .main-menu > .main-menu-elements {
    width: 100%;
    justify-content: flex-start;
    margin: 0;
    padding: 0 var(--page-gutter) 0.75rem;
  }

  .menu-search {
    width: min(100%, 24rem);
  }
}

@media (max-width: 640px) {
  .search-wrap {
    padding: 1rem;
    border-radius: 14px;
  }

  .search-title-row {
    align-items: flex-start;
  }

  .search-content-type {
    margin-top: 0.08rem;
  }
}
