/* Стили для сетки новостей */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* Стили для карточки новости */
.news-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    height: 100%;
    cursor: pointer;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Контейнер изображения - КВАДРАТНЫЙ */
.news-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1; /* Делает контейнер квадратным */
    overflow: hidden;
    background: #f0f4f8;
    flex-shrink: 0;
}

.news-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Изображение покрывает квадрат */
    transition: transform 0.3s;
}

.news-card:hover .news-image-container img {
    transform: scale(1.05);
}

.image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #00558f 0%, #003d6b 100%);
    color: white;
    font-size: 2rem;
    text-align: center;
}

.image-placeholder div:first-child {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.image-placeholder div:last-child {
    font-size: 0.9rem;
}

/* Контент карточки */
.news-content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Мета-информация (дата и просмотры) */
.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    color: #64748b;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.news-date, .news-views {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Заголовок новости */
.news-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8rem;
}

/* Краткое описание */
.news-excerpt {
    font-size: 0.9rem;
    color: #475569;
    line-height: 1.5;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Теги в карточке */
.news-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto; /* Прижимаем теги к низу */
}

.news-tag {
    display: inline-block;
    padding: 4px 10px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 16px;
    font-size: 0.75rem;
    transition: all 0.3s;
    cursor: pointer;
}

.news-tag:hover {
    background: #00558f;
    color: white;
}

/* Скелетон загрузки */
.skeleton-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.skeleton-image {
    width: 100%;
    aspect-ratio: 1 / 1; /* Квадратный скелетон */
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

.skeleton-content {
    padding: 1.25rem;
}

.skeleton-line {
    height: 12px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 6px;
    margin-bottom: 0.75rem;
}

.skeleton-line.short {
    width: 40%;
}

.skeleton-line.medium {
    width: 70%;
}

.skeleton-line.long {
    width: 100%;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .news-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

        /*.news-image {
            width: 100%;
            height: 200px;
            background: linear-gradient(135deg, #00558f 0%, #003d6b 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 1.1rem;
            overflow: hidden;
            position: relative;
        }

        .news-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .news-image .image-placeholder {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            background: linear-gradient(135deg, #00558f 0%, #003d6b 100%);
            color: white;
        } /*

        .news-content {
            padding: 1.5rem;
        }

        .news-date {
            color: #64748b;
            font-size: 0.9rem;
            margin-bottom: 0.5rem;
            font-weight: normal;
        }

        .news-title {
            font-size: 1.3rem;
            color: #0f172a;
            margin-bottom: 1rem;
            line-height: 1.4;
        }

        .news-excerpt {
            color: #64748b;
            font-size: 0.95rem;
            line-height: 1.5;
            margin-bottom: 1rem;
            font-weight: normal;
            white-space: pre-line; /* Сохраняет переносы строк */
            word-wrap: break-word;
            max-height: 4.5em; /* Ограничиваем высоту */
            overflow: hidden;
            display: -webkit-box;
            -webkit-line-clamp: 3; /* Ограничиваем количество строк */
            -webkit-box-orient: vertical;
        }
        .read-more {
            color: #00558f;
            text-decoration: none;
            font-size: 0.9rem;
            font-weight: bold;
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            transition: color 0.3s;
        }

        .read-more:hover {
            color: #003d6b;
        }

        .news-sidebar {
            background: white;
            border-radius: 12px;
            padding: 2rem;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        }

        .sidebar-title {
            font-size: 1.3rem;
            color: #0f172a;
            margin-bottom: 1.5rem;
            padding-bottom: 0.5rem;
            border-bottom: 2px solid #00558f;
        }

        .archive-list {
            list-style: none;
            padding: 0;
            margin: 0;
        }

        .archive-list li {
            margin-bottom: 0.5rem;
        }

        .archive-list a {
            color: #64748b;
            text-decoration: none;
            transition: color 0.3s;
            display: block;
            padding: 0.5rem 0;
            border-bottom: 1px solid #f1f5f9;
        }

        .archive-list a:hover {
            color: #00558f;
            background: #f8fafc;
            padding-left: 10px;
        }

        .news-layout {
            display: grid;
            grid-template-columns: 2fr 1fr;
            gap: 3rem;
            align-items: start;
        }

        /* Пагинация */
        .pagination {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 0.5rem;
            margin-top: 3rem;
            flex-wrap: wrap;
        }

        .pagination a, .pagination span {
            padding: 0.5rem 1rem;
            border: 1px solid #e2e8f0;
            border-radius: 6px;
            color: #64748b;
            text-decoration: none;
            transition: all 0.3s;
            min-width: 44px;
            text-align: center;
        }

        .pagination a:hover {
            background: #00558f;
            color: white;
            border-color: #00558f;
        }

        .pagination .current {
            background: #00558f;
            color: white;
            border-color: #00558f;
        }

        .pagination .disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        /* Модальное окно */
        .modal {
            display: none;
            position: fixed;
            z-index: 1000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0,0,0,0.5);
            backdrop-filter: blur(5px);
        }

        .modal-content {
            background-color: white;
            margin: 5% auto;
            padding: 0;
            border-radius: 15px;
            width: 90%;
            max-width: 600px;
            max-height: 80vh;
            overflow-y: auto;
            box-shadow: 0 20px 40px rgba(0,0,0,0.3);
            animation: modalSlideIn 0.3s ease-out;
            position: relative;
        }

        @keyframes modalSlideIn {
            from {
                opacity: 0;
                transform: translateY(-50px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .modal-header {
            padding: 2rem 2rem 1rem;
            border-bottom: 1px solid #e2e8f0;
            position: relative;
        }

        .modal-date {
            color: #64748b;
            font-size: 0.9rem;
            margin-bottom: 0.5rem;
        }

        .modal-title {
            font-size: 1.5rem;
            color: #0f172a;
            margin: 0;
            line-height: 1.4;
        }

        .modal-body {
            padding: 1rem 2rem 2rem;
        }


        .modal-image {
            width: 100%;
            height: 0;
            padding-bottom: 100%; 
            margin-bottom: 1.5rem;
            border-radius: 8px;
            overflow: hidden;
            position: relative;
            background: linear-gradient(135deg, #00558f 0%, #003d6b 100%);
        }

        .modal-image img {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
            object-position: center;
        }

        /*.modal-image {
            width: 100%;
            height: 200px;
            background: linear-gradient(135deg, #00558f 0%, #003d6b 100%);
            margin-bottom: 1.5rem;
            border-radius: 8px;
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
        }

        .modal-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        } */

        .modal-content-text {
            color: #374151;
            line-height: 1.6;
            font-size: 1rem;
            white-space: pre-wrap;  
            word-wrap: break-word;
        }

        .close {
            position: absolute;
            right: 20px;
            top: 20px;
            color: #64748b;
            float: right;
            font-size: 2rem;
            font-weight: bold;
            cursor: pointer;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: all 0.3s;
            z-index: 1001;
        }

        .close:hover {
            background: #f1f5f9;
            color: #0f172a;
        }

        /* Адаптивность для страницы новостей */
        @media (max-width: 1024px) {
            .news-layout {
                grid-template-columns: 1fr;
                gap: 2rem;
            }
            
            .news-sidebar {
                order: -1;
            }
        }

        @media (max-width: 768px) {
            .news-container {
                padding: 0 1rem;
            }
            
            .page-header h1 {
                font-size: 2rem;
            }
            
            .news-grid {
                grid-template-columns: 1fr;
            }
            
            .news-card {
                margin-bottom: 1rem;
            }
            
            .modal-content {
                width: 95%;
                margin: 10% auto;
            }
            
            .pagination {
                gap: 0.25rem;
            }
            
            .pagination a, .pagination span {
                padding: 0.5rem 0.75rem;
                font-size: 0.9rem;
            }
        }

    .archive-compact {
        background: white;
        border-radius: 12px;
        overflow: hidden;
        border: 1px solid #e2e8f0;
        margin-bottom: 20px;
    }

    .archive-year {
        border-bottom: 1px solid #e2e8f0;
    }

    .archive-year:last-child {
        border-bottom: none;
    }

    .archive-year-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px 20px;
        background: #f8fafc;
        cursor: pointer;
        transition: all 0.3s;
        user-select: none;
    }

    .archive-year-header:hover {
        background: #f1f5f9;
    }

    .archive-year-header.active {
        background: #e2e8f0;
    }

    .archive-year-title {
        font-weight: 600;
        color: #0f172a;
        font-size: 1.1rem;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .archive-year-count {
        background: #00558f;
        color: white;
        padding: 2px 10px;
        border-radius: 20px;
        font-size: 0.85rem;
        font-weight: 500;
    }

    .archive-year-toggle {
        color: #64748b;
        font-size: 1.2rem;
        transition: transform 0.3s;
    }

    .archive-year-header.active .archive-year-toggle {
        transform: rotate(180deg);
    }

    .archive-months {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out;
        background: white;
    }

    .archive-months.show {
        max-height: 500px; /* Достаточно для всех месяцев */
        transition: max-height 0.5s ease-in;
    }

    .archive-month {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 20px 12px 40px;
        border-bottom: 1px solid #f1f5f9;
        cursor: pointer;
        transition: all 0.2s;
    }

    .archive-month:last-child {
        border-bottom: none;
    }

    .archive-month:hover {
        background: #f8fafc;
        padding-left: 45px;
    }

    .archive-month.active {
        background: #f0f9ff;
        border-left: 3px solid #00558f;
    }

    .archive-month-name {
        color: #374151;
        font-size: 0.95rem;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .archive-month-count {
        background: #e2e8f0;
        color: #475569;
        padding: 2px 8px;
        border-radius: 16px;
        font-size: 0.8rem;
        font-weight: 500;
    }

    .archive-month.active .archive-month-count {
        background: #00558f;
        color: white;
    }

    /* Компактный режим для мобильных */
    @media (max-width: 768px) {
        .archive-year-header {
            padding: 12px 15px;
        }
        
        .archive-month {
            padding: 10px 15px 10px 35px;
        }
    }

    .sidebar-title {
        display: flex;
        align-items: center;
        gap: 8px;
        margin: 0 0 15px 0;
    }

    .sidebar-icon {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }

     .sidebar-eye {
        width: 15px;
        height: 15px;
        flex-shrink: 0;
    }   


    /* Если используете SVG код, иконка будет наследовать цвет текста */
    .sidebar-icon {
        color: inherit;
    }

    .news-meta {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0.5rem;
        font-size: 0.85rem;
        color: #64748b;
    }

    .news-date {
        display: inline-flex;
        align-items: center;
        gap: 4px;
    }

    .news-views {
        display: inline-flex;
        align-items: center;
        gap: 4px;
    }

    .news-card-tags {
        margin: 0.5rem 0;
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .news-tag {
        display: inline-block;
        padding: 4px 10px;
        background: #f1f5f9;
        color: #374151;
        border-radius: 16px;
        font-size: 0.75rem;
        text-decoration: none;
        transition: all 0.3s;
        cursor: pointer;
    }

    .news-tag:hover {
        background: #00558f;
        color: white;
    }


    /* Анимация обновления просмотров */
@keyframes viewsUpdate {
    0% { transform: scale(1); color: #00558f; }
    50% { transform: scale(1.2); color: #ff6b6b; }
    100% { transform: scale(1); color: #64748b; }
}

.news-views-updated {
    animation: viewsUpdate 0.5s ease-out;
}