/**
 * News Feed Section Styles
 * OBF 2026 Theme - News Feed Section
 */

/* Section Base Styles */
.news-feed-section {
    position: relative;
    z-index: 1;
    padding: 40px 0;
    background: #f8f9fa;
}

.news-feed-section .container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Section Header */
.news-feed-section__header {
    text-align: center;
    margin-bottom: 60px;
}

/* News Feed Grid */
.news-feed-grid {
    margin-bottom: 40px;
}

/* News Feed Rows */
.news-feed-row {
    display: grid;
    gap: 30px;
    margin-bottom: 30px;
}

/* Первый ряд: 1 большая карточка (2 колонки) + 1 обычная */
.news-feed-row--first {
    grid-template-columns: 2fr 1fr;
}

/* Первый ряд: 1/2 + 1/2 */
.news-feed-row--half {
    grid-template-columns: 1fr 1fr;
}

/* Второй ряд: 3 обычные карточки */
.news-feed-row--second {
    grid-template-columns: repeat(3, 1fr);
}

/* News Card Base */
.news-card {
    background: #ffffff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Featured card has horizontal layout */
.news-card--featured {
    flex-direction: column;
    min-height: 300px;
}

/* Regular cards keep vertical layout */
.news-card--regular {
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* News Card Link */
.news-card__link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Featured card link has horizontal layout */
.news-card--featured .news-card__link {
    flex-direction: row;
    align-items: stretch;
}

/* Mirrored card — фото справа, текст слева */
.news-card--mirrored .news-card__link {
    flex-direction: row-reverse;
}

.news-card__link:hover {
    text-decoration: none;
    color: inherit;
}

/* News Card Image */
.news-card__image-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.news-card--featured .news-card__image-container {
    width: 50%;
    height: 100%;
    flex-shrink: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-card--regular .news-card__image-container {
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-card__image {
    width: 100%;
    height: auto;
    object-fit: contain;
    object-position: center;
    transition: transform 0.3s ease, filter 0.3s ease;
}

/* Специальные стили для featured карточки */
.news-card--featured .news-card__image {
    width: 100%;
    height: auto;
    object-fit: contain;
    object-position: center;
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease, filter 0.3s ease;
}

/* Специальные стили для обычных карточек */
.news-card--regular .news-card__image {
    width: 100%;
    height: auto;
    object-fit: contain;
    object-position: center;
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease, filter 0.3s ease;
}

/* Подложка с блюром для featured карточки */
.news-card--featured .news-card__image-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: var(--bg-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(10px);
    transform: scale(1.1);
    z-index: 1;
    opacity: 0.8;
}

/* Подложка с блюром для обычных карточек */
.news-card--regular .news-card__image-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: var(--bg-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(10px);
    transform: scale(1.1);
    z-index: 1;
    opacity: 0.8;
}

.news-card:hover .news-card__image {
    filter: blur(2px);
    transform: scale(1.05);
}

.news-card--featured:hover .news-card__image {
    filter: blur(2px);
    transform: scale(1.05);
}

.news-card--regular:hover .news-card__image {
    filter: blur(2px);
    transform: scale(1.05);
}

/* News Card Overlay */
.news-card__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.news-card:hover .news-card__overlay {
    opacity: 1;
}

.news-card__read-more {
    color: #ffffff;
    font-family: 'Jost', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 20px;
    border: 2px solid #ffffff;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.news-card:hover .news-card__read-more {
    background: #228B22;
    color: #ffffff;
    border-color: #228B22;
}

/* News Card Content */
.news-card__content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.news-card--featured .news-card__content {
    width: 50%;
    padding: 30px;
    justify-content: center;
}

.news-card--regular .news-card__content {
    padding: 20px;
}

/* News Card Meta */
.news-card__meta {
    margin-bottom: 15px;
}

.news-card__date {
    font-family: 'Jost', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: #DC143C;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* News Card Title */
.news-card__title {
    font-family: 'Jost', sans-serif;
    font-weight: 600;
    color: #000000;
    line-height: 1.3;
    margin: 0 0 15px 0;
}

.news-card--featured .news-card__title {
    font-size: 1.6rem;
}

.news-card--regular .news-card__title {
    font-size: 1.2rem;
}

/* News Card Excerpt */
.news-card__excerpt {
    font-family: 'Jost', sans-serif;
    font-size: 0.95rem;
    font-weight: 400;
    color: #666666;
    line-height: 1.5;
    margin: 0;
    flex-grow: 1;
}

.news-card--featured .news-card__excerpt {
    font-size: 1rem;
}

.news-card--regular .news-card__excerpt {
    font-size: 0.9rem;
}

/* News Feed Footer */
.news-feed__footer {
    text-align: center;
    margin-top: 30px;
}

.news-feed__all-btn {
    display: inline-block;
    padding: 15px 30px;
    background: #228B22;
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    font-family: 'Jost', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.news-feed__all-btn:hover {
    background: #1e7a1e;
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(34, 139, 34, 0.3);
}

/* Responsive Design */
@media (max-width: 1200px) {
}

@media (max-width: 992px) {
    
    .news-feed-section__header {
        margin-bottom: 50px;
    }
    
    .news-feed-row {
        gap: 20px;
    }
    
    .news-card--featured .news-card__image-container {
        height: 100%;
    }
    
    .news-card--regular .news-card__image-container {
        height: 180px;
    }
    
    .news-card--featured .news-card__title {
        font-size: 1.4rem;
    }
    
    .news-card--regular .news-card__title {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    
    .news-feed-section__header {
        margin-bottom: 40px;
    }
    
    /* На планшетах делаем все карточки в одну колонку */
    .news-feed-row--first,
    .news-feed-row--second {
        grid-template-columns: 1fr;
    }
    
    /* Возвращаем вертикальную структуру для featured карточки на мобильных */
    .news-card--featured .news-card__link {
        flex-direction: column;
    }
    
    .news-card--featured .news-card__image-container {
        width: 100%;
        height: 200px;
    }
    
    /* Убираем подложку на мобильных устройствах */
    .news-card--featured .news-card__image-container::before {
        display: none;
    }
    
    .news-card--featured .news-card__image {
        width: 100%;
        height: auto;
        object-fit: contain;
    }
    
    .news-card--featured .news-card__content {
        width: 100%;
        padding: 20px;
    }
    
    .news-card--regular .news-card__image-container {
        height: 200px;
    }
    
    .news-card__content {
        padding: 20px;
        text-align: center;
    }
    
    .news-card--featured .news-card__title {
        font-size: 1.3rem;
    }
    
    .news-card--regular .news-card__title {
        font-size: 1.1rem;
    }
    
    .news-card__excerpt {
        font-size: 0.9rem;
        text-align: left;
    }
}

@media (max-width: 480px) {
    
    .news-feed-section .container {
        padding: 0 15px;
    }
    
    .news-feed-row {
        gap: 15px;
        margin-bottom: 20px;
    }
    
    /* Убеждаемся что на мобильных все карточки вертикальные */
    .news-card--featured .news-card__link {
        flex-direction: column;
    }
    
    .news-card--featured .news-card__image-container {
        width: 100%;
        height: 180px;
    }
    
    /* Убираем подложку на мобильных устройствах */
    .news-card--featured .news-card__image-container::before {
        display: none;
    }
    
    .news-card--featured .news-card__image {
        width: 100%;
        height: auto;
        object-fit: contain;
    }
    
    .news-card--featured .news-card__content {
        width: 100%;
        padding: 15px;
    }
    
    .news-card--regular .news-card__image-container {
        height: 180px;
    }
    
    .news-card__content {
        padding: 15px;
    }
    
    .news-card--featured .news-card__title,
    .news-card--regular .news-card__title {
        font-size: 1.1rem;
    }
    
    .news-card__excerpt {
        font-size: 0.85rem;
    }
    
    .news-feed__all-btn {
        padding: 12px 25px;
        font-size: 0.9rem;
    }
}

/* Animation for cards */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.news-card {
    animation: fadeInUp 0.6s ease forwards;
}

.news-card:nth-child(1) { animation-delay: 0.1s; }
.news-card:nth-child(2) { animation-delay: 0.2s; }
.news-card:nth-child(3) { animation-delay: 0.3s; }
.news-card:nth-child(4) { animation-delay: 0.4s; }
.news-card:nth-child(5) { animation-delay: 0.5s; }

/* Поддержка уменьшенной анимации */
@media (prefers-reduced-motion: reduce) {
    .news-card {
        animation: none;
    }
    
    .news-card:hover {
        transform: none;
    }
    
    .news-card:hover .news-card__image {
        transform: none;
    }
    
    .news-card--featured:hover .news-card__image {
        transform: none;
    }
    
    .news-card--regular:hover .news-card__image {
        transform: none;
    }
}