.media-box--js-sortable-chosen .media-box__header {
  background: $primary_color;
}

/* The server renders additional thumb(s) for extra images in a gallery,
 * if the user is allowed to edit it and it has multiple pages; hide these
 * until the user explicitly requests to edit it (if at all). */
.js-sortable-has-next:not(.editing) .media-box:last-child,
.js-sortable-has-prev:not(.editing) .media-box:first-child {
  display: none;
}

/* Make it clear that the extra images are not truly part of the page. */
.js-sortable-has-next .media-box:last-child,
.js-sortable-has-prev .media-box:first-child {
  opacity: 0.4;
}

.input--search-gallery-list {
  border: $border;
  width: 250px;
  padding: 0 4px;
  line-height: 28px;
  font-family: $font_family_base;
}

.input--search-gallery-list, .add-to-gallery-list ul a.block__list__link {
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
}

.add-to-gallery-list {
  ::-webkit-scrollbar-track
  {
    -webkit-box-shadow: inset 0 0 6px #ccc;
    background-color: $background_color;
  }

  ::-webkit-scrollbar
  {
    width: 6px;
    background-color: $background_color;
  }

  ::-webkit-scrollbar-thumb
  {
    background-color: $primary_color;
  }

  ul {
    max-height: 132px;
    overflow-y: auto;
    overflow-x: hidden; /* Scrollbar customization is only available in WebKit; Gecko and IE have wider bars that cause horizontal overflow */
  }
}

/* Limit the width of ul items inside gallery list (.add-to-gallery-list includes .block__list__link elements
 * that are not part of the list, hence nested selector) */
.add-to-gallery-list li a.block__list__link {
  width: 244px; /* input--search-gallery-list width - 6px scrollbar */
}

.dragging {
  opacity: 0.4;
}