/* Focal-point crop: --img-pos-x/-y (0-100) and --img-pos-zoom (>= 1) on a [data-img-pos] wrapper. */

.psv-img {
  width: 100%;
  aspect-ratio: var(--img-aspect, 4 / 3);
}

[data-img-pos] {
  display: block;
  overflow: hidden;
  container-type: size;
  --img-pos-x: 50;
  --img-pos-y: 50;
  --img-pos-zoom: 1;
}

[data-img-pos] > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position:
    clamp(100%, calc(50cqw - (var(--img-pos-x) / 100) * (100cqw - 100%)), 0%)
    clamp(100%, calc(50cqh - (var(--img-pos-y) / 100) * (100cqh - 100%)), 0%);
  transform: scale(var(--img-pos-zoom));
  transform-origin: center;
}
