/* news-feed.css */

.news-feed-container {
    margin-top: 50px; /* Space below the heading */
    padding: 20px;
    max-width: 800px; /* Further decreased max-width */
    margin-left: auto;
    margin-right: auto;
}

.news-feed-carousel-wrapper {
    width: 100%;
    overflow: hidden; /* Hide scrollbars */
    position: relative;
    padding-left: 20px; /* Add padding to the left */
    padding-right: 20px; /* Add padding to the right */
}

.news-feed-carousel-wrapper::before,
.news-feed-carousel-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    width: 50px; /* Width of the blur effect */
    height: 100%;
    pointer-events: none; /* Allow interaction with content underneath */
    z-index: 1; /* Ensure it's above the news feed */
}

.news-feed-carousel-wrapper::before {
    left: 0;
    background: linear-gradient(to right, var(--paper-grey), transparent); /* Blur from left */
}

.news-feed-carousel-wrapper::after {
    right: 0;
    background: linear-gradient(to left, var(--paper-grey), transparent); /* Blur from right */
}

@keyframes scrollNews {
    0% { transform: translateX(0); }
    100% { transform: translateX(var(--scroll-width)); }
}

.news-feed {
    display: flex; /* Arrange items in a row */
    gap: 20px; /* Space between news items */
    /* Removed JavaScript-based transition */
    animation: scrollNews linear infinite;
    animation-duration: 30s; /* Adjust duration as needed for desired speed */
}

.news-feed-carousel-wrapper:hover .news-feed {
    animation-play-state: paused;
}

.news-item {
    flex-shrink: 0;
    width: 300px;
    background-color: transparent; /* Overall news-item background should be transparent */
    border-radius: 8px; /* Apply overall rounding */
    box-shadow: none; /* Overall shadow for the card */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Ensure rounded corners clip content */
}

.news-item-image {
    width: 100%;
    height: 150px;
    background-color: var(--lilac-pale); /* Pale lilac background */
    border-top-left-radius: 8px; /* Match news-item border-radius */
    border-top-right-radius: 8px; /* Match news-item border-radius */
    /* No margin-bottom here */
}

.news-item-text {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    /* No justify-content: space-between here, as content will flow */
}

.news-item-title-bar {
    background-color: #808080; /* Darker gray background for title */
    padding: 10px 15px; /* Padding for title bar */
    margin-top: 0; /* Remove any top margin */
}

.news-item-title-bar h3 {
    font-size: 1.2rem;
    margin: 0;
    color: var(--white); /* White text for title */
}

.news-item-content {
    background-color: var(--grey-background); /* Gray background for text content */
    padding: 15px; /* Padding for text content */
    border-bottom-left-radius: 8px; /* Match news-item border-radius */
    border-bottom-right-radius: 8px; /* Match news-item border-radius */
    flex-grow: 1; /* Allow content to take remaining space */
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center text vertically if needed */
}

.news-item-content p {
    font-size: 0.9rem;
    color: var(--text-color);
    margin: 0;
}

/* Mobile Optimization - уменьшаем боковые отступы только для карусели новостей */
@media (max-width: 768px) {
    .news-feed-container {
        padding: 20px 0; /* Убираем боковые отступы контейнера */
        margin-left: -30px; /* Компенсируем padding body */
        margin-right: -30px;
        width: calc(100% + 60px);
    }

    .news-feed-carousel-wrapper {
        padding-left: 10px;
        padding-right: 10px;
    }

    .news-feed-carousel-wrapper::before,
    .news-feed-carousel-wrapper::after {
        width: 15px; /* Меньше размытие по бокам на мобильных */
    }

    .news-item {
        width: 220px; /* Уменьшаем карточки с 300px до 220px */
    }

    .news-item-image {
        height: 110px; /* Уменьшаем высоту изображения */
    }

    .news-item-title-bar {
        padding: 8px 12px; /* Уменьшаем padding с 10px 15px */
    }

    .news-item-title-bar h3 {
        font-size: 0.95rem; /* Уменьшаем размер заголовка */
    }

    .news-item-content {
        padding: 10px 12px; /* Уменьшаем padding с 15px */
    }

    .news-item-content p {
        font-size: 0.8rem; /* Уменьшаем размер текста */
        line-height: 1.3; /* Уплотняем межстрочный интервал */
    }
}