.services {
  padding: 60px 0;
  background-color: #fff;
}

.services__row {
  margin-bottom: 20px;
}

.services__grid {
  display: grid;
  grid-template-columns: 3fr 1fr 1fr; /* Початкова розкладка: перший блок розгорнутий */
  gap: 20px;
}

.services__card {
  position: relative;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  border-radius: 8px;
}

.services__card-inner {
  position: relative;
  height: 400px; /* Фіксована висота для десктопа */
  padding: 16px; /* Внутрішній відступ для контенту */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.services__card-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right;
  z-index: 1;
  transition: transform 0.5s ease; /* Плавний зум при ховері (тільки десктоп) */
}

.services__card-image img {
  height: 100%;
}

.services__card-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  z-index: 2;
  position: relative;
  margin: 0;
  opacity: 1; /* Стан за замовчуванням */
  transition: opacity 0.3s ease; /* Плавне зникнення */
}

.services__card-description {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  color: #fff;
  z-index: 2;
  max-width: 300px;
  position: relative;
  margin: 0;
  line-height: 1.4;
  opacity: 1; /* Стан за замовчуванням */
  transition: opacity 0.3s ease; /* Плавне зникнення */
}

/* Приховуємо заголовок і опис для нерозгорнутих карток на десктопі */
.services__card:not(.services__card--expanded):not(
    .services__card--default-expanded
  )
  .services__card-title,
.services__card:not(.services__card--expanded):not(
    .services__card--default-expanded
  )
  .services__card-description {
  opacity: 0; /* Приховано для неактивних карток */
}

/* Ефект ховеру на десктопі */
@media (min-width: 769px) {
  .services__card:hover .services__card-image {
    transform: scale(1.05); /* Легкий зум при ховері */
  }
}

/* Мобільна розкладка (до 768px) */
@media (max-width: 768px) {
  .services {
    padding: 20px 0;
  }
  .services__row {
    margin-bottom: 15px;
  }
  .services__grid {
    display: grid;
    grid-template-columns: 1fr !important; /* Один стовпець на мобільних */
    gap: 15px;
  }

  .services__card-inner {
    height: inherit;
    aspect-ratio: 1 / 1; /* Квадратна форма на мобільних */
  }

  .services__card-image {
    transition: none; /* Відключаємо зум на мобільних */
    object-fit: cover;
    object-position: right;
  }

  .services__card-title {
    font-size: 1.2rem;
    opacity: 1 !important; /* Завжди видно на мобільних */
  }

  .services__card-description {
    font-size: 0.9rem;
    opacity: 1 !important; /* Завжди видно на мобільних */
  }
}
