/*
 * EdGEL Search result panels
 * --------------------------------------------------
 */
// stylelint-disable font-family-no-missing-generic-family-keyword

/* Base class */
.search {
  margin-bottom: @line-height-computed;
  background-color: @panel-bg;
  border: 1px solid transparent;
  border-radius: @panel-border-radius;
  .box-shadow(0 1px 1px rgba(0, 0, 0, 5%));
  .shade;
  padding: @panel-body-padding;
  position: relative;
}

.search,
.search-body {
  zoom: 1;
  overflow: hidden;
}

.search-body {
  display: table-cell;
  vertical-align: top;
  width: 10000px;
}

/* Reset margins on headings for tighter default spacing */
.search-title {
  margin-top: 0;
  margin-bottom: 5px;
  font-size: @font-size-h3;
}

/* Set the clickable area for the search result heading link to cover the whole search block */
.search .search-title a {
  position: static;
  &:before {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    content: "";
    white-space: nowrap;
    overflow: hidden;
    z-index: 1;
  }
}

/* Ensure all other links in the result block are still clickable */
.search a {
  position: relative;
  z-index: 2;
}

/* The search result reference line */
.search-ref {
  margin-bottom: 0;
  line-height: 1.6;
  color: @panel-success-text;
}

/* The related media object (image) in the search result block */
.search-object {
  width: percentage((1 / @grid-columns));
  min-width:      .px-rem(90px)[];
  padding-right:  .px-rem(20px)[];
  display:        table-cell;
  vertical-align: middle;
}

/* Ensure the image is rendered over the icon and padding */
.search-object img {
  width:       100%;
  float:       left;
  position:    relative;
}

/* User profile search result items */
.search-object-person,
.search-object-video {
  position:       relative;
  line-height:    1px;

  /* Ensure badly-sized images are cropped */
  max-height:     1px;
  overflow:       hidden;

  /* Fallback display glyphicon on grey background */
  background-color: @gray-lighter;
  &:before {
    font-family: "Glyphicons Halflings";
    color:       @gray-light;
    width:       100%;
    position:    absolute;
    top:         50%;
    left:        0;
    text-align:  center;
  }
}

/* Images of people are cropped to circles with a user icon as fallback */
.search-object-person {
  padding-bottom:  percentage((130 / 100));
  &:before {
    font-size:   3.2rem;
    /* User symbol */
    content:     "\e008";
  }
}

/* Video images are 9x4 with a facetime-video icon as fallback */
.search-object-video {
  padding-bottom: percentage((9 / 16));
  &:before {
    font-size:   2rem;
    /* Facetime video symbol */
    content:     "\e059";
  }
}

.search-body :last-child {
  padding-bottom: 0;
  margin-bottom: 0;
}

// stylelint-enable
