@import "../../assets/styles/theme.scss"; .row.lab-list { position: relative; &::before { content: ""; position: absolute; top: 10%; left: 0; width: 100%; // Увеличиваем ширину на 10%, чтобы занять отступ height: 436px; background-image: url('../../assets/images/backround/bg_labs_block.svg'); background-repeat: no-repeat; background-position: left center; background-size: contain; // Или cover, если нужно заполнить область z-index: -1; transform: translateX(-11.6%); // Смещаем влево, компенсируя padding @media (max-width: 768px) { display: none; // Скрываем картинку на мобильных } } display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); /* Используем 1fr для равных колонок */ justify-content: space-between; gap: $row-gap; max-width: 100%; // Гарантия, что не выйдет за границы width: 100%; box-sizing: border-box; // Учитываем padding и border внутри ширины .card { display: block; position: relative; height: 300px; border-radius: 8px; border-width: 1px; border-style: solid; border-color: transparent; color: $text-secondary; border: 1px solid transparent; .image { position: absolute; object-fit: cover; width: 100%; height: 100%; opacity: 1; transition: opacity 0.3s ease-out; } .card-content { margin: 0; position: absolute; inset: auto 20px 10px 20px; transition: inset .3s; background: none !important; z-index: 2; /* Контент всегда сверху */ h2 { margin: 0; font-size: 20px; font-weight: 600; line-height: 28px; } .hidden { max-height: 0; transition: max-height 0.3s ease-out, opacity 0.3s 0.3s ease-out; opacity: 0; max-width: 80%; p { font-size: 16px; font-weight: 400; line-height: 20px; } .link-label { font-size: 20px; font-weight: 500; line-height: 24px; } } } &:hover .card-content { bottom: 20px; } &:hover .card-content .hidden { max-height: 200px; opacity: 1; transition: max-height 0.3s ease-out, opacity .1s ease-in; } &:hover .image { transition: opacity .3s ease-in; filter: brightness(0.5); /* Затемняем изображение */ } } } // Медиа-запрос для мобильных устройств @media (max-width: 768px) { .row.lab-list { grid-template-columns: repeat(1, minmax(0, 1fr)); } .card { width: 100%; /* Карточка занимает всю ширину своей колонки */ height: 215px !important; /* Устанавливаем минимальную высоту */ } }