/* ===== NEWS PAGE STYLES ===== */

/* Page background */
body {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

/* Main content */
.main-content {
    padding-top: 100px;
}

/* News section */
.news-section {
    padding: 60px 0;
}

/* Section styles moved to styles.css for consistency */

/* News grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--spacing-xl);
    margin-top: var(--spacing-2xl);
}

.news-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 22px;
    cursor: pointer;
}

.news-card {
        /* Убираем hover эффекты для мобильных */
    }

/* News image */
.news-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    border-radius: 24px;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    border-radius: 24px;
}

.news-image img {
        /* Убираем hover эффекты для мобильных */
    }

.news-category {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 12px;
    background: white;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* News content */
.news-content {
    padding: 0;
    padding-top: var(--spacing-lg);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-meta {
    margin-bottom: var(--spacing-md);
}

.news-date {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    display: flex;
    align-items: center;
    gap: 8px;
}

.news-date i {
    color: var(--primary-color);
}

.news-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    line-height: 1.4;
}

.news-excerpt {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--spacing-lg);
    flex: 1;
}



/* News Modal */
.news-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    box-sizing: border-box;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

/* Карусель изображений в модальном окне новостей */
.news-image-carousel {
    position: relative;
    width: 400px;
    margin: 0;
}

.news-image-carousel img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.news-image-carousel img {
        /* Убираем hover эффекты для мобильных */
    }

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
    z-index: 2;
}

.carousel-nav {
        /* Убираем hover эффекты для мобильных */
    }

.carousel-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: translateY(-50%);
}

.carousel-prev {
    left: 10px;
}

.carousel-next {
    right: 10px;
}

.carousel-counter {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    z-index: 2;
}

/* Модальное окно для увеличения изображений */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.image-modal .modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(4px);
}

.image-modal .modal-content {
    position: relative;
    max-width: calc(100vw - 80px);
    max-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    height: fit-content;
    background: transparent;
}

.image-modal .modal-content img {
    max-width: calc(100vw - 120px);
    max-height: calc(100vh - 120px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
}

.image-modal .modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal .modal-close {
        /* Убираем hover эффекты для мобильных */
    }

.image-modal .modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal .modal-nav {
        /* Убираем hover эффекты для мобильных */
    }

.image-modal .modal-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.image-modal .modal-prev {
    left: 20px;
}

.image-modal .modal-next {
    right: 20px;
}

.image-modal .modal-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 10;
}

.modal-content {
    position: relative;
    background: #ffffff;
    border-radius: var(--radius-lg);
    max-width: 1200px;
    max-height: 90vh;
    width: 100%;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close {
        /* Убираем hover эффекты для мобильных */
    }

.modal-header {
    position: relative;
    float: left;
    width: 400px;
    margin: 0 15px 15px 0;
    shape-outside: margin-box;
}

.modal-header img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: var(--radius-lg);
    display: block;
}

.modal-meta {
    position: absolute;
    bottom: 10px;
    left: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 2;
}

.modal-category {
    padding: 4px 12px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 500;
    color: #fff;
}

.modal-date {
    padding: 4px 12px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 500;
    color: #fff;
}

.modal-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 400px;
    margin-top: 5px;
    padding: 14px 28px;
    border: 2px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-lg);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
    position: relative;
    min-width: 150px;
    text-align: center;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background: transparent;
    color: var(--primary-color);
    box-shadow: none;
}

.modal-button:hover {
    border-color: var(--primary-color);
}



.modal-content-text {
    width: 100%;
}

.modal-title {
    color: var(--text-primary);
    font-size: var(--font-size-xl);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: var(--spacing-md);
    text-align: left;
}

.modal-body {
    padding: 22px;
    overflow-y: auto;
    flex: 1;
}

.modal-text {
    color: var(--text-primary);
    line-height: 1.7;
    font-size: var(--font-size-sm);
    text-align: justify;
    width: 100%;
}

.modal-text br {
    margin-bottom: var(--spacing-md);
}

/* Footer transparent background */
.footer {
    background: transparent !important;
    backdrop-filter: blur(10px);
}

/* Responsive design */
/* Планшеты (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
    
    .news-card {
        padding: 18px;
    }
    
    .modal-content {
        max-width: 90vw;
        margin: 30px;
    }
    
    .modal-header {
        width: 350px;
    }
    
    .modal-button {
        width: 350px;
    }
}

/* Планшеты и мобильные (до 768px) */
@media (max-width: 768px) {
    .main-content {
        padding-top: 80px;
    }
    
    /* Полноэкранное модальное окно новостей на планшетах */
    .news-modal {
        padding: 0;
    }
    
    .modal-content {
        max-width: 100vw;
        max-height: 100vh;
        width: 100vw;
        height: 100vh;
        margin: 0;
        border-radius: 0;
    }
    
    .news-section {
        padding: 40px 0;
    }
    
    /* Section styles handled by styles.css */
    
    .news-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
        padding: 0 20px;
    }
    
    .news-card {
        padding: 16px;
    }
    
    .news-content {
        padding-top: var(--spacing-md);
    }
    
    .news-title {
        font-size: var(--font-size-base);
        line-height: 1.3;
    }
    
    .news-excerpt {
        font-size: var(--font-size-sm);
        margin-bottom: var(--spacing-md);
    }
    
    /* Модальное окно */
    .modal-content {
        margin: 15px;
        max-height: calc(100vh - 30px);
        flex-direction: column;
    }
    
    .modal-header {
        width: 100%;
        float: none;
        margin: 0;
        shape-outside: none;
    }
    
    .news-image-carousel {
        width: 100%;
    }
    
    .modal-header img,
    .news-image-carousel img {
        aspect-ratio: 16/9;
        height: auto;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
    
    .modal-title {
        font-size: var(--font-size-lg);
        margin-bottom: var(--spacing-sm);
    }
    
    .modal-body {
        padding: var(--spacing-lg);
    }
    
    .modal-text {
        font-size: var(--font-size-sm);
        text-align: left;
    }
    
    .modal-button {
        width: 100%;
        margin-top: var(--spacing-md);
        padding: 12px 20px;
        font-size: 11px;
    }
    
    .modal-content-text {
        width: 100%;
    }
    
    /* Адаптивность для карусели */
    .carousel-nav {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .carousel-prev {
        left: 8px;
    }
    
    .carousel-next {
        right: 8px;
    }
    
    .carousel-counter {
        bottom: 8px;
        right: 8px;
        font-size: 11px;
        padding: 4px 8px;
    }
    
    /* Адаптивность для модального окна увеличения изображений */
    .image-modal {
        padding: 15px;
        background: rgba(0, 0, 0, 0.9);
        backdrop-filter: blur(4px);
    }
    
    .image-modal .modal-backdrop {
        background: rgba(0, 0, 0, 0.9);
        backdrop-filter: blur(4px);
    }
    
    .image-modal .modal-content {
        max-width: calc(100vw - 30px);
        max-height: calc(100vh - 30px);
        background: transparent;
    }
    
    .image-modal .modal-content img {
        max-width: calc(100vw - 60px);
        max-height: calc(100vh - 60px);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-xl);
    }
    
    .image-modal .modal-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 1.4rem;
        background: rgba(0, 0, 0, 0.8);
        backdrop-filter: blur(4px);
    }
    
    .image-modal .modal-nav {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
        background: rgba(0, 0, 0, 0.7);
    }
    
    .image-modal .modal-prev {
        left: 10px;
    }
    
    .image-modal .modal-next {
        right: 10px;
    }
    
    .image-modal .modal-counter {
        bottom: 10px;
        font-size: 0.8rem;
        padding: 6px 12px;
        border-radius: var(--radius-md);
        background: rgba(0, 0, 0, 0.8);
        backdrop-filter: blur(4px);
    }
}

/* Мобильные устройства (до 480px) */
@media (max-width: 480px) {
    .main-content {
        padding-top: 70px;
    }
    
    .news-section {
        padding: 30px 0;
    }
    
    /* Section styles handled by styles.css */
    
    .news-grid {
        display: flex;
        flex-direction: column;
        gap: var(--spacing-md);
        padding: 0;
    }
    
    .news-card {
        padding: 14px;
    }
    
    .news-image {
        aspect-ratio: 16/9;
        border-radius: 16px;
    }
    
    .news-image img {
        border-radius: 16px;
    }
    
    .news-category {
        top: 8px;
        left: 8px;
        padding: 3px 8px;
        font-size: 10px;
    }
    
    .news-title {
        font-size: var(--font-size-sm);
        line-height: 1.3;
        margin-bottom: var(--spacing-sm);
    }
    
    .news-excerpt {
        font-size: 13px;
        line-height: 1.4;
        margin-bottom: var(--spacing-sm);
    }
    
    .news-date {
        font-size: 11px;
    }
    
    /* Полноэкранное модальное окно для мобильных */
    .news-modal {
        padding: 0;
        align-items: flex-start;
    }
    
    .modal-content {
        margin: 0;
        max-width: 100vw;
        max-height: 100vh;
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        overflow-y: auto;
    }
    
    .modal-header {
        padding: 20px 0 0 0;
        margin: 0;
        width: 100%;
        float: none;
    }
    
    .news-image-carousel {
        width: 100%;
        margin: 0;
    }
    
    .modal-header img,
    .news-image-carousel img {
        aspect-ratio: 16/9;
        border-radius: var(--radius-lg);
        margin-bottom: 16px;
        width: 100%;
        cursor: pointer;
    }
    
    .modal-title {
        font-size: var(--font-size-lg);
        line-height: 1.4;
        margin-bottom: var(--spacing-md);
        font-weight: 600;
        padding: 0;
        text-align: left;
    }
    
    .modal-meta {
        position: absolute;
        bottom: 12px;
        left: 12px;
        gap: 10px;
        display: flex;
        align-items: center;
    }
    
    .modal-category,
    .modal-date {
        padding: 4px 10px;
        font-size: 11px;
        border-radius: var(--radius-md);
        background: rgba(0, 0, 0, 0.7);
        color: white;
        backdrop-filter: blur(4px);
    }
    
    .modal-body {
        padding: 0 20px 20px 20px;
    }
    
    .modal-text {
        font-size: 15px;
        line-height: 1.6;
        color: var(--text-primary);
    }
    
    .modal-button {
        width: 100%;
        margin: 0 0 var(--spacing-md) 0;
        padding: 14px 20px;
        font-size: 12px;
        border-radius: var(--radius-lg);
        font-weight: 600;
    }
    
    .modal-close {
        top: 15px;
        right: 15px;
        width: 36px;
        height: 36px;
        font-size: 1.3rem;
        background: rgba(0, 0, 0, 0.8);
        backdrop-filter: blur(4px);
        z-index: 1000;
    }
    
    /* Карусель для мобильных */
    .carousel-nav {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    
    .carousel-prev {
        left: 5px;
    }
    
    .carousel-next {
        right: 5px;
    }
    
    .carousel-counter {
        position: absolute;
        bottom: 12px;
        right: 12px;
        font-size: 10px;
        padding: 4px 8px;
        border-radius: var(--radius-md);
        background: rgba(0, 0, 0, 0.7);
        color: white;
        backdrop-filter: blur(4px);
    }
    
    /* Модальное окно изображений для мобильных */
    .image-modal {
        padding: 10px;
    }
    
    .image-modal .modal-backdrop {
        background: rgba(0, 0, 0, 0.9);
        backdrop-filter: blur(4px);
    }
    
    .image-modal .modal-content {
        max-width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
        background: transparent;
    }
    
    .image-modal .modal-content img {
        max-width: calc(100vw - 40px);
        max-height: calc(100vh - 40px);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-xl);
    }
    
    .image-modal .modal-close {
        top: 5px;
        right: 5px;
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
        background: rgba(0, 0, 0, 0.8);
        backdrop-filter: blur(4px);
    }
    
    .image-modal .modal-nav {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
        background: rgba(0, 0, 0, 0.7);
    }
    
    .image-modal .modal-prev {
        left: 5px;
    }
    
    .image-modal .modal-next {
        right: 5px;
    }
    
    .image-modal .modal-counter {
        bottom: 5px;
        font-size: 0.7rem;
        padding: 4px 8px;
        border-radius: var(--radius-md);
        background: rgba(0, 0, 0, 0.8);
        backdrop-filter: blur(4px);
    }
}