/**
 * Стили для страниц категорий: Новости, Общественная деятельность, Услуги
 *
 * @package Empty_Theme
 */

/* Импорт шрифтов как на главной странице */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&family=Roboto:wght@300;400;500;700;900&display=swap');

/* Общие стили для всех страниц категорий */
.news-page-container,
.public-activity-page-container,
.services-page-container {
    padding: 60px 0;
    margin-top: 140px;
    font-family: 'Roboto', 'Montserrat', sans-serif;
}

.page-header {
    margin-bottom: 50px;
    text-align: center;
    position: relative;
    padding-bottom: 25px;
}

.page-title {
    font-size: 42px;
    font-weight: 800;
    color: #0071CE;
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
    margin-bottom: 15px;
    text-shadow: 1px 1px 2px rgba(0, 113, 206, 0.2);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards;
}

.page-title:after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 0;
    height: 3px;
    background-color: #0071CE;
    transform: translateX(-50%);
    animation: expandWidth 1.2s ease forwards 0.5s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes expandWidth {
    to {
        width: 80px;
    }
}

.page-description {
    max-width: 800px;
    margin: 0 auto;
    font-size: 18px;
    color: #fff;
    line-height: 1.6;
    opacity: 0;
    transform: translateY(15px);
    animation: fadeInUp 0.8s ease forwards 0.3s;
}

/* Сетка новостей */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}

/* Стили карточки */
.news-card {
    background-color: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    opacity: 0;
    transform: translateY(30px);
    animation: cardFadeIn 0.8s ease forwards;
}

/* Задержка анимации для создания эффекта появления по очереди */
.news-grid .news-card:nth-child(1) { animation-delay: 0.1s; }
.news-grid .news-card:nth-child(2) { animation-delay: 0.2s; }
.news-grid .news-card:nth-child(3) { animation-delay: 0.3s; }
.news-grid .news-card:nth-child(4) { animation-delay: 0.4s; }
.news-grid .news-card:nth-child(5) { animation-delay: 0.5s; }
.news-grid .news-card:nth-child(6) { animation-delay: 0.6s; }
.news-grid .news-card:nth-child(7) { animation-delay: 0.7s; }
.news-grid .news-card:nth-child(8) { animation-delay: 0.8s; }
.news-grid .news-card:nth-child(9) { animation-delay: 0.9s; }

@keyframes cardFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.news-card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    flex-shrink: 0;
}

.news-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover .news-thumbnail {
    transform: scale(1.05);
}

.news-date {
    position: absolute;
    bottom: 0;
    left: 0;
    padding: 8px 15px;
    background-color: rgba(0, 113, 206, 0.8);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    border-top-right-radius: 8px;
}

.news-card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    height: 100%;
}

.news-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.3;
    min-height: 52px; /* Примерно две строки текста */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-family: 'Montserrat', sans-serif;
}

.news-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease, transform 0.3s ease;
    display: inline-block;
    position: relative;
}

.news-title a:hover {
    color: #0071CE;
    transform: translateX(5px);
}

.news-title a:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: #0071CE;
    transition: width 0.3s ease;
}

.news-title a:hover:after {
    width: 100%;
}

.news-excerpt {
    font-size: 15px;
    line-height: 1.6;
    color: #666;
    margin-bottom: 20px;
    flex-grow: 1;
    min-height: 72px; /* Примерно 3 строки текста */
    max-height: 96px; /* Примерно 4 строки текста */
    overflow: hidden;
}

.read-more-link {
    display: inline-block;
    padding: 8px 20px;
    background-color: #0071CE;
    color: #fff;
    text-decoration: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    align-self: flex-start;
    margin-top: auto;
    position: relative;
    overflow: hidden;
    z-index: 1;
    box-shadow: 0 4px 10px rgba(0, 113, 206, 0.2);
}

.read-more-link:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, #005da7, #0071CE);
    z-index: -1;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s ease;
}

.read-more-link:hover {
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 113, 206, 0.3);
}

.read-more-link:hover:before {
    transform: scaleX(1);
    transform-origin: left;
}

/* Пагинация */
.pagination {
    text-align: center;
    margin-top: 40px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards 1s;
}

.pagination .page-numbers {
    display: inline-block;
    padding: 8px 15px;
    margin: 0 5px;
    background-color: #f5f5f5;
    color: #333;
    border-radius: 5px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
}

.pagination .page-numbers.current {
    background-color: #0071CE;
    color: #fff;
}

.pagination .page-numbers:hover:not(.current) {
    background-color: #e0e0e0;
}

.pagination .prev,
.pagination .next {
    padding: 8px 15px;
}

/* Сообщение об отсутствии постов */
.no-posts-found {
    text-align: center;
    padding: 50px 0;
    font-size: 18px;
    color: #666;
}

/* Стили для эффекта волны на кнопках */
.read-more-link {
    position: relative;
    overflow: hidden;
}

.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.4);
    width: 100px;
    height: 100px;
    margin-top: -50px;
    margin-left: -50px;
    animation: ripple 0.6s ease-out;
    transform: scale(0);
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* Анимация карточек при прокрутке */
.animate-card {
    animation: fadeInUp 0.6s ease forwards;
}

/* Адаптивные стили */
@media (max-width: 992px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .news-page-container,
    .public-activity-page-container,
    .services-page-container {
        margin-top: 120px;
    }

    .page-title {
        font-size: 28px;
    }

    .news-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 576px) {
    .page-title {
        font-size: 24px;
    }

    .news-card-image {
        height: 180px;
    }

    .news-title {
        font-size: 18px;
    }

    .news-excerpt {
        font-size: 14px;
    }

    .pagination .page-numbers {
        padding: 6px 12px;
        margin: 0 3px;
        font-size: 14px;
    }
}