/* projects_category.css */

/* Основные стили страницы */
.main-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px 100px;
}

/* Стиль заголовка категории */
.category-title {
    font-size: 45px;
    font-weight: 500;
    margin-bottom: 60px;
    line-height: 1.2;
    color: #333;
}

/* Сетка проектов */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
    gap: 40px;
    margin-bottom: 60px;
}

/* Карточка проекта с фиксированной структурой */
.project-card {
    display: flex;
    flex-direction: column;
    border: 2px solid #d0d0d0;
    border-radius: 54.5px;
    padding: 40px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    height: 580px; /* Фиксированная высота */
    box-sizing: border-box;
    background-color: #fcfcfc;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border-color: #333;
}

/* Контейнер для текста с ограничением по высоте */
.project-text-container {
    height: 180px; /* Фиксированная высота для текста */
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-bottom: 30px;
    overflow: hidden; /* Скрываем текст, выходящий за пределы */
}

/* Заголовок проекта с ограничением в 3 строки */
.project-title {
    font-size: 28px;
    font-weight: 500;
    line-height: 1.3;
    color: #333;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Ограничение до 3 строк */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Контейнер изображения - фиксированной высоты */
.project-image-container {
    width: 100%;
    height: 350px; /* Фиксированная высота */
    overflow: hidden;
    border-radius: 25px;
    position: relative;
    margin-top: auto; /* Прижимаем изображение к низу */
}

/* Изображение проекта */
.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-card:hover .project-image {
    transform: scale(1.03);
}

/* Адаптивность */
@media (max-width: 1440px) {
    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    }
}

@media (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
        gap: 30px;
    }
    
    .project-card {
        height: 600px;
        padding: 30px;
    }
    
    .project-image-container {
        height: 300px;
    }
    
    .project-text-container {
        height: 150px;
    }
}

@media (max-width: 1024px) {
    .main-content {
        padding: 0 40px;
    }
    
    .category-title {
        font-size: 36px;
        line-height: 1.2;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .project-card {
        padding: 30px;
        max-width: 460px;
        margin: 0 auto;
        width: 100%;
        height: auto;
        min-height: 500px;
    }
    
    .project-title {
        font-size: 26px;
        margin-bottom: 20px;
    }
    
    .project-image-container {
        height: 200px;
    }
    
    .project-text-container {
        margin-bottom: 20px;
        padding: 10px 0;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 0 20px;
    }
    
    .category-title {
        font-size: 28px;
    }
    
    .project-title {
        font-size: 22px;
    }
    
    .project-image-container {
        height: auto;
        max-height: 250px;
    }
    
    .project-card {
        max-width: 100%;
        min-height: 400px;
        padding: 25px;
    }
}