:root {
  --ahu-search-blue: #0878d1;
  --ahu-search-dark: #12324a;
}

body.ahu-search-is-open { overflow: hidden; }

.ahu-content-search__trigger,
.ahu-content-search-shortcode {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 42px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #dbe6ee;
  border-radius: 999px;
  background: #fff;
  color: var(--ahu-search-dark);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .18s ease, color .18s ease, box-shadow .18s ease;
}

.ahu-content-search__trigger:hover,
.ahu-content-search__trigger:focus-visible,
.ahu-content-search-shortcode:hover,
.ahu-content-search-shortcode:focus-visible {
  border-color: var(--ahu-search-blue);
  color: var(--ahu-search-blue);
  box-shadow: 0 5px 18px rgb(8 120 209 / 14%);
}

.ahu-content-search__trigger svg,
.ahu-content-search-shortcode svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
}

.ahu-content-search__trigger span { display: none; }
.ahu-content-search__trigger--floating { position: fixed; right: 20px; bottom: 20px; z-index: 9998; }

.ahu-content-search[hidden] { display: none !important; }
.ahu-content-search {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: start center;
  padding: clamp(18px, 7vh, 72px) 16px 24px;
  overflow-y: auto;
}

.ahu-content-search__backdrop {
  position: fixed;
  inset: 0;
  background: rgb(7 28 43 / 68%);
  backdrop-filter: blur(5px);
}

.ahu-content-search__dialog {
  position: relative;
  width: min(760px, 100%);
  padding: clamp(20px, 4vw, 34px);
  border-radius: 20px;
  background: #fff;
  color: var(--ahu-search-dark);
  box-shadow: 0 28px 90px rgb(0 0 0 / 28%);
}

.ahu-content-search__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.ahu-content-search__eyebrow {
  margin: 0 0 3px;
  color: var(--ahu-search-blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.ahu-content-search__header h2 { margin: 0; color: var(--ahu-search-dark); font-size: clamp(23px, 4vw, 32px); line-height: 1.25; }
.ahu-content-search__close {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: #eef6fb;
  color: var(--ahu-search-dark);
  font: 300 28px/1 sans-serif;
  cursor: pointer;
}

.ahu-content-search__form {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 7px 7px 15px;
  border: 2px solid #cbdbe6;
  border-radius: 13px;
  background: #fff;
}

.ahu-content-search__form:focus-within { border-color: var(--ahu-search-blue); box-shadow: 0 0 0 4px rgb(8 120 209 / 11%); }
.ahu-content-search__form svg { width: 23px; height: 23px; fill: none; stroke: #64748b; stroke-width: 1.8; stroke-linecap: round; }
.ahu-content-search__form input {
  min-width: 0;
  min-height: 46px;
  padding: 0;
  border: 0 !important;
  outline: 0 !important;
  background: transparent;
  color: var(--ahu-search-dark);
  box-shadow: none !important;
  font: inherit;
  font-size: 17px;
}

.ahu-content-search__form button {
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 9px;
  background: var(--ahu-search-blue);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.ahu-content-search__hint { margin: 9px 2px 0; color: #718096; font-size: 12px; }
.ahu-content-search__status { margin: 18px 2px 10px; color: #64748b; font-size: 14px; }
.ahu-content-search__results { display: grid; gap: 8px; }
.ahu-content-search__result {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 10px;
  border: 1px solid #e3ebf0;
  border-radius: 12px;
  color: var(--ahu-search-dark) !important;
  text-decoration: none !important;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.ahu-content-search__result:hover,
.ahu-content-search__result:focus-visible { border-color: #9ccbea; background: #f5faff; transform: translateY(-1px); outline: none; }
.ahu-content-search__result img,
.ahu-content-search__result-icon { width: 58px; height: 58px; border-radius: 9px; object-fit: cover; background: #eef6fb; }
.ahu-content-search__result-icon { display: grid; place-items: center; color: var(--ahu-search-blue); }
.ahu-content-search__result-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.ahu-content-search__result-body { display: grid; min-width: 0; }
.ahu-content-search__result-type { color: var(--ahu-search-blue); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.ahu-content-search__result strong { margin: 2px 0; overflow: hidden; font-size: 16px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.ahu-content-search__result-excerpt { overflow: hidden; color: #64748b; font-size: 13px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.ahu-content-search__result-arrow { padding: 0 6px; color: var(--ahu-search-blue); font-size: 20px; }
.ahu-content-search__all {
  display: block;
  margin-top: 14px;
  padding: 12px;
  border-radius: 10px;
  background: #eef6fb;
  color: var(--ahu-search-blue) !important;
  font-weight: 800;
  text-align: center;
  text-decoration: none !important;
}

.ahu-content-search__all[hidden] { display: none; }

/* The theme applies width:100% to every search input, including submit inputs. */
.ahu-news-sidebar .search-form > label,
.ahu-hero-search .search-form > label {
  flex: 1 1 auto;
  min-width: 0;
}

.ahu-news-sidebar .search-form .search-field,
.ahu-hero-search .search-form .search-field {
  width: 100%;
  min-width: 0;
}

.ahu-news-sidebar .search-form .search-submit,
.ahu-hero-search .search-form .search-submit {
  flex: 0 0 auto;
  width: auto;
  min-width: 96px;
}

@media (max-width: 760px) {
  .ahu-content-search { padding: 12px; place-items: start center; }
  .ahu-content-search__dialog { margin-top: 8px; padding: 20px 16px; border-radius: 16px; }
  .ahu-content-search__form { grid-template-columns: auto minmax(0, 1fr); }
  .ahu-content-search__form button { grid-column: 1 / -1; }
  .ahu-content-search__hint { display: none; }
  .ahu-content-search__result { grid-template-columns: 48px minmax(0, 1fr) auto; }
  .ahu-content-search__result img,
  .ahu-content-search__result-icon { width: 48px; height: 48px; }
  .ahu-content-search__result-excerpt { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ahu-content-search__trigger,
  .ahu-content-search__result { transition: none; }
}
