/* ==========================================================================
   Блок банера (Заголовок сторінки)
   ========================================================================== */
.nw_banner {
    background-color: #fff;
    height: 136px;
    background-image: url("../img/newsbackground.png");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: contain;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nw_banner_title {
    color: #212121;
    font-size: 36px;
    font-weight: 600;
}

/* ==========================================================================
   Навігація (Таби / Категорії)
   ========================================================================== */
.nw_news-tabs-menu {
    border-bottom: 1px solid #D9D9D9;
    margin: 40px 0;
    padding-bottom: 0;
}

.nw_tabs-list {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 32px;
    overflow-x: auto;
    scrollbar-width: none;
}

.nw_tabs-list::-webkit-scrollbar {
    display: none;
}

.nw_tabs-list li {
    padding-bottom: 12px;
    position: relative;
    white-space: nowrap;
    cursor: pointer;
}

.nw_tabs-list li a {
    text-decoration: none;
    color: #000000;
    font-size: 18px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nw_tabs-list li a:hover {
    color: #4CAF50;
}

.nw_tabs-list li.nw_active {
    border-bottom: 2px solid #4CAF50;
    margin-bottom: -1px;
}

.nw_tabs-list li.nw_active a {
    color: #4CAF50;
}

/* ==========================================================================
   Список карток новин
   ========================================================================== */
/* Контейнер для списку - додаємо плавність переходу */
.nw_news-list-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
    margin-top: 32px;
    padding-bottom: 60px;
    /* Анімація для всього контейнера */
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    will-change: opacity, transform;
}

/* Сама картка - додаємо індивідуальну плавність */
.nw_news-card-item {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    transition: opacity 0.3s ease;
}

/* Стан для JS-фільтрації (приховування) */
.nw_news-card-item[style*="display: none"] {
    opacity: 0;
    pointer-events: none;
}

/* ==========================================================================
   Зображення новини
   ========================================================================== */
.nw_news-card-image {
    flex: 0 0 254px; /* Точна ширина за макетом */
    height: 158px;   /* Точна висота за макетом */
    overflow: hidden;
    border-radius: 4px;
    background-color: #f5f5f5;
}

.nw_news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.nw_news-card-item:hover .nw_news-card-image img {
    transform: scale(1.05);
}

/* ==========================================================================
   Контентна частина картки
   ========================================================================== */
.nw_news-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Дата - вгорі праворуч */
.nw_news-top-info {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 4px;
}

.nw_news-date {
    color: #909090;
    font-size: 14px;
    font-weight: 400;
}

/* Заголовок новини */
.nw_news-title {
    margin: 0 0 12px 0;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.25;
}

.nw_news-title a {
    text-decoration: none;
    color: #212121;
    transition: color 0.2s ease;
}

.nw_news-title a:hover {
    color: #4CAF50;
}

/* Короткий опис (Excerpt) */
.nw_news-excerpt {
    font-size: 16px;
    color: #424242;
    line-height: 1.5;
    margin-bottom: 16px;
    /* Обмеження на 2 рядки для однорідності */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Хештеги (Теги) */
.nw_news-hashtags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.nw_news-hashtags a {
    color: #909090;
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    transition: color 0.2s ease;
}

.nw_news-hashtags a:hover {
    color: #4CAF50;
}

.nw_no-results {
    text-align: center;
    padding: 60px 20px;
    background: #fdfdfd;
    border: 1px dashed #d9d9d9;
    border-radius: 8px;
    margin-top: 20px;
}

.nw_no-results-icon {
    font-size: 50px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.nw_no-results h3 {
    font-size: 22px;
    font-weight: 600;
    color: #212121;
    margin-bottom: 10px;
}

.nw_no-results p {
    font-size: 16px;
    color: #909090;
}

/* Контейнер */
.nw_pagination_wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 60px 0 30px;
}

/* Базовий стиль посилань та чисел */
.nw_pagination_wrapper .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 4px;
    background: #FFFFFF;
    border: 1px solid #E0E0E0;
    border-radius: 6px;
    color: #757575; /* Сірий текст для неактивних */
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
}

/* Стан при наведенні */
.nw_pagination_wrapper a.page-numbers:hover {
    border-color: #909090;
    color: #909090;
    background-color: #f6f6f6;
}

/* Активна сторінка */
.nw_pagination_wrapper .page-numbers.current {
    background-color: #FFFFFF;
    border-color: #909090;
    color: #909090;
    font-weight: 700;
    cursor: default;
    box-shadow: 0 2px 8px #f6f6f6;
}

/* Стилізація стрілок через CSS */
.nw_pag_arrow {
    display: block;
    width: 8px;
    height: 8px;
    border-top: 2px solid #909090;
    border-right: 2px solid #909090;
    transition: border-color 0.2s;
}

.nw_pag_arrow.prev { transform: rotate(-135deg); margin-left: 3px; }
.nw_pag_arrow.next { transform: rotate(45deg); margin-right: 3px; }

.page-numbers:hover .nw_pag_arrow {
    border-color: #909090;
}

/* Крапки (...) */
.nw_pagination_wrapper .dots {
    border: none;
    background: transparent;
    min-width: 20px;
    color: #BDBDBD;
}

/* Обрізка заголовка на 2 рядки з трьома крапками в кінці */
.nw_news-title a {
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Кількість рядків */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    max-height: 2.6em; /* line-height * 2 */
}

/* Обрізка анонсу на 3 рядки */
.nw_news-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #757575;
    margin-bottom: 15px;
}

/* Адаптивність */
@media (max-width: 480px) {
    .nw_pagination_wrapper { gap: 6px; }
    .nw_pagination_wrapper .page-numbers { min-width: 32px; height: 32px; font-size: 13px; }
}

/* ==========================================================================
   Адаптивність (Responsive)
   ========================================================================== */
@media (max-width: 992px) {
    .nw_news-card-image {
        flex: 0 0 220px;
        height: 140px;
    }
}

@media (max-width: 768px) {
    .nw_news-card-item {
        flex-direction: column;
        gap: 16px;
    }

    .nw_news-card-image {
        flex: 0 0 auto;
        width: 100%;
        height: 200px;
    }

    .nw_news-top-info {
        justify-content: flex-start;
        margin-top: 4px;
    }

    .nw_news-title {
        font-size: 20px;
    }
}