/*
 * QHPH search-first accessibility / responsive QA (27 Oct 2026).
 * When the user enters a query, results move into the first viewport.
 * Only presentation changes: no catalog, ranking or publishing side effects.
 */
body.home-v2:has(#searchInput:not(:placeholder-shown)) .v3-hero {
  padding-top: 18px !important;
  padding-bottom: 14px !important;
}
body.home-v2:has(#searchInput:not(:placeholder-shown)) .v3-hero .eyebrow,
body.home-v2:has(#searchInput:not(:placeholder-shown)) .v3-hero .qhph-journey-copy,
body.home-v2:has(#searchInput:not(:placeholder-shown)) .v3-hero .home-v2-sub,
body.home-v2:has(#searchInput:not(:placeholder-shown)) .v3-hero .city-identity-strip,
body.home-v2:has(#searchInput:not(:placeholder-shown)) .v3-hero .city-identity-landmarks,
body.home-v2:has(#searchInput:not(:placeholder-shown)) .v3-hero .intent-mode-wrap,
body.home-v2:has(#searchInput:not(:placeholder-shown)) .v3-hero .v3-context-row,
body.home-v2:has(#searchInput:not(:placeholder-shown)) .v3-hero .home-scroll-cue {
  display: none !important;
}
body.home-v2:has(#searchInput:not(:placeholder-shown)) .v3-hero h1 {
  font-size: clamp(28px, 3vw, 39px) !important;
  line-height: 1.12;
  letter-spacing: -.04em;
  margin: 0 0 12px !important;
}
body.home-v2:has(#searchInput:not(:placeholder-shown)) .v3-hero .v3-search {
  margin-top: 8px !important;
}
body.home-v2:has(#searchInput:not(:placeholder-shown)) .v3-hero .v3-time-tabs {
  margin-top: 10px !important;
}
body.home-v2:has(#searchInput:not(:placeholder-shown)) .v3-hero .weather-aware-banner {
  margin-top: 10px !important;
  margin-bottom: 0 !important;
}

/* Text-first layout for search results without promotional photos.
   No invented visuals, permission-free remote image scraping or blank image wall. */
body.home-v2:has(#searchInput:not(:placeholder-shown)) #todayGrid {
  grid-auto-flow: row !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-auto-columns: auto !important;
  overflow-x: visible !important;
  gap: 10px !important;
}
body.home-v2:has(#searchInput:not(:placeholder-shown)) #todayGrid .qhph-search-result:has(.v3-card-placeholder) {
  display: grid !important;
  grid-template-columns: 66px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  gap: 3px 12px;
  min-height: 96px;
  padding: 12px;
  border-radius: 16px;
  scroll-snap-align: none;
  text-align: left;
}
body.home-v2:has(#searchInput:not(:placeholder-shown)) #todayGrid .qhph-search-result .v3-card-placeholder {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 66px !important;
  height: 66px !important;
  min-height: 66px !important;
  aspect-ratio: 1 !important;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 11px !important;
  letter-spacing: .08em;
}
body.home-v2:has(#searchInput:not(:placeholder-shown)) #todayGrid .qhph-search-result .v3-card-body {
  grid-column: 2;
  grid-row: 1;
  min-height: 0 !important;
  padding: 0 !important;
  align-self: end;
  min-width: 0;
}
body.home-v2:has(#searchInput:not(:placeholder-shown)) #todayGrid .qhph-search-result .home-card-badges {
  grid-column: 2;
  grid-row: 2;
  position: static !important;
  align-self: start;
  justify-content: flex-start;
  padding: 0 !important;
  margin: 2px 0 0 !important;
  min-width: 0;
}
body.home-v2 #todayGrid .qhph-search-result:focus-visible {
  outline: 3px solid var(--accent, #e8784d);
  outline-offset: 3px;
}

/* Keep the five-result preview honest: a search card marked as hidden by
   product-p0-p1.js must not be resurrected by the text-first grid rule. */
body.home-v2:has(#searchInput:not(:placeholder-shown)) #todayGrid .qhph-search-result.qhph-p0-feed-hidden {
  display: none !important;
}

/* Desktop nav is a true left rail; its fixed buttons must not cover result cards. */
@media (min-width: 1200px) {
  body.home-v2 main {
    padding-left: 112px;
  }
  body.home-v2 .v3-bottom-nav .nav-item small {
    font-size: 11px;
  }
}
@media (max-width: 759px) {
  body.home-v2:has(#searchInput:not(:placeholder-shown)) #todayGrid {
    grid-template-columns: 1fr !important;
  }
  body.home-v2:has(#searchInput:not(:placeholder-shown)) .v3-hero {
    padding-top: 12px !important;
    padding-bottom: 10px !important;
  }
  body.home-v2:has(#searchInput:not(:placeholder-shown)) .v3-hero h1 {
    font-size: 29px !important;
  }
  body.home-v2:has(#searchInput:not(:placeholder-shown)) .v3-hero .v3-search {
    min-height: 48px;
  }
}
