.page-frontend--projects-page .site-main {
  margin-top: 90px;
}

@media (max-width: 1200px) {
  .page-frontend--projects-page .site-main {
    margin-top: 60px;
  }
}

/* ===== Hero ===== */

.hero {
  padding-top: 50px;
  margin-bottom: 50px;
}

.hero .section-header {
  padding-bottom: 20px;
}

.section-header svg {
  flex-shrink: 0;
}

.hero__breadcrumbs {
  margin-bottom: 37px;
}

.section-header__description {
  margin: 0 0 0 190px;
  color: var(--color-text);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.6;
  text-align: right;
}

@media (max-width: 1200px) {
  .hero {
    margin-bottom: 31px;
  }

  .hero .section-header {
    flex-flow: row wrap;
    padding-bottom: 0;
    border-bottom: none;
  }

  .section-header__description {
    width: 100%;
    flex-shrink: 0;
    margin: 15px 0 0 0;
    padding-top: 25px;
    text-align: left;
    border-top: 2px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
  }
}

@media (max-width: 639px) {
  .hero {
    padding-top: 25px;
    margin-bottom: 25px;
  }

  .hero__breadcrumbs {
    margin-bottom: 25px;
  }
}

/* ===== Карточки ===== */

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  grid-template-rows: repeat(2, auto);
  gap: 20px;
  justify-content: center;
  padding-bottom: 90px;
}

/* Первая строка: одна большая + группа из двух */
.cards>.card:first-child {
  grid-row: 1 / 2;
  grid-column: 1 / 2;
  height: 560px;
}

.card-group {
  display: grid;
  grid-template-rows: repeat(2, 270px);
  gap: 20px;
}

/* Вторая строка: две большие */
.cards>.card:nth-child(3),
.cards>.card:nth-child(4) {
  height: 560px;
}

.card {
  position: relative;
  width: 100%;
  text-decoration: none;
  display: block;
  overflow: hidden;
  border-radius: 3px;
}

.card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  z-index: 1;
}

.card-bg::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.8) 100%);
  z-index: 2;
}

.card-content {
  position: absolute;
  bottom: 30px;
  left: 30px;
  right: 30px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  z-index: 3;
}

.card-text {
  color: var(--color-text);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
}

.card-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  flex-grow: 0;
  width: 46px;
  height: 46px;
  border-radius: 3px;
  transition: background-color 0.3s ease;
}

.card:hover .card-icon {
  background-color: var(--color-primary);
}

.card-bg--1 {
  background-image: url(../img/project-1.jpg);
}

.card-bg--2 {
  background-image: url(../img/project-2.jpg);
}

.card-bg--3 {
  background-image: url(../img/project-3.jpg);
}

.card-bg--4 {
  background-image: url(../img/project-4.jpg);
}

.card-bg--5 {
  background-image: url(../img/project-5.jpg);
}

.text-wrapping--mobile {
  display: none;
}

@media (max-width: 1000px) {
  .cards {
    grid-template-columns: 1fr;
    max-width: none;
  }

  .card-group {
    display: flex;
    flex-direction: column;
  }

  .card-group .card {
    height: 220px;
  }

  .cards>.card:first-child {
    height: 220px;
  }

  .cards>.card:nth-child(3),
  .cards>.card:nth-child(4) {
    height: 220px;
  }

  .card-content {
    bottom: 25px;
    left: 20px;
    right: 20px;
  }

  .card-text {
    max-width: 406px;
    font-size: 14px;
  }

  .text-wrapping--desktop {
    display: none;
  }

  .card-icon {
    width: 26px;
    height: 26px;
  }

  .card-icon svg {
    width: 10px;
    height: 10px;
  }
}

@media (max-width: 639px) {
  .card-group .card {
    height: 300px;
  }

  .cards>.card:first-child {
    height: 300px;
  }

  .cards>.card:nth-child(3),
  .cards>.card:nth-child(4) {
    height: 300px;
  }

  .text-wrapping--mobile {
    display: inline;
  }
}