/**
 * @file
 * Stylesheet for the Linkit module.
 */
.js input.form-linkit-autocomplete {
  background-image: url("data:image/svg+xml,%3csvg width='40' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M8 1C3.46.827-.188 5.787 1.313 10.068c1.176 4.384 6.993 6.417 10.637 3.7.326-.39.565.276.846.442l3.74 3.739 1.413-1.414-4.35-4.35c2.811-3.468 1.15-9.247-3.062-10.71A7.003 7.003 0 008 1zm0 2c3.242-.123 5.849 3.42 4.777 6.477-.842 3.132-4.994 4.58-7.6 2.65-2.745-1.73-2.9-6.125-.285-8.044A5.006 5.006 0 018 3z' fill='%23868686'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: 100% center;
}

.js[dir="rtl"] input.form-linkit-autocomplete {
  background-image: url("data:image/svg+xml,%3csvg width='40' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 1c4.54-.173 8.188 4.787 6.687 9.068-1.176 4.384-6.993 6.417-10.637 3.7-.326-.39-.565.276-.846.442l-3.74 3.739-1.413-1.414 4.35-4.35C3.59 8.717 5.25 2.938 9.462 1.475A7.003 7.003 0 0112 1zm0 2c-3.242-.123-5.849 3.42-4.777 6.477.842 3.132 4.994 4.58 7.6 2.65 2.745-1.73 2.9-6.125.285-8.044A5.006 5.006 0 0012 3z' fill='%23868686'/%3e%3c/svg%3e");
  background-position: 0 50%;
}

.js input.form-linkit-autocomplete.ui-autocomplete-loading {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' height='20' width='40'%3e%3cstyle%3e%40keyframes s%7b0%25%7btransform:rotate(0deg) translate(-50%25,0)%7d50%25%7btransform:rotate(430deg) translate(-50%25,0);stroke-dashoffset:20%7dto%7btransform:rotate(720deg) translate(-50%25,0)%7d%7d%3c/style%3e%3ccircle fill='none' cy='5' cx='5' stroke='%23003ecc' stroke-dashoffset='6.125' stroke-dasharray='25' style='animation:s 1s linear infinite;transform-origin:left' r='4'/%3e%3c/svg%3e");
  background-position: center right -10px;
}

.js[dir="rtl"] input.form-linkit-autocomplete.ui-autocomplete-loading {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' height='20' width='40'%3e%3cstyle%3e%40keyframes s%7b0%25%7btransform:rotate(0deg) translate(-50%25,0)%7d50%25%7btransform:rotate(-430deg) translate(-50%25,0);stroke-dashoffset:20%7dto%7btransform:rotate(-720deg) translate(-50%25,0)%7d%7d%3c/style%3e%3ccircle fill='none' cy='5' cx='5' stroke='%23003ecc' stroke-dashoffset='6.125' stroke-dasharray='25' style='animation:s 1s linear infinite;transform-origin:left' r='4'/%3e%3c/svg%3e");
  background-position: center left 10px;
}

/* Override the default jQuery UI theme */
.linkit-ui-autocomplete {
  position: relative;
  overflow: auto;
  max-height: calc((100vh - 80px) / 2);
}

:not(.ck) > .linkit-ui-autocomplete.ui-widget {
  position: absolute;
  max-width: inherit;
  font-size: 0.9em;
  &.ck-reset_all-excluded {
    white-space: break-spaces;
  }
}

.linkit-ui-autocomplete.ui-menu .linkit-result-line-wrapper {
  margin: 0;
  padding: 5px 7px;
}

.linkit-ui-autocomplete.ui-menu .linkit-result-line-wrapper.unpublished {
  background: #fff4f4;
}

.linkit-ui-autocomplete.ui-menu .linkit-result-line-wrapper.ui-state-focus,
.linkit-ui-autocomplete.ui-menu .linkit-result-line-wrapper.ui-state-active {
  color: #fff;
  border: 0;
  border-bottom: 1px solid #bfbfbf;
  background: #0075ba;
}

.ui-autocomplete
  .linkit-result-line-wrapper.ui-menu-item-wrapper.ui-state-active,
.ui-autocomplete
  .linkit-result-line-wrapper.ui-menu-item-wrapper.ui-state-focus {
  background: #bfbfbf;
}

.linkit-result-line:not(:last-of-type) {
  border-bottom: 1px solid #bfbfbf;
}

.ui-menu .linkit-result-line--group.ui-menu-divider {
  height: auto;
  margin: 0;
  padding: 3px;
  text-align: center;
  color: #555;
  border-bottom: 1px solid #bfbfbf;
  background-color: #e7e7e7;
  font-size: 0.9em;
  font-weight: 600;
  line-height: inherit;
}

.linkit-result-line--title {
  display: block;
  font-weight: 600;
}

.linkit-result-line--description {
  display: block;
  font-size: 0.9em;
  line-height: 1.3;
}

.linkit-result-line--description img {
  display: block;
}

/* Required to accommodate CKEditor v45 UI changes. See #3532814 */
.ck.ck-form.ck-link-form.ck-vertical-form,
.ck.ck-form.ck-link-form.ck-responsive-form {
  width: fit-content;
  min-width: 340px;
  max-width: 640px;
}

.ck.ck-button-action.ck-button_with-text {
  min-width: 60px !important;
}

.ck-link-form .linkit-ui-autocomplete,
.ck-link-form .linkit-ui-autocomplete * {
  white-space: break-spaces;
  word-wrap: break-word;
  word-break: normal;
}
