/*
 * Search/navigation stabilization, October 2026.
 * Intentionally loaded LAST under a new filename to avoid the old homepage
 * overlay rules and browser-cached /site-upgrade.css leaking into /search/.
 *
 * The existing typography, colors and layouts elsewhere remain intact.
 */

/* Keep the navigation above every page element, including search suggestions.
   A fixed header with equivalent body offset is more reliable here than the
   previous sticky/absolute mixture (the header is a top-level body child). */
html body { padding-top: 84px !important; }
html body .site-header,
html body .site-header.home-header {
  position: fixed !important;
  inset: 0 0 auto 0 !important;
  top: 0 !important;
  width: 100% !important;
  height: 84px;
  margin: 0 !important;
  z-index: 2000 !important;
}
html body .site-header.home-header {
  background: linear-gradient(
    90deg,
    rgba(255,255,255,.98) 0%,
    rgba(255,255,255,.95) 27%,
    rgba(18,25,28,.94) 56%,
    rgba(10,15,17,.97) 100%
  ) !important;
}
html body .site-header .header-search-link {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 40px !important;
  min-width: 40px !important;
  height: 42px !important;
  flex: 0 0 40px !important;
  padding: 0;
  color: #171c20;
  opacity: 1 !important;
  visibility: visible !important;
  text-decoration: none;
  border-radius: 4px;
}
html body .site-header .header-search-link svg {
  width: 21px !important;
  height: 21px !important;
  display: block !important;
  flex: none;
}
html body .site-header.home-header .header-search-link { color: #fff !important; }
html body .site-header .header-search-link:hover,
html body .site-header .header-search-link:focus-visible {
  color: #c7552d !important;
  background: rgba(199,85,45,.10) !important;
}
html body .site-header .header-search-link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 1px;
}

/* Home search stays in document flow. Suggestions must paint ABOVE the following
   hero, whose positioned title otherwise intercepts clicks on result labels. */
html body .site-search-shell.site-search-shell--home {
  position: relative !important;
  inset: auto !important;
  top: auto !important;
  left: auto !important;
  display: block;
  width: 100%;
  margin: 0 !important;
  padding: 13px max(4vw,24px);
  z-index: 50 !important;
  background: #f7f2e9;
  border-bottom: 1px solid rgba(23,28,32,.13);
}
html body .home-header + .site-search-shell { margin-top: 0 !important; }

/* /search/: use the same serif heading, eyebrow, warm paper, contained width
   and understated cards as the rest of the InstantTraveling editorial site. */
html body .search-page.search-page--editorial {
  min-height: 68vh;
  padding: 0 !important;
  background: #f7f2e9;
}
html body .search-page .directory-hero.search-page__hero {
  min-height: 0;
  padding: clamp(64px,7vw,112px) max(4vw,24px) clamp(48px,6vw,84px) !important;
  background: #eee5d7;
}
html body .search-page__inner {
  width: min(100%,1320px);
  margin: 0 auto;
}
html body .search-page__hero .eyebrow {
  margin: 0 0 19px;
  color: #a3482a;
  font: 600 .67rem/1.3 var(--mono,'DM Mono',monospace);
  text-transform: uppercase;
  letter-spacing: .12em;
}
html body .search-page__hero h1 {
  max-width: 1040px;
  margin: 0;
  color: #171c20;
  font: 500 clamp(3rem,5vw,5.2rem)/1.02 var(--serif,'Newsreader',Georgia,serif) !important;
  letter-spacing: -.05em;
}
html body .search-page__hero p.search-page__lead {
  max-width: 740px;
  margin: 17px 0 0 !important;
  color: #525c59;
  font: 400 clamp(.96rem,1.2vw,1.07rem)/1.6 var(--sans,'DM Sans',Arial,sans-serif);
}

/* Dedicated search field and results stay in one coherent composition. */
html body .search-page__hero .site-search-shell.site-search-shell--results {
  position: static !important;
  display: block;
  margin: clamp(30px,3.5vw,54px) 0 0 !important;
  padding: 0 !important;
  border: 0 !important;
  width: min(100%,1080px);
  background: transparent !important;
  box-shadow: none !important;
}
html body .search-page__hero .site-search {
  display: grid;
  grid-template-columns: 28px minmax(0,1fr) auto;
  align-items: center;
  width: 100%;
  min-height: 66px;
  padding: 0 0 0 18px;
  margin: 0;
  border: 1px solid rgba(23,28,32,.22);
  background: #fffdf9;
  box-shadow: 0 12px 28px rgba(23,28,32,.06);
}
html body .search-page__hero .site-search__icon { width: 22px; height: 22px; }
html body .search-page__hero .site-search__icon svg { width: 100%; height: 100%; }
html body .search-page__hero .site-search input {
  width: 100%;
  min-width: 0;
  padding: 14px 17px;
  font: 600 clamp(.88rem,1.2vw,1.04rem)/1.35 var(--sans,'DM Sans',Arial,sans-serif);
  color: #171c20;
  border: none;
  background: transparent;
}
html body .search-page__hero .site-search > button[type="submit"] {
  align-self: stretch;
  min-width: 108px;
  padding: 0 22px;
  color: #fff;
  background: #171c20;
  border: 0;
  font: 700 .79rem/1 var(--sans,'DM Sans',Arial,sans-serif);
}
html body .search-page__hero .site-search > button[type="submit"]:hover { background: #c7552d; }
html body .search-page__hero .site-search-results {
  position: relative !important;
  inset: auto !important;
  grid-column: 1 / -1;
  margin: 14px -1px 0 -19px;
  padding: 0;
  width: calc(100% + 20px);
  max-height: none !important;
  overflow: visible;
  border: 1px solid rgba(23,28,32,.14);
  background: #fffdf9;
  box-shadow: none;
}
html body .search-page__hero .site-search-results[hidden] { display: none !important; }
html body .search-page__hero .search-page__result-count {
  display: block;
  margin: 0;
  padding: 16px 23px 13px;
  border-bottom: 1px solid rgba(23,28,32,.12);
  font: 700 .68rem/1.3 var(--mono,'DM Mono',monospace);
  color: #a34a2e;
  text-transform: uppercase;
  letter-spacing: .06em;
}
html body .search-page__hero .site-search-results > a {
  display: grid;
  grid-template-columns: 1fr 24px;
  gap: 12px;
  align-items: center;
  padding: 18px 23px;
  border-bottom: 1px solid rgba(23,28,32,.09);
  background: #fffdf9;
  color: #171c20;
  text-decoration: none;
}
html body .search-page__hero .site-search-results > a:hover,
html body .search-page__hero .site-search-results > a.is-active { background: #f2e7da; }
html body .search-page__hero .site-search-results b {
  white-space: normal;
  font: 600 clamp(1.18rem,1.6vw,1.55rem)/1.15 var(--serif,'Newsreader',Georgia,serif);
  letter-spacing: -.025em;
}
html body .search-page__hero .site-search-results small {
  margin-top: 7px;
  font: 600 .62rem/1.2 var(--mono,'DM Mono',monospace);
  color: #686b65;
  letter-spacing: .04em;
}
html body .search-page__hero .site-search-results i { color: #bd5430; }
html body .search-page__hero .site-search-empty { margin: 0; padding: 20px 23px; }

/* Category hints: spaced, bordered chips rather than concatenated links. */
html body .search-page__hero .search-page__help {
  width: min(100%,1080px);
  margin: 24px 0 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 16px;
}
html body .search-page__hero .search-page__help > span {
  color: #61665f;
  font: 600 .76rem/1.3 var(--sans,'DM Sans',Arial,sans-serif);
}
html body .search-page__hero .search-page__help > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
html body .search-page__hero .search-page__help a {
  display: inline-flex;
  align-items: center;
  padding: 9px 14px;
  min-height: 34px;
  border: 1px solid rgba(23,28,32,.17);
  background: rgba(255,255,255,.45);
  color: #353c39;
  font: 600 .75rem/1.2 var(--sans,'DM Sans',Arial,sans-serif);
  text-decoration: none;
}
html body .search-page__hero .search-page__help a:hover,
html body .search-page__hero .search-page__help a:focus-visible {
  border-color: #a84326;
  background: #fffdf9;
  color: #a84326;
}
html body .search-page__footnote {
  max-width: 1320px;
  margin: 0 auto;
  padding: 30px max(4vw,24px);
  font: 500 .71rem/1.5 var(--mono,'DM Mono',monospace);
  color: #6e7069;
}

/* Header remains usable alongside the narrow/mobile menu. */
@media (max-width: 800px) {
  html body { padding-top: 68px !important; }
  html body .site-header,
  html body .site-header.home-header { height: 68px !important; }
  html body .site-header .header-search-link {
    order: 0;
    min-width: 42px !important;
    width: 42px !important;
    height: 42px !important;
    flex-basis: 42px !important;
    margin-left: auto;
  }
  html body .site-header .menu-toggle { margin-left: 4px; }
  html body .site-search-shell.site-search-shell--home { padding: 9px 12px; }
  html body .search-page .directory-hero.search-page__hero {
    padding: 55px 18px 56px !important;
  }
  html body .search-page__hero h1 { font-size: clamp(2.65rem,9vw,4.1rem) !important; }
  html body .search-page__hero .site-search input { padding: 12px; }
  html body .search-page__hero .site-search > button[type="submit"] {
    min-width: 68px;
    padding: 0 12px;
  }
  html body .search-page__hero .site-search-results { margin-left: -19px; }
  html body .search-page__footnote { padding: 25px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  html body .site-header .header-search-link { transition: none; }
}

/* Multilingual preview: the header retains the established InstantTraveling
   visual system. Narrower translated labels avoid shifting the main layout. */
html[lang="nl"] .site-header #site-nav,
html[lang="de"] .site-header #site-nav { gap: clamp(8px, 1.15vw, 19px); }
html[lang="nl"] .site-header .header-right,
html[lang="de"] .site-header .header-right { gap: clamp(8px, 1vw, 16px); }
.site-header .nav-language-note {
  display: inline-block; vertical-align: .18em;
  font-size: .58em; line-height: 1;
  font-weight: 650; letter-spacing: .02em; opacity: .68;
}
@media (max-width: 1240px) {
  html[lang="nl"] .site-header #site-nav,
  html[lang="de"] .site-header #site-nav { gap: 8px; font-size: .75rem; }
  html[lang="nl"] .site-header .nav-language-note,
  html[lang="de"] .site-header .nav-language-note { font-size: .57em; }
}
