/* Search — one-screen editorial layout */
html:has(.page-search) {
  overflow: hidden;
}

.page-search.page-shell {
  overflow: hidden;
}

.page-shell.page-search {
  --ink: var(--insp-ink);
  --ink-muted: var(--insp-muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-search .search-screen {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.search-screen__top {
  flex-shrink: 0;
  padding: clamp(12px, 1.8vh, 22px) clamp(16px, 2.2vw, 36px) clamp(8px, 1.2vh, 14px);
  border-bottom: 1px solid var(--insp-line);
  background: var(--insp-bg);
}

.search-screen__label {
  font-size: var(--insp-text-xs);
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--insp-muted);
  margin-bottom: 4px;
}

.search-screen__title {
  font-family: var(--insp-serif);
  font-size: clamp(1.75rem, 4.5vh, 3.25rem);
  font-weight: 300;
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin-bottom: clamp(4px, 0.8vh, 10px);
}

.search-screen__lead {
  font-size: clamp(0.625rem, 1.15vh, 0.75rem);
  font-weight: 300;
  color: var(--insp-muted);
  margin-bottom: clamp(10px, 1.4vh, 16px);
  max-width: 48ch;
  line-height: 1.5;
}

.search-form {
  display: flex;
  gap: 8px;
  margin-bottom: clamp(6px, 1vh, 10px);
  max-width: 640px;
}

.search-form__input {
  flex: 1;
  min-width: 0;
  min-height: clamp(36px, 4.5vh, 44px);
  padding: 8px 14px;
  border: 1px solid var(--insp-line);
  background: rgba(255, 255, 255, 0.4);
  font: inherit;
  font-size: clamp(0.6875rem, 1.15vh, 0.8125rem);
  letter-spacing: 0.04em;
  color: var(--insp-ink);
  outline: none;
  transition: border-color 0.2s;
}

.search-form__input:focus {
  border-color: rgba(42, 40, 36, 0.42);
  background: rgba(255, 255, 255, 0.65);
}

.search-form__submit {
  flex-shrink: 0;
  min-height: clamp(36px, 4.5vh, 44px);
  padding: 0 18px;
  background: var(--insp-ink);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: opacity 0.2s;
}

.search-form__submit:hover {
  opacity: 0.88;
}

.search-screen__count {
  font-size: 0.5625rem;
  letter-spacing: 0.1em;
  color: var(--insp-muted);
  min-height: 1em;
}

.search-screen__empty {
  font-size: clamp(0.6875rem, 1.15vh, 0.8125rem);
  font-weight: 300;
  color: var(--insp-muted);
  padding: 8px 0 0;
}

.search-hint {
  font-size: clamp(0.6875rem, 1.15vh, 0.8125rem);
  font-weight: 300;
  color: var(--insp-muted);
  line-height: 1.5;
  padding: 4px 0;
}

.search-screen__results {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: clamp(10px, 1.4vh, 16px) clamp(16px, 2.2vw, 36px) clamp(12px, 1.6vh, 20px);
  background: var(--insp-bg-deep);
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 960px;
}

.search-card {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--insp-line);
  background: rgba(255, 255, 255, 0.22);
  text-decoration: none;
  color: inherit;
  transition: background 0.2s;
}

.search-card:hover {
  background: rgba(255, 255, 255, 0.42);
}

.search-card__media {
  width: 64px;
  height: 52px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-card__media img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.search-card__type {
  display: inline-block;
  font-size: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--insp-muted);
  margin-bottom: 3px;
}

.search-card__title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin-bottom: 3px;
}

.search-card__text {
  font-size: 0.625rem;
  font-weight: 300;
  line-height: 1.4;
  color: var(--insp-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 1200px) {
  .insp-header__inner {
    grid-template-columns: 1fr auto;
  }

  .insp-nav {
    display: none;
  }

  .page-search .menu-btn {
    display: flex;
  }
}

@media (max-width: 900px) {
  html:has(.page-search) {
    overflow: auto;
  }

  .page-search {
    --insp-rail: 36px;
    height: auto;
    max-height: none;
    overflow: auto;
  }

  .insp-shell {
    margin-left: var(--insp-rail);
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .page-search .search-screen {
    overflow: visible;
    min-height: 60vh;
  }

  .search-screen__results {
    overflow: visible;
    flex: none;
  }

  .insp-pager__dir {
    display: none;
  }
}

@media (max-width: 560px) {
  .search-form {
    flex-direction: column;
  }

  .search-form__submit {
    width: 100%;
  }

  .search-card {
    grid-template-columns: 52px 1fr;
    gap: 10px;
  }

  .search-card__media {
    width: 52px;
    height: 48px;
  }

  .insp-header__link:first-of-type {
    display: none;
  }
}
