/* Gisou search overlay + page */
.gh-search[hidden] {
  display: none !important;
}

.gh-search {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0.75rem;
  padding-top: max(0.75rem, env(safe-area-inset-top));
}

.gh-search__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 24, 22, 0.45);
  backdrop-filter: blur(4px);
}

.gh-search__panel {
  position: relative;
  width: min(640px, 100%);
  max-height: min(88vh, 720px);
  overflow: auto;
  margin-top: clamp(0.5rem, 8vh, 4rem);
  padding: 1.25rem 1.25rem 1.5rem;
  background: #fff9f3;
  border: 1px solid rgba(120, 90, 70, 0.12);
  border-radius: 2px;
  box-shadow: 0 24px 64px rgba(40, 28, 20, 0.18);
}

.gh-search__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.gh-search__title {
  margin: 0;
  font-family: var(--font-heading, 'Cormorant Garamond', Georgia, serif);
  font-size: clamp(1.35rem, 3vw, 1.65rem);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.gh-search__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.15s ease;
}

.gh-search__close:hover,
.gh-search__close:focus-visible {
  background: rgba(120, 90, 70, 0.08);
}

.gh-search__field-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  background: #fff;
  border: 1px solid rgba(120, 90, 70, 0.22);
  border-radius: 2px;
}

.gh-search__field-wrap:focus-within {
  border-color: rgba(120, 90, 70, 0.45);
  box-shadow: 0 0 0 3px rgba(245, 200, 160, 0.35);
}

.gh-search__field-icon {
  flex-shrink: 0;
  color: rgba(60, 45, 38, 0.55);
}

.gh-search__input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 1rem;
  line-height: 1.4;
  color: #2c221c;
}

.gh-search__input:focus {
  outline: none;
}

.gh-search__input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.gh-search__hint {
  margin: 0.65rem 0 0;
  font-size: 0.8125rem;
  color: rgba(60, 45, 38, 0.65);
}

.gh-search__quick {
  margin-top: 1rem;
}

.gh-search__quick-label {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(60, 45, 38, 0.55);
}

.gh-search__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.gh-search__chip {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  font-size: 0.8125rem;
  text-decoration: none;
  color: #2c221c;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(120, 90, 70, 0.18);
  border-radius: 999px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.gh-search__chip:hover {
  background: #fff;
  border-color: rgba(120, 90, 70, 0.35);
}

.gh-search__status {
  margin: 1rem 0 0.35rem;
  min-height: 1.25rem;
  font-size: 0.8125rem;
  color: rgba(60, 45, 38, 0.7);
}

.gh-search__results {
  list-style: none;
  margin: 0;
  padding: 0;
}

.gh-search__results:empty {
  display: none;
}

.gh-search__hit {
  margin: 0;
  border-top: 1px solid rgba(120, 90, 70, 0.1);
}

.gh-search__hit-link {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 0;
  text-decoration: none;
  color: inherit;
  transition: background 0.12s ease;
}

.gh-search__hit-link:hover,
.gh-search__hit-link:focus-visible {
  background: rgba(255, 255, 255, 0.55);
  outline: none;
}

.gh-search__thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  background: #f5e6d3;
  border-radius: 2px;
}

.gh-search__thumb--empty {
  display: block;
  background: linear-gradient(135deg, #f8efe4, #edd9c4);
}

.gh-search__hit-text {
  min-width: 0;
}

.gh-search__hit-title {
  display: block;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.35;
}

.gh-search__hit-meta {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: rgba(60, 45, 38, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gh-search__badge {
  align-self: start;
  padding: 0.2rem 0.45rem;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(60, 45, 38, 0.75);
  background: rgba(120, 90, 70, 0.08);
  border-radius: 2px;
  white-space: nowrap;
}

.gh-search__empty {
  margin: 1rem 0 0;
  font-size: 0.9375rem;
  color: rgba(60, 45, 38, 0.75);
}

.gh-search__full-link {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.8125rem;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  color: #2c221c;
}

/* Dedicated search page */
.gh-search-page {
  padding: 1.5rem 0 3rem;
  background: #fff9f3;
  min-height: 50vh;
}

.gh-search-page__inner {
  max-width: 720px;
}

.gh-search-page__title {
  margin: 0 0 1.25rem;
  font-family: var(--font-heading, 'Cormorant Garamond', Georgia, serif);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 500;
  text-align: center;
}

.gh-search__field-wrap--page {
  max-width: 100%;
}

body.gh-search-open {
  overflow: hidden;
}

@media (min-width: 750px) {
  .gh-search__hit-link {
    grid-template-columns: 64px 1fr auto;
    gap: 1rem;
    padding: 0.85rem 0.25rem;
  }

  .gh-search__thumb {
    width: 64px;
    height: 64px;
  }
}
