/**
 * @file
 * HABD search (/search). Library beauty/habd.search, theme group, weight 43.
 *
 * Values follow docs/components-redesign/Briefs/Search Developer Brief.md
 * and Search Results.dc.html. Markup: block--search-form.html.twig (band),
 * views-view--search--page.html.twig (results) and
 * includes/habd/search/result-card.html.twig (card).
 */

/* The main search page is full width; the band and results set their own
   inner width. It drops the legacy search page's 210px top padding and
   background photo (custom.css, body.path-search
   .js-quickedit-main-content); style.css's main.px-0 overflow:hidden is not
   used here. */
body.path-search .js-quickedit-main-content.habd-search-page {
  display: block;
  padding: 0;
  background: var(--habd-cream);
}

/* ==========================================================================
   Band (brief 02, 04, 05)
   ========================================================================== */
.habd.habd-search-band {
  --habd-bg: var(--habd-forest);
  padding: 28px var(--habd-gutter) 0;
}
.habd.habd-search-band--chooser {
  padding: 92px var(--habd-gutter) 110px;
}
.habd-search-band__inner {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: calc(var(--habd-max) - 2 * var(--habd-gutter));
  margin: 0 auto;
}
.habd-search-band--chooser .habd-search-band__inner {
  align-items: center;
  gap: 44px;
}
.habd-search-band__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}
.habd.habd .habd-search-band__title {
  font-size: clamp(40px, calc(3vw + 22px), 68px);
  font-weight: 300;
  line-height: 1.02;
  color: var(--habd-ink-light);
}

/* Search bar: a cream pill (brief 04). */
.habd .habd-search-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 8px 8px 8px 26px;
  border-radius: var(--habd-radius-pill);
  background: var(--habd-cream-flat);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
  --habd-focus: var(--habd-gold-ink);
}
.habd .habd-search-bar--hero {
  max-width: 860px;
}
.habd .habd-search-bar__glyph {
  flex: none;
  width: 16px;
  height: 16px;
  border: 2px solid var(--habd-gold-deep);
  border-radius: 50%;
}
.habd .habd-search-bar__field {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.habd.habd .habd-search-bar__label {
  margin: 0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  line-height: 1.3;
  text-transform: uppercase;
  color: var(--habd-gold-ink);
}
.habd.habd .habd-search-bar__input {
  width: 100%;
  height: auto;
  margin: 0;
  padding: 2px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 19px;
  font-weight: 300;
  line-height: 1.4;
  color: var(--habd-ink);
  -webkit-appearance: none;
  appearance: none;
}
.habd.habd .habd-search-bar__input::placeholder {
  color: var(--habd-ink-meta);
  opacity: 1;
}
.habd.habd .habd-search-bar__input:focus {
  outline: none;
}
.habd .habd-search-bar:focus-within {
  box-shadow: 0 0 0 2px var(--habd-gold-deep), 0 18px 40px rgba(0, 0, 0, 0.25);
}
.habd.habd .habd-search-bar__submit {
  flex: none;
  padding: 16px 40px;
  box-shadow: none;
}
@media (max-width: 640px) {
  .habd .habd-search-bar {
    gap: 10px;
    padding: 6px 6px 6px 18px;
  }
  .habd .habd-search-bar__glyph {
    display: none;
  }
  .habd.habd .habd-search-bar__input {
    font-size: 17px;
  }
  .habd.habd .habd-search-bar__submit {
    padding: 14px 20px;
  }
}

/* Chooser cards (brief 02). */
.habd.habd .habd-search-chooser {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 1100px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.habd.habd .habd-search-chooser__card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  min-height: 168px;
  padding: 26px 26px 28px;
  border: 1px solid #23452F;
  border-radius: 16px;
  background: #11311F;
  color: var(--habd-ink-light-soft);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.habd.habd .habd-search-chooser__card:hover,
.habd.habd .habd-search-chooser__card:focus-visible {
  border-color: var(--habd-gold-deep);
  background: #143823;
  color: var(--habd-ink-light-soft);
}
.habd .habd-search-chooser__number {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--habd-gold-deep);
}
.habd .habd-search-chooser__title {
  font-family: var(--habd-serif);
  font-size: 30px;
  font-weight: 400;
  line-height: 1.1;
  color: var(--habd-ink-light);
}
.habd .habd-search-chooser__line {
  font-size: 16px;
  font-weight: 300;
  line-height: 1.5;
  color: var(--habd-ink-light-soft);
}
@media (max-width: 1024px) {
  .habd.habd .habd-search-chooser {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .habd.habd-search-band--chooser {
    padding-top: 56px;
    padding-bottom: 64px;
  }
  .habd.habd .habd-search-chooser {
    grid-template-columns: minmax(0, 1fr);
  }
  .habd.habd .habd-search-chooser__card {
    min-height: 0;
  }
}

/* Result type tabs (brief 05): pills hanging off the band's bottom edge. */
.habd .habd-search-tabs {
  margin: 0 calc(-1 * var(--habd-gutter));
  padding: 0 var(--habd-gutter);
  overflow-x: auto;
  scrollbar-width: none;
}
.habd .habd-search-tabs::-webkit-scrollbar {
  display: none;
}
.habd.habd .habd-search-tabs__list {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.habd.habd .habd-search-tabs__tab {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 12px 22px;
  border-radius: 10px 10px 0 0;
  font-size: 15px;
  font-weight: 400;
  white-space: nowrap;
  color: var(--habd-ink-light-soft);
  transition: background-color 0.2s ease, color 0.2s ease;
}
.habd.habd .habd-search-tabs__tab:hover,
.habd.habd .habd-search-tabs__tab:focus-visible {
  background: rgba(229, 200, 140, 0.1);
  color: var(--habd-gold);
}
.habd.habd .habd-search-tabs__tab.is-active {
  background: var(--habd-cream);
  font-weight: 500;
  color: var(--habd-ink);
}

/* ==========================================================================
   Results (brief 03, 06, 07)
   ========================================================================== */
.habd.habd-search {
  --habd-bg: var(--habd-cream);
  padding: 34px var(--habd-gutter) 88px;
}
.habd-search__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  max-width: calc(var(--habd-max) - 2 * var(--habd-gutter));
  margin: 0 auto;
}
.habd-search--panel .habd-search__inner {
  grid-template-columns: 256px minmax(0, 1fr);
  align-items: start;
}
.habd-search__main {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
}

/* Filter panel (brief 06). */
.habd .habd-filter-panel {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 22px 24px;
  border: 1px solid #EBE3CF;
  border-radius: 14px;
  background: #FFFFFF;
}
.habd .habd-filter-panel__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.habd.habd .habd-filter-panel__title {
  font-family: var(--habd-sans) !important;
  font-size: 12px;
  font-weight: 500;
}
.habd.habd .habd-filter-panel__clear {
  font-size: 14px;
  color: var(--habd-gold-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.habd .habd-filter-panel__group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.habd.habd .habd-filter-panel__label {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--habd-ink);
}
.habd.habd .habd-filter-panel__select {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid #E3DBC8;
  border-radius: 8px;
  background-color: var(--habd-cream);
  font-size: 16px;
  color: var(--habd-ink);
}
.habd.habd .habd-filter-panel__apply {
  align-self: flex-start;
}

/* Chips: applied filters and the accessibility and inclusivity panel. */
.habd.habd .habd-search-chips,
.habd.habd .habd-search-features__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.habd.habd .habd-search-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--habd-cream-line);
  border-radius: var(--habd-radius-pill);
  background: var(--habd-cream);
  font-size: 15px;
  line-height: 1.3;
  color: var(--habd-ink);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.habd.habd .habd-search-chip:hover,
.habd.habd .habd-search-chip:focus-visible {
  border-color: var(--habd-gold-display);
  color: var(--habd-ink);
}
.habd .habd-search-chip__x {
  font-size: 18px;
  line-height: 1;
  color: var(--habd-gold-ink);
}
.habd.habd .habd-search-chip--dark {
  border-color: rgba(229, 200, 140, 0.35);
  background: rgba(255, 255, 255, 0.03);
  color: var(--habd-ink-light);
}
.habd.habd .habd-search-chip--dark:hover,
.habd.habd .habd-search-chip--dark:focus-visible {
  border-color: var(--habd-gold);
  background: rgba(229, 200, 140, 0.1);
  color: var(--habd-ink-light);
}
.habd.habd .habd-search-chip--dark.is-active {
  border-color: var(--habd-gold);
  background: var(--habd-gold);
  color: var(--habd-forest);
}

.habd.habd-search-features {
  --habd-bg: var(--habd-forest);
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 26px 28px 28px;
  border-radius: 18px;
}
.habd .habd-search-features__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(229, 200, 140, 0.18);
}
.habd.habd .habd-search-features__title {
  font-size: clamp(26px, calc(0.8vw + 20px), 34px);
  font-weight: 300;
  line-height: 1.1;
  color: var(--habd-ink-light);
}

/* Heading and count line (brief 07). */
.habd .habd-search__header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 18px;
  border-bottom: 1px solid #E0D8C2;
}
.habd.habd .habd-search__title {
  font-size: clamp(36px, calc(1.8vw + 24px), 52px);
  font-weight: 300;
  line-height: 1.05;
  color: var(--habd-ink);
}
.habd:not(#habd-reset) .habd-search__count {
  margin: 0;
  font-size: 16px;
  font-weight: 300;
  color: var(--habd-ink-meta);
}

/* ==========================================================================
   Result card (brief 08)
   ========================================================================== */
.habd .habd-search__results {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.habd .habd-search-card {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr) 208px;
  gap: 24px;
  align-items: stretch;
  padding: 18px;
  border: 1px solid #EBE3CF;
  border-radius: 14px;
  background: #FFFFFF;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.habd .habd-search-card:hover {
  border-color: var(--habd-cream-line);
  box-shadow: 0 14px 32px rgba(90, 74, 32, 0.1);
}
.habd .habd-search-card--no-photo {
  grid-template-columns: minmax(0, 1fr) 208px;
  padding-left: 26px;
}
.habd .habd-search-card__media {
  display: block;
  height: 186px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--habd-cream-flat);
}
.habd .habd-search-card__media > :is(img, picture, .habd-fallback) {
  display: block;
  width: 100%;
  height: 100%;
}
.habd.habd .habd-search-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* A logo sits whole on white, not cropped to fill. */
.habd .habd-search-card__media--logo {
  border: 1px solid #F0EADB;
  background: #FFFFFF;
}
.habd.habd .habd-search-card__media--logo img {
  padding: 18px;
  object-fit: contain;
}
.habd .habd-search-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 6px 0;
}
.habd .habd-search-card__kind {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--habd-gold-ink);
}
.habd .habd-search-card__titles {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.habd.habd .habd-search-card__title {
  font-size: clamp(26px, calc(0.6vw + 20px), 32px);
  font-weight: 400;
  line-height: 1.1;
  color: var(--habd-ink);
  overflow-wrap: anywhere;
}
.habd.habd .habd-search-card__title a {
  color: inherit;
}
.habd.habd .habd-search-card__title a:hover,
.habd.habd .habd-search-card__title a:focus-visible {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.habd .habd-search-card__badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}
.habd .habd-search-card__badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid var(--habd-gold-display);
  border-radius: var(--habd-radius-pill);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--habd-gold-ink);
}
.habd .habd-search-card__meta {
  font-size: 15px;
  color: var(--habd-ink-meta);
}
.habd .habd-search-card__text {
  font-size: 16px;
  font-weight: 300;
  line-height: 1.55;
  color: var(--habd-ink-body);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.habd.habd .habd-search-card__features {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: auto 0 0;
  padding: 12px 0 0;
  border-top: 1px solid #F0EADB;
  list-style: none;
  font-size: 14px;
  color: var(--habd-forest);
}
.habd .habd-search-card__features li {
  position: relative;
  padding-left: 12px;
}
.habd .habd-search-card__features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--habd-gold-deep);
}
.habd .habd-search-card__aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 4px 4px 22px;
  border-left: 1px solid #F0EADB;
  text-align: right;
}
.habd .habd-search-card__rating {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.habd .habd-search-card__score,
.habd .habd-search-card__figure {
  font-family: var(--habd-serif);
  font-size: 40px;
  line-height: 1;
  color: var(--habd-ink);
}
.habd .habd-search-card__figure {
  font-size: 30px;
}
.habd .habd-search-card__reviews {
  font-size: 13px;
  color: var(--habd-ink-meta);
}
.habd.habd .habd-search-card__cta {
  margin-top: auto;
}
@media (max-width: 1100px) {
  .habd .habd-search-card {
    grid-template-columns: 180px minmax(0, 1fr) 170px;
    gap: 18px;
  }
  .habd .habd-search-card__media {
    height: 160px;
  }
}
@media (max-width: 900px) {
  .habd-search--panel .habd-search__inner {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 768px) {
  .habd .habd-search-card,
  .habd .habd-search-card--no-photo {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding: 16px;
  }
  .habd .habd-search-card__media {
    height: 190px;
  }
  .habd .habd-search-card__aside {
    flex-direction: row;
    align-items: center;
    padding: 12px 0 0;
    border-top: 1px solid #F0EADB;
    border-left: 0;
    text-align: left;
  }
  .habd .habd-search-card__rating {
    align-items: flex-start;
  }
  .habd.habd .habd-search-card__cta {
    margin-top: 0;
  }
}

/* ==========================================================================
   No results (brief 09) and pagination (brief 10)
   ========================================================================== */
.habd .habd-search-empty {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 44px 44px 46px;
  border: 1px solid #EBE3CF;
  border-radius: 14px;
  background: #FFFFFF;
}
.habd.habd .habd-search-empty__title {
  font-size: 34px;
  font-weight: 400;
  line-height: 1.1;
  color: var(--habd-ink);
}
.habd:not(#habd-reset) .habd-search-empty__text {
  max-width: 620px;
  margin: 0;
  font-size: 17px;
  font-weight: 300;
  color: var(--habd-ink-body);
}
@media (max-width: 640px) {
  .habd .habd-search-empty {
    padding: 28px 22px;
  }
}

.habd .habd-search__pager .pager-nav {
  margin: 12px 0 0;
}
.habd.habd .habd-search__pager .pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin: 0;
  padding: 0;
}
.habd.habd .habd-search__pager .pagination > li > a,
.habd.habd .habd-search__pager .pagination > li > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  float: none;
  min-width: 42px;
  height: 42px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid var(--habd-cream-line);
  border-radius: var(--habd-radius-pill);
  background: #FFFFFF;
  font-size: 15px;
  line-height: 1;
  color: var(--habd-ink);
}
.habd.habd .habd-search__pager .pagination > li > a:hover,
.habd.habd .habd-search__pager .pagination > li > a:focus-visible {
  border-color: var(--habd-gold-display);
  background: var(--habd-cream);
  color: var(--habd-ink);
}
.habd.habd .habd-search__pager .pagination > .active > a,
.habd.habd .habd-search__pager .pagination > .is-active > a {
  border-color: var(--habd-forest);
  background: var(--habd-forest);
  color: var(--habd-gold);
}

/* The compact bar alone (/search/business, /search/members). */
.habd.habd-search-band--results:not(:has(.habd-search-tabs)) {
  padding-bottom: 28px;
}
