.media-box--js-sortable-chosen .media-box__header {
  background: var(--primary-color);
}

/* 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;
}

/* 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;
}

.input--search-gallery-list {
  border: var(--border);
  width: 250px;
  padding: 0 4px;
  line-height: 28px;
  font-family: var(--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 #cccccc;
  background-color: var(--background-color);
}

.add-to-gallery-list ::-webkit-scrollbar {
  width: 6px;
  background-color: var(--background-color);
}

.add-to-gallery-list ::-webkit-scrollbar-thumb {
  background-color: var(--primary-color);
}

.add-to-gallery-list ul {
  max-height: 132px;
  overflow: hidden auto; /* 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;
}
