/* ==========================================================================
   Mitata carousel
   ========================================================================== */

:root {
  --slide-width: min(650px, 80vw);
  --slide-height: auto;
  --card-radius: 30px;

  --side-offset: 260px;
  --side-scale: 0.88;
  --side-opacity: 0.45;
}

.mitata-title {
  text-align: center;
  color: var(--accent);
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 40px;
}

.mitata-wrap {
  position: relative;
  max-width: 1400px;
  margin: auto;
  height: 675px;
}

.mitata-track {
  position: relative;
  height: 100%;
}

.mitata-slide {
  position: absolute;

  width: var(--slide-width);
  aspect-ratio: 918 / 694;
  height: auto;

  left: 50%;
  top: 20px;

  transition:
    transform 0.65s cubic-bezier(0.25, 0.8, 0.25, 1),
    opacity 0.65s ease;
}

.mitata-slide-img-wrap {
  width: 100%;
  height: 100%;
  border-radius: var(--card-radius);
  overflow: hidden;
}

.mitata-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mitata-slide-title {
  position: absolute;
  left: 50%;
  bottom: -75px;
  transform: translateX(-50%);

  background: #006586;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;

  padding: 14px 28px;
  border-radius: 999px;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.slide-center {
  transform: translateX(-50%) scale(1);
  opacity: 1;
  z-index: 3;
}

.slide-center .mitata-slide-title {
  opacity: 1;
}

.slide-left {
  transform: translateX(calc(-50% - var(--side-offset)))
    scale(var(--side-scale));
  opacity: var(--side-opacity);
  z-index: 2;
}

.slide-right {
  transform: translateX(calc(-50% + var(--side-offset)))
    scale(var(--side-scale));
  opacity: var(--side-opacity);
  z-index: 2;
}

.slide-hidden {
  transform: translateX(-50%) scale(0.7);
  opacity: 0;
  z-index: 1;
}

.mitata-nav {
  position: absolute;
  top: calc(20px + (var(--slide-width) * 694 / 918) / 2);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  background: #006586;
  cursor: pointer;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.mitata-nav svg {
  width: 18px;
  height: 18px;
  fill: white;
}

.mitata-prev {
  left: calc(50% - 620px);
}

.mitata-next {
  right: calc(50% - 620px);
}

@media (max-width: 1024px) {
  :root {
    --slide-width: min(600px, 75vw);
    --side-offset: 180px;
    --side-scale: 0.82;
    --side-opacity: 0.35;
  }

  .mitata-wrap {
    height: 575px;
  }

  .mitata-prev {
    left: 20px;
  }

  .mitata-next {
    right: 20px;
  }
}

@media (max-width: 600px) {
  :root {
    --slide-width: 85vw;
    --side-offset: 70px;
    --side-scale: 0.72;
    --side-opacity: 0.3;
  }

  .mitata-wrap {
    height: 360px;
    overflow: hidden;
  }

  .mitata-slide {
    top: 10px;
    aspect-ratio: 918 / 694;
  }

  .mitata-slide-title {
    bottom: -50px;
    font-size: 14px;
    padding: 10px 20px;
    white-space: normal;
    max-width: 85vw;
    text-align: center;
  }

  .mitata-nav {
    width: 38px;
    height: 38px;
  }

  .mitata-nav svg {
    width: 14px;
    height: 14px;
  }

  .mitata-prev {
    left: 8px;
  }

  .mitata-next {
    right: 8px;
  }
}
