/* Стили для кнопок-карточек на главной странице */

.button-container {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
    margin-top: 20px;
    justify-items: start;
    align-items: stretch; /* Выравниваем карточки по высоте */
}

.button-card {
    background: var(--color-bg-field, #E1E5EF); /* Цвет как у поля ввода в forms */
    border: 1px solid rgba(19, 36, 49, 0.06);
    border-radius: 24px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 8px 18px rgba(31, 35, 48, 0.08);
    color: inherit;
    text-decoration: none;
    width: 100%;
    max-width: 400px;
    justify-content: space-between;
    box-sizing: border-box;
    height: 100%; /* Карточки занимают всю доступную высоту */
}

.button-card:hover {
    background: #E1E5EF; /* Оставляем тот же фон, без затемнения */
    box-shadow: 0 10px 22px rgba(31, 35, 48, 0.14);
    border-color: var(--color-link, #266FFF); /* Синяя обводка при ховере */
}

.button-icon {
    width: auto;
    height: auto;
    flex: 0 0 auto;
    border-radius: 0;
    background: transparent; /* Без фона */
    color: var(--color-primary, #132431);
    display: flex;
    align-items: center;
    font-size: 30px;
}

.button-icon img {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

/* При наведении меняем цвет иконки на синий (цвет ссылок из colors.css) */
.button-card:hover .button-icon img {
    /* Фильтр подобран под #266FFF (var(--color-link)) */
    filter: brightness(0) saturate(100%) invert(38%) sepia(96%) saturate(2466%) hue-rotate(209deg) brightness(100%) contrast(101%);
}

.button-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.button-title {
    font-family: 'Source Sans 3', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: var(--color-primary, #132431);
    line-height: 1.2; /* Компактный межстрочный интервал */
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Максимум 2 строки */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 57.6px; /* 24px * 1.2 * 2 строки для выравнивания */
}

.button-description {
    font-family: 'Source Sans 3', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    color: var(--color-text-secondary, rgba(111, 114, 134, 1));
    line-height: 1.4;
    flex: 1; /* Описание занимает оставшееся пространство */
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Максимум 3 строки для описания */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Заголовок секции */
.hero-section-header {
    text-align: center;
    margin-bottom: 40px;
}

.hero-section-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.hero-section-title {
    font-family: 'Source Sans 3', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: var(--color-primary, #132431);
    margin: 0 0 12px 0;
}

.hero-section-description {
    font-family: 'Source Sans 3', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    color: var(--color-text-secondary, rgba(111, 114, 134, 1));
    margin-left: auto;
    margin-right: auto;
    margin-top: 0;
    margin-bottom: 0;
}

@media (max-width: 1920px) {
    .button-container {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Адаптивность для больших экранов */
@media (max-width: 1420px) {
    .button-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Адаптивность для планшетов */
@media (max-width: 1024px) {
    .button-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }
    
    .button-card {
        width: 100%;
        max-width: 100%;
        padding: 20px;
    }
    
    .button-title {
        font-size: 22px;
        min-height: 52.8px; /* 22px * 1.2 * 2 строки */
    }
    
    .button-description {
        font-size: 15px;
    }
    
    .button-icon img {
        width: 50px;
        height: 50px;
    }
    
    .hero-section-title {
        font-size: 28px;
    }
    
    .hero-section-description {
        font-size: 15px;
    }
}

/* Адаптивность для мобильных устройств (768px — 320px): один макет как на 320 */
@media (max-width: 768px) {
    .button-container {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-top: 12px;
    }
    
    .button-card {
        width: 100%;
        max-width: 100%;
        padding: 16px;
        gap: 12px;
        border-radius: 20px;
        display: flex;
        flex-direction: row;
    }
    
    .button-title {
        font-size: 18px;
        min-height: auto;
        height: auto;
        display: flex;
        align-items: center;
    }
    
    .button-description {
        font-size: 13px;
        color: #202020;
        -webkit-line-clamp: 2;
    }
    
    .button-icon {
        width: 40px;
        height: auto;
    }
    
    .button-icon img {
        width: 44px;
        height: 44px;
    }
    
    .hero-section-title {
        width: 295px;
        max-width: 100%;
        font-size: 20px;
        margin-left: auto;
        margin-right: auto;
        text-align: center;
    }
    
    .hero-section-description {
        font-size: 13px;
        text-align: center;
        color: #266FFF;
    }
}
