/* ==== Site search (templates/website/_search_box.html + js/site-search.js) ==== */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.ss { position: relative; display: flex; align-items: center; min-width: 0; }
.ss__icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 18px; pointer-events: none; }
.ss__input {
  width: 100%; min-width: 0; outline: 0; font-family: inherit;
  -webkit-appearance: none; appearance: none;
}
.ss__input::-webkit-search-cancel-button { cursor: pointer; }

/* --- top bar --- */
.top-bar-center { flex: 1 1 auto; display: flex; justify-content: center; padding: 0 20px; min-width: 0; }
.ss--bar { width: 100%; max-width: 440px; }
.ss--bar .ss__icon { left: 12px; font-size: 15px; color: rgba(255, 255, 255, 0.75); }
.ss--bar .ss__input {
  height: 30px; padding: 0 34px 0 36px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22); background: rgba(255, 255, 255, 0.12);
  color: #fff; font-size: 0.82rem; transition: background .15s, border-color .15s;
}
.ss--bar .ss__input::placeholder { color: rgba(255, 255, 255, 0.7); }
.ss--bar .ss__input:hover { background: rgba(255, 255, 255, 0.18); }
.ss--bar .ss__input:focus { background: #fff; color: var(--text_color); border-color: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25); }
.ss--bar .ss__input:focus::placeholder { color: var(--muted1); }
.ss--bar:focus-within .ss__icon { color: var(--accent); }
.ss__kbd {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  min-width: 18px; height: 18px; border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 4px;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; color: rgba(255, 255, 255, 0.8); pointer-events: none;
}
.ss--bar .ss__input:focus ~ .ss__kbd { display: none; }

/* --- homepage hero --- */
.hero-search-simple { position: relative; z-index: 5; max-width: 820px; margin: 0 auto; padding: 0 24px 40px; }
.ss--hero, .ss--page {
  background: #fff; border-radius: 999px; padding: 6px 6px 6px 0;
  box-shadow: 0 18px 48px rgba(16, 24, 40, 0.22);
}
.ss--hero .ss__icon, .ss--page .ss__icon { left: 22px; font-size: 21px; color: var(--accent); }
.ss--hero .ss__input, .ss--page .ss__input {
  height: 54px; padding: 0 16px 0 54px; border: 0; background: transparent;
  color: var(--text_color); font-size: 1.02rem;
}
.ss--hero .ss__input::placeholder, .ss--page .ss__input::placeholder { color: var(--muted1); }
.ss__btn {
  flex: none; height: 50px; padding: 0 26px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--accent); color: #fff; font-size: 0.98rem; font-weight: 700; font-family: inherit;
  transition: filter .15s;
}
.ss__btn:hover { filter: brightness(1.1); }
.ss--hero:focus-within, .ss--page:focus-within { box-shadow: 0 18px 48px rgba(16, 24, 40, 0.22), 0 0 0 4px rgba(255, 255, 255, 0.35); }
.ss-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.ss-chips span { color: rgba(255, 255, 255, 0.8); font-size: 0.85rem; align-self: center; margin-right: 2px; }
.ss-chip {
  border: 1px solid rgba(255, 255, 255, 0.4); background: rgba(255, 255, 255, 0.12); color: #fff;
  padding: 6px 14px; border-radius: 999px; font-size: 0.85rem; font-weight: 600; font-family: inherit; cursor: pointer;
  transition: background .15s;
}
.ss-chip:hover { background: rgba(255, 255, 255, 0.25); }

/* --- dropdown results --- */
.ss__results {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 200;
  width: max(100%, 460px); max-width: calc(100vw - 24px); max-height: min(72vh, 560px); overflow-y: auto;
  margin: 0; padding: 6px; list-style: none; text-align: left;
  background: #fff; color: var(--text_color); border: 1px solid var(--border_color); border-radius: 16px;
  box-shadow: 0 24px 60px rgba(16, 24, 40, 0.22);
}
.ss--bar .ss__results { left: 50%; transform: translateX(-50%); width: 520px; }
.ss__results[hidden] { display: none; }

.ss-item a {
  display: flex; gap: 12px; align-items: flex-start; padding: 10px; border-radius: 12px;
  color: inherit; text-decoration: none;
}
.ss-item a:hover, .ss-item.is-active a { background: var(--bgl2); }
.ss-item.is-active a { box-shadow: inset 3px 0 0 var(--accent); }
.ss-item__img {
  flex: none; width: 54px; height: 54px; border-radius: 10px; object-fit: cover; background: var(--bgl2);
}
.ss-item__img--icon { display: grid; place-items: center; color: var(--accent); font-size: 24px; }
.ss-item__body { min-width: 0; flex: 1; display: grid; gap: 2px; }
.ss-item__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ss-item__title { font-weight: 700; font-size: 0.95rem; line-height: 1.3; }
.ss-item__type {
  flex: none; padding: 2px 9px; border-radius: 999px; background: rgba(134, 62, 35, 0.1); color: var(--accent);
  font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
}
.ss-item__meta { font-size: 0.8rem; font-weight: 700; color: var(--accent-2); }
.ss-item__desc {
  font-size: 0.82rem; line-height: 1.45; color: var(--muted1);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ss__results mark, .ss-page mark { background: rgba(134, 62, 35, 0.14); color: inherit; border-radius: 3px; padding: 0 1px; }
.ss-all a {
  display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 4px; padding: 11px;
  border-top: 1px solid var(--border_color); color: var(--accent); font-weight: 700; font-size: 0.88rem; text-decoration: none;
}
.ss-all a:hover { text-decoration: underline; }
.ss-empty { display: flex; gap: 12px; align-items: flex-start; padding: 16px 14px; color: var(--muted1); font-size: 0.9rem; }
.ss-empty ion-icon { font-size: 26px; color: var(--accent); flex: none; }
.ss-empty strong { display: block; color: var(--text_color); margin-bottom: 2px; }
.ss-empty a { color: var(--accent); font-weight: 700; }

/* --- /search/ page --- */
.ss-hero { background: var(--accent); padding: 64px 24px 56px; text-align: center; color: #fff; }
.ss-hero h1 { font-family: var(--heading-font); font-size: clamp(2rem, 5vw, 3.2rem); margin: 0 0 10px; color: #fff; }
.ss-hero p { margin: 0 auto 26px; max-width: 560px; color: rgba(255, 255, 255, 0.85); font-size: 1.05rem; }
.ss-hero .ss--page { max-width: 760px; margin: 0 auto; }
.ss-page { max-width: 900px; margin: 0 auto; padding: 32px 24px 56px; }
.ss-page[hidden] { display: none; }
.ss-page__head { margin: 0 0 14px; color: var(--muted1); font-size: 0.98rem; }
.ss-page__head strong { color: var(--text_color); }
.ss-page__head a { color: var(--accent); font-weight: 700; }
.ss-page__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ss-page__list .ss-item a {
  padding: 14px; border: 1px solid var(--border_color); background: var(--card); border-radius: 14px;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.ss-page__list .ss-item a:hover { border-color: var(--accent); box-shadow: 0 10px 26px rgba(16, 24, 40, 0.08); transform: translateY(-1px); background: var(--card); }
.ss-page__list .ss-item__img { width: 84px; height: 72px; }
.ss-page__list .ss-item__title { font-size: 1.05rem; }

/* --- dark mode --- */
.dark-mode .ss--hero, .dark-mode .ss--page { background: var(--bgd_l4); }
.dark-mode .ss--hero .ss__input, .dark-mode .ss--page .ss__input,
.dark-mode .ss--bar .ss__input:focus { color: #fff; }
.dark-mode .ss--bar .ss__input:focus { background: var(--bgd_l4); border-color: var(--bgd_l5); }
.dark-mode .ss__results { background: var(--bgd_l3); border-color: var(--bgd_l5); color: #fff; }
.dark-mode .ss-item a:hover, .dark-mode .ss-item.is-active a { background: var(--bgd_l4); }
.dark-mode .ss-item__img { background: var(--bgd_l4); }
.dark-mode .ss-empty strong { color: #fff; }
.dark-mode .ss-all a { border-color: var(--bgd_l5); }
.dark-mode .ss-hero { background: var(--bgd_l3); }
.dark-mode .ss-page__head strong { color: #fff; }
.dark-mode .ss-page__list .ss-item a { background: var(--bgd_l2); border-color: var(--bgd_l5); }

/* --- small screens --- */
@media (max-width: 1100px) {
  .top-bar-item[href^="mailto"] span { display: none; }
}
@media (max-width: 760px) {
  .top-bar-center { padding: 0 10px; }
  .ss--bar .ss__results { left: 0; transform: none; width: calc(100vw - 32px); }
  .ss__kbd { display: none; }
}
@media (max-width: 560px) {
  .ss--hero, .ss--page { padding: 5px 5px 5px 0; }
  .ss--hero .ss__input, .ss--page .ss__input { height: 46px; padding-left: 46px; font-size: 16px; }
  .ss--hero .ss__icon, .ss--page .ss__icon { left: 17px; }
  .ss__btn { height: 44px; padding: 0 16px; }
  .ss__results { width: calc(100vw - 32px); }
  .ss-page__list .ss-item__img { width: 64px; height: 60px; }
  .ss-hero { padding: 44px 16px 40px; }
}
.search-results-section[hidden] { display: none; }

/* the top bar sits before the header in the fixed wrapper; lift it so its
   dropdown paints over the nav */
.fixed-header-wrapper .top-bar { position: relative; z-index: 5; }
/* keep site-wide input styles off the search boxes */
.ss--hero .ss__input, .ss--page .ss__input,
.ss--hero .ss__input:focus, .ss--page .ss__input:focus {
  border: 0 !important; box-shadow: none !important; outline: none !important; background: transparent !important;
}
.ss--bar .ss__input:focus { outline: none !important; }
