/* Shared by the Astro, React and Vanilla FileInput variants. The visible
   control is an .exo-button, styled by button.css (load it too). */

.exo-file-input {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--exo-space-3, 8px);
  max-width: 100%;
  vertical-align: middle;
}

/* Visually hidden, but still in the form and holding the files. */
.exo-file-input__input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.exo-file-input__button {
  flex: none;
}

.exo-file-input__name {
  min-width: 0;
  overflow: hidden;
  font-family: var(--exo-font-family-sans, system-ui, sans-serif);
  font-size: var(--exo-font-size-sm, 14px);
  line-height: var(--exo-font-line-height-snug, 1.25);
  color: var(--exo-color-text-muted, #666666);
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Drop target: shown while a file is dragged over a droppable FileInput. */
.exo-file-input__overlay {
  position: absolute;
  inset: calc(-1 * var(--exo-space-1, 4px));
  z-index: 1;
  display: none;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 0 var(--exo-space-3, 8px);
  font-family: var(--exo-font-family-sans, system-ui, sans-serif);
  font-size: var(--exo-font-size-sm, 14px);
  font-weight: var(--exo-font-weight-medium, 500);
  color: var(--exo-color-accent, #2f5fdb);
  white-space: nowrap;
  background: color-mix(in srgb, var(--exo-color-accent, #2f5fdb) 10%, var(--exo-color-bg, #ffffff));
  border: var(--exo-border-width-1, 1px) dashed var(--exo-color-accent, #2f5fdb);
  border-radius: var(--exo-radius-3, 6px);
  /* Let drag events reach the wrapper, so leaving it is tracked the same way. */
  pointer-events: none;
}

.exo-file-input--dragging > .exo-file-input__overlay {
  display: flex;
}
