/**
 * @file
 * Compact multi-value file widget: one slim row per file, bin icon to remove.
 *
 * worksg_base_compact_file_widget() replaces core's draggable table with plain
 * rows, so this works the same under Gin and the front-end theme. Gin styles
 * every .button with !important, so the bin button has to answer in kind.
 */

.worksg-compact-files .worksg-compact-files__item {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0.375rem 0;
  border-bottom: 1px solid var(--gin-border-color, #e0e0e0);
}

.worksg-compact-files .worksg-compact-files__item:first-of-type {
  border-top: 1px solid var(--gin-border-color, #e0e0e0);
}

.worksg-compact-files .worksg-compact-files__item + .js-form-item:not(.worksg-compact-files__item) {
  margin-top: 1rem;
}

.worksg-compact-files .worksg-compact-files__item .form-managed-file,
.worksg-compact-files .worksg-compact-files__item .form-managed-file__main {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  margin: 0;
}

.worksg-compact-files .worksg-compact-files__item .file {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.worksg-compact-files input.worksg-compact-files__remove {
  flex: 0 0 auto;
  width: 2.25rem !important;
  min-width: 0 !important;
  height: 2.25rem !important;
  min-height: 0 !important;
  margin: 0 0 0 auto !important;
  padding: 0 !important;
  overflow: hidden;
  color: transparent !important;
  font-size: 0 !important;
  border: 0 !important;
  border-radius: 0.375rem !important;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' fill='%23666'%3E%3Cpath d='M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z'/%3E%3C/svg%3E") center / 1.25rem no-repeat !important;
  box-shadow: none !important;
  cursor: pointer;
}

.worksg-compact-files input.worksg-compact-files__remove:hover,
.worksg-compact-files input.worksg-compact-files__remove:focus-visible {
  background-color: rgba(215, 34, 34, 0.1) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' fill='%23d72222'%3E%3Cpath d='M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z'/%3E%3C/svg%3E") !important;
}

.worksg-compact-files input.worksg-compact-files__remove:focus-visible {
  outline: 2px solid #d72222 !important;
  outline-offset: 1px !important;
}
