/* Native images keep their box, src, alt, links and click targets in every state. */
img[data-image-state="loading"],
img[data-image-state="error"] {
  box-sizing: border-box;
  object-fit: contain !important;
  object-position: center;
  content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1' height='1'/%3E");
  background-repeat: no-repeat;
  background-position: center;
  color: #52534d;
  background-color: var(--jtl-image-placeholder, #e9e8e1);
}
img[data-image-state="loading"] {
  --jtl-loading-dots: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='124' height='48' viewBox='0 0 124 48'%3E%3Cg fill='%23848170'%3E%3Ccircle cx='55' cy='23' r='2'/%3E%3Ccircle cx='62' cy='23' r='2' opacity='.65'/%3E%3Ccircle cx='69' cy='23' r='2' opacity='.35'/%3E%3C/g%3E%3C/svg%3E");
  background-image: var(--jtl-loading-dots), linear-gradient(110deg, transparent 30%, #ffffff52 49%, transparent 68%);
  background-size: min(100%,124px) auto, 220% 100%;
  animation: jtl-image-wait 1.5s ease-in-out 3;
}
img[data-image-state="error"] {
  background-size: min(100%,144px) auto;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='144' height='64' viewBox='0 0 144 64'%3E%3Cg fill='none' stroke='%2375746a' stroke-width='1.5'%3E%3Crect x='63' y='7' width='18' height='14' rx='2'/%3E%3Cpath d='m64 19 6-6 4 4 3-3 3 4'/%3E%3C/g%3E%3Ctext x='72' y='42' fill='%2354574e' text-anchor='middle' font-family='sans-serif' font-size='12'%3E%E5%9B%BE%E5%83%8F%E6%9A%82%E4%B8%8D%E5%8F%AF%E7%94%A8%3C/text%3E%3C/svg%3E");
}
@keyframes jtl-image-wait { from {background-position: center, 100% center} to {background-position: center, -100% center} }
@media (prefers-reduced-motion: reduce) {
  img[data-image-state="loading"] { animation: none; background-image: var(--jtl-loading-dots); }
}
