/* Force all Select2 containers to be full-width in the admin.
   Select2 JS sets an inline width (e.g. 64px) based on the hidden <select>,
   which must be overridden. */
#wagtail .select2.select2-container {
    width: 100% !important;
}

/* top level element */
#wagtail .select2-selection {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    box-sizing: border-box;
    border-radius: 6px;
    width: 100%;
    font-family: Open Sans, Arial, sans-serif;
    border: 1px solid #e6e6e6;
    padding: .9em 1.2em;
    color: #333;
    font-size: 1.2em;
    font-weight: 300;
    outline: none;
}

/* wrapper div */
#wagtail .select2-selection__rendered {
    width: 100%;
}

/* a selected item in the list */
#wagtail .select2-selection--multiple .select2-selection__choice {
    border-radius: 2px;
    border: none;
    background-color: #43b1b0;
    padding: .2em .5em;
    color: #fff;
    line-height: 2em;
    white-space: nowrap;
    font-weight: 400;
    display: block;
    /* allocate space for the floated close box */
    margin-right: 2em;
}

/* close box */
#wagtail .select2-selection--multiple .select2-selection__choice .select2-selection__choice__remove {
    font-weight: 400;
    float: right;
    right: 0.1em;
    width: 0;
    height: 0;
    visibility: hidden;
}
#wagtail .select2-selection--multiple .select2-selection__choice .select2-selection__choice__remove:before {
    width: 16px;
    height: 16px;
    margin-left: 1em;
    font-family: wagtail;
    visibility: visible;
    display: block;
    color: #d9d9d9;
    content: "";
}
#wagtail .select2-selection--multiple .select2-selection__choice .select2-selection__choice__remove:hover:before {
    color: #cd3238;
}

/* search box wrapper */
#wagtail .select2-search.select2-search--inline {
    display: block;
    float: left;
    line-height: 1.5em;
    font-weight: 300;
    font-size: 1.2em;
}
/* search box input */
#wagtail .select2-search__field {
    box-sizing: border-box;
    box-shadow: none;
    border: none;
    margin: 0;
    width: inherit;
    background-color: inherit;
    outline: none;
    display: inline-block;
    padding: 0.2em 0.5em;
}

/* dropdown showing results */
#wagtail .select2-dropdown {
    border-color: #d9d9d9;
}
#wagtail .select2-container--classic .select2-results__option--highlighted[aria-selected] {
    background-color: #43b1b0;
}

#wagtail .select2-selection.select2-selection--single {
    height: auto;
    background: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    box-sizing: border-box;
    border-radius: 6px;
    width: 100%;
    font-family: Open Sans,Arial,sans-serif;
    border: 1px solid #e6e6e6;
    padding: .9em 1.2em;
    background-color: #fafafa;
    color: #333;
    font-size: 1.2em;
    font-weight: 300;
    outline: none;
}

#wagtail .select2-selection.select2-selection--single:focus,
#wagtail .select2-container--open .select2-selection.select2-selection--single {
    background-color: #f4fcfc;
    border-color: #54d0d0;
    outline: none;
}

#wagtail .select2-selection.select2-selection--single .select2-selection__arrow {
    display: none;
}

#wagtail .select2-selection.select2-selection--single .select2-selection__rendered {
    line-height: unset;
    padding: 0;
}

#wagtail .collection_select2_widget .select2.select2-container {
    width: calc(100% - 10px) !important;
}
#wagtail .collection_select2_widget .select2.select2-container::after {
    visibility: hidden;
}

#wagtail .collection_select2_widget .select2-selection--single {
    height: 3rem;
}
