.mainpage-banners {
  margin-top: 40px;
}

.mainpage-banners__inner {
  width: 100%;
}

.mainpage-banners__header {
  margin-bottom: 26px;
}

.mainpage-banners__title {
  margin: 0;
  color: var(--text-color);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}

.mainpage-banners__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mainpage-banners__item {
  display: block;
  text-decoration: none;
  outline: none;
}

.mainpage-banners__card {
  position: relative;
  display: block;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background-color: #1f1f1f;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  will-change: transform;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.mainpage-banners__card::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 2px;
  border-radius: 14px;
  background: linear-gradient(90deg, #fe611f 0%, #097efa 100%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;

  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.mainpage-banners__item:nth-child(2n) .mainpage-banners__card::before {
  background: linear-gradient(90deg, #097efa 0%, #fe611f 100%);
}

.mainpage-banners__item:hover .mainpage-banners__card,
.mainpage-banners__item:focus-visible .mainpage-banners__card {
  transform: translateY(-5px) translateZ(0);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.mainpage-banners__item:hover .mainpage-banners__card::before,
.mainpage-banners__item:focus-visible .mainpage-banners__card::before {
  opacity: 1;
}

.mainpage-banners__image {
  display: block;
  width: 100%;
  object-fit: cover;
}

@media only screen and (max-width: 1023px) {
  .mainpage-banners__title {
    font-size: 20px;
  }
}

@media only screen and (min-width: 1024px) {
  .mainpage-banners__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
  }
}
