.work {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.work-header {
  width: 100%;
  height: 60px;
  border-radius: 16px;
  border: 1px solid var(--dark-color-10);
  background-color: var(--dark-color-60);
  padding: 12px 12px 12px 24px;
  gap: 32px;
  justify-content: space-between;
  align-items: center;
  font-family: "Kaushan Script", cursive;
  font-weight: 400;
  font-size: 18px;
  color: var(--white-color);
  display: flex;
}

.view-all {
  width: fit-content;
  height: 36px;
  border-radius: 8px;
  padding: 8px 18px;
  font-family: "Geist", sans-serif;
  font-weight: 500;
  font-size: 14px;
  color: var(--dark-pink-90);
  background: none;
  transition: all 0.2s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
  text-decoration: none;
}

.view-all:hover {
  background-color: var(--dark-pink-10);
  transition: all 0.2s ease-in-out;
}

.work-content {
  width: 100%;
  height: fit-content;
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* Две равные колонки */
  gap: 16px;
  opacity: 1;
  transition: opacity 0.3s ease-in-out;
}

.work-content.disable {
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.work-item {
  width: 100%; /* Убрал фиксированную ширину */
  aspect-ratio: 320/298; /* Сохраняет пропорции */
  border-radius: 16px;
  padding: 6px;
  gap: 6px;
  border: 1px solid var(--dark-color-10);
  background-color: var(--dark-color-60);
  display: flex;
  flex-direction: column;
}

.work-item img {
  width: 100%;
  flex: 1; /* Занимает доступное пространство */
  min-height: 0; /* Важно для flex */
  object-fit: cover; /* Сохраняет пропорции изображения */
  border-radius: 12px;
}

.work-item-info {
  width: 100%;
  padding: 6px;
  gap: 6px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.work-item-title {
  font-family: "Geist", sans-serif;
  font-weight: 600;
  font-size: 16px;
  color: var(--white-color);
  line-height: 1.2;
}

.work-item-category {
  font-family: "Geist", sans-serif;
  font-weight: 500;
  font-size: 14px;
  color: var(--white-color-70);
  line-height: 1.2;
}

/* Планшеты и средние экраны */
@media screen and (max-width: 768px) and (min-width: 509px) {
  .work-content {
    gap: 12px;
  }

  .work-header {
    padding: 12px;
  }
}

/* Мобильные устройства */
@media screen and (max-width: 508px) {
  .work-header {
    height: auto;
    min-height: 60px;
    padding: 12px 16px;
    gap: 12px;
  }

  .work-content {
    grid-template-columns: 1fr; /* Одна колонка */
    gap: 12px;
  }

  .work-item {
    aspect-ratio: 1/1; /* Квадратные карточки на мобильных */
  }

  .work-item-info {
    padding: 8px;
  }

  .work-item-title {
    font-size: 18px;
  }

  .work-item-category {
    font-size: 14px;
  }
}

/* Очень маленькие экраны */
@media screen and (max-width: 360px) {
  .work-item-title {
    font-size: 16px;
  }

  .work-item-category {
    font-size: 13px;
  }
}