/*
 * search-continuity.css: GH #4566, the DMV search page.
 *
 * Owner 2026-11-28, verbatim: "The current design has way too much dead space above the
 * fold." and "update the search landing for better continuity, e.g. cross-linking the map
 * image from the blog as a thumbnail, or using a zillow-style result (similar to CVSDH)
 * with the stylized map on the left."
 *
 * WHY its own file: only a brand with blog area articles (DMV) or planning areas (CVSDH,
 * GH #4570, owner 2026-11-28: "CVSDH has a lot of deadspace at the top and top-right")
 * links it, from the search result page alone (views/blog_area_fragments.go
 * searchContinuityCSSLink), so these rules may scope to that page's #main and reach no
 * other brand or page. On CVSDH the toolbar sits in the split view's listings column and
 * the area picker (.pa-picker, order 1) follows it on its own line. The toolbar is a flex
 * row over the existing .pageHeading and the .search-tools group (the bed/bath/price
 * filter row, owner 2026-11-29: "basic bed/bath/price filters are universally needed",
 * then Save Search and the sort select, owner 2026-11-29: "review all sites for aligment,
 * spacing, deadzones, etc").
 * All five brands link this file today (views searchCompactToolbar). The compare control is a
 * viewport-fixed pill since owner 2026-11-28 ("reclaim this space", search_result.css),
 * so it is no longer a toolbar member.
 */

/* Compact toolbar. WHY flex with order: the criteria line, "revise search", Save Search
   and sort (order 0) share one wrapping row at the top of #main; every
   other child (alerts, the empty state, the Notify button; order 1) keeps a full line
   below it. Measured from the CSS, 1366x768: the stacked well (80px), button row (34px),
   compare well (74px), list margin (20px) and "Found" block (45px) were 253px above the
   first card; the toolbar row and the tightened "Found" line are 68px. */
body#search_result #main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  padding-top: 8px;
}
/* WHY: .container's clearfix pseudo-elements would be flex items (an empty slot each);
   floats no longer need clearing in a flex row. */
body#search_result #main::before,
body#search_result #main::after {
  content: none;
}
body#search_result #main > * {
  flex: 0 0 100%;
  order: 1;
}
body#search_result #main > .pageHeading,
body#search_result #main > .search-tools {
  flex: 0 1 auto;
  order: 0;
  width: auto;
  float: none;
  margin: 0;
  padding: 0;
}
/* Owner 2026-11-29, verbatim: "review all sites for aligment, spacing, deadzones, etc":
   Save Search and the sort select are one group (views .search-tools) that grows into
   the heading's row; when the row is too narrow the group wraps whole, so the select
   never sits alone on a line. WHY margin-left auto on the select: it stays flush with the
   column's right edge, Save Search beside the heading on the left. */
body#search_result #main > .search-tools {
  flex: 1 1 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}
body#search_result #main > .search-tools > .sort-by {
  margin-left: auto;
}
/* The criteria line as plain text, not a well. WHY it may wrap but never truncate: the
   heading is the page's identity (and its OCR keyword); it takes the free width. */
body#search_result #main > .pageHeading {
  flex: 1 1 320px;
  min-height: 0;
  background: none;
  border: 0;
  box-shadow: none;
  font-weight: 600;
}
body#search_result #main > .pageHeading a {
  font-weight: normal;
}
/* Small controls, one 30px row. */
body#search_result #main > .search-tools > .btn {
  padding: 5px 10px;
  font-size: 13px;
  line-height: 1.5;
}
body#search_result #main > .search-tools > .sort-by select {
  display: inline-block;
  width: auto;
  height: 30px;
  padding: 4px 8px;
  font-size: 13px;
}
/* Owner 2026-11-29, verbatim: "basic bed/bath/price filters are universally needed"
   (after "chicago needs filters in that empty space"): the compact filter row (views
   writeSearchFilterRow), first in the .search-tools group of every brand's search page
   and in a planning-area landing head (planning-areas.css places it there). One line of
   small controls at the sort select's 30px height and 13px type. WHY width auto:
   Bootstrap's .form-control is 100% wide, which would put every field on a line of its
   own. WHY wrap and min-width 0: a narrow column wraps the row whole onto its own line,
   above Save Search and the sort select, and then its fields onto a second line; nothing
   scrolls sideways. WHY here: this file is linked by every brand's search page, the
   landing pages included, and no other page carries the row. */
.pa-filters {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  margin: 0;
}
.pa-filters .form-control {
  width: auto;
  height: 30px;
  padding: 4px 8px;
  font-size: 13px;
}
.pa-filters input.form-control {
  width: 7.5em;
}
.pa-filters .btn {
  min-height: 30px;
  padding: 4px 12px;
  font-size: 13px;
  line-height: 1.5;
}
/* Phones (keep it compact): the row takes its own full line and its fields share that
   width, wrapping onto a second line rather than scrolling sideways. */
@media (max-width: 767.99px) {
  .pa-filters {
    flex-basis: 100%;
  }
  .pa-filters > .form-control {
    flex: 1 1 5.5em;
    min-width: 0;
  }
}
/* The "Found N listings" line sits right under the toolbar. */
body#search_result .list-results {
  margin-top: 4px;
}
body#search_result .list-results .found {
  margin-bottom: 6px;
}
/* GH #4549: the promoted "Found" h1 (search_result.css .search-heading) takes the same margin. */
body#search_result .list-results .found p,
body#search_result .list-results .found h1 {
  margin: 0;
}

/* Blog-article split (views/blog_area_fragments.go), the CVSDH pattern: the article's map
   on the left, the results on the right. Phone first: the map is a thumbnail strip on top
   (96px image, the "Living in <Place>" link beside it), the results below. */
.ba-split-map {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 15px;
  border-bottom: 1px solid #e3e3e3;
  background: #f7f5f0;
}
.ba-map {
  flex: 0 0 96px;
}
.ba-map img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}
.ba-article {
  min-width: 0;
}
.ba-article-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
.ba-article-sub {
  margin: 2px 0 0;
  font-size: 12px;
  color: #666;
}

/* Tablet and up: side by side, the map column 40% wide and sticky, so it stays in view
   while the page scrolls the results (window scroll, unlike CVSDH's one-viewport
   scroller: the column holds one static image). */
@media (min-width: 768px) {
  .ba-split {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    align-items: start;
  }
  .ba-split-map {
    position: sticky;
    top: 0;
    flex-direction: column;
    align-items: stretch;
    max-height: 100vh;
    padding: 12px 15px;
    border-bottom: 0;
    border-right: 1px solid #e3e3e3;
  }
  .ba-map {
    flex: 0 1 auto;
    min-height: 0;
  }
  /* WHY max-height: the whole map stays inside the viewport beside its caption. */
  .ba-map img {
    max-height: calc(100vh - 90px);
    object-fit: contain;
  }
  .ba-article-title {
    font-size: 18px;
  }
  /* WHY width auto: Bootstrap's .container fixes a page-wide width at each breakpoint,
     which would overflow the 60% column. */
  .ba-split-list .container {
    width: auto;
  }
}
