/*
// Copyright 2024 The Lynx Authors. All rights reserved.
// Licensed under the Apache License Version 2.0 that can be found in the
// LICENSE file in the root directory of this source tree.
*/
x-image, filter-image {
  align-items: center;
  justify-content: center;
  --justify-content: center;
  flex-direction: row !important;
  contain: strict;
  object-fit: fill;
}

x-image > *,
filter-image > * {
  display: none;
}

x-image[blur-radius]::part(img) {
  --blur-radius: 0;
  filter: blur(var(--blur-radius));
}

filter-image[blur-radius]::part(img), filter-image[drop-shadow]::part(img) {
  --blur-radius: 0;
  --drop-shadow: 0px 0px;
  filter: blur(var(--blur-radius)) drop-shadow(var(--drop-shadow));
}

x-image:not([auto-size])::part(img), filter-image::part(img) {
  width: 100%;
  flex: 0 0 100%;
  align-self: stretch;
  object-fit: inherit;
}

x-image[mode="aspectFit"], filter-image[mode="aspectFit"] {
  object-fit: contain;
}

x-image[mode="aspectFill"], filter-image[mode="aspectFill"] {
  object-fit: cover;
}

x-image[mode="center"]:not([auto-size])::part(img),
filter-image[mode="center"]::part(img) {
  position: absolute;
  margin: auto;
  width: unset;
  flex: unset;
  align-self: unset;
}

x-image[auto-size] {
  display: contents;
}

x-image[auto-size]::part(img) {
  margin: inherit;
  padding: inherit;
  width: inherit;
  height: inherit;
  box-sizing: inherit;
  flex: inherit;
  min-width: inherit;
  min-height: inherit;
  border: inherit;
  border-radius: inherit;
  max-width: 100%;
  max-height: 100%;
  position: inherit;
  top: inherit;
  left: inherit;
  right: inherit;
  bottom: inherit;
  transform: inherit;
  opacity: inherit;
  z-index: inherit;
  filter: inherit;
}
