.gallery {
  padding: var(--section-padding-vertical) 0;
  background-color: #ffffff;
}

.gallery-carousel {
  position: relative;
  height: calc(var(--gallery-card-width) * 3 / 4 * 1.12 + 0.5vw);
  overflow: hidden;
}

.gallery-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--gallery-card-width);
  margin-left: calc(var(--gallery-card-width) / -2);
  margin-top: calc(var(--gallery-card-width) * 3 / 4 / -2);
  border-radius: 0.6rem;
  overflow: hidden;
  box-shadow: 0 0.4vw 1.2vw rgba(29, 29, 27, 0.3);
  transform: translateX(calc(var(--slot, 0) * var(--gallery-spacing)));
  transition: var(--transition-smooth);
  z-index: 1;
}

.gallery-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.gallery-card figcaption {
  position: absolute;
  bottom: 0;
  width: 100%;
  padding: 0.5vw;
  text-align: center;
  font-size: 1.1vw;
  color: var(--color-web-background);
  background-color: rgba(0, 0, 0, 0.6);
}

.gallery-card[data-offset="0"] {
  scale: 1.12;
  opacity: 1;
  z-index: 2;
}

.gallery-card[data-offset="1"],
.gallery-card[data-offset="-1"] {
  scale: 0.9;
  opacity: 0.45;
}

.gallery-card:not([data-offset="0"]):not([data-offset="1"]):not([data-offset="-1"]) {
  opacity: 0;
  pointer-events: none;
}

.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 3.2vw;
  height: 3.2vw;
  border: none;
  border-radius: 50%;
  background-color: rgba(33, 56, 81, 0.85);
  color: var(--color-web-background);
  font-size: 1.8vw;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.3s ease;
  z-index: 3;
}

.gallery-arrow:hover {
  background-color: var(--color-primary-foreground);
}

.gallery-prev {
  left: 14vw;
}

.gallery-next {
  right: 14vw;
}
