.mi-event-cards {
  width: 100%;
  --mi-event-desktop-card-width: 378px;
}

.mi-event-cards__title {
  margin: 0 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  text-align: center;
}

.mi-event-cards__title::before {
  content: "";
  width: 12px;
  height: 26px;
  background: #ff4b4b;
  flex: 0 0 auto;
}

.mi-event-cards__grid {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: stretch;
  gap: 30px;
}

.mi-event-cards__controls {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  z-index: 2;
  margin: -10px 0 0;
  padding: 12px 16px 10px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.92) 34px, #fff 64px);
}

.mi-event-cards__status {
  min-width: 68px;
  text-align: center;
  font-weight: 500;
}

.mi-event-cards__arrow {
  width: 48px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  background: #ff4b4b;
  color: #fff;
  transition: opacity 160ms ease, background-color 160ms ease;
}

.mi-event-cards__arrow span {
  display: block;
  line-height: 1;
  transform: translateY(-1px);
}

.mi-event-cards__arrow[disabled] {
  cursor: default;
  background: rgba(255, 75, 75, 0.3);
  opacity: 1;
  color: #fff;
}

@media (min-width: 981px) and (max-width: 1699px) {
  .mi-event-cards.has-4-cards .mi-event-cards__controls {
    display: flex;
  }

  .mi-event-cards.has-4-cards .mi-event-cards__grid {
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    gap: 24px;
    padding: 0 16px 40px;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 16px;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  .mi-event-cards.has-4-cards .mi-event-cards__grid::-webkit-scrollbar {
    display: none;
  }

  .mi-event-cards.has-4-cards .mi-event-cards-item {
    flex: 0 0 var(--mi-event-desktop-card-width);
    width: var(--mi-event-desktop-card-width);
    min-width: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }
}

.mi-event-cards-item {
  width: min(100%, 340px);
  background: #fff;
  border: 1px solid #ff4b4b;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.06), 0 24px 48px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
}

.mi-event-cards-item.is-hidden {
  display: none !important;
}

.mi-event-cards-item__image-wrap {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f4f4f4;
}

.mi-event-cards-item__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mi-event-cards-item__body {
  padding: 22px;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
}

.mi-event-cards-item__title {
  margin: 0 0 12px;
  min-height: 2.6em;
}

.mi-event-cards-item__date {
  font-weight: 700;
  margin-bottom: 14px;
  min-height: 4.5em;
}

.mi-event-cards-item__text {
  margin-bottom: 18px;
  flex: 1 1 auto;
}

.mi-event-cards-item__footer {
  margin-top: auto;
  padding-top: 8px;
}

.mi-event-cards-item__button {
  display: inline-block;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 4px;
  border: 1px solid currentColor;
  color: #ff4b4b;
  background: #fff;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.mi-event-cards-item__button:hover,
.mi-event-cards-item__button:focus-visible {
  background: #ff4b4b;
  color: #fff;
  border-color: #ff4b4b;
  box-shadow: 0 0 0 3px rgba(255, 75, 75, 0.14);
}

.mi-event-cards-item__button:focus-visible {
  outline: none;
}

@media (max-width: 980px) {
  .mi-event-cards__controls {
    display: flex;
  }

  .mi-event-cards-item {
    box-shadow: 0 8px 14px rgba(0, 0, 0, 0.03), 0 12px 20px rgba(0, 0, 0, 0.015);
  }

  .mi-event-cards__title {
    font-size: 1.5rem;
    gap: 10px;
  }

  .mi-event-cards__title::before {
    width: 10px;
    height: 22px;
  }

  .mi-event-cards__grid {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    gap: 16px;
    padding: 0 16px 40px;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 16px;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  .mi-event-cards__grid::-webkit-scrollbar {
    display: none;
  }

  .mi-event-cards-item {
    flex: 0 0 calc(100% - 56px);
    width: calc(100% - 56px);
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }
}

@media (min-width: 768px) and (max-width: 980px) {
  .mi-event-cards-item {
    flex: 0 0 calc(50% - 24px);
    width: calc(50% - 24px);
  }
}

@media (min-width: 1700px) {
  .mi-event-cards {
    padding-left: 24px;
    padding-right: 24px;
    box-sizing: border-box;
  }

  .mi-event-cards__grid {
    gap: 24px;
    justify-content: center;
    overflow: visible;
    padding: 0;
  }

  .mi-event-cards-item {
    flex: 0 0 var(--mi-event-desktop-card-width);
    width: var(--mi-event-desktop-card-width);
    min-width: 0;
  }
}
