/* ============================================================
   CONFIDE — SEARCH (templates/search.html)
   Design values from the approved handover (search.html), mapped
   onto theme.json presets and custom properties.
   ============================================================ */

.cf-search {
  padding:
    clamp(var(--wp--preset--spacing--65), 5vw, var(--wp--preset--spacing--75))
    clamp(20px, 4vw, var(--wp--preset--spacing--70))
    clamp(var(--wp--preset--spacing--75), 7vw, var(--wp--preset--spacing--80));
}

.cf-search > * {
  margin-block: 0;
}

/* Breadcrumbs — "Home / Search" */
.cf-search__breadcrumbs {
  margin-bottom: var(--wp--preset--spacing--50);
  color: var(--wp--preset--color--muted);
  font-size: var(--wp--preset--font-size--small);
}

.cf-search__breadcrumbs a {
  color: inherit;
}

.cf-search__breadcrumbs a:hover {
  color: var(--wp--preset--color--trust-blue);
}

.cf-search__breadcrumbs li:last-child {
  color: var(--wp--preset--color--body);
}

/* Heading */
.cf-search__title {
  margin-bottom: var(--wp--preset--spacing--50);
  color: var(--wp--preset--color--ink);
  font-size: var(--wp--preset--font-size--h2);
  line-height: var(--wp--custom--line-height--tight);
  text-wrap: balance;
}

/* Search field — magnifier sits inside the input, no submit button */
.cf-search__form .wp-block-search__inside-wrapper {
  position: relative;
}

.cf-search__form .wp-block-search__inside-wrapper::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 18px;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  background: var(--wp--preset--color--muted);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.85' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 3a8 8 0 1 0 0 16 8 8 0 0 0 0-16z'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") center / contain no-repeat;
  pointer-events: none;
}

.cf-search__form .wp-block-search__input {
  width: 100%;
  padding: 18px 20px 18px 52px;
  border: var(--wp--custom--border--hairline);
  border-radius: var(--wp--custom--radius--sm);
  background: var(--wp--preset--color--white);
  color: var(--wp--preset--color--ink);
  font-family: var(--wp--preset--font-family--sans);
  font-size: var(--wp--preset--font-size--lead);
  transition: border-color var(--wp--custom--motion--duration-fast) var(--wp--custom--motion--ease-standard);
}

.cf-search__form .wp-block-search__input::placeholder {
  color: var(--wp--preset--color--muted);
}

.cf-search__form .wp-block-search__input:focus {
  outline: none;
  border-color: var(--wp--preset--color--trust-blue);
}

/* "6 results for …" + Clear search */
.cf-search__summary {
  margin: var(--wp--preset--spacing--50) 0 var(--wp--preset--spacing--20);
  color: var(--wp--preset--color--muted);
  font-size: var(--wp--preset--font-size--body);
}

/* Results */
.cf-search__list {
  margin: 0;
  padding: 0;
  border-top: var(--wp--custom--border--hairline);
  list-style: none;
}

.cf-search__list > li {
  margin: 0;
}

.cf-result {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: clamp(var(--wp--preset--spacing--40), 3vw, var(--wp--preset--spacing--60));
  align-items: start;
  margin: 0 -20px;
  padding: var(--wp--preset--spacing--50) 20px;
  border-bottom: var(--wp--custom--border--hairline);
  color: var(--wp--preset--color--ink);
  transition: background-color var(--wp--custom--motion--duration-fast) var(--wp--custom--motion--ease-standard);
}

.cf-result:hover {
  background: var(--wp--preset--color--white);
}

.cf-result > * {
  margin: 0;
}

.cf-result__type {
  padding-top: var(--wp--preset--spacing--10);
  color: var(--wp--preset--color--lime-strong);
  font-family: var(--wp--preset--font-family--heading);
  font-size: 11px; /* No preset this small; matches the design's eyebrow labels. */
  font-weight: var(--wp--custom--font-weight--semibold);
  letter-spacing: 0.1em;
  line-height: 1.4;
  text-transform: uppercase;
}

.cf-result__body > * {
  margin: 0;
}

.cf-result__title {
  color: var(--wp--preset--color--ink);
  font-family: var(--wp--preset--font-family--heading);
  font-size: var(--wp--preset--font-size--h3);
  font-weight: var(--wp--custom--font-weight--semibold);
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.cf-result__excerpt {
  max-width: 64ch;
  margin-top: var(--wp--preset--spacing--20);
  color: var(--wp--preset--color--muted);
  font-size: var(--wp--preset--font-size--body);
  line-height: 1.6;
  text-wrap: pretty;
}

.cf-result__excerpt p {
  margin: 0;
}

.cf-result__path {
  margin-top: var(--wp--preset--spacing--30);
  color: var(--wp--preset--color--muted);
  font-size: var(--wp--preset--font-size--small);
}

/* Pagination */
.cf-search__pagination {
  margin-top: var(--wp--preset--spacing--60);
  font-size: var(--wp--preset--font-size--body);
}

/* No results */
.cf-search__empty {
  padding-top: clamp(36px, 5vw, var(--wp--preset--spacing--80));
  border-top: var(--wp--custom--border--hairline);
}

.cf-search__empty > * {
  margin-block: 0;
}

.cf-search__empty-title {
  margin-bottom: var(--wp--preset--spacing--40);
  color: var(--wp--preset--color--ink);
  font-size: clamp(22px, 2.6vw, 30px); /* Sits between the h3 and h2 presets. */
  line-height: 1.15;
  text-wrap: balance;
}

.cf-search__empty-text {
  max-width: 56ch;
  margin-bottom: var(--wp--preset--spacing--50);
  color: var(--wp--preset--color--muted);
  font-size: var(--wp--preset--font-size--lead);
  line-height: 1.7;
  text-wrap: pretty;
}

.cf-search__suggestions {
  gap: 10px;
}

.cf-search__chip .wp-block-button__link {
  padding: 10px var(--wp--preset--spacing--40);
  border: var(--wp--custom--border--hairline);
  background: var(--wp--preset--color--white);
  color: var(--wp--preset--color--body);
  font-size: var(--wp--preset--font-size--small);
  transition: border-color var(--wp--custom--motion--duration-fast) var(--wp--custom--motion--ease-standard);
}

.cf-search__chip .wp-block-button__link:hover {
  border-color: var(--wp--preset--color--trust-blue);
  color: var(--wp--preset--color--body);
}

.cf-search__cta {
  margin-top: var(--wp--preset--spacing--60);
}

.cf-search__cta .wp-block-button__link {
  padding: 15px 26px;
  font-size: var(--wp--preset--font-size--lead);
  transition: filter var(--wp--custom--motion--duration-fast) var(--wp--custom--motion--ease-standard);
}

.cf-search__cta .wp-block-button__link:hover {
  filter: brightness(0.94);
}

@media (max-width: 900px) {
  .cf-result {
    grid-template-columns: 1fr;
    gap: var(--wp--preset--spacing--20);
  }

  .cf-result__type {
    padding-top: 0;
  }
}

@media (max-width: 640px) {
  .cf-result__type {
    font-size: 12.5px; /* Mobile type minimum from the handover. */
  }
}
