/* The sources are the original square posters. Each frame is a rectangle
   inside its poster so all mirrors, roofs and wheels stay in the picture. */
.fleet-photo {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: var(--bus-ratio);
  overflow: hidden;
  container-type: size;
  background: #000;
}

.fleet-photo::before {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(100cqw, calc(100cqh * var(--bus-ratio)));
  aspect-ratio: var(--bus-ratio);
  transform: translate(-50%, -50%);
  content: "";
  background: var(--bus-photo) var(--bus-x) var(--bus-y) / var(--bus-scale) auto no-repeat;
}

.fleet-photo[data-family="trunk"] {
  /* 1840 × 545 at (110, 997) */
  --bus-photo: url("media/troncal.jpg");
  --bus-ratio: 3.376146789;
  --bus-scale: 111.304347826%;
  --bus-x: 52.884615385%;
  --bus-y: 66.333998669%;
}

.fleet-photo[data-family="feeder"] {
  /* 1280 × 476 at (170, 984) */
  --bus-photo: url("media/alimentadora.jpg");
  --bus-ratio: 2.689075630;
  --bus-scale: 160%;
  --bus-x: 22.135416667%;
  --bus-y: 62.595419847%;
}

.fleet-photo[data-family="center"] {
  /* 1040 × 467 at (180, 1052) */
  --bus-photo: url("media/centro.jpg");
  --bus-ratio: 2.226980728;
  --bus-scale: 196.923076923%;
  --bus-x: 17.857142857%;
  --bus-y: 66.540164453%;
}
