/* Work stages section (shortcode) */

.bs-work-stages {
  padding: 40px 0;
  background: #212121;
}

.bs-work-stages__title {
  margin: 0 0 20px;
  color: #fff;
  text-transform: uppercase;
  text-align: center;
  font-weight: 500;
  font-size: 28px;
  line-height: 1.05;
}

.bs-work-stages__title-accent {
  color: #fcba1d;
}

.bs-work-stages__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.bs-work-stages__item {
  min-height: 78px;
  border: 1px solid #fff;
  border-radius: 10px;
  padding: 14px 14px 12px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: transparent;
  grid-column: span 1;
}

.bs-work-stages__item.is-highlighted {
  background: #fcba1d;
  border-color: #fcba1d;
  color: #212121;
  grid-column: span 1;
}

/* Mobile: highlighted stretches only when it is the only item in last row */
@media (max-width: 767.98px) {
  .bs-work-stages__grid > .bs-work-stages__item.is-highlighted:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

.bs-work-stages__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.bs-work-stages__badge {
  min-height: 24px;
  padding: 3px 12px;
  border-radius: 25.5px;
  background: #fcba1d;
  color: #212121;
  font-size: 10px;
  line-height: 1.6;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.bs-work-stages__item.is-highlighted .bs-work-stages__badge {
  border: 1px solid #212121;
}

.bs-work-stages__icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.bs-work-stages__item.is-highlighted .bs-work-stages__icon {
  border: 1px solid #212121;
  background-color: transparent;
}

.bs-work-stages__icon img {
  display: block;
  width: 10.5px;
  height: 10.5px;
  object-fit: contain;
}

.bs-work-stages__text {
  margin: 0;
  font-size: 12px;
  line-height: 1.17;
  color: inherit;
}

@media (min-width: 768px) {
  .bs-work-stages {
    padding: 50px 0;
  }

  .bs-work-stages__title {
    font-size: 28px;
    margin-bottom: 28px;
  }

  .bs-work-stages__grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    max-width: 900px;
    margin: 0 auto;
  }

  .bs-work-stages__item {
    min-height: 85px;
    padding: 12px 16px 14px;
    grid-column: span 2;
  }

  /* If last row has 1 item (3-column layout), stretch full row */
  .bs-work-stages__grid > .bs-work-stages__item:last-child:nth-child(3n + 1):not(.is-highlighted) {
    grid-column: span 6;
  }

  /* If last row has 2 items (3-column layout), make both 50/50 */
  .bs-work-stages__grid > .bs-work-stages__item:nth-last-child(2):nth-child(3n + 1),
  .bs-work-stages__grid > .bs-work-stages__item:last-child:nth-child(3n + 2) {
    grid-column: span 3;
  }

  .bs-work-stages__item.is-highlighted {
    grid-column: span 2;
  }

  .bs-work-stages__meta {
    margin-bottom: 10px;
    gap: 10px;
  }

  .bs-work-stages__badge {
    min-height: 32px;
    font-size: 12px;
    line-height: 1;
    padding: 8px 14px;
    min-width: 67px;
    justify-content: center;
  }

  .bs-work-stages__icon {
    width: 32px;
    height: 32px;
  }

  .bs-work-stages__icon img {
    width: 14px;
    height: 14px;
  }

  .bs-work-stages__text {
    font-size: 14px;
    line-height: 1.14;
  }
}

@media (min-width: 1200px) {
  .bs-work-stages {
    padding: 50px 0;
  }

  .bs-work-stages__title {
    font-size: 28px;
    margin-bottom: 30px;
  }

  .bs-work-stages__grid {
    gap: 15px;
  }

  .bs-work-stages__item {
    min-height: 85px;
  }
}

@media (min-width: 1600px) {
  .bs-work-stages {
    padding: 67px 0 61px;
  }

  .bs-work-stages__title {
    font-size: 28px;
    margin-bottom: 49px;
  }

  .bs-work-stages__grid {
    gap: 20px;
    max-width: 1500px;
  }

  .bs-work-stages__item {
    min-height: 118px;
    padding: 19px 19px 14px;
  }

  .bs-work-stages__badge {
    min-height: 41px;
    border-radius: 25.5px;
    padding: 10px 20px;
    font-size: 18px;
    line-height: 1;
    min-width: 90px;
  }

  .bs-work-stages__icon {
    width: 41px;
    height: 41px;
  }

  .bs-work-stages__icon img {
    width: 20px;
    height: 20px;
  }

  .bs-work-stages__meta {
    margin-bottom: 14px;
  }

  .bs-work-stages__text {
    font-size: 18px;
    line-height: 1.22;
    letter-spacing: 0.23px;
  }
}
