/* Copyright Ayers Electronics Inc. All rights reserved. */
/* the search page. */
/* The SEARCH page: the typing column and the
   results side by side under the head row, the whole width - 360 + 16 + 560 at 960, 420 + 24 + the rest at 1920. */
#searchPage {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  padding: 10px var(--page-margin) 12px;
  box-sizing: border-box;
}
/* Fixed at every state - it never gets smaller or larger; the left and right side stay the
   same size - no fold: 360/16/1fr here and 420/24/1fr at 1280 and up (the media query below), whether the
   query is empty, being typed, or answered. Down the typing column: the field, then the keypad. */
.search-split {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 16px;
  width: 100%;
  min-height: 0;
}
.search-typing {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.search-typing > * + * {
  margin-top: 10px;
}
.search-field {
  flex: none;
  height: 40px;
  display: flex;
  align-items: center;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 0 10px;
  box-sizing: border-box;
}
.search-field input {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: var(--type-body);
  padding: 0;
  outline: none;
  box-shadow: none;
}
.search-field input::-webkit-search-cancel-button {
  display: none;
}
.search-field:focus-within {
  outline: none;
  box-shadow: var(--focus-ring-outset);
}
/* The keys never move: the slot takes the height its own rows need and gives none of it back. */
.search-keypad-slot {
  flex: none;
}
.search-keypad-slot:empty {
  display: none;
}
/* The letters are drawn as capitals; they type lower case, and Shift gives the one capital. */
.search-keypad-slot .key:not(.wide) {
  text-transform: uppercase;
}
.search-results {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
/* The tabs draw their ring outside themselves and the row clips, so the row carries the ring's width as
   padding on every side and takes it straight back as margin: the ring shows whole and nothing at rest
   moves. A row too long for the width wraps onto a second line, so no chip is ever cut by the edge; each
   chip carries its spacing on its right and foot, and the row gives the foot's back. */
.search-tabs {
  display: flex;
  flex-wrap: wrap;
  min-height: calc(34px + 2 * var(--focus-ring-width));
  padding: var(--focus-ring-width);
  margin: calc(-1 * var(--focus-ring-width));
  margin-bottom: calc(-1 * var(--focus-ring-width) - 6px);
  align-items: center;
  flex: none;
  overflow: hidden;
}
.search-tabs > * {
  margin-right: 6px;
  margin-bottom: 6px;
}
.search-tabs > :last-child {
  margin-right: 0;
}
/* min-height, not height: a bigger line-height or letter-spacing than this grows the
   chip instead of losing its label under overflow: hidden. */
.search-tab {
  flex: none;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  font: inherit;
  font-size: var(--type-micro);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text);
  background: var(--elevated);
  white-space: nowrap;
}
.search-tab.active {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}
.search-tab.none {
  color: var(--muted);
  background: transparent;
}
.search-count {
  flex: none;
  min-height: 16px;
  margin: 7px 0;
  font-size: var(--type-label);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  align-content: flex-start;
}
/* The list fades into the ground over its last band, so a row the edge cuts never shows cut through
   its letters; a seated row stops above the fade, and the spacer below lets the last row scroll clear
   of it. -webkit-mask-image is the WebView floor's (Chromium 83) spelling. */
.search-list {
  --search-fade-h: 24px;
  scroll-padding-bottom: var(--search-fade-h);
  -webkit-mask-image: linear-gradient(to bottom, var(--bg) calc(100% - var(--search-fade-h)), transparent 100%);
  mask-image: linear-gradient(to bottom, var(--bg) calc(100% - var(--search-fade-h)), transparent 100%);
}
.search-list::after {
  content: "";
  display: block;
  flex: none;
  height: var(--search-fade-h);
}
.search-legend {
  flex: none;
  margin: 8px 0 2px;
  font-size: var(--type-micro);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.search-legend:first-child {
  margin-top: 0;
}
.search-empty {
  flex: none;
  margin: 0;
  padding: 20px 0;
  font-size: var(--type-label);
  color: var(--muted);
}
/* The list's rows stand 5px apart, a heading 13px under what it follows. */
.search-list > * + *,
.search-list::after {
  margin-top: 5px;
}
.search-list > * + .search-legend {
  margin-top: 13px;
}
/* A result row on the list band (section 3): a 50px art slot, the title over one line of facts, the kind badge.
   min-height, not height: the title and facts lines grow the row past 50 rather than losing a line
   under overflow: hidden. */
.search-row {
  flex: none;
  width: 100%;
  min-height: 50px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  padding: 0 10px 0 0;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  text-align: left;
  overflow: hidden;
}
.search-row > * + * {
  margin-left: 10px;
}
/* The page's ring drawn inside the row, on base.css's layer over the row's art: the lists scroll,
   and a scroller clips whatever draws past its edge. */
#guide .search-row:focus {
  position: relative;
  box-shadow: none;
}
.search-row .art {
  flex: none;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--elevated);
  font-size: var(--type-micro);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.search-row .art img {
  display: block;
  object-fit: cover;
}
.search-row .art.poster img {
  width: 33px;
  height: 50px;
}
.search-row .art.wide img {
  width: 50px;
  height: 28px;
}
.search-row .art.chan {
  background: var(--cat-news-fill);
  font-size: var(--type-body);
  letter-spacing: 0;
  color: var(--text);
}
.search-row .art.chan img {
  width: 50px;
  height: 50px;
  object-fit: contain;
}
/* A title with no picture wears the title face (js/stock-card.js) in its square: the dark field, the
   accent wash (css/components/tiles.css) and the kind's icon. The row beside it names the title and
   its kind, so the face's own words are not drawn. */
.search-row .art.stock {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  box-sizing: border-box;
}
.search-row .art .stock-title {
  display: none;
}
.search-row .art .stock-kind {
  display: none;
}
.search-row .art .stock-icon {
  width: 30px;
  height: 30px;
}
.search-row .body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.search-row .title {
  font-size: var(--type-body);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-row .facts {
  font-size: var(--type-micro);
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-row .facts:empty {
  display: none;
}
/* Which network a result plays from: the network's own name under the facts. No colour of its own
   until the card mark's sheet is signed. */
.search-row .search-network {
  font-size: var(--type-micro);
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-top: 2px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* A network whose Binge Limit is spent: its row greyed, the limit's name under the network's. */
.search-row.binge-spent .art {
  filter: grayscale(1) brightness(0.55);
}
.search-row .binge-label {
  font-size: var(--type-micro);
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-top: 2px;
  color: var(--accent-text);
  white-space: nowrap;
}
.search-row .badge {
  flex: none;
  font-size: var(--type-micro);
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 4px;
  line-height: 1;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-small);
  color: var(--muted);
}
.search-row .badge.live {
  color: var(--live);
  border-color: var(--live);
}
@media (min-width: 1280px) {
  /* The search page at 1920: 420 for typing, 24 of air, the rest results. */
  .search-split {
    grid-template-columns: 420px minmax(0, 1fr);
    gap: 24px;
  }
  .search-field {
    height: 48px;
  }
  .search-field input {
    font-size: var(--type-heading);
  }
  .search-tabs {
    min-height: calc(44px + 2 * var(--focus-ring-width));
    margin-bottom: calc(-1 * var(--focus-ring-width) - 8px);
  }
  .search-tabs > * {
    margin-right: 8px;
    margin-bottom: 8px;
  }
  .search-tabs > :last-child {
    margin-right: 0;
  }
  .search-tab {
    min-height: 40px;
    padding: 0 14px;
    font-size: var(--type-label);
  }
  .search-count {
    font-size: var(--type-body);
    min-height: 20px;
  }
}
/* A phone's width has no room for two columns: the typing column - the field alone - stands over the
   results side, which takes the rest of the height. A phone draws no keypad in the slot. */
@media (max-width: 767px) {
  .search-split {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px;
  }
}
