/* Сетка кейсов на главной в 2 ряда (18.11.2026): большой слева, два справа, ниже три. Телефон — столбик по 3 */
.cases-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: 300px;
  gap: 20px;
  margin-top: 60px;
}
.cases-grid__item {
  position: relative;
  display: flex;
  overflow: hidden;
  border-radius: 16px;
  color: inherit;
  text-decoration: none;
  isolation: isolate;
}
.cases-grid__logo {
  position: absolute;
  z-index: 2;
  top: 20px;
  left: 20px;
  width: 96px;
  height: 66px;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(15, 25, 50, .18);
}
.cases-grid__logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.cases-grid__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.cases-grid__ind {
  font-weight: 500;
  font-size: 15px;
  line-height: 1.3;
  color: #1E65F4;
}
.cases-grid__num {
  margin-top: 18px;
  font-weight: 500;
  font-size: 40px;
  line-height: 1.05;
  color: #1E65F4;
}
.cases-grid__num-text {
  margin-top: 6px;
  font-size: 15px;
  line-height: 1.4;
  color: #3F4162;
}
.cases-grid__title {
  margin-top: 18px;
  font-weight: 500;
  font-size: 18px;
  line-height: 1.3;
  color: #191B36;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
  overflow: hidden;
}

/* Карточки-фото: текст поверх обложки, снизу затемнение, подпись отрасли — темной плашкой */
.case-photo {
  flex-direction: column;
  justify-content: flex-end;
  color: #fff;
  background: #1b2440;
}
.case-photo .cases-grid__cover {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.case-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(12, 19, 35, 0) 18%, rgba(12, 19, 35, .62) 52%, rgba(12, 19, 35, .95) 100%);
}
.case-photo:hover .cases-grid__cover {
  transform: scale(1.03);
}
.case-photo .cases-grid__body {
  padding: 24px 28px 28px;
}
.case-photo .cases-grid__ind {
  align-self: flex-start;
  padding: 5px 12px;
  border-radius: 8px;
  background: rgba(12, 19, 35, .6);
  font-size: 14px;
  color: #fff;
}
.case-photo .cases-grid__num {
  color: #fff;
}
.case-photo .cases-grid__num-text {
  color: #DCE4F7;
}
.case-photo .cases-grid__title {
  margin-top: 12px;
  font-size: 21px;
  color: #fff;
  -webkit-line-clamp: 3;
}
.case-photo--big {
  grid-column: 1 / span 3;
  grid-row: span 2;
}
.case-photo--big .cases-grid__logo {
  top: 28px;
  left: 28px;
  width: 128px;
  height: 88px;
}
.case-photo--big .cases-grid__body {
  max-width: 640px;
  padding: 40px 44px;
}
.case-photo--big .cases-grid__num {
  font-size: 72px;
}
.case-photo--big .cases-grid__num-text {
  font-size: 18px;
}
.case-photo--big .cases-grid__title {
  margin-top: 28px;
  font-size: 26px;
  -webkit-line-clamp: 5;
}
.case-photo--big.is-nonum .cases-grid__title {
  margin-top: 14px;
  font-size: 32px;
}
.case-photo--half {
  grid-column: span 3;
  grid-row: span 2;
}
.case-photo--wide {
  grid-column: 1 / -1;
  grid-row: span 2;
}
.case-photo--s2 {
  grid-column: span 2;
}
.case-photo--s3 {
  grid-column: span 3;
}
.case-photo--s6 {
  grid-column: 1 / -1;
}

/* Горизонтальная карточка справа от большой: картинка и текст */
.case-row {
  grid-column: 4 / span 3;
  display: grid;
  grid-template-columns: 42% minmax(0, 1fr);
  border: 1px solid #EBEEF5;
  background: #fff;
  transition: border-color .3s ease;
}
.case-row:hover {
  border-color: #1E65F4;
}
.case-row__pic {
  position: relative;
  display: block;
  overflow: hidden;
  background: #F6F8FE;
}
.case-row__pic .cases-grid__cover {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.case-row__pic .cases-grid__logo {
  top: 16px;
  left: 16px;
}
.case-row .cases-grid__body {
  padding: 26px 26px 28px;
}
.case-row .cases-grid__ind {
  margin-bottom: auto;
}
.case-row.is-nonum .cases-grid__title {
  font-size: 22px;
}

.cases-grid__more [hidden] {
  display: none;
}

/* Планшет: две колонки, большой и горизонтальные — на всю ширину */
@media (max-width: 1023px) {
  .cases-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: auto;
    margin-top: 40px;
  }
  .case-photo--big,
  .case-photo--wide,
  .case-photo--s6,
  .case-row {
    grid-column: 1 / -1;
  }
  .case-photo--big,
  .case-photo--wide {
    grid-row: auto;
    min-height: 440px;
  }
  .case-photo--half,
  .case-photo--s2,
  .case-photo--s3 {
    grid-column: span 1;
    grid-row: auto;
    min-height: 300px;
  }
  .case-photo--s6 {
    min-height: 300px;
  }
  .case-row {
    min-height: 260px;
  }
}

/* Телефон: кейсы друг под другом, сначала три, остальное — по кнопке «Показать еще» */
@media (max-width: 767px) {
  .cases-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
  }
  .cases-grid__item.is-collapsed {
    display: none;
  }
  .case-photo,
  .case-photo--big,
  .case-photo--wide,
  .case-photo--half,
  .case-photo--s2,
  .case-photo--s3,
  .case-photo--s6 {
    min-height: 300px;
  }
  .case-photo--big {
    min-height: 420px;
  }
  .case-photo .cases-grid__body,
  .case-photo--big .cases-grid__body {
    padding: 20px;
  }
  .case-photo--big .cases-grid__num {
    font-size: 44px;
  }
  .case-photo .cases-grid__title,
  .case-photo--big .cases-grid__title {
    font-size: 20px;
    -webkit-line-clamp: 5;
  }
  .case-photo--big.is-nonum .cases-grid__title {
    font-size: 24px;
  }
  .case-row {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .case-row__pic {
    flex: none;
    height: 200px;
  }
  .case-row .cases-grid__body {
    padding: 18px 20px 22px;
  }
  .case-row .cases-grid__ind {
    margin-bottom: 0;
  }
  .case-row .cases-grid__title,
  .case-row.is-nonum .cases-grid__title {
    margin-top: 10px;
    font-size: 19px;
  }
  .cases-grid__num {
    margin-top: 10px;
    font-size: 30px;
  }
  .cases-grid__logo,
  .case-photo--big .cases-grid__logo,
  .case-row__pic .cases-grid__logo {
    top: 14px;
    left: 14px;
    width: 80px;
    height: 56px;
    padding: 5px;
    border-radius: 10px;
  }
}
