.searchbar-item {
  width: 100%;
  display: block;
  position: relative;
  padding: 8px 9px 9px 9px;
  cursor: pointer;
  transition: 0.2s transform, 0.2s opacity;
}
.searchbar-item.placeholder {
  height: 36px;
}
.searchbar-item:after {
  content: "";
  clear: both;
  display: block;
}
.searchbar-item:hover {
  background-color: rgba(0, 0, 0, 0.04);
}
.searchbar-item:focus,
.searchbar-item.fakefocus {
  background-color: rgba(0, 0, 0, 0.08);
  outline: none;
}
.dark-theme .theme-background-color .searchbar-item:hover,
.dark-mode .searchbar-item:hover {
  background-color: rgba(255, 255, 255, 0.08);
}
.dark-theme .theme-background-color .searchbar-item:focus,
.dark-theme .theme-background-color .searchbar-item.fakefocus,
.dark-mode .searchbar-item:focus,
.dark-mode .searchbar-item.fakefocus {
  background-color: rgba(255, 255, 255, 0.14);
}

.searchbar-item .title {
  display: inline-block;
  vertical-align: middle;
  max-width: 45%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.searchbar-item .title.wide {
  max-width: 70%;
}

.searchbar-item i,
.searchbar-item .icon-image {
  position: absolute;
  top: 0.7em;
  left: -1.4em;
  opacity: 0.25;
  font-size: 1em;
  width: 1em;
  height: 1em;
}

.dark-theme .theme-background-color .searchbar-item i {
  opacity: 0.33;
}

.searchbar-item .icon-image {
  opacity: 1;
}

/* buttons */

.searchbar-item .action-button {
  position: absolute;
  width: 1.5em;
  height: 1.5em;
  right: 0.45em;
  top: calc(0.16em + 1px);
  border: none;
  border-radius: 50%;
  outline: none;
  overflow: hidden;
  cursor: pointer;
  opacity: 0;
  background: transparent;
  transition: 0.05s;
  font-size: 1.2em;
  color: currentColor;
}
/* increase button click area
:before is already used for icon */
.searchbar-item .action-button:after {
  content: "";
  width: 3em;
  height: 2.5em;
  top: -0.25em;
  left: -0.75em;
  display: block;
  position: absolute;
}
.searchbar-item:hover .action-button,
.searchbar-item:focus .action-button,
.searchbar-item .action-button.always-visible,
body.touch .searchbar-item .action-button {
  opacity: 0.6;
}
.dark-mode .searchbar-item:hover .action-button,
.dark-mode .searchbar-item:focus .action-button,
.searchbar-item .action-button.always-visible,
body.dark-mode.touch .searchbar-item .action-button {
  opacity: 0.8;
}
.searchbar-item .action-button:hover,
.searchbar-item .action-button:focus {
  opacity: 1;
  background: rgba(0, 0, 0, 0.05);
}
.dark-mode .searchbar-item .action-button:hover,
.dark-mode .searchbar-item .action-button:focus {
  opacity: 1;
  background: rgba(0, 0, 0, 0.15);
}
.searchbar-item .action-button:active {
  background: rgba(0, 0, 0, 0.175);
}
.dark-mode .searchbar-item .action-button:active {
  background: rgba(0, 0, 0, 0.35);
}

/* secondary text */

.searchbar-item .secondary-text .md-info {
  float: left;
  opacity: 0.75;
  font-size: inherit;
}
.searchbar-item .secondary-text .md-info:first-child {
  padding-left: 0;
}
.searchbar-item .secondary-text .md-info:last-of-type {
  padding-right: 0.5em;
}
.searchbar-item .secondary-text .md-info + .md-info:before {
  content: "-";
  padding: 0 0.3em;
}
.searchbar-item .secondary-text {
  display: inline-block;
  opacity: 0.66;
  font-size: 0.95em;
  overflow: hidden;
  vertical-align: middle;
  padding-left: 1.5em;
  max-width: 50%;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-height: 2em;
}

.searchbar-item .image {
  height: 2.75em;
  margin: 0.25em 0.5em 0.5em 0;
  float: left;
}
.searchbar-item:focus .image {
  height: 4em;
}

.searchbar-item .description-block {
  display: block;
  line-height: 1.15em;
  max-height: 2.3em;
  overflow: hidden;
  opacity: 0.666;
  font-size: 0.85em;
  margin-top: 0.1em;
  margin-right: 2.5em;
}
.searchbar-item .description-block strong {
  font-size: inherit;
  font-weight: 500;
}
/* when a result is selected, we can show more of the description */
.searchbar-item:focus .description-block {
  max-height: none;
  opacity: 0.8;
  line-height: 1.2em;
}

.searchbar-item .attribution {
  display: none;
  line-height: 1.15em;
  font-size: 0.85rem;
  opacity: 0.9;
  margin-top: 0.2em;
}
.searchbar-item:focus .attribution {
  display: block;
}

/* switch to a two-line layout */

@media all and (max-width: 650px) {
  .searchbar-item .title {
    max-width: calc(100% - 50px);
  }
  .searchbar-item .secondary-text {
    display: block;
    max-width: 100%;
    padding-top: 0.1em;
    padding-left: 0;
    /* prevents letters like "g" from being cut off */
    line-height: 1em;
  }
  .searchbar-item .image {
    display: none;
  }
}
