body {
  margin: 0;
}

img {
  display: block;
  height: auto;
  width: 100%;
}

.container {
  align-items: center;
  display: flex;
  height: 100vh;
  justify-content: center;
}

.card {
  border: 3px solid hotpink;
  border-radius: 1rem;
  width: 40vw;
  overflow: hidden;
}

.image {
  height: 100%;
  object-fit: cover;
  width: 100%;
  position: absolute;
  top: 0;
}

figcaption {
  padding: 1rem;
}

.ratio-box {
  width: 100%;
  height: 0;
  padding-top: calc(100% * (9/16));
  position: relative;
}