/*
 * @copyright   Copyright (C) 2010-2024 Combodo SAS
 * @license     http://opensource.org/licenses/AGPL-3.0
 */

$ibo-input-image--image-view--min-height: $ibo-size-500 !default;
$ibo-input-image--image-view--background-color: $ibo-color-grey-200 !default;
$ibo-input-image--image-view--border-radius: $ibo-border-radius-500 !default;

$ibo-input-image--edit-buttons--margin-left: 0.5rem !default;
$ibo-input-image--edit-buttons--elements-spacing: $ibo-input-image--edit-buttons--margin-left !default;

.ibo-input-image {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
}

.ibo-input-image--image-view {
  position: relative;
  overflow: hidden;
  min-height: $ibo-input-image--image-view--min-height;
  background-color: $ibo-input-image--image-view--background-color;
  border-radius: $ibo-input-image--image-view--border-radius;
  @extend %ibo-fully-centered-content;

  img[src=""],
  img[src="null"] {
    // Hiding "broken" image when src is not set
    visibility: hidden;
  }

  input[type="file"] {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    opacity: 0;
  }
}

.ibo-input-image--edit-buttons {
  display: flex;
  flex-direction: column;
  margin-left: $ibo-input-image--edit-buttons--margin-left;

  // Overload original siblings rule as buttons are displayed vertically
  .ibo-button + .ibo-button {
    margin-top: $ibo-input-image--edit-buttons--elements-spacing;
    margin-left: 0;
  }
}