/* Стили страницы категории материалов. Подключить после style.css / style.add.css */

.materials-page__header {
    margin-bottom: 32px;
}

.materials-page__title {
    max-width: 920px;
}

.materials-page__main {
    padding-bottom: 48px;
}

.materials-page__empty {
    margin: 48px 0;
    padding: 32px;
    text-align: center;
    font-size: 18px;
    line-height: 150%;
    color: #7b7b7b;
    background: #f7f7f7;
    border-radius: 8px;
}

.materials-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    align-items: stretch;
}

.material-card {
    height: 100%;
    min-width: 0;
}

.material-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none;
    background: #fff;
    border: 1px solid #eaeaea;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.material-card__link:hover {
    border-color: #455999;
    box-shadow: 0 12px 32px rgba(69, 89, 153, 0.12);
    transform: translateY(-2px);
}

.material-card__media {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f0f0f0;
}

.material-card__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(34, 34, 34, 0) 55%, rgba(34, 34, 34, 0.08) 100%);
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.material-card__link:hover .material-card__media::after {
    opacity: 0.6;
}

.material-card__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.material-card__link:hover .material-card__img {
    transform: scale(1.04);
}

.material-card__body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 12px;
    padding: 20px 20px 24px;
}

.material-card__date {
    font-size: 13px;
    line-height: 150%;
    color: #7b7b7b;
    letter-spacing: 0.02em;
}

.material-card__title {
    margin: 0;
    font-size: 20px;
    font-weight: 500;
    line-height: 130%;
    color: #222;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.25s ease;
}

.material-card__link:hover .material-card__title {
    color: #455999;
}

.material-card__excerpt {
    margin: 0;
    flex-grow: 1;
    font-size: 14px;
    line-height: 160%;
    color: #7b7b7b;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.material-card__more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    font-size: 16px;
    line-height: 160%;
    color: #455999;
    transition: color 0.25s ease, gap 0.25s ease;
}

.material-card__more svg {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

.material-card__link:hover .material-card__more {
    color: #52006c;
    gap: 12px;
}

.materials-page .pagination,
.materials-page .pager {
    margin-top: 40px;
}

@media only screen and (max-width: 1299px) {
    .materials-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media only screen and (max-width: 991px) {
    .materials-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .materials-page__header {
        margin-bottom: 24px;
    }
}

@media only screen and (max-width: 767px) {
    .materials-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .materials-page__main {
        padding-bottom: 32px;
    }

    .material-card__body {
        padding: 16px 16px 20px;
        gap: 8px;
    }

    .material-card__title {
        font-size: 18px;
    }

    .material-card__excerpt {
        font-size: 13px;
        -webkit-line-clamp: 2;
    }

    .material-card__more {
        font-size: 14px;
    }

    .material-card__more svg {
        width: 20px;
        height: 20px;
    }

    .materials-page__empty {
        margin: 24px 0;
        padding: 24px 16px;
        font-size: 16px;
    }
}
