/* NEWS SECTION */

.news-section {
    padding: 5rem 0;
    background-color: var(--color-secondary);
}

.news-layout {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

.news-card {
    background-color: var(--color-secondary);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.news-card a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.news-card a:hover {
    text-decoration: none;
}

.news-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    display: block;
}

.news-content {
    padding: 1.5rem;
}

.news-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-primary);
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
}

.news-date {
    font-size: 0.875rem;
    font-weight: 400;
    color: #666;
    margin: 0;
}

/* Адаптивность */
@media (max-width: 1200px) {
    .news-layout {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .news-section {
        padding: 3rem 0;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 2rem;
    }
    
    .section-title {
        font-size: 1.875rem;
    }
    
    .news-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Скрываем 3-ю и 4-ю новости на мобильных только на главной странице (не на странице /news/) */
    .news-section:not(.news-list-page) .news-layout .news-card:nth-child(n+3) {
        display: none;
    }
    
    .news-image {
        height: 300px;
    }
    
.section-button {
    padding: 1rem 2rem;
    font-size: 1rem;
    width: 100%;
    max-width: 300px;
}

.news-year-filter {
    display: flex;
    align-items: center;
}

.news-year-select {
    padding: 0.5rem 2rem 0.5rem 1rem;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    background-color: var(--color-secondary);
    color: var(--color-primary);
    font-size: 1rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    transition: border-color 0.3s ease;
}

.news-year-select:hover {
    border-color: #34a8a8;
}

.news-year-select:focus {
    outline: none;
    border-color: #34a8a8;
}

.news-pagination {
    margin-top: 3rem;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.news-pagination .bx-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0 auto;
    flex-wrap: wrap;
    width: auto;
}

.news-pagination .bx-pagination a,
.news-pagination .bx-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0.5rem;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    background-color: var(--color-secondary);
    color: var(--color-primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.news-pagination .bx-pagination a:hover {
    border-color: #34a8a8;
    color: #34a8a8;
}

.news-pagination .bx-pagination .bx-active {
    background-color: #FDE895;
    color: var(--color-secondary);
    border-color: #FDE895;
}

.news-pagination .bx-pagination .bx-pag-next,
.news-pagination .bx-pagination .bx-pag-prev {
    font-weight: 600;
}

.news-pagination .bx-pagination .bx-pag-next:hover,
.news-pagination .bx-pagination .bx-pag-prev:hover {
    background-color: #FDE895;
    border-color: #FDE895;
    color: var(--color-button-text);
}

/* Центрирование пагинации для других блоков */
.section-button-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
}

.section-button-wrapper .bx-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0 auto;
    flex-wrap: wrap;
    width: auto;
}

@media (max-width: 600px) {
    .news-section {
        padding: 2rem 0;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .news-layout {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    /* Скрываем 3-ю и 4-ю новости на мобильных только на главной странице (не на странице /news/) */
    .news-section:not(.news-list-page) .news-layout .news-card:nth-child(n+3) {
        display: none;
    }
    
    .news-card {
        border-radius: 0;
    }
    
    .news-image {
        height: 200px;
        width: 100%;
    }
    
    .news-year-select {
        font-size: 0.875rem;
        padding: 0.5rem 1.75rem 0.5rem 0.75rem;
    }
    
    .section-button {
        min-width: 335px;
    }
}
